๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Jakub Kicinski Wed, 18 Nov 2026 23:23
[PATCH net-next 1/8] net: stop making HW-GRO depend on SW GRO
#18801
Author: Jakub Kicinski
Date: Wed, 18 Nov 2026 23:23
67 lines
10721 bytes
bnxt, qede and bnx2x clear NETIF_F_GRO_HW whenever NETIF_F_GRO is off.
Nothing in the stack needs that. HW-GRO'd skbs arrive already coalesced
with gso_size set, exactly like LRO frames, and LRO never depended on
the software GRO bit. netif_elide_gro() only gates the software path,
and the in-driver consumers of the offload key off the feature bit
itself, not off NETIF_F_GRO.

The coupling gets in the way of exercising the offload on its own:
turning SW GRO off to isolate HW GRO takes HW GRO down with it on these
three drivers, which is why the GRO selftests carry a generic XDP hack.
The core only ever constrained GRO_HW on RXCSUM, RXFCS and LRO, and the
other HW-GRO capable drivers do not couple the two either.

User visible change: "ethtool -K $dev gro off" no longer implies
"rx-gro-hw off" on bnxt, qede and bnx2x.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c       | 3 ---
 drivers/net/ethernet/qlogic/qede/qede_filter.c  | 3 +--
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 6fb0619731ae..5686c4ecb944 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -4934,7 +4934,7 @@ netdev_features_t bnx2x_fix_features(struct net_device *dev,
 	if (!(features & NETIF_F_RXCSUM))
 		features &= ~NETIF_F_LRO;
 
-	if (!(features & NETIF_F_GRO) || !bnx2x_mtu_allows_gro(dev->mtu))
+	if (!bnx2x_mtu_allows_gro(dev->mtu))
 		features &= ~NETIF_F_GRO_HW;
 	if (features & NETIF_F_GRO_HW)
 		features &= ~NETIF_F_LRO;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 6846a27bfef4..27c53db2c9e4 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -14092,9 +14092,6 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
 	if ((bp->flags & BNXT_FLAG_NO_AGG_RINGS) || bp->xdp_prog)
 		features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW);
 
-	if (!(features & NETIF_F_GRO))
-		features &= ~NETIF_F_GRO_HW;
-
 	if (features & NETIF_F_GRO_HW)
 		features &= ~NETIF_F_LRO;
 
diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c
index 5bf32f1034e0..d0e203167e35 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -915,8 +915,7 @@ netdev_features_t qede_fix_features(struct net_device *dev,
 {
 	struct qede_dev *edev = netdev_priv(dev);
 
-	if (edev->xdp_prog || edev->ndev->mtu > PAGE_SIZE ||
-	    !(features & NETIF_F_GRO))
+	if (edev->xdp_prog || edev->ndev->mtu > PAGE_SIZE)
 		features &= ~NETIF_F_GRO_HW;
 
 	return features;
-- 
2.56.1
Re: [PATCH net-next 1/8] net: stop making HW-GRO depend on SW GRO
#20474
Author: netdev-bot+sashiko
Date: Sun, 22 Nov 2026 17:03
100 lines
11519 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] On bnxt, `ethtool -K $dev gro off lro on` used to give
  hardware LRO.

--

net: stop making HW-GRO depend on SW GRO

This patch removes the code in bnxt, qede and bnx2x that cleared
NETIF_F_GRO_HW whenever NETIF_F_GRO was off. The commit message gives
one user visible change: "ethtool -K $dev gro off" no longer implies
"rx-gro-hw off" on these drivers.

[ ... ]

> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 6846a27bfef4c..27c53db2c9e45 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -14092,9 +14092,6 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
>  	if ((bp->flags & BNXT_FLAG_NO_AGG_RINGS) || bp->xdp_prog)
>  		features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW);
>  
> -	if (!(features & NETIF_F_GRO))
> -		features &= ~NETIF_F_GRO_HW;
> -
>  	if (features & NETIF_F_GRO_HW)
>  		features &= ~NETIF_F_LRO;
>  

[Severity: Medium]
Does this change what "ethtool -K $dev gro off lro on" does on bnxt?

Before this patch, turning SW GRO off cleared NETIF_F_GRO_HW first. The
LRO request then got past the GRO_HW-over-LRO check below it, and
bnxt_set_features() picked LRO:

bnxt_set_features() {
    ...
	if (features & NETIF_F_GRO_HW)
		flags |= BNXT_FLAG_GRO;
	else if (features & NETIF_F_LRO)
		flags |= BNXT_FLAG_LRO;
    ...
}

With the check removed, NETIF_F_GRO_HW stays in wanted_features, since
bnxt_init_one() turns it on by default. bnxt_fix_features() then
clears NETIF_F_LRO, and netdev_fix_features() drops it again:

net/core/dev.c:netdev_fix_features() {
    ...
	if ((features & NETIF_F_GRO_HW) && (features & NETIF_F_LRO)) {
		netdev_dbg(dev, "Dropping LRO feature since HW-GRO is requested.\n");
		features &= ~NETIF_F_LRO;
	}
    ...
}

So the device ends up in BNXT_FLAG_GRO mode instead of BNXT_FLAG_LRO,
and ethtool shows large-receive-offload as "off [requested on]". To get
LRO now, the user also has to set "rx-gro-hw off".

This mapping looks intentional. Before commit 1054aee82321 ("bnxt_en:
Use NETIF_F_GRO_HW."), bnxt_set_features() chose hardware GRO based on
NETIF_F_GRO and fell back to LRO when GRO was off. The GRO -> GRO_HW
dependency kept that behaviour working.

bnx2x_fix_features() checks GRO_HW and LRO in the same order:

	if (!bnx2x_mtu_allows_gro(dev->mtu))
		features &= ~NETIF_F_GRO_HW;
	if (features & NETIF_F_GRO_HW)
		features &= ~NETIF_F_LRO;

Fewer users hit this by default, because bnx2x_init_dev() clears
GRO_HW when LRO is on. But if a user has enabled rx-gro-hw and later
runs "gro off lro on", they would also get HW-GRO instead of LRO.

Later patches in the series only remove the bp->xdp_prog clause from
bnxt_fix_features(). The GRO_HW-over-LRO ordering is still there at the
end of the series.

Should the commit message say that LRO requests with gro off are now
refused while rx-gro-hw is on? Or should an explicit LRO request take
precedence here?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118232315.3593731-1-kuba%40kernel.org
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads