-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VF/Switchdev abstraction #346
Conversation
2f107f6
to
137004c
Compare
Tests done through beaker job ran without issues. I'd hold the MR until I get a feedback from Ivan whether the use case when VFs are created before setting the switchdev mode is valid and expected. If it is valid this will need to be reworked. |
Just a note that here's the RFC for unfication of PF/VF/VF_REP names: https://patchwork.ozlabs.org/project/netdev/patch/[email protected]/ |
Apparently it is possible to create VFs without setting the switchdev mode - this is typical scenario where tuntap is substituted with virtual function devices. The MR should be updated and create_vfs should be updated to support both non-switchdev and switchdev scenarios. |
Note, for mlx5 it is not possible to create vfs and then set the switchdev mode:
|
8d9e324
to
e6b8572
Compare
f57c2ee
to
331380a
Compare
With all the differences between drivers/NICs, I think it makes sense to split all VF/SRIOV related actions to separate commands. What do you think? |
The only difference is the bnxt_en driver. The fact that you can't set switchdevice mode unless you have virtual functions created is considered a bug that has been already fixed in upstream kernel. I asked Ivan to update RHEL kernels. I could expose more Device methods, but you would have to be more specific. Eventually these methods can be exposed with followup patches. The example in the MR description was a bit out of date, maybe that would fit what you're asking for. I updated it, so please check. |
I've checked with Ivan and there's already a MR for RHEL9 kernel to update the bnxt_en driver, so there's no other difference across the drivers. |
I'm fine with current implementation, makes sense. |
Based on a discussion with LNST team I plan to update the code. The main issue detected was with
The last statement will not work because We came to conclusion that |
331380a
to
0f83ecd
Compare
Testing is blocked by podman dependency issue containers/podman-py#350 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks ok to me.
0f83ecd
to
3276f69
Compare
This extends the Device class with properties and methods required to configure virtual functions. Signed-off-by: Jan Tluka <[email protected]>
This extends the Device class with methods and properties that can be used to work with Device in switchdev mode. Signed-off-by: Jan Tluka <[email protected]>
In few setups some devices and their vfs do not have the alternate names available in netlink messages, but the alternate name is used directly as the device name. To deal with these situations, simply include also the device name in the search. Signed-off-by: Jan Tluka <[email protected]>
Instead of returning empty string, the method should raise DeviceFeatureNotSupported exception. Signed-off-by: Jan Tluka <[email protected]>
…presentors This class wraps creation and access to Device virtual functions and their representors. Signed-off-by: Jan Tluka <[email protected]>
Update of the recipe to use the SRIOVDevices for configuration of a switchdev capable device. Signed-off-by: Jan Tluka <[email protected]>
This parameter is no longer required as the device names are parsed from netlink messages. Signed-off-by: Jan Tluka <[email protected]>
Without the patch the device names in any device method calls would appear as None. This is because the devices are not mapped (unless moved to a network namespace in case of VFs). The patch adds mapping of the devices with following pattern: {phys_dev._id}_vf{vf_index} {phys_dev._id}_vf_rep{vf_index} Signed-off-by: Jan Tluka <[email protected]>
59aa3d0
to
d0d1b14
Compare
I've cleaned up the commit history and added one more patch for SRIOVDevices class, where I noticed that device method calls printed I'll schedule a Beaker test job to verify the functionality and this can be merged. |
New test jobs: J:8640504 J:8640505 J:8640506 J:8640507 |
These tests passed. Note that bnxt_en driver contains bug where the vfs need to be created before moving to switchdev mode. |
Ack, no more comments at the moment. |
Description
This MR extends the Device class with methods and properties required to configure and use vfs of an ethernet device in switchdev mode.
User would typically configure the device as follows (see also the change to BaseSRIOVNetnsTcRecipe):
Known issues:
[PATCH net-next v2] bnxt_en: Allow to set switchdev mode without existing VFs
Tests
J:8572626 J:8572625 J:8572624 J:8572623
Reviews
@olichtne @Axonis
Closes: #345 #344