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

driver/rawnetworkinterfacedriver: add interface up/down/(basic, EEE, pause) configuration #1525

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

Bastian-Krause
Copy link
Member

@Bastian-Krause Bastian-Krause commented Oct 15, 2024

Description
Add methods to the RawNetworkInterfaceDriver to set interfaces up and down, as well as getting and waiting for the interface state. Also add basic/EEE/pause interface configuration and query support.

This allows the driver to take more control over the interface, preconfiguration is not needed anymore. Tests that expect the exporter interface to be down (such as ethernet selftests, cable tests) are now possible.

Note that the RawNetworkInterfaceDriver now brings the bound interface up on activate and down on deactivate.
Also note that ethtool gained the required --json support for the default sub command and for --show-eee only in v6.10.

Checklist

  • Documentation for the feature
  • Tests for the feature
  • Add a section on how to use the feature to doc/usage.rst
  • PR has been tested

labgrid/driver/rawnetworkinterfacedriver.py Outdated Show resolved Hide resolved
helpers/labgrid-raw-interface Outdated Show resolved Hide resolved
labgrid/driver/rawnetworkinterfacedriver.py Show resolved Hide resolved
helpers/labgrid-raw-interface Show resolved Hide resolved
Add methods to the RawNetworkInterfaceDriver to set interfaces up and
down, as well as getting and waiting for the interface state.

This allows the driver to take more control over the interface,
preconfiguration is not needed anymore. Tests that expect the exporter
interface to be down (such as ethernet selftests, cable tests) are now
possible.

Note that the RawNetworkInterfaceDriver now brings the bound interface
up on activate and down on deactivate.

Signed-off-by: Bastian Krause <[email protected]>
Add interface configuration (`ethtool --change`) support to the
RawNetworkInterfaceDriver. This allows configuring the bound interface
(speed, lanes, duplex, port, master-slave, mdix, autoneg, advertise,
phyad, xcvr, wol, sopass, msglvl).

Also add add a `get_settings()` method to query those settings. Note
that ethtool gained the required --json support for the default sub
command in v6.10.

Signed-off-by: Bastian Krause <[email protected]>
Add interface Energy Efficient Ethernet (EEE) configuration
(`ethtool --set-eee`) support to the RawNetworkInterfaceDriver. This
allows configuring the EEE parameters eee, tx-lpi, tx-timer and advertise
on the bound interface.

Also add a `get_eee_settings()` method to query those settings. Note
that ethtool gained the required --json support for this sub command in
v6.10.

Signed-off-by: Bastian Krause <[email protected]>
Add interface pause configuration (`ethtool --pause`) support to the
RawNetworkInterfaceDriver. This allows configuring the pause parameters
autoneg, rx and tx on the bound interface.

Also add a `get_pause_settings()` method to query those settings.

Signed-off-by: Bastian Krause <[email protected]>
@Bastian-Krause
Copy link
Member Author

Rebased on latest master.

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 41.02564% with 46 lines in your changes missing coverage. Please review.

Project coverage is 56.5%. Comparing base (47fdd37) to head (a93f147).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
labgrid/driver/rawnetworkinterfacedriver.py 41.0% 46 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1525     +/-   ##
========================================
- Coverage    56.6%   56.5%   -0.1%     
========================================
  Files         168     168             
  Lines       13033   13111     +78     
========================================
+ Hits         7385    7417     +32     
- Misses       5648    5694     +46     
Flag Coverage Δ
3.10 56.5% <41.0%> (-0.1%) ⬇️
3.11 56.5% <41.0%> (-0.1%) ⬇️
3.12 56.5% <41.0%> (-0.1%) ⬇️
3.13 56.5% <41.0%> (-0.1%) ⬇️
3.9 56.6% <41.5%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jluebbe jluebbe merged commit 0304ec6 into labgrid-project:master Nov 1, 2024
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants