For ports on non-system (i.e. userspace) datapaths, the dpif_netlink_vport_get() call in netdev_linux_netnsid_update() is meaningless, these ports are not kernel vports.
Generalize the tap class check in netdev_linux_netnsid_update() with a dpif_type check: when dpif_type is set and is not "system", assume the device is local without attempting the vport lookup. This change will cover all device types on userspace datapaths (e.g. veth pairs). Signed-off-by: Matteo Perin <[email protected]> --- lib/netdev-linux.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 47faea8c6..c694dc1c5 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -614,7 +614,12 @@ static int netdev_linux_netnsid_update(struct netdev_linux *netdev) { if (netnsid_is_unset(netdev->netnsid)) { - if (netdev_get_class(&netdev->up) == &netdev_tap_class) { + const char *dpif_type = netdev_get_dpif_type(&netdev->up); + + if (netdev_get_class(&netdev->up) == &netdev_tap_class + || (dpif_type && strcmp(dpif_type, "system"))) { + /* vport netlink lookup makes no sense for + * non-system dpif types, set nsid to local. */ netnsid_set_local(&netdev->netnsid); } else { return netdev_linux_netnsid_update__(netdev); -- 2.43.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
