🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20475

Re: [PATCH net-next 2/8] selftests: drv-net: drop the generic XDP hack from the HW GRO setup

#20475
From: netdev-bot+sashiko
Date: Sun, 22 Nov 2026 17:03
109 lines
12313 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] After this patch, nothing in
  tools/testing/selftests/drivers/net/hw/gro_stats.py checks that rx-…

--

selftests: drv-net: drop the generic XDP hack from the HW GRO setup

This commit removes the generic XDP fallback from the HW GRO setup in
gro_lib.py and hw/gro_stats.py. Drivers no longer tie HW GRO to
NETIF_F_GRO, so the setup now asks ethtool for SW GRO off and rx-gro-hw
on directly.

> diff --git a/tools/testing/selftests/drivers/net/gro_lib.py b/tools/testing/selftests/drivers/net/gro_lib.py
> index 875a715b2ae1c..6eff19db3541f 100644
> --- a/tools/testing/selftests/drivers/net/gro_lib.py
> +++ b/tools/testing/selftests/drivers/net/gro_lib.py
> @@ -263,26 +263,7 @@ def _setup(cfg, mode, test_name):
>          set_ethtool_feat(cfg.ifname, cfg.feat,
>                           {"generic-receive-offload": False,
>                            "rx-gro-hw": True,
> -                          "large-receive-offload": False},
> -                          check=False)

[ ... ]

> diff --git a/tools/testing/selftests/drivers/net/hw/gro_stats.py b/tools/testing/selftests/drivers/net/hw/gro_stats.py
> index 70e76e3888bdb..569ca81368e69 100755
> --- a/tools/testing/selftests/drivers/net/hw/gro_stats.py
> +++ b/tools/testing/selftests/drivers/net/hw/gro_stats.py
> @@ -173,24 +173,6 @@ def _setup_hw_gro(cfg):
>                         "rx-gro-hw": True,
>                         "large-receive-offload": False})
>  
> -    # Some NICs treat HW GRO as a GRO sub-feature so disabling GRO
> -    # will also clear HW GRO. Use a hack of installing XDP generic
> -    # to skip SW GRO, even when enabled.
> -    feat = ethtool(f"-k {cfg.ifname}", json=True)[0]
> -    if not feat["rx-gro-hw"]["active"]:

[ ... ]

> -        _set_ethtool_feat(cfg, feat,
> -                          {"generic-receive-offload": True,
> -                           "rx-gro-hw": True,
> -                           "large-receive-offload": False})
> -

[Severity: Medium]
Now that this read-back is gone, does anything in gro_stats.py still check
that rx-gro-hw is actually active after _setup_hw_gro() runs?

_setup_hw_gro() calls the file-local _set_ethtool_feat(). That helper only
raises KsftSkipEx when a feature is marked fixed. It never re-reads the
features after running ethtool -K:

tools/testing/selftests/drivers/net/hw/gro_stats.py:_set_ethtool_feat() {
    ...
    eth_cmd = ethtool(" ".join(new))
    defer(ethtool, " ".join(old))

    # If ethtool printed something kernel must have modified some features
    if eth_cmd.stdout:
        ksft_pr(eth_cmd)
}

In the same patch, _setup() in gro_lib.py drops check=False. It now relies
on the read-back in the shared helper:

tools/testing/selftests/drivers/net/lib/py/feat.py:set_ethtool_feat() {
    ...
    current = ethtool(f"-k {dev}", json=True, host=host)[0]
    for name, state in feats.items():
        if current[name]["active"] != state:
            raise KsftXfailEx(f"{name} was not set to {s2n[state]}")
}

The kernel can still clear rx-gro-hw even when the feature is not fixed:

- netdev_fix_features() drops NETIF_F_GRO_HW when RXCSUM is off or RX-FCS
  is on.
- A driver's ndo_fix_features can clear it.
- The tests may run on a kernel without "net: stop making HW-GRO depend
  on SW GRO".

In those cases, would gro_stats.py go on to run with both SW and HW GRO
disabled?

If so, test_gro_stats_full would fail its ksft_ge(gro_coalesced, 1) and
rx-hw-gro-* checks with misleading messages. Meanwhile test_gro_stats_single
and test_gro_order could pass without HW GRO ever having run.

Would it make sense to switch _setup_hw_gro() to the shared
set_ethtool_feat()? Another option is to re-read ethtool -k after the set
and skip or xfail when rx-gro-hw is not active.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118232315.3593731-1-kuba%40kernel.org
Technical Details
Message-ID: <179536698167.3135.988717812075290728@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368760-linux-kernel-netdev=dewy.ru
References: <20261118232315.3593731-3-kuba@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368760-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 2/8] selftests: drv-net: drop the generic XDP
 hack from the HW GRO setup
Date: Sun, 22 Nov 2026 17:03:01 +0000
Organization: Usenet Network
Message-ID: <179536698167.3135.988717812075290728@kernel.org>
References: <20261118232315.3593731-3-kuba@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3682065"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:2JWHq+qZBtg1w1CPmdiAfO7drug= sha256:yg7txFFCDJvECan241TwcvOD7YGT7vYOJoyTGxnEzbk=
	sha1:R2hLgy6wyksvmd4WSgoSLL45W60= sha256:Bck/DKKc5I0lQ3KXWLAFVgMdUcVIXSzk7d5ZI1D3x6c=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 83E4F125D83; Sun, 22 Nov 2026 20:03:22 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id T0zD6wPt3dlb;
	Sun, 22 Nov 2026 20:03:14 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-368760-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id CB16F125D81; Sun, 22 Nov 2026 20:03:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 2C4B96047DC; Sun, 22 Nov 2026 17:03:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795366984;
	b=EQshY4Rr9exAYPUHrHQNq+RFgoY+c7rWcox7j0AiSd1/zN8h0mqawVXF5M33WeKVA7PK
	 ynJQttKV4kPETT5MdCkvEaIBMRw92y8ypC85286k31XYzl5n2RFOH9ENJYCc/VdpMaeqr
	 WGvVZo1Krin6AlVL4hr3kJw+eWg15XCxHpcgVqKEMv/CZ4J4hf6zuHaIK74Si3wuIL6mT
	 Th/y6W1UA91q8f+tCaYBXM/3V3H/v3mrJWQONBeZQC4bwehK/yBlwU57zHy/h8Sicpr5g
	 noK3Eucj1vafrK0UzITVy3u3k3KyQB1eYrDuDAVvYVU5haDS3emcjKuPc1EjXBu9Kqw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795366984;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=vvzwh5GY5QMNLLzQ84AaKr2G99TlKd4xQAgrpeGbXeM=;
	b=T+t2VdMDLrj6tz/q220ZsEw6Fi/1CbfBeb72MYt2wwaLfTOTlpe2Az9Z0NfIhPV5KG36
	 RITRm5Z82XUvxDi6E2u4y9bYd+aU/v5tPByX5tpZ0spEZzQXP8shr92h0YYx2jkahyrPq
	 fZ7PU2pbhbVjbn11GkG0C2v9nyNJfytgaxU9yMNbMRxmtf/77BhPYqO1TTVQ4FN1Yy6OL
	 hNENjc4/zCs9ye01ZelEzsjm1vhHg+FMet3UoE7KJ5XHO/4MKXPtd86fFgYSSqimuzIi9
	 iGzyK65c4P2dL5uN9WigKj8dj1CwP5RIlZ4b+Nm8dWtwPBXn5UwMxu7BIvruZRP+liA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kcXx6K5K;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 587A3606A32A;
	Sun, 22 Nov 2026 17:03:04 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kcXx6K5K
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795366983;
	b=XAT1PjwSyG3ZooUUTG7z3r8iO6h4AluJ5IhLspPY7DyZ1RrCU+/YqbQeNp+2YYwAI/eM
	 b2IkSy5dOtOICt1B8irRF2goP1vPiH2hKTFEiHrTK2bEix4wRcga82uB4Uhw5nv2BeTLi
	 lsszhQYHSdUv28d19zo5Qkap8oCGzi1QdPJyLJHt3MjpJprPGsjpiOZA+nMi6KgAs76Nl
	 Ff92j37qqhVoPyk7pgcU2SVdioAmGZP+ziiL3G4IfOlNHT6UVj06HGR00vU4QeNR8NKrL
	 MK5AxG1j+jJzeqgVf9g8nPDwWFUQDGe65xwtSsjthHYPxUN+QxBAq5c7scMRq1XR1Zg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795366983;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=vvzwh5GY5QMNLLzQ84AaKr2G99TlKd4xQAgrpeGbXeM=;
	b=VonyeTH2N5xm+2BUQyuI0jgTL7hRlEVooPKGFiwua6fbfuZPQi0nv6amCHiqdPjkFKn2
	 ldD6j//hpn9JU32/Z+PdV3W1AjCl7mN32anG25Qsya+cM9qTL5B58SLBPPqNBL/fUVamp
	 dBabrg6gnNV7tWuzPJ88ur04TbIWLYpiE8uHh5yACwhB4UDsGsU6ZJVDjltE8GCeRP2Dc
	 I4ZY8YRIEEk2LEj82FSYfInCHI6ylJCFMMhvQiAk9kDOHS2cadNYxblA1zKml0h9YW7b2
	 FXYPqXmMeqv0SqjpoyPIOUi8u9rOJCrRJzoQXNT633q3a7NiezIKmyM2C5SkC965HHg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kcXx6K5K;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79412606A33B;
	Sun, 22 Nov 2026 17:03:03 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A9E11F000C0;
	Sun, 22 Nov 2026 17:03:02 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795366983;
	bh=vvzwh5GY5QMNLLzQ84AaKr2G99TlKd4xQAgrpeGbXeM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=kcXx6K5KOPBdgnXvlGlK1lb4eveQeZ8a7Vzna+DmaOotwEfCqFIKxcpoAbRusRO4Y
	 2gSE65DdxsCx4noedpBmi/U+fdqDUmTgdGwbqX7uE4GEQJNMb+lFUXgAXC/mgyb99e
	 QeuvsdoRYfTt+skZwJbpWOCwF9k0t8PmaqQn89t8TxNf7jyl7ZbCvAxZD91vuRKUMt
	 D6lybYWuPm2QsHkz6Km0DfotRLjps1iqkAA4oyLtJH7WHE/bOnNvO0C2OlVLXqn3tF
	 KakIIHqkR5ZH+jQ7BgITIvsSV0LLz6q7qOUbIcImhVl6fdRu/efnayQUpQFmpgsSQY
	 L7SsEvMUyD1wg==
X-Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
 pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
 michael.chan@broadcom.com, manishc@marvell.com, joshwash@google.com,
 hramamurthy@google.com, tariqt@nvidia.com, saeedm@nvidia.com,
 daniel@iogearbox.net, hawk@kernel.org, sdf@fomichev.me, willemb@google.com,
 przemyslaw.kitszel@intel.com, bpf@vger.kernel.org
X-In-Reply-To: <20261118232315.3593731-3-kuba@kernel.org>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list