bridge_delete_or_reconfigure() deletes every interface that's not dumped by OFPROTO_PORT_FOR_EACH(). ofproto_dpif.c:port_dump_next(), used by OFPROTO_PORT_FOR_EACH, checks if the ofport is in the datapath by calling port_query_by_name(). If port_query_by_name() returns an error, the dump is interrupted. If port_query_by_name() returns ENODEV, the device doesn't exist and the dump can continue.
port_query_by_name() for the userspace datapath returns ENOENT instead of ENODEV. This is expected by dpif_port_query_by_name(), but it's not handled correctly by port_dump_next(). This commit fixes the problem by handling ENOENT like ENODEV. dpif-netdev handles reconfiguration errors for an interface by deleting it from the datapath, so it's possible that a device is missing. When this happens we must make sure that port_dump_next() continues to dump other devices otherwise they will be deleted and the two layers will have an inconsistent view. The problem was found while developing new code. Signed-off-by: Daniele Di Proietto <[email protected]> --- 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 3b036a116..5051667b9 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -3481,7 +3481,7 @@ port_dump_next(const struct ofproto *ofproto_, void *state_, *port = state->port; state->has_port = true; return 0; - } else if (error != ENODEV) { + } else if (error != ENODEV && error != ENOENT) { return error; } } -- 2.11.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
