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

UseVfsMixin: add vf_trust parameter #379

Closed
wants to merge 2 commits into from
Closed

UseVfsMixin: add vf_trust parameter #379

wants to merge 2 commits into from

Conversation

jtluka
Copy link
Collaborator

@jtluka jtluka commented Sep 26, 2024

Description

This adds vf_trust parameter to UseVfsMixin. The Device class is extended with vf_trust() method.

Tests

J:9865704 J:9939392

Note that sfc driver tests failed because the device does not support vf_trust. I have a separate patch set that fixes that along with different way to achieve same functionality.

Reviews

@olichtne

Allows configuration of vf device trust mode.

Signed-off-by: Jan Tluka <[email protected]>
Allows user to set trust mode on created VFs.

Signed-off-by: Jan Tluka <[email protected]>
@@ -12,11 +12,16 @@ class UseVfsMixin:
with VF Device instances. This allows user to interact with the network
interfaces without additional changes to the code of recipe.

Mixin provides two boolean parameters:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As they're not both boolean, I'll update the dosctring.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the docstring still says "two boolean parameters"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, so I think I've accidentally originally pushed the code to LNST-project's git tree instead of my fork. Then I pushed the updates into my fork's git, so they're not visible here. I'll fix that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no way to change the source branch of PR, I created a new one in #381

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed in new PR.

@jtluka
Copy link
Collaborator Author

jtluka commented Sep 27, 2024

I noticed that there's a flaw in the implementation:

    Testwide configuration for recipe VlansOverBondRecipe description:
    Using vf device enp2s0f0v0 of pf enp2s0f0 for DeviceReq host1.eth0 trusted={self.params.vf_trust}
    Using vf device enp2s0f1v0 of pf enp2s0f1 for DeviceReq host1.eth1 trusted={self.params.vf_trust}
    Using vf device enp2s0f0v0 of pf enp2s0f0 for DeviceReq host2.eth0 trusted={self.params.vf_trust}

For this recipe we need to set vf trust only on host1 that configures the bond device. The other host does not use bonding so it is not necessary to configure vf trust.

@jtluka
Copy link
Collaborator Author

jtluka commented Sep 30, 2024

I noticed that there's a flaw in the implementation:

    Testwide configuration for recipe VlansOverBondRecipe description:
    Using vf device enp2s0f0v0 of pf enp2s0f0 for DeviceReq host1.eth0 trusted={self.params.vf_trust}
    Using vf device enp2s0f1v0 of pf enp2s0f1 for DeviceReq host1.eth1 trusted={self.params.vf_trust}
    Using vf device enp2s0f0v0 of pf enp2s0f0 for DeviceReq host2.eth0 trusted={self.params.vf_trust}

For this recipe we need to set vf trust only on host1 that configures the bond device. The other host does not use bonding so it is not necessary to configure vf trust.

Fixed by adding vf_trust_device_list property.

@@ -56,7 +63,7 @@ def generate_test_wide_description(self, config):

if self.params.use_vfs:
description += [
f"Using vf device {vf_dev.name} of pf {sriov_devices.phys_dev.name} for DeviceReq {host.hostid}.{vf_dev._id}"
f"Using vf device {vf_dev.name} of pf {sriov_devices.phys_dev.name} for DeviceReq {host.hostid}.{vf_dev._id} trusted={self.params.vf_trust}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this directly prints self.params... is there maybe also a getter for the Device.vf_trust value that should be used instead to reflect the real state of the device?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no getter atm. The "property" is implemented through a method. Maybe I could change this to property.

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.

minor questions asked. but overall looks ok

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