Skip to content

Commit

Permalink
netdev-windows: Add checking when creating netdev with system type on…
Browse files Browse the repository at this point in the history
… Windows

In the recent Antrea project testing, some port could not be created
on Windows.

When doing debug, our team found there is one case happening when multiple
ports are waiting for be created with correct port number.

Some system type port will be created netdev successfully and it will cause
conflict as in the dpif side it will be internal type. So finally the port
will be created failed and it could not be easily recovered.

With the patch, on Windows the netdev creating will be blocked for system
type when the ovs_tyep got on dpif is internal. More detailed case description
is in the reported issue No.262 with link below.

Reported-at:openvswitch/ovs-issues#262
Signed-off-by: Wilson Peng <[email protected]>
Signed-off-by: Alin Gabriel Serdean <[email protected]>
  • Loading branch information
pweisong authored and aserdean committed Mar 6, 2023
1 parent bfc0d5d commit e3c821f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/netdev-windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ netdev_windows_system_construct(struct netdev *netdev_)
struct netdev_windows_netdev_info info;
struct ofpbuf *buf;
int ret;
const char *type = NULL;

/* Query the attributes and runtime status of the netdev. */
ret = query_netdev(netdev_get_name(&netdev->up), &info, &buf);
Expand All @@ -167,6 +168,16 @@ netdev_windows_system_construct(struct netdev *netdev_)
}
ofpbuf_delete(buf);

/* Don't create netdev if ovs-type is "internal"
* but the type of netdev->up is "system". */
type = netdev_get_type(&netdev->up);
if (type && !strcmp(type, "system") &&
(info.ovs_type == OVS_VPORT_TYPE_INTERNAL)) {
VLOG_DBG("construct device %s, ovs_type: %u failed",
netdev_get_name(&netdev->up), info.ovs_type);
return 1;
}

netdev->change_seq = 1;
netdev->dev_type = info.ovs_type;
netdev->port_no = info.port_no;
Expand Down

0 comments on commit e3c821f

Please sign in to comment.