ofproto-dpif: Do not dpif_port_del() patch ports in port_del().
authorBen Pfaff <blp@nicira.com>
Fri, 30 Aug 2013 03:55:10 +0000 (20:55 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 4 Sep 2013 22:50:11 +0000 (15:50 -0700)
commitdd707baace74a3f79dbcbdeba7a856bf8d7dd34a
tree9ec45927fa6e04ba1de737dd7d180e43871a5fac
parentbb0c4b09b1a3192b31990cfac735eed214d33d04
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 <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif.c