ovs, dpdk: ignore ovs-netdev tun interface

When configuring a OVS bridge to use the netdev datapath, OpenvSwitch
will create a tun interface named ovs-netdev. This interface should be
ignored by NetworkManager.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1169
This commit is contained in:
Fernando Fernandez Mancera 2022-03-30 16:06:38 +02:00
parent e99d0b333c
commit 2bbe7f9204
3 changed files with 9 additions and 2 deletions

View file

@ -542,6 +542,12 @@ create_device(NMDeviceFactory *factory,
NM_SETTING_TUN_SETTING_NAME),
NULL);
/* OpenvSwitch will create a tun device named ovs-netdev when the datapath selected is netdev */
if (nm_streq0(iface, "ovs-netdev")) {
*out_ignore = TRUE;
return NULL;
}
return g_object_new(NM_TYPE_DEVICE_TUN,
NM_DEVICE_IFACE,
iface,

View file

@ -6329,7 +6329,8 @@ device_recheck_slave_status(NMDevice *self, const NMPlatformLink *plink)
plink_master = nm_platform_link_get(nm_device_get_platform(self), plink->master);
plink_master_keep_alive = nmp_object_ref(NMP_OBJECT_UP_CAST(plink_master));
if (master == NULL && plink_master && nm_streq0(plink_master->name, "ovs-system")
if (master == NULL && plink_master
&& NM_IN_STRSET(plink_master->name, "ovs-system", "ovs-netdev")
&& plink_master->type == NM_LINK_TYPE_OPENVSWITCH) {
_LOGD(LOGD_DEVICE, "the device claimed by openvswitch");
goto out;

View file

@ -2792,7 +2792,7 @@ get_existing_connection(NMManager *self, NMDevice *device, gboolean *out_generat
int master_ifindex = nm_platform_link_get_master(priv->platform, ifindex);
/* Check that the master is activating before assuming a
* slave connection. However, ignore ovs-system master as
* slave connection. However, ignore ovs-system/ovs-netdev master as
* we never manage it.
*/
if (master_ifindex