🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20478

Re: [PATCH net-next 5/8] eth: mlx5e: drop the now-dead HW-GRO and LRO vs XDP handling

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

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

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] mlx5e_set_xdp_feature() in
  drivers/net/ethernet/mellanox/mlx5/core/en_main.c still sets…
- [Low] The commit message calls the removed code 'now-dead' and then
  says 'This does change user visible behavior: attaching XDP with HW-…
- [Low] mlx5e_xdp_set() still ends with '/* Need to fix some features.

--

eth: mlx5e: drop the now-dead HW-GRO and LRO vs XDP handling

The core now clears HW-GRO and LRO before ndo_bpf and keeps them off
while an XDP program is attached. This patch removes the xdp_prog clause
from mlx5e_fix_features() and the packet_merge refusal in
mlx5e_xdp_allowed(), and calls mlx5e_params_validate_xdp() directly from
mlx5e_xdp_set().

> This does change user visible behavior: attaching XDP with HW-GRO or LRO
> on used to fail with -EINVAL and now succeeds with them turned off.

[Severity: Low]
Is this attribution accurate? The subject calls the removed code
"now-dead". At the parent commit, the -EINVAL in mlx5e_xdp_allowed()
already looks unreachable:

dev_xdp_attach()
    dev->xdp_pending = 1;
    dev_xdp_clear_rx_agg()
        netdev_update_features()
            __netdev_update_features()
                strips NETIF_F_XDP_DISABLES (xdp_pending is counted
                by dev_xdp_prog_count())
                mlx5e_set_features()
                    set_feature_lro() / set_feature_hw_gro()
                        packet_merge.type = MLX5E_PACKET_MERGE_NONE
    ndo_bpf -> mlx5e_xdp_set()

netif_xdp_propagate() follows the same sequence. When HW-GRO is pinned,
the core returns -EBUSY before ndo_bpf is called.

So the change from -EINVAL to success seems to come from the earlier core
commits ("net: state the "XDP excludes HW-GRO" rule in the core" and
"net: state the "XDP excludes LRO" rule in the core"), not from this
patch.

Could the message say that, and also mention the dependency in the other
direction? This patch removes both mlx5e guards: the xdp_prog clause in
mlx5e_fix_features() and the packet_merge refusal. If it is applied or
backported without the core commits, XDP could run on LRO/HW-GRO
coalesced frames.

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index d8563f8638447..e462dfc725ae4 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c

[ ... ]

> @@ -5177,20 +5166,6 @@ static void mlx5e_tx_timeout(struct net_device *dev, unsigned int txqueue)
>  	queue_work(priv->wq, &priv->tx_timeout_work);
>  }
>  
> -static int mlx5e_xdp_allowed(struct net_device *netdev, struct mlx5_core_dev *mdev,
> -			     struct mlx5e_params *params)
> -{
> -	if (params->packet_merge.type != MLX5E_PACKET_MERGE_NONE) {
> -		netdev_warn(netdev, "can't set XDP while HW-GRO/LRO is on, disable them first\n");
> -		return -EINVAL;
> -	}

[Severity: Medium]
With this refusal gone, does mlx5e_set_xdp_feature() also need an
update? It still advertises native XDP only when packet merge is off:

drivers/net/ethernet/mellanox/mlx5/core/en_main.c:mlx5e_set_xdp_feature() {
    ...
	if (netdev->netdev_ops->ndo_bpf &&
	    params->packet_merge.type == MLX5E_PACKET_MERGE_NONE)
		val = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
		      NETDEV_XDP_ACT_XSK_ZEROCOPY |
		      NETDEV_XDP_ACT_RX_SG;
    ...
}

With LRO or HW-GRO on and no program attached, the netdev netlink
xdp-features attribute reports no BASIC, REDIRECT or RX_SG. A native
attach in that state now succeeds anyway:
dev_xdp_attach()->dev_xdp_clear_rx_agg() turns the offloads off before
ndo_bpf, and xdp_features is never checked.

Userspace would then see no XDP support on a device where attaching an
XDP program works. The same goes for bond_xdp_set_features(), which
intersects the slave xdp_features. After detach, the core turns
LRO/HW-GRO back on and the advertised mask is empty again.

The empty mask only looks correct when tcp-data-split pins HW-GRO, since
the core returns -EBUSY there. Would it match the new behavior better to
key this gate off the HDS state instead of packet_merge in general?

> -
> -	if (!mlx5e_params_validate_xdp(netdev, mdev, params))
> -		return -EINVAL;
> -
> -	return 0;
> -}
> -
>  static void mlx5e_rq_replace_xdp_prog(struct mlx5e_rq *rq, struct bpf_prog *prog)
>  {
>  	struct bpf_prog *old_prog;
> @@ -5215,10 +5190,9 @@ static int mlx5e_xdp_set(struct net_device *netdev, struct bpf_prog *prog)
>  	new_params = priv->channels.params;
>  	new_params.xdp_prog = prog;
>  
> -	if (prog) {
> -		err = mlx5e_xdp_allowed(netdev, priv->mdev, &new_params);
> -		if (err)
> -			goto unlock;
> +	if (prog && !mlx5e_params_validate_xdp(netdev, priv->mdev, &new_params)) {
> +		err = -EINVAL;
> +		goto unlock;
>  	}
>  
>  	/* no need for full reset when exchanging programs */

[Severity: Low]
This isn't a bug, but should the tail of mlx5e_xdp_set() be removed as
well?

unlock:
	mutex_unlock(&priv->state_lock);

	/* Need to fix some features. */
	if (!err)
		netdev_update_features(netdev);

Commit f6279f113ad5 ("net/mlx5e: Update netdev features after changing
XDP state") added this call so mlx5e_fix_features() could apply or
release the params->xdp_prog LRO/HW-GRO clause. This patch removes that
clause.

On attach, the core has already called netdev_update_features() via
dev_xdp_clear_rx_agg().

On detach, this call runs while dev_xdp_prog_count() is still non-zero,
because dev_xdp_set_prog() only runs after dev_xdp_install() returns. So
it cannot restore LRO/HW-GRO. That happens in the core's own
netdev_update_features() call in dev_xdp_attach(), after the program is
cleared.

The comment also suggests a dependency that no longer exists.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118232315.3593731-1-kuba%40kernel.org
Technical Details
Message-ID: <179536698791.3135.11919808360238549850@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368763-linux-kernel-netdev=dewy.ru
References: <20261118232315.3593731-6-kuba@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368763-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 5/8] eth: mlx5e: drop the now-dead HW-GRO and LRO
 vs XDP handling
Date: Sun, 22 Nov 2026 17:03:07 +0000
Organization: Usenet Network
Message-ID: <179536698791.3135.11919808360238549850@kernel.org>
References: <20261118232315.3593731-6-kuba@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3682225"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:JnJ39myFLPABmqWgci5K8wxPnss= sha256:6IiOvEwO1S3Y1d7nrGTmgANOzi20VQdbS9IyBc0/IFU=
	sha1:RSuUU8i1WWS8w8yCuVAtQhwfsT8= sha256:HP/moMwRBOrqKiqVmqHUuKFXlV6DHXqjAyM/wIihv2Q=
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 0CEA4125D83; Sun, 22 Nov 2026 20:03:36 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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 nKwDGEonoixh;
	Sun, 22 Nov 2026 20:03:32 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368763-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 0ECE0125D81; Sun, 22 Nov 2026 20:03:24 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 7F42C30F5E; Sun, 22 Nov 2026 17:03:11 +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=1795366991;
	b=neB0E27c+kl5+LHkmbJ3pwFpYoYpGjC1Nt8cwtGcBaFCGewWXt9RwjSZy1Q21QVJU3OX
	 MMbkkzKSCdRzX0iuj1dzZ//9qExt2Tp2y1braS94ZOSvfPLi0xXKFp26sdrRElC+5kEk5
	 eYWtfYxbVp1nxbxa719CFEUsEoMMhJZ5S7ZPGhqeLSSOeB+H18N+bs8UZiCJz/ofKXELg
	 r7kNsR/rTbTJPVLAAz8urI7CGmVngQhAdjrD1mGsvuwLeTQPKKbPqwBmRbWpBrrhr9+2L
	 SUgicUxwi+xyQD86k2Cjl9t8xZrD/ZscEJ8NtXwG93pPh1sh7jWv+N3ozUPoLcrEh9w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795366991;
	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=7mlhzgdEHG82CBdkOiOI4F4bFR6o3gvjX8G2/QVEMLU=;
	b=0HhE8SRg726hDAwga6BAhH7U9ls2yUYUvlgYaRjjFA3J5ugZ59d5T/6Xm+Hs4rII5+cX
	 r2rAWL0v6CisF3QYx1B+RyGWmY9SkDGHE6Pe7p9XtKDlBMM01ClrzPpE1euzMy4p7gR2b
	 PqcztJlpXCt55+yIsOmWq7Pw9opUdPoZQxLH9QK+Qk1/TPB1aX2G1enRxQhZliKjWI8fS
	 65DGMXIc93/q4PKhFgJN25dUo9amBNd9QwYUZ6js+DOjd+VEut4xb7n1enK3831zifcmW
	 1zyLJgmztSl6tf8mkusrv1gXdTyymh1IjPNYDe35RJrbvZYFHtN80kyjMlPPZhLBcLQ==
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=mgIN7M0Y;
	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 404E7606A33C;
	Sun, 22 Nov 2026 17:03:11 +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=mgIN7M0Y
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=1795366989;
	b=Qy5hJDONuaCJv23DdPvPVjY7AeUO7GI6tK+NCTAn+qJalPSkkS5/CoVJmyjO+t0ZDX7d
	 E1MRJPGZW5SN+o13eBQZVunZkdzK4svsuw191ZXDG2QEy2ZWN9zs0L+f0fOm/oEpV0vB0
	 2tpt9U2KVou2KMPBxUtZ04qH5Ypex/TylqeBSBN8HPfHhylJXI907Onps4SOQ0yh4xagm
	 vDhzcToPGMWS/ohmnXScOC+VyktKi1XhAp7/f/XCjpHQ+oh68KwAD0xPruqdU/CZX8+uw
	 R1jXLOb1vr6uKGUgkljoHSITvRlwC8aop7t7W66TylQYTrM9DnFJWGNTKpX3nwCv1VA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795366989;
	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=7mlhzgdEHG82CBdkOiOI4F4bFR6o3gvjX8G2/QVEMLU=;
	b=N3myZzoDj97XH22ImiKTb1Nc9fGNWcsatCJjtaWzhRsIVgiLHNntPCTT8Hs+xrReMSGO
	 zAO0L5WzMDrhr7SxhBs3Q0W73JK5lv5DVQgZ2VAaj8TvbwggqS0WR3UImv6ueElQwCnQO
	 79FP8tSQ+uA5h0U1I0sot+Uvc5VVMiIrPHDZYiwAWB06a6Ciaa+f0xh+pwbtuk60q4kRL
	 7XigR6m26QYuBaC8qL4PHelnoIHVddG4v78Gg+t8tQEZYj+rC44H+LndimvE9//AAAVRY
	 PfQWwAKC42Ciu5DgvNUkRWEbeYLQrCpUkMJCQ6yD6bF8oYdh2izcsJriGQuZSqprkEQ==
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=mgIN7M0Y;
	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 D24E0606A331;
	Sun, 22 Nov 2026 17:03:09 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 516761F000CF;
	Sun, 22 Nov 2026 17:03:08 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795366989;
	bh=7mlhzgdEHG82CBdkOiOI4F4bFR6o3gvjX8G2/QVEMLU=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=mgIN7M0YSkIozPR7XXuFMY33ouj+9hnQjzonHtsFdOoQpRYrIXEX3pH3a9jM5WS7D
	 2K3+xT2M8ZwtykThoDEFvRKz5QIasAjE2yNBnzT0Z8HsATo2ZPTN+d7HuSrz8YeIii
	 eBgbhbVTAcRGbNrYy/JflRA37FyVw+3+BQXli43L8fCQVVkARw0/niS9G9tJXIcK9v
	 Ev7Orw8oqKHe1+/wrPerKooadAaY1QRNwaA2AQf46EedaqyRsQv1dTLxeb3QMs210j
	 Fbd1BxhKfZBZah0PS3xExBU6oScl3TlRItLCHCy/qTiZkO5QWvCVmjZvsjAed4HMJw
	 9AjeEMz0darzw==
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-6-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