mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
dpif: Allow the port number to be requested when adding an interface.
The datapath allows requesting a specific port number for a port, but the dpif interface didn't expose it. This commit adds that support. Signed-off-by: Justin Pettit <jpettit@nicira.com>
This commit is contained in:
@@ -407,7 +407,16 @@ dpif_netdev_port_add(struct dpif *dpif, struct netdev *netdev,
|
||||
struct dp_netdev *dp = get_dp_netdev(dpif);
|
||||
int port_no;
|
||||
|
||||
port_no = choose_port(dpif, netdev);
|
||||
if (*port_nop != UINT16_MAX) {
|
||||
if (*port_nop >= MAX_PORTS) {
|
||||
return EFBIG;
|
||||
} else if (dp->ports[*port_nop]) {
|
||||
return EBUSY;
|
||||
}
|
||||
port_no = *port_nop;
|
||||
} else {
|
||||
port_no = choose_port(dpif, netdev);
|
||||
}
|
||||
if (port_no >= 0) {
|
||||
*port_nop = port_no;
|
||||
return do_add_port(dp, netdev_get_name(netdev),
|
||||
|
Reference in New Issue
Block a user