Hi all,
I find that We do not update OFPUTIL_PC_PORT_DOWN bit of port's config
immediately in update_port_config.
Is there any reason to delay this update?
It seems that we get problem in this scenario:
1. add an unplugged port(p0) to br0
2. ovs-ofctl mod-port br0 p0 down
3. link p0 to other device
4. ovs-ofctl mod-port br0 p0 up
Because p0 is unplugged or we config it down, the status of p0 remains the same.
OFPUTIL_PC_PORT_DOWN bit of p0's config will not change.
In step 4, (config & OFPUTIL_PC_PORT_DOWN) == 0 and (port->pp.config &
OFPUTIL_PC_PORT_DOWN) == 0,
So (toggle & OFPUTIL_PC_PORT_DOWN) == 0. We can not call
netdev_turn_flags_on at all.
I think we can update OFPUTIL_PC_PORT_DOWN bit of port's config immediately:
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index a9cf221..f1029fb 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -2956,11 +2956,10 @@ update_port_config(struct ofport *port,
} else {
netdev_turn_flags_on(port->netdev, NETDEV_UP, NULL);
}
- toggle &= ~OFPUTIL_PC_PORT_DOWN;
}
port->pp.config ^= toggle;
- if (port->pp.config != old_config) {
+ if (toggle & ~OFPUTIL_PC_PORT_DOWN) {
port->ofproto->ofproto_class->port_reconfigured(port, old_config);
}
}
Regards
kmindg
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss