Updated netlink dependency version #398
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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