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

Updated netlink dependency version #398

Merged

Conversation

almaslennikov
Copy link
Contributor

The version of netlink introduced in #395 breaks the use case of getting eswitch mode of pci device, introduced in the same PR.

Here's a comparison table of results from several version of netlink compared against each other and devlink cmd:

PCI device devlink report netlink v1.1.1-0.20210518155637-4cb3795f2ccb (broken) netlink v1.1.0 (previous) netlink master vishvananda/netlink@b10eb8f
PF in switchdev eswitch mode mode switchdev inline-mode none encap enable mode="", err=nil switchdev switchdev
PF in legacy eswitch mode mode legacy inline-mode none encap disable mode="", err=nil legacy legacy
VF for switchdev PF devlink answers: Operation not supported mode="", err=nil mode="", err=nil mode="", err=nil
VF for legacy PF devlink answers: Operation not supported mode="", err=nil mode="", err=nil mode="", err=nil
non-sriov PF devlink answers: Operation not supported mode="", err=nil mode="", err=nil mode="", err=nil

The broken version of netlink reports empty eswitch mode for sriov enabled devices.

So, to fix the issue, upgrading the version of netlink to the current master. We can't downgrade to the previously used version because https://github.com/Mellanox/sriovnet/ dependency relies on a newer version.

Also, changed the error handling because devlink's "Operation not supported" results in empty value from netlink.
Here's the logs from my machine:

  • Intel Corporation I350 Gigabit Network Connection
    [utils.go:66] Getting pf name for 0000:01:00.1
    [utils.go:73] Devlink query for eswitch mode is not supported for device 0000:01:00.1. error getting devlink device attributes for net device 0000:01:00.1 no such device
    [utils.go:89] Using default flow

  • ConnectX 6 switchdev VFs
    [utils.go:66] Getting pf name for 0000:03:00.2
    [utils.go:78] Using switchdev flow
    [utils.go:66] Getting pf name for 0000:03:00.3
    [utils.go:78] Using switchdev flow
    [utils.go:66] Getting pf name for 0000:03:00.4
    [utils.go:78] Using switchdev flow
    [utils.go:66] Getting pf name for 0000:03:00.5
    [utils.go:78] Using switchdev flow

  • ConnectX 6 legacy vfs
    [utils.go:66] Getting pf name for 0000:03:00.7
    [utils.go:89] Using default flow
    [utils.go:66] Getting pf name for 0000:03:01.0
    [utils.go:89] Using default flow
    [utils.go:66] Getting pf name for 0000:03:01.1
    [utils.go:89] Using default flow
    [utils.go:66] Getting pf name for 0000:81:00.0
    [utils.go:73] Devlink query for eswitch mode is not supported for device 0000:81:00.0.
    [utils.go:89] Using default flow

Signed-off-by: Alexander Maslennikov <[email protected]>
@zshi-redhat
Copy link
Collaborator

Thanks for the detailed comparision tests!

Also, changed the error handling because devlink's "Operation not supported" results in empty value from netlink. Here's the logs from my machine:

So we won't see the "Operation not supported" message by calling GetPfEswitchMode, It just returns empty value and nil error, right? that's why the handling of "Operation not supported" is removed if I understand correctly.

@almaslennikov
Copy link
Contributor Author

@zshi-redhat Yes, that's right

@adrianchiris adrianchiris merged commit 7488066 into k8snetworkplumbingwg:master Nov 18, 2021
almaslennikov added a commit to almaslennikov/sriovnet that referenced this pull request Nov 22, 2021
The current version of netlink breaks the use case of getting eswitch mode of pci device. The broken version of netlink reports empty eswitch mode for sriov enabled devices.
To move from the broken version of netlink, updating it to the latest master at the time.

See the more detailed reasoning for the change in k8snetworkplumbingwg/sriov-network-device-plugin#398
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.

3 participants