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

PCINetDevices: use sysfs to enumerate ethernet devices #4

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fnordahl
Copy link
Contributor

@fnordahl fnordahl commented Mar 15, 2021

The PCINetDevice constructor already uses sysfs to initialize
itself so this would not introduce a behavioural change. It
does however allow use of the PCI library with the netdevsim
driver which would help in downstream testing.

Use existence of sriov_numvfs as indication of SR-IOV support
instead of sriov_totalvfs to allow testing with netdevsim.

Handle non-existence of sriov_totalvfs by detecting the
netdevsim driver and returning a fixed number for totalvfs.

@fnordahl fnordahl changed the title PCINetDevices: use sysfs to enumerate ethernet devices PCINetDevices: support enumerating netdevsim devices Mar 16, 2021
@fnordahl fnordahl changed the title PCINetDevices: support enumerating netdevsim devices PCINetDevices: use sysfs to enumerate ethernet devices Mar 16, 2021
The `PCINetDevice` constructor already uses sysfs to initialize
itself so this would not introduce a behavioural change. It
does however allow use of the PCI library with the `netdevsim`
driver which would help in downstream testing.

Use existence of `sriov_numvfs` as indication of SR-IOV support
instead of `sriov_totalvfs` to allow testing with `netdevsim`.

Handle non-existence of `sriov_totalvfs` by detecting the
`netdevsim` driver and returning a fixed number for totalvfs.
Pass on device details when instantiating the PCINetDevice objects
instead of enumerating devices twice.
@fnordahl fnordahl marked this pull request as ready for review March 17, 2021 07:36
@fnordahl
Copy link
Contributor Author

In addition to on-metal testing successful test run consuming this code can be viewed in https://review.opendev.org/c/x/charm-ovn-chassis/+/780592

@fnordahl fnordahl requested a review from javacruft March 17, 2021 08:41
@fnordahl fnordahl marked this pull request as draft September 13, 2021 03:17
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.

1 participant