Re: [PATCH net-next v2] selftests: drv-net: so_txtime: only send test traffic to sch_etf
From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-08-11 15:27:24
On Tue, 11 Aug 2026 10:29:12 -0400 Willem de Bruijn wrote:
quoted hunk ↗ jump to hunk
I can reproduce after tc qdisc replace dev eth0 root handle pfifo_fast tc qdisc replace dev eth0 root handle 1: pfifo_fast It is not possible to replace tc qdisc replace with a del + add pair, due to "Error: Cannot delete qdisc with handle of zero." on systems with the default 0: qdisc, like my debian trixie. The simplest change, then, is to replace the qdisc twice, first for the kind, then for the handle.@@ -45,17 +45,18 @@ def _qdisc_setup(ifname, qdisc, optargs=""): """ orig = tc(f"qdisc show dev {ifname} root", json=True)[0].get("kind", None) defer(tc, f"qdisc replace dev {ifname} root {orig}") + tc(f"qdisc replace dev {ifname} root {qdisc} {optargs}") tc(f"qdisc replace dev {ifname} root handle 1: {qdisc} {optargs}")It's an extra replace, so a bit ugly. But avoiding that requires parsing the json for existing handle, branching on that. I'm testing the above some more, will send that if no concerns.
If we are adding an extra command adding del would seem more intuitive? But no preference. The issue may be because the ring reconfig test now also sets up qdiscs. And we don't have a proper way to restore previous qdisc config in the tests. If another test needs to change qdiscs we should probably add better infra, but for now I think the simple workaround you suggest is best.