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

WIP: Set GUID and MAC for VF with default driver loaded #245

Closed
wants to merge 1 commit into from

Conversation

pliurh
Copy link
Collaborator

@pliurh pliurh commented Feb 7, 2022

No description provided.

@github-actions
Copy link

github-actions bot commented Feb 7, 2022

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@pliurh
Copy link
Collaborator Author

pliurh commented Feb 7, 2022

fix #244

@pliurh
Copy link
Collaborator Author

pliurh commented Feb 7, 2022

/test-all

Copy link
Collaborator

@e0ne e0ne left a comment

Choose a reason for hiding this comment

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

The change itself looks good to me but I prefer to have some more details in the commit message why do we need it

@e0ne
Copy link
Collaborator

e0ne commented Feb 7, 2022

Do we still need #233 with this fix?

@SchSeba
Copy link
Collaborator

SchSeba commented Feb 7, 2022

I change my PR to contain also this change (it was implemented there in another method) so maybe we can just merge #233 ?

Copy link
Collaborator

@zshi-redhat zshi-redhat left a comment

Choose a reason for hiding this comment

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

Could you remind me what issue does this PR fix?

if err = setVfGuid(addr, pfLink); err != nil {
return err
}
} else if err = setVfAdminMac(addr, pfLink); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can still set VF admin mac w/ vfio-pci driver, right?
Just like sriov-cni can set VF attributes(admin-mac, vlan, trust, spoofchk etc) in vfio-pci mode.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Does it make any sense to set the VF MAC when using vfio-pci driver? We invoke vfIsReady in setVfAdminMac, it returns error with vfio-pci driver.

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 to resolve #244

Copy link
Contributor

Choose a reason for hiding this comment

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

I am afraid this will result in adapters with vfio-pci to use the ff:ff:ff:ff:ff:ff:ff address. Can we just skip the setVfAdminMac in case we did not change the vfNum? Considering this agent always creates the VFs, the mac will always be set, because it would happen when we created them.

Copy link
Collaborator

@zshi-redhat zshi-redhat Feb 8, 2022

Choose a reason for hiding this comment

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

Does it make any sense to set the VF MAC when using vfio-pci driver?

I think yes. For some vendor NICs, the default admin MAC is all-zero, which means all packet (including packets with spoofed MAC) can be sent by app using the VF (when VF spoofChk is set to on).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed. PTAL.

@pliurh pliurh changed the title Set GUID and MAC for VF with default driver loaded WIP: Set GUID and MAC for VF with default driver loaded Feb 7, 2022
@github-actions
Copy link

github-actions bot commented Feb 8, 2022

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

pkg/utils/utils.go Outdated Show resolved Hide resolved
Changing other VF driver type or other parameter will no longer
trigger setting GUID and MAC
@github-actions
Copy link

github-actions bot commented Feb 8, 2022

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@@ -287,15 +287,18 @@ func configSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetwor
break
}
}
if strings.EqualFold(iface.LinkType, "IB") {
if err = setVfGuid(addr, pfLink); err != nil {
if iface.NumVfs != ifaceStatus.NumVfs {
Copy link
Collaborator

Choose a reason for hiding this comment

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

its not clear to me why we skip this step, i think its worth adding a comment here

looking at @mskrocki comment

Considering this agent always creates the VFs, the mac will always be set, because it would happen when we created them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree. The change in this PR will be merged into #233, and this PR will be deprecated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @pliurh @adrianchiris @mskrocki can you please take a look on #233

I think my implementation there is better I will explain on that PR

@pliurh pliurh closed this Feb 10, 2022
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.

6 participants