summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@samsung.com>2019-07-22 17:56:50 +0300
committerIlya Maximets <i.maximets@samsung.com>2019-08-29 18:25:50 +0300
commit3f51ea180ba1183aed9912aa48b7f0e6de3b578d (patch)
treeb48f6e89bfddb87329b58c0460c9d2d13bdcdd63 /lib
parent5c56607200c3c345efe7d79b148b5ffa22bb5bc2 (diff)
downloadopenvswitch-3f51ea180ba1183aed9912aa48b7f0e6de3b578d.tar.gz
dpif-netdev: Fail port addition if reconfiguration failed.
If the port was destroyed during the initial reconfiguration, we should report an error to the upper layers. Otherwise, successful addition of the port will be logged and upper layers will continue to configure this port. For example, the 'dpif' layer will try to initilaize flow API for this device. Fix that by checking for port existence after reconfiguration. We can't get the real error code here, so let's assume EINVAL. 'ovs-vsctl' will tell the user to check the logs for a real reason anyway. Fixes: e32971b8ddb4 ("dpif-netdev: Centralized threads and queues handling code.") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Ian Stokes <ian.stokes@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/dpif-netdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index d0a1c58ad..75d85b2fd 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -1862,7 +1862,8 @@ do_add_port(struct dp_netdev *dp, const char *devname, const char *type,
reconfigure_datapath(dp);
- return 0;
+ /* Check that port was successfully configured. */
+ return dp_netdev_lookup_port(dp, port_no) ? 0 : EINVAL;
}
static int