Skip to content

Commit

Permalink
dpif-netdev: Fail port addition if reconfiguration failed.
Browse files Browse the repository at this point in the history
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: e32971b ("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>
  • Loading branch information
igsilya committed Aug 29, 2019
1 parent 5c56607 commit 3f51ea1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/dpif-netdev.c
Expand Up @@ -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
Expand Down

0 comments on commit 3f51ea1

Please sign in to comment.