-
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
UseVfsMixin: add vf_trust parameter #379
Conversation
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: |
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.
As they're not both boolean, I'll update the dosctring.
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.
the docstring still says "two boolean parameters"
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.
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.
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.
There is no way to change the source branch of PR, I created a new one in #381
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.
This is fixed in new PR.
I noticed that there's a flaw in the implementation:
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 |
@@ -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}" |
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.
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?
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.
There's no getter atm. The "property" is implemented through a method. Maybe I could change this to property.
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.
minor questions asked. but overall looks ok
Description
This adds
vf_trust
parameter to UseVfsMixin. The Device class is extended withvf_trust()
method.Tests
J:9865704J:9939392Note 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