* [PATCH net] selftests: drv-net: tso: don't touch dangerous feature bits
@ 2026-06-29 23:39 Jakub Kicinski
2026-06-30 4:33 ` Pavan Chebbi
2026-06-30 11:38 ` Daniel Zahka
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2026-06-29 23:39 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, Jakub Kicinski,
shuah, daniel.zahka, linux-kselftest
query_nic_features() detects which offloads depend on tx-gso-partial
by enabling everything, turning tx-gso-partial off, and seeing which
active features drop out. Enabling all hw features is dangerous:
we may end up enabling rx-fcs and loopback for example. For the
ice driver we end up getting into problems with feature dependencies
so the cleanup isn't successful either, and the test exits with
rx-fcs and loopback enabled.
Scope the feature probing just to segmentation bits.
Fixes: 266b835e5e84 ("selftests: drv-net: tso: enable test cases based on hw_features")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: shuah@kernel.org
CC: daniel.zahka@gmail.com
CC: linux-kselftest@vger.kernel.org
---
tools/testing/selftests/drivers/net/hw/tso.py | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/drivers/net/hw/tso.py b/tools/testing/selftests/drivers/net/hw/tso.py
index 1b789fea8929..802bb4868046 100755
--- a/tools/testing/selftests/drivers/net/hw/tso.py
+++ b/tools/testing/selftests/drivers/net/hw/tso.py
@@ -187,28 +187,24 @@ from lib.py import bkg, cmd, defer, ethtool, ip, rand_port, wait_port_listen
cfg.wanted_features.add(f["name"])
cfg.hw_features = set()
- hw_all_features_cmd = ""
for f in features["hw"]["bits"]["bit"]:
if f.get("value", False):
- feature = f["name"]
- cfg.hw_features.add(feature)
- hw_all_features_cmd += f" {feature} on"
- try:
- ethtool(f"-K {cfg.ifname} {hw_all_features_cmd}")
- except Exception as e:
- ksft_pr(f"WARNING: failure enabling all hw features: {e}")
- ksft_pr("partial gso feature detection may be impacted")
+ cfg.hw_features.add(f["name"])
# Check which features are supported via GSO partial
cfg.partial_features = set()
if 'tx-gso-partial' in cfg.hw_features:
+ seg_features = {f for f in cfg.hw_features if "segmentation" in f}
+ ethtool(f"-K {cfg.ifname} " +
+ " ".join(f"{f} on" for f in seg_features))
+
ethtool(f"-K {cfg.ifname} tx-gso-partial off")
no_partial = set()
features = cfg.ethnl.features_get({"header": {"dev-index": cfg.ifindex}})
for f in features["active"]["bits"]["bit"]:
no_partial.add(f["name"])
- cfg.partial_features = cfg.hw_features - no_partial
+ cfg.partial_features = seg_features - no_partial
ethtool(f"-K {cfg.ifname} tx-gso-partial on")
restore_wanted_features(cfg)
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] selftests: drv-net: tso: don't touch dangerous feature bits
2026-06-29 23:39 [PATCH net] selftests: drv-net: tso: don't touch dangerous feature bits Jakub Kicinski
@ 2026-06-30 4:33 ` Pavan Chebbi
2026-06-30 11:38 ` Daniel Zahka
1 sibling, 0 replies; 3+ messages in thread
From: Pavan Chebbi @ 2026-06-30 4:33 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah,
daniel.zahka, linux-kselftest
[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]
On Tue, Jun 30, 2026 at 5:09 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> query_nic_features() detects which offloads depend on tx-gso-partial
> by enabling everything, turning tx-gso-partial off, and seeing which
> active features drop out. Enabling all hw features is dangerous:
> we may end up enabling rx-fcs and loopback for example. For the
> ice driver we end up getting into problems with feature dependencies
> so the cleanup isn't successful either, and the test exits with
> rx-fcs and loopback enabled.
>
> Scope the feature probing just to segmentation bits.
>
> Fixes: 266b835e5e84 ("selftests: drv-net: tso: enable test cases based on hw_features")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: shuah@kernel.org
> CC: daniel.zahka@gmail.com
> CC: linux-kselftest@vger.kernel.org
> ---
> tools/testing/selftests/drivers/net/hw/tso.py | 16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)
>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5469 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] selftests: drv-net: tso: don't touch dangerous feature bits
2026-06-29 23:39 [PATCH net] selftests: drv-net: tso: don't touch dangerous feature bits Jakub Kicinski
2026-06-30 4:33 ` Pavan Chebbi
@ 2026-06-30 11:38 ` Daniel Zahka
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Zahka @ 2026-06-30 11:38 UTC (permalink / raw)
To: Jakub Kicinski, davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, shuah,
linux-kselftest
On 6/29/26 7:39 PM, Jakub Kicinski wrote:
> query_nic_features() detects which offloads depend on tx-gso-partial
> by enabling everything, turning tx-gso-partial off, and seeing which
> active features drop out. Enabling all hw features is dangerous:
> we may end up enabling rx-fcs and loopback for example. For the
> ice driver we end up getting into problems with feature dependencies
> so the cleanup isn't successful either, and the test exits with
> rx-fcs and loopback enabled.
>
> Scope the feature probing just to segmentation bits.
>
> Fixes: 266b835e5e84 ("selftests: drv-net: tso: enable test cases based on hw_features")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-30 11:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29 23:39 [PATCH net] selftests: drv-net: tso: don't touch dangerous feature bits Jakub Kicinski
2026-06-30 4:33 ` Pavan Chebbi
2026-06-30 11:38 ` Daniel Zahka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox