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

pkg: net: report backing device address #221

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

ffromani
Copy link
Collaborator

@ffromani ffromani commented Feb 4, 2021

Report the backing device address - currently PCI only -
in the network interface data.
This allows the client code to fetch the device information using
the specific package, for example pkg/pci.

We prefer to add the address, and not a pointer to the relevant
backing device object, the make the net module less coupled with
the other hardware modules.

Signed-off-by: Francesco Romani [email protected]

@ffromani
Copy link
Collaborator Author

ffromani commented Feb 4, 2021

WIP because we need tests; to enable tests, we need to have a ghw snapshot in the source tree; I will provide it with a PR soon enough.

@ffromani
Copy link
Collaborator Author

ffromani commented Feb 8, 2021

To move forward, we need first to move forward on #224

@ffromani ffromani changed the title WIP: pkg: net: report backing device address pkg: net: report backing device address Feb 9, 2021
@ffromani
Copy link
Collaborator Author

ffromani commented Feb 9, 2021

This PR is a precondition to solve #92

Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

@fromanirh thank you for the PR! Left a couple notes and suggestions inline for ya.

pkg/net/net.go Outdated Show resolved Hide resolved
pkg/net/net_linux.go Show resolved Hide resolved
pkg/net/net.go Outdated Show resolved Hide resolved
pkg/net/net_linux.go Outdated Show resolved Hide resolved
Report the backing device address - currently PCI only -
in the network interface data.
This allows the client code to fetch the device information using
the specific package, for example `pkg/pci`.

The PCIAddress field is non-nil only if the backing device is
connected through a PCI bus. Non-PCI devices (e.g. USB network
interface are not yet supported).

Signed-off-by: Francesco Romani <[email protected]>
@ffromani ffromani force-pushed the net-backing-device-address branch from 617636e to 13f3f64 Compare February 11, 2021 15:54
Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

Awesome work, @fromanirh :) Thank you!

@jaypipes jaypipes merged commit 8e90727 into jaypipes:master Feb 11, 2021
@jaypipes
Copy link
Owner

@fromanirh for a future PR, feel free to update the README.md to list this new PCIAddress field.

@ffromani
Copy link
Collaborator Author

@fromanirh for a future PR, feel free to update the README.md to list this new PCIAddress field.

Sure thing! #226 (actually I should have done this earlier :\ )

@ffromani ffromani deleted the net-backing-device-address branch February 12, 2021 07:47
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.

2 participants