Skip to content

Commit 02471a8

Browse files
committed
ethtool: T3871: honor the unsupported-driver denylist for flow-control too
Flow-control commits failed intermittently on virtio_net and similar paravirtualized drivers: they support reading pause parameters but not setting them, and that mismatch varies across kernel/QEMU versions. The existing denylist for this already covered speed/duplex changes and its name implied flow-control too, but nothing actually consulted it there - the check relied solely on a live probe. The paired smoketest branched on that same raw probe instead of the fixed capability check, so it missed the same drivers. Assisted-by: Claude:claude-sonnet-5
1 parent 363fae2 commit 02471a8

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

python/vyos/ethtool.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ def check_speed_duplex(self, speed, duplex):
217217

218218
def check_flow_control(self):
219219
""" Check if the NIC supports flow-control """
220+
if self.get_driver_name() in _drivers_without_speed_duplex_flow:
221+
return False
220222
return bool(self._flow_control)
221223

222224
def get_flow_control(self):

smoketest/scripts/cli/test_interfaces_ethernet.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,17 +287,21 @@ def test_ethtool_coalesce(self):
287287

288288
def test_ethtool_flow_control(self):
289289
for interface in self._interfaces:
290+
ethtool = Ethtool(interface)
290291
# Disable flow-control
291292
self.cli_set(self._base_path + [interface, 'disable-flow-control'])
292-
# Check current flow-control state on ethernet interface
293-
out, err = popen(f'sudo ethtool --json --show-pause {interface}')
294-
# Flow-control not supported - test if it bails out with a proper
295-
# this is a dynamic path where err = 1 on VMware, but err = 0 on
296-
# a physical box.
297-
if bool(err):
293+
294+
# Ask the same capability check the CLI commit itself uses,
295+
# rather than a raw ethtool --show-pause probe: some drivers
296+
# (virtio_net, vmxnet3, xen_netfront, ...) support querying
297+
# pause parameters but not changing them, so a bare --show-pause
298+
# exit code is not a reliable predictor of whether the commit
299+
# will succeed.
300+
if not ethtool.check_flow_control():
298301
with self.assertRaises(ConfigSessionError):
299302
self.cli_commit()
300303
else:
304+
out, err = popen(f'sudo ethtool --json --show-pause {interface}')
301305
out = loads(out)
302306
# Flow control is on
303307
self.assertTrue(out[0]['autonegotiate'])

0 commit comments

Comments
 (0)