From 8911c674fc310ef8767364e80c0128357e3d49d7 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 29 Aug 2013 20:55:10 -0700 Subject: [PATCH] ofproto-dpif: Do not dpif_port_del() patch ports in port_del(). Patch ports don't have datapath ports so it doesn't make sense to try to call dpif_port_del() on them. If we do try, it will fail, which makes the caller think that the port wasn't really deleted, which in turn keeps ofproto from reporting the port deletion via OpenFlow. This fixes the problem. Without this patch, the following commands, executed under "make sandbox", will report the patch port addition in "ovs-ofctl monitor" output, but not the patch port deletion. With this patch, both the addition and deletion will be reported. ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev ovs-ofctl monitor br0 128 & ovs-vsctl add-port br0 patch1 \ -- set interface patch1 type=patch options:peer=patch2 \ -- add-port br0 patch2 \ -- set interface patch2 type=patch options:peer=patch1 ovs-vsctl del-port patch1 ovs-vsctl del-port patch2 Reported-by: YAMAMOTO Takashi Signed-off-by: Ben Pfaff --- ofproto/ofproto-dpif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index e824891ee..18e591832 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -3109,7 +3109,7 @@ port_del(struct ofproto *ofproto_, ofp_port_t ofp_port) sset_find_and_delete(&ofproto->ghost_ports, netdev_get_name(ofport->up.netdev)); ofproto->backer->need_revalidate = REV_RECONFIGURE; - if (!ofport->is_tunnel) { + if (!ofport->is_tunnel && !netdev_vport_is_patch(ofport->up.netdev)) { error = dpif_port_del(ofproto->backer->dpif, ofport->odp_port); if (!error) { /* The caller is going to close ofport->up.netdev. If this is a -- 2.47.0