BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jakub Kicinski" <kuba@kernel.org>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next v2 6/9] eth: mlx5e: drop the now-dead HW-GRO and LRO vs XDP handling
Date: Mon, 23 Nov 2026 01:01:34 +0000	[thread overview]
Message-ID: <sashiko-outbox-228501@kernel.org> (raw)
In-Reply-To: <20261122010112.1471146-7-kuba@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] net/mlx5e: XSK pool setup fails with HW-GRO/LRO in
  mlx5e_set_xdp_feature()
--

commit bbcc3184f046fe17399985b6692abbf4e736da56
Author: Jakub Kicinski <kuba@kernel.org>

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

This commit removes the driver-side mutual exclusion checks between XDP and
HW-GRO/LRO, relying on the networking core to clear HW-GRO and LRO before
attaching an XDP program, and keys XDP feature advertising off
tcp-data-split instead of packet merge state.

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index 06a8a4be4be7c..08568137d044d 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -4487,12 +4487,14 @@ static int mlx5e_handle_feature(struct net_device *netdev,
>  
>  void mlx5e_set_xdp_feature(struct mlx5e_priv *priv)
>  {
> +	struct netdev_config *cfg = priv->netdev->cfg_pending;
>  	struct mlx5e_params *params = &priv->channels.params;
>  	struct net_device *netdev = priv->netdev;
>  	xdp_features_t val = 0;
>  
> +	/* XDP can't run with HW-GRO, and tcp-data-split keeps HW-GRO on */
>  	if (netdev->netdev_ops->ndo_bpf &&
> -	    params->packet_merge.type == MLX5E_PACKET_MERGE_NONE)
> +	    cfg->hds_config != ETHTOOL_TCP_DATA_SPLIT_ENABLED)
>  		val = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
>  		      NETDEV_XDP_ACT_XSK_ZEROCOPY |
>  		      NETDEV_XDP_ACT_RX_SG;

[Severity: Medium]
Does advertising NETDEV_XDP_ACT_XSK_ZEROCOPY while HW-GRO or LRO is active
break AF_XDP pool setup when a socket is bound before an XDP program is
attached?

Unlike XDP_SETUP_PROG, xp_assign_dev() checks NETDEV_XDP_ACT_XSK and calls
ndo_bpf(XDP_SETUP_XSK_POOL) without clearing HW-GRO or LRO in the core.
When no XDP program is attached yet and HW-GRO (with tcp-data-split auto)
or LRO is enabled, mlx5e_xsk_enable_locked() runs with
params->packet_merge.type != MLX5E_PACKET_MERGE_NONE:

drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c:mlx5e_xsk_enable_locked() {
	...
	mlx5e_build_xsk_param(pool, &xsk);
	mlx5e_build_xsk_channel_param(priv->mdev, params, &xsk, cparam);

	if (!params->xdp_prog) {
		/* XSK objects will be created when an XDP program is set,
		 * and the channels are reopened.
		 */
		goto validate_closed;
	}
	...
validate_closed:
	if (!mlx5e_validate_xsk_param(params, &cparam->rq_opt, priv->mdev)) {
		err = -EINVAL;
		goto err_remove_pool;
	}
}

Because mlx5e_rx_is_linear_skb() returns false whenever
params->packet_merge.type != MLX5E_PACKET_MERGE_NONE,
mlx5e_validate_xsk_param() logs "Striding RQ linear mode for XSK can't be
activated with current params" and fails with -EINVAL instead of
xp_assign_dev() rejecting zero-copy cleanly with -EOPNOTSUPP (or disabling
HW-GRO/LRO via netdev_update_features()).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261122010112.1471146-1-kuba@kernel.org?part=6

  reply	other threads:[~2026-11-23  1:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22  1:01 [PATCH net-next v2 0/9] net: make core auto-disable HW-GRO and LRO when XDP gets attached Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 1/9] net: stop making HW-GRO depend on SW GRO Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 2/9] selftests: drv-net: gro_stats: use the shared set_ethtool_feat() Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 3/9] selftests: drv-net: drop the generic XDP hack from the HW GRO setup Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 4/9] net: state the "XDP excludes HW-GRO" rule in the core Jakub Kicinski
2026-11-23  1:33   ` netdev-bot+sashiko
2026-11-22  1:01 ` [PATCH net-next v2 5/9] net: state the "XDP excludes LRO" " Jakub Kicinski
2026-11-23  1:33   ` netdev-bot+sashiko
2026-11-22  1:01 ` [PATCH net-next v2 6/9] eth: mlx5e: drop the now-dead HW-GRO and LRO vs XDP handling Jakub Kicinski
2026-11-23  1:01   ` sashiko-bot [this message]
2026-11-23  1:33   ` netdev-bot+sashiko
2026-11-22  1:01 ` [PATCH net-next v2 7/9] eth: bnxt_en: don't clear HW-GRO and LRO for XDP in ndo_fix_features Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 8/9] eth: qede: drop the now-dead HW-GRO vs XDP handling Jakub Kicinski
2026-11-22  1:01 ` [PATCH net-next v2 9/9] eth: gve: drop the now-dead HW-GRO vs XDP interlock Jakub Kicinski
2026-11-23  1:33   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-228501@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox