Article View: linux.kernel.netdev
Article #20317[PATCH net-next v2 3/9] selftests: drv-net: drop the generic XDP hack from the HW GRO setup
From: Jakub Kicinski
Date: Sun, 22 Nov 2026 01:01
Date: Sun, 22 Nov 2026 01:01
87 lines
12085 bytes
12085 bytes
The HW GRO tests want SW GRO out of the way so that what they observe
can only have come from the device. On drivers which keyed HW GRO off
NETIF_F_GRO that was not expressible with ethtool alone, so the setup
fell back to attaching a generic XDP program, which suppresses SW GRO
as a side effect.
Those drivers no longer tie the two features together, so ask for the
feature combination directly.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
v2:
- drop check=False in gro_stats.py too, now that it uses the shared
helper (Willem)
v1: https://lore.kernel.org/20261118232315.3593731-3-kuba@kernel.org
---
.../testing/selftests/drivers/net/gro_lib.py | 21 +------------------
.../selftests/drivers/net/hw/gro_stats.py | 21 +------------------
2 files changed, 2 insertions(+), 40 deletions(-)
diff --git a/tools/testing/selftests/drivers/net/gro_lib.py b/tools/testing/selftests/drivers/net/gro_lib.py
index 875a715b2ae1..6eff19db3541 100644
--- a/tools/testing/selftests/drivers/net/gro_lib.py
+++ b/tools/testing/selftests/drivers/net/gro_lib.py
@@ -263,26 +263,7 @@ def _run_gro_bin(cfg, test_name, protocol=None, num_flows=None,
set_ethtool_feat(cfg.ifname, cfg.feat,
{"generic-receive-offload": False,
"rx-gro-hw": True,
- "large-receive-offload": False},
- check=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"]:
- ksft_pr("Driver clears HW GRO and SW GRO is cleared, using generic XDP workaround")
- prog = cfg.net_lib_dir / "xdp_dummy.bpf.o"
- ip(f"link set dev {cfg.ifname} xdpgeneric obj {prog} sec xdp")
- defer(ip, f"link set dev {cfg.ifname} xdpgeneric off")
-
- # Attaching XDP may change features, fetch the latest state
- feat = ethtool(f"-k {cfg.ifname}", json=True)[0]
-
- set_ethtool_feat(cfg.ifname, feat,
- {"generic-receive-offload": True,
- "rx-gro-hw": True,
- "large-receive-offload": False})
+ "large-receive-offload": False})
elif mode == "lro":
# netdevsim advertises LRO for feature inheritance testing with
# bonding/team tests but it doesn't actually perform the offload
diff --git a/tools/testing/selftests/drivers/net/hw/gro_stats.py b/tools/testing/selftests/drivers/net/hw/gro_stats.py
index a413e6fed210..2cccab12f68c 100755
--- a/tools/testing/selftests/drivers/net/hw/gro_stats.py
+++ b/tools/testing/selftests/drivers/net/hw/gro_stats.py
@@ -145,26 +145,7 @@ def _run_gro_test(cfg, test_name, num_flows=None, ignore_fail=False,
set_ethtool_feat(cfg.ifname, feat,
{"generic-receive-offload": False,
"rx-gro-hw": True,
- "large-receive-offload": False},
- check=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"]:
- ksft_pr("Driver clears HW GRO when SW GRO is cleared, using generic XDP workaround")
- prog = cfg.net_lib_dir / "xdp_dummy.bpf.o"
- ip(f"link set dev {cfg.ifname} xdpgeneric obj {prog} sec xdp")
- defer(ip, f"link set dev {cfg.ifname} xdpgeneric off")
-
- # Attaching XDP may change features, fetch the latest state
- feat = ethtool(f"-k {cfg.ifname}", json=True)[0]
-
- set_ethtool_feat(cfg.ifname, feat,
- {"generic-receive-offload": True,
- "rx-gro-hw": True,
- "large-receive-offload": False})
+ "large-receive-offload": False})
def _check_gro_stats(cfg, test_queue, stats_before,
--
2.56.1
Technical Details
Message-ID:
<20261122010112.1471146-4-kuba@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-368556-linux-kernel-netdev=dewy.ruReferences:
<20261122010112.1471146-1-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-368556-linux-kernel-netdev=dewy.ru From: kuba@kernel.org (Jakub Kicinski) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v2 3/9] selftests: drv-net: drop the generic XDP hack from the HW GRO setup Date: Sat, 21 Nov 2026 17:01:06 -0800 Organization: Usenet Network Message-ID: <20261122010112.1471146-4-kuba@kernel.org> References: <20261122010112.1471146-1-kuba@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3535807"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:m6aFCWGlu7b6r1JV/VFG4gJPqnE= sha256:9F/FrYfLfrU8G7s0z9qS+Z04SoZSBbk0b8Sml6GkhNk= sha1:PhS9X+2pSxPmDbnoiUBBnNtfuKk= sha256:W1wHTxFhdh/1zr5LgXiCv4yeofKh2IxZuo9PtOSQmN8= 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 BC0CF115C5C; Sun, 22 Nov 2026 04:01:37 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 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] 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 YozCt9fvrVja; Sun, 22 Nov 2026 04:01:34 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-368556-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 265B3115C55; Sun, 22 Nov 2026 04:01:25 +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 AF286606BEF; Sun, 22 Nov 2026 01:01:24 +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=1795309281; b=vq+aEo6EPi7VJZEM/PBfVpFx8G4GCly4v1i2okGPyKxE8vHJ1ctJ3GyAq8OtP64m0LGq d+53a1nSdDGfeoTa+USbHMsp0JmwEQzVBk1b5WWiviPj4Ioxz698QzDINkyLTV/GwMgDm tfIpbeLJUHYJfRhq4U6I4dpLN1DMnBzS+A/ZqzEL3Pofher18IyhoPjvj2cW0kL2Wdngw jXq5g0k7Z2kpIeOJiamua+HvncjMD0H8kFIgc95AVnM6ji8t58d/Uq+q5zBtiObUD24Ik XCrWIEFDTlzcD4F+9cXXLR1/omhIGBROpkf8iJ42EIevPW2Q9BpJoJslUD9ebsRexBQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795309281; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding; bh=0KfEfmTKYVapY/XxDnS3jkDJG9L03MCRk+3zIwQKZXo=; b=uzTTvwwcDCPBxXY5A6ZC7nWOyVBBnGsKEAgfb8Rsa5ij41TSEPysR3q2ofM8GM9HyQY8 iwMY207vmKixnwh7bQUleYbZ8MlYDqk9zRHOazuLQzWUqFkJtuCgzunMVMYKyreJWnpct Eq3/7rvBOdkkxUQE+UPPDveqHGaQ2LB+MZZU1qxXaIlY7bYtGln0YKw2lsA6e/LOkhxZh CbZL/07wpG4VOWVUyc8NtwQemHErcBANYcCBxJjAKMexE8cN8gzsSRr5KqRIMS3zqS9vk Gj4Xbx9LMTDXKjNAqW2BYnFgYm1FDXJSfYMcVCwD2lRg4E9j2yYEuOAeDk9DIeyNwfA== 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=cmWY0SP9; 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 28657606A69F; Sun, 22 Nov 2026 01:01:21 +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=cmWY0SP9 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=1795309280; b=YjMuI1myV6h/d+jBxr20DOoK/2LqQ/OHQNPbY5T6R7p77RSXRYF90aUYhliy6+UJFLJF kl5TfOix1Vg+b46hFwfB9Zua+Wx8wm0uUO+tw2UZWWB0JNuNY/iBMtk4bnNCYNep0xX6E uKAaPDSd0EkLCg7lTbl/p+FHUY/d2HbYIARtF6DoI39Tcxti+Xbj+s7VaLwhK0G3XkiBz bw+VTVgfqr818BhkeesMCmknoriBAVVR/UZN4A94RPEAiYRPYueIQrb8SNhspo30MDccb Sq+DgF5Unw5LBtrAM52Vxhhbki7Vv2spZo3/6WS5XvR7t89F6Na3mp0WVaiXu164TEg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795309280; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=0KfEfmTKYVapY/XxDnS3jkDJG9L03MCRk+3zIwQKZXo=; b=VR4RfNVK3TnMFDksc88kwV8et5SzoGtEfzsIIDJAO5V7YMylTxO7XkfQ/b2KXCvC3yuh ndNegwqk8QcCiiKWwvu74tF0Brk7RzCXfsj8MR7eKgoKmJe4yn4AWPGTYop4vDRQHuCoB cmZ6f5CAPS1sBHaR1SubNzO/b2Dg4YLzn74nR9KcXMSn0u5AunP2Tiq68rfr2RJJHLwHT TsRgLIBcywE5+oGr8wAQUZekJVe344/x2kIW2dEhunAblStRp0odQxVHoAdStEec9ALLL IKJD3Cdf4JjqLlyZBy0CTrlZQkYHjoliqWYNJTPzK2/pPcoYQXzskhRea7hxTvn9lpg== 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=cmWY0SP9; 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 4B913606A32A; Sun, 22 Nov 2026 01:01:20 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67CFF1F000CF; Sun, 22 Nov 2026 01:01:19 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795309279; bh=0KfEfmTKYVapY/XxDnS3jkDJG9L03MCRk+3zIwQKZXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cmWY0SP9KiOxy/Bua7M6XpPutN+Uv6pJDy4rFt5j0qMmEF8MfL1D7D5rIDHAbV0Bp gC8VYItDZ6ihV8WTmMqbatcKnMDxDkk1gW3F0Q1nHPAcCaAsL01MZPxFH7NsC8IFQU tdkhsScyf1RP+URtxZ1JWYukplwLxVqUWnrYQ4PrRfuCgeoXSMzT+GgKR5U8SW2mbX f/M9ois8HcTOYFCiHQ5Rqdzn2Qi9qIoC5tl7DtrjMpP+Msq1sa919UudZkyrBLhXO2 OzbZayhe2XIAayoUJICg6rQUxk04ylPGyPLsmF4cqQpub+DjdiAksoh5kLcxS6Yq8+ /f82x4wPns5vg== X-Cc: 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, Jakub Kicinski <kuba@kernel.org> X-Mailer: git-send-email 2.56.1 X-In-Reply-To: <20261122010112.1471146-1-kuba@kernel.org> 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