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

ethtool: add get/set channels functions #1192

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

sohorx
Copy link
Contributor

@sohorx sohorx commented Mar 26, 2024

Add simple setter/getter for ETHTOOL_CHANNELS

exemple:

>>> from pyroute2.ethtool import Ethtool
>>> with Ethtool() as tool:
...     print(tool.get_channels('eth0'))
...
EthtoolChannels(max_rx=0, max_tx=0, max_other=1, max_combined=2, rx_count=0, tx_count=0, other_count=1, combined_count=1)
>>> with Ethtool() as tool:
...     tool.set_channels('eth0', {'combined_count': 2})
...     print(tool.get_channels('eth0'))
...
EthtoolChannels(max_rx=0, max_tx=0, max_other=1, max_combined=2, rx_count=0, tx_count=0, other_count=1, combined_count=2)
>>>

Thoses fonctionnalities can be found with ethtool -l and ethtool -L

@sohorx sohorx force-pushed the ethtool/channels branch from c3a6cbc to b12acc6 Compare March 27, 2024 11:20
svinota added a commit that referenced this pull request Apr 2, 2024
@svinota svinota merged commit b12acc6 into svinota:master Apr 2, 2024
17 of 18 checks passed
@svinota
Copy link
Owner

svinota commented Apr 2, 2024

Thanks, merged!

PS: pls don't forget to run make format on the code while making PR, thanks!

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