[Bug 2020409] Re: can't move mellanox interface to switchdev when SR-IOV disable
Danilo Egea Gondolfo
2020409 at bugs.launchpad.net
Tue Oct 8 17:26:20 UTC 2024
** Description changed:
+ [ 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://github.com/canonical/netplan/pull/454 for details) but still need to be
+ 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-switch-mode: switchdev
+ enp3s0f1np1:
+ match:
+ macaddress: 98:03:9b:c3:ef:bb
+ mtu: 9000
+ set-name: enp3s0f1np1
+ embedded-switch-mode: switchdev
+
+ After applying the configuration, the e-switch mode can be checked with
+ the devlink tool. For example:
+
+ root at node-laveran:~# devlink dev eswitch show pci/0000:03:00.0
+ pci/0000:03:00.0: mode switchdev inline-mode none encap-mode basic
+ root at node-laveran:~# devlink dev eswitch show pci/0000:03:00.1
+ 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://bugs.launchpad.net/netplan/+bug/2020409
+ https://github.com/canonical/netplan/pull/454
+
+ A PPA for Ubuntu 22.04 can be found here
+ https://launchpad.net/~danilogondolfo/+archive/ubuntu/netplan-sru
+
+
+ ---- 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.
-
+ 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?
-
+ Who will be the best person at canonical side so help use fix this
+ issues?
[1] -
https://github.com/canonical/netplan/blob/3279c57e8b1745be0d19119b4ad1a061c327593e/netplan/cli/sriov.py#L373-L459
** Summary changed:
- 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
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netplan.io in Ubuntu.
Matching subscriptions: foundations-bugs
https://bugs.launchpad.net/bugs/2020409
Title:
[SRU] can't move mellanox interface to switchdev when SR-IOV disable
Status in Netplan:
Fix Released
Status in netplan.io package in Ubuntu:
Fix Released
Status in netplan.io source package in Jammy:
In Progress
Status in netplan.io source package in Noble:
Fix Released
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://github.com/canonical/netplan/pull/454 for details) but still need to be
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-switch-mode: switchdev
enp3s0f1np1:
match:
macaddress: 98:03:9b:c3:ef:bb
mtu: 9000
set-name: enp3s0f1np1
embedded-switch-mode: switchdev
After applying the configuration, the e-switch mode can be checked with
the devlink tool. For example:
root at node-laveran:~# devlink dev eswitch show pci/0000:03:00.0
pci/0000:03:00.0: mode switchdev inline-mode none encap-mode basic
root at node-laveran:~# devlink dev eswitch show pci/0000:03:00.1
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://bugs.launchpad.net/netplan/+bug/2020409
https://github.com/canonical/netplan/pull/454
A PPA for Ubuntu 22.04 can be found here
https://launchpad.net/~danilogondolfo/+archive/ubuntu/netplan-sru
---- 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?
[1] -
https://github.com/canonical/netplan/blob/3279c57e8b1745be0d19119b4ad1a061c327593e/netplan/cli/sriov.py#L373-L459
To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/2020409/+subscriptions
More information about the foundations-bugs
mailing list