From: netdev-bot+sashiko@kernel.org
To: kuba@kernel.org
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
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 [thread overview]
Message-ID: <179536698791.3135.11919808360238549850@kernel.org> (raw)
In-Reply-To: <20261118232315.3593731-6-kuba@kernel.org>
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
next prev parent reply other threads:[~2026-11-22 17:03 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 23:23 [PATCH net-next 0/8] net: adjust HW GRO and LRO feature handling Jakub Kicinski
2026-11-18 23:23 ` [PATCH net-next 1/8] net: stop making HW-GRO depend on SW GRO Jakub Kicinski
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 2/8] selftests: drv-net: drop the generic XDP hack from the HW GRO setup Jakub Kicinski
2026-11-19 21:40 ` Willem de Bruijn
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 3/8] net: state the "XDP excludes HW-GRO" rule in the core Jakub Kicinski
2026-11-19 22:59 ` Willem de Bruijn
2026-11-20 22:13 ` Jakub Kicinski
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 4/8] net: state the "XDP excludes LRO" " Jakub Kicinski
2026-11-19 23:02 ` Willem de Bruijn
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 5/8] eth: mlx5e: drop the now-dead HW-GRO and LRO vs XDP handling Jakub Kicinski
2026-11-19 15:42 ` Dragos Tatulea
2026-11-22 17:03 ` netdev-bot+sashiko [this message]
2026-11-18 23:23 ` [PATCH net-next 6/8] eth: bnxt_en: don't clear HW-GRO and LRO for XDP in ndo_fix_features Jakub Kicinski
2026-11-18 23:23 ` [PATCH net-next 7/8] eth: qede: drop the now-dead HW-GRO vs XDP handling Jakub Kicinski
2026-11-22 17:03 ` netdev-bot+sashiko
2026-11-18 23:23 ` [PATCH net-next 8/8] eth: gve: drop the now-dead HW-GRO vs XDP interlock Jakub Kicinski
2026-11-18 23:44 ` Ankit Garg
2026-11-19 22:14 ` Harshitha Ramamurthy
2026-11-22 17:03 ` 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=179536698791.3135.11919808360238549850@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=hramamurthy@google.com \
--cc=joshwash@google.com \
--cc=kuba@kernel.org \
--cc=manishc@marvell.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=saeedm@nvidia.com \
--cc=sdf@fomichev.me \
--cc=tariqt@nvidia.com \
--cc=willemb@google.com \
/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