[ovs-discuss] netdev_linux_update_flags() needs seq_change() ?

Ben Pfaff blp at ovn.org
Fri Jan 13 21:03:32 UTC 2017


On Wed, Jan 11, 2017 at 04:05:51PM +0800, Brandon Cheng wrote:
> After all statements of netdev_linux_update_flags() executed successfully,
> it also executes seq_change() to tell ofproto_run() something changed to
> update ovsdb.
> 
> And in order to config port to linkup can update ovsdb.
> it needs to use "a->config == b->config" instead of "&& !((a->config ^
> b->config) & OFPUTIL_PC_PORT_DOWN)" in the ofport_equal() of ofproto.c.
> 
> For example:
> step1: # ovs-ofctl mod-port br0 14 down -O openflow13 ---->although port 16
> is actually down, it doesn't update ovsdb, so config of port 16 is still up
> in the ovsdb.
> step2: # ovs-ofctl mod-port br0 14 up -O openflow13   ----> because config
> of port 16 in the ovsdb is still up, this up action will not be executed.
> So that this port can't be up forever.
> 
> Is this a bug?

Please test this patch.

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index a5a9ec1..1eadbbd 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -2742,6 +2742,7 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
     if (new_flags != old_flags) {
         error = set_flags(netdev_get_name(&netdev->up), new_flags);
         get_flags(&netdev->up, &netdev->ifi_flags);
+        netdev_change_seq_changed(&netdev->up);
     }
 
     return error;

Thanks,

Ben.


More information about the discuss mailing list