Skip to content

Commit

Permalink
T6764: Ethtool not all NICs can show ring-buffers
Browse files Browse the repository at this point in the history
Not all NICs could provide ring-buffers info requested by ethtool
in JSON format
For example 'vif' Xen/XCP-NG interfaces
Fix it
  • Loading branch information
sever-sever committed Nov 5, 2024
1 parent 47aa697 commit 080fd85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/vyos/ethtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ def __init__(self, ifname):
self._features = loads(out)[0]

# Get information about NIC ring buffers
out, _ = popen(f'ethtool --json --show-ring {ifname}')
self._ring_buffer = loads(out)[0]
out, err = popen(f'ethtool --json --show-ring {ifname}')
if not bool(err):
self._ring_buffer = loads(out)[0]

# Get current flow control settings, but this is not supported by
# all NICs (e.g. vmxnet3 does not support is)
Expand Down

0 comments on commit 080fd85

Please sign in to comment.