[SRU] can't move mellanox interface to switchdev when SR-IOV disable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
Medium
|
Unassigned | ||
netplan.io (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Committed
|
Undecided
|
Lukas Märdian | ||
Noble |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
Due to limitations in how Netplan handles SR-IOV devices it wasn't possible
to change the embedded switch mode without having to create Virtual Functions.
Setting the e-switch mode should be allowed independently of
the existence of Virtual Functions.
This problem prevents the use of Scalable Functions without SR-IOV.
This fix is available on Ubuntu 24.04.
[ Test Plan ]
To reproduce the problem addressed by this SRU one needs to
have access to specialized hardware (SR-IOV-capable NICs).
This fix was tested on real hardware when they were implemented
(see https:/
tested on Ubuntu 22.04.
We will work with Canonical's Openstack team to do the fix verification.
* detailed instructions how to reproduce the bug
A configuration like the below can be used to test if the e-switch mode
can be set to "switchdev" without Virtual Functions:
network:
version: 2
ethernets:
enp3s0f0np0:
match:
macaddress: 98:03:9b:c3:ef:ba
mtu: 9000
set-name: enp3s0f0np0
embedded-
enp3s0f1np1:
match:
macaddress: 98:03:9b:c3:ef:bb
mtu: 9000
set-name: enp3s0f1np1
embedded-
After applying the configuration, the e-switch mode can be checked with
the devlink tool. For example:
root@node-
pci/0000:03:00.0: mode switchdev inline-mode none encap-mode basic
root@node-
pci/0000:03:00.1: mode switchdev inline-mode none encap-mode basic
[ Where problems could occur ]
These changes should affect only SR-IOV related scenarios.
Undetected problems could cause Netplan to fail to configure the device
and Virtual Functions wouldn't be created anymore.
[ Other Info ]
Related work:
https:/
https:/
A PPA for Ubuntu 22.04 can be found here https:/
---- Original bug description ----
I am looking on the netplan implementation of switchdev [1]. The current code assume that we can move to switchdev only if SR-IOV enabled.
This assumption is incorrect, as we can move to switchdev even if SR-IOV is disabled.
There 2 use-case come to mind:
1. VF Lag with Subfunction (you don't need SR-IOV to enable Subfunction)
2. VF Lag creation. It better to first move the PF (physicals function) to switchdev mode before creating the SR-IOV VF. In this case you don't need to unbind and bind the VFs, which mean you save time at boot.
Who will be the best person at canonical side so help use fix this issues?
Related branches
- Lukas Märdian: Approve
- Ubuntu Core Development Team: Pending requested
-
Diff: 2460 lines (+2373/-0)13 files modifieddebian/changelog (+12/-0)
debian/libnetplan0.symbols (+1/-0)
debian/patches/lp1988018/0018-libnetplan-add-a-getter-for-bond-mode.patch (+115/-0)
debian/patches/lp1988018/0019-sriov-move-the-udev-logic-to-a-service-unit.patch (+163/-0)
debian/patches/lp1988018/0020-sriov-check-the-eswitch-mode-before-trying-to-change.patch (+100/-0)
debian/patches/lp1988018/0021-sriov_rebind-cooperate-with-VF-LAG-activation.patch (+172/-0)
debian/patches/lp1988018/0022-sriov_rebind-netplan-rebind-debug-setup.patch (+113/-0)
debian/patches/lp1988018/0023-tests-sriov-adapt-tests-to-the-last-sr-iov-related-c.patch (+554/-0)
debian/patches/lp1988018/0024-sriov_apply-execute-apply-sriov-only-before-network-.patch (+83/-0)
debian/patches/lp2020409/0025-sriov-accept-setting-the-eswitch-mode-without-VFs.patch (+148/-0)
debian/patches/lp2020409/0026-cli-sriov-refactoring.patch (+768/-0)
debian/patches/lp2020409/0027-cli-sriov-set-eswitch-regardless-of-pcidev.vfs.patch (+132/-0)
debian/patches/series (+12/-0)
CVE References
Changed in netplan: | |
status: | Fix Committed → Fix Released |
tags: | added: sru-next |
Changed in netplan: | |
status: | Fix Released → Fix Committed |
description: | updated |
summary: |
- can't move mellanox interface to switchdev when SR-IOV disable + [SRU] can't move mellanox interface to switchdev when SR-IOV disable |
Changed in netplan.io (Ubuntu Noble): | |
status: | New → Fix Released |
Changed in netplan.io (Ubuntu Jammy): | |
status: | New → In Progress |
tags: | removed: sru-next |
tags: | added: server-todo |
Changed in netplan.io (Ubuntu Jammy): | |
assignee: | nobody → Lukas Märdian (slyon) |
Some Nvidia docs on use-cases to move to switchdev mode without SR-IOV
[1] - https:/ /github. com/Mellanox/ scalablefunctio ns/wiki/ Upstream- step-by- step-guide /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ tree/Documentat ion/networking/ device_ drivers/ ethernet/ mellanox/ mlx5.rst? h=v5.12- rc3#n186
[2] - https:/