Skip to content
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

Support for vf testing in enrt #375

Merged
merged 7 commits into from
Sep 3, 2024

Conversation

jtluka
Copy link
Collaborator

@jtluka jtluka commented Aug 6, 2024

Description

This adds new mixin that can be used in ENRT recipes to use VFs of the NICs (PFs) defined by DeviceReq recipe requirements instead of PFs. This is configurable through a bool parameter without need of any additional changes to the original recipe.

Tests

  • J:9725633 use_vfs=True ice/i40e/bnxt_en/mlx5_core
  • J:9725634 use_vfs=False
  • J:9726325 SRIOV* test set as this fixes some bugs
  • J:9730056 vlan, bond and other types of BaremetalEnrtRecipes

Reviews

@olichtne @enhaut

@jtluka
Copy link
Collaborator Author

jtluka commented Aug 6, 2024

TODO: add testwide description

@jtluka jtluka force-pushed the support-for-vf-testing-in-enrt branch 2 times, most recently from 4d47614 to b3e0826 Compare August 14, 2024 11:58
@jtluka jtluka force-pushed the support-for-vf-testing-in-enrt branch from b3e0826 to a87cb8a Compare August 14, 2024 13:09
@jtluka
Copy link
Collaborator Author

jtluka commented Aug 15, 2024

VlansRecipe shows incorrect order of network configuration - first vlan devices are created over PFs, then VFs are created:

2024-08-14 17:50:27       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.eth0.down()
2024-08-14 17:50:27       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.eth0.down()
2024-08-14 17:50:27       (localhost)        -    INFO: Result: PASS, What: Creating Device host1.vlan0 = VlanDevice(realdev=Device(machine=host1, id=eth0, name=enp1s0f0np0, ifindex=3), vlan_id=10)
2024-08-14 17:50:27           (host1)        -   ERROR: Command "ethtool -a t_vlan0" execution failed (exited with 1)
2024-08-14 17:50:27       (localhost)        -    INFO: Result: PASS, What: Creating Device host1.vlan1 = VlanDevice(realdev=Device(machine=host1, id=eth0, name=enp1s0f0np0, ifindex=3), vlan_id=20)
2024-08-14 17:50:27           (host1)        -   ERROR: Command "ethtool -a t_vlan1" execution failed (exited with 1)
2024-08-14 17:50:27       (localhost)        -    INFO: Result: PASS, What: Creating Device host1.vlan2 = VlanDevice(realdev=Device(machine=host1, id=eth0, name=enp1s0f0np0, ifindex=3), vlan_id=30)
2024-08-14 17:50:27           (host1)        -   ERROR: Command "ethtool -a t_vlan2" execution failed (exited with 1)
2024-08-14 17:50:28       (localhost)        -    INFO: Result: PASS, What: Creating Device host2.vlan0 = VlanDevice(realdev=Device(machine=host2, id=eth0, name=enp1s0f0np0, ifindex=4), vlan_id=10)
2024-08-14 17:50:28           (host2)        -   ERROR: Command "ethtool -a t_vlan0" execution failed (exited with 1)
2024-08-14 17:50:28       (localhost)        -    INFO: Result: PASS, What: Creating Device host2.vlan1 = VlanDevice(realdev=Device(machine=host2, id=eth0, name=enp1s0f0np0, ifindex=4), vlan_id=20)
2024-08-14 17:50:28           (host2)        -   ERROR: Command "ethtool -a t_vlan1" execution failed (exited with 1)
2024-08-14 17:50:28       (localhost)        -    INFO: Result: PASS, What: Creating Device host2.vlan2 = VlanDevice(realdev=Device(machine=host2, id=eth0, name=enp1s0f0np0, ifindex=4), vlan_id=30)
2024-08-14 17:50:28           (host2)        -   ERROR: Command "ethtool -a t_vlan2" execution failed (exited with 1)
2024-08-14 17:50:28       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.eth0.up_and_wait()
2024-08-14 17:50:28           (host1)        -    INFO: Waiting for vf(s) creation on PF enp1s0f0np0 for 10 seconds
2024-08-14 17:50:28           (host1)        -   ERROR: Command "ethtool -a eth0" execution failed (exited with 1)
2024-08-14 17:50:29           (host1)        -    INFO: vfs on PF enp1s0f0np0 successfully created
2024-08-14 17:50:29       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.eth0.create_vfs(1)
2024-08-14 17:50:29       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.eth0_vf0._enable()
2024-08-14 17:50:29       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.eth0._enable()
2024-08-14 17:50:29       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.eth0.up_and_wait()
2024-08-14 17:50:29           (host2)        -    INFO: Waiting for vf(s) creation on PF enp1s0f0np0 for 10 seconds
2024-08-14 17:50:29           (host2)        -   ERROR: Command "ethtool -a eth0" execution failed (exited with 1)
2024-08-14 17:50:30           (host2)        -    INFO: vfs on PF enp1s0f0np0 successfully created
2024-08-14 17:50:30       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.eth0.create_vfs(1)
2024-08-14 17:50:31       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.eth0_vf0._enable()
2024-08-14 17:50:31       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.eth0._enable()
2024-08-14 17:50:32       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.vlan0.ip_add(Ip4Address(192.168.10.1/24), peer=None)
2024-08-14 17:50:33       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.vlan1.ip_add(Ip4Address(192.168.11.1/24), peer=None)
2024-08-14 17:50:34       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.vlan2.ip_add(Ip4Address(192.168.12.1/24), peer=None)
2024-08-14 17:50:35       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.vlan0.ip_add(Ip6Address(fd00:0:1000::1/64), peer=None)
2024-08-14 17:50:36       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.vlan1.ip_add(Ip6Address(fd00:0:1010::1/64), peer=None)
2024-08-14 17:50:37       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.vlan2.ip_add(Ip6Address(fd00:0:1020::1/64), peer=None)
2024-08-14 17:50:37       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.eth0.up_and_wait()
2024-08-14 17:50:37       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.vlan0.up_and_wait()
2024-08-14 17:50:37       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.vlan1.up_and_wait()
2024-08-14 17:50:37       (localhost)        -    INFO: Result: PASS, What: Calling Device method host1.vlan2.up_and_wait()
2024-08-14 17:50:38       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.vlan0.ip_add(Ip4Address(192.168.10.2/24), peer=None)
2024-08-14 17:50:39       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.vlan1.ip_add(Ip4Address(192.168.11.2/24), peer=None)
2024-08-14 17:50:40       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.vlan2.ip_add(Ip4Address(192.168.12.2/24), peer=None)
2024-08-14 17:50:41       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.vlan0.ip_add(Ip6Address(fd00:0:1000::2/64), peer=None)
2024-08-14 17:50:42       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.vlan1.ip_add(Ip6Address(fd00:0:1010::2/64), peer=None)
2024-08-14 17:50:43       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.vlan2.ip_add(Ip6Address(fd00:0:1020::2/64), peer=None)
2024-08-14 17:50:43       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.eth0.up_and_wait()
2024-08-14 17:50:43       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.vlan0.up_and_wait()
2024-08-14 17:50:43       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.vlan1.up_and_wait()
2024-08-14 17:50:43       (localhost)        -    INFO: Result: PASS, What: Calling Device method host2.vlan2.up_and_wait()

The DoubleBondRecipe and LinuxBridgeOverBondRecipe are working fine.

@jtluka
Copy link
Collaborator Author

jtluka commented Aug 15, 2024

VlansRecipe shows incorrect order of network configuration - first vlan devices are created over PFs, then VFs are created:

The DoubleBondRecipe and LinuxBridgeOverBondRecipe are working fine.

The problem seems to be the VlansRecipe code that firstly creates VlanDevices, then calls super().test_wide_configuration that is a bug IMO:

config = super().test_wide_configuration()

@jtluka
Copy link
Collaborator Author

jtluka commented Aug 15, 2024

VlansRecipe shows incorrect order of network configuration - first vlan devices are created over PFs, then VFs are created:
The DoubleBondRecipe and LinuxBridgeOverBondRecipe are working fine.

The problem seems to be the VlansRecipe code that firstly creates VlanDevices, then calls super().test_wide_configuration that is a bug IMO:

config = super().test_wide_configuration()

Same issue is in following recipes:

  • BondRecipe
  • TeamRecipe
  • TeamVsBondRecipe
  • VlansOverBondRecipe
  • VlansOverTeamRecipe
  • VxlanMulticastRecipe

olichtne
olichtne previously approved these changes Sep 2, 2024
Copy link
Collaborator

@olichtne olichtne left a 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.

@jtluka
Copy link
Collaborator Author

jtluka commented Sep 3, 2024

VlansRecipe shows incorrect order of network configuration - first vlan devices are created over PFs, then VFs are created:
The DoubleBondRecipe and LinuxBridgeOverBondRecipe are working fine.

The problem seems to be the VlansRecipe code that firstly creates VlanDevices, then calls super().test_wide_configuration that is a bug IMO:

config = super().test_wide_configuration()

Same issue is in following recipes:

* BondRecipe

* TeamRecipe

* TeamVsBondRecipe

* VlansOverBondRecipe

* VlansOverTeamRecipe

* VxlanMulticastRecipe

Fixed. I will rerun the tests for the updated recipes to check I did not miss anything.

@jtluka
Copy link
Collaborator Author

jtluka commented Sep 3, 2024

Additional tests for tests with fixed super().test_wide_configuration() call in J:9813755

Since our internal test coverage does not include BondRecipe, TeamRecipe and TeamVsBondRecipe, I did not include these.

@jtluka
Copy link
Collaborator Author

jtluka commented Sep 3, 2024

Additional tests for tests with fixed super().test_wide_configuration() call in J:9813755

Since our internal test coverage does not include BondRecipe, TeamRecipe and TeamVsBondRecipe, I did not include these.

All tests except VxlanMulticastRecipe ran fine with and without use_vfs=True. For VxlanMulticastRecipe I did not realize that it does not inherit from BaremetalEnrtRecipe, so it does not have the use_vfs parameter.

I'll update the patch that modifies VxlanMulticastRecipe and this can be merged.

To properly use the UseVfsMixin, the test_wide_configuration must be
called before creating any devices, otherwise the PFs could be used as
parent device for e.g. Bond or VlanDevice instead of VFs.

Signed-off-by: Jan Tluka <[email protected]>
@jtluka jtluka force-pushed the support-for-vf-testing-in-enrt branch from 0abffb6 to 798c83c Compare September 3, 2024 11:31
@jtluka jtluka merged commit f581231 into LNST-project:master Sep 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants