From: sashiko-bot@kernel.org
To: "Jakub Kicinski" <kuba@kernel.org>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next 4/8] net: state the "XDP excludes LRO" rule in the core
Date: Thu, 19 Nov 2026 23:24:34 +0000 [thread overview]
Message-ID: <sashiko-outbox-224183@kernel.org> (raw)
In-Reply-To: <20261118232315.3593731-5-kuba@kernel.org>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] net/mlx5e: HDS state desync and NULL pointer dereference in
mlx5e_fix_features() [1]
--
commit 8d89a545dc54012efb30f6483506602bf2681942
Author: Jakub Kicinski <kuba@kernel.org>
net: state the "XDP excludes LRO" rule in the core
This commit clears NETIF_F_LRO alongside NETIF_F_GRO_HW in the networking
core when an XDP program is attached, and drops netif_disable_lro() from
generic_xdp_install().
> diff --git a/net/core/dev.c b/net/core/dev.c
> index c0bb5eb9fdea0..2b9c7aac09693 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
[ ... ]
> @@ -11431,9 +11439,9 @@ int __netdev_update_features(struct net_device *dev)
> /* GRO_HW may be added back in via ndo_fix_features e.g. if driver needs
> * it to honor the HDS config, clear it before the fix features call.
> */
> - if ((features & NETIF_F_GRO_HW) && dev_xdp_prog_count(dev)) {
> - netdev_dbg(dev, "Dropping HW-GRO feature since XDP is attached.\n");
> - features &= ~NETIF_F_GRO_HW;
> + if ((features & NETIF_F_XDP_DISABLES) && dev_xdp_prog_count(dev)) {
> + netdev_dbg(dev, "Dropping HW-GRO and LRO features since XDP is attached.\n");
> + features &= ~NETIF_F_XDP_DISABLES;
> }
>
> if (dev->netdev_ops->ndo_fix_features)
[Severity: High]
This problem wasn't introduced by this patch, but can mlx5e_fix_features()
re-enabling NETIF_F_GRO_HW for HDS cause an HDS state desync or a NULL
pointer dereference [1]?
Because mlx5e_fix_features() runs before netdev_fix_features() without
enforcing NETIF_F_RXCSUM, disabling NETIF_F_RXCSUM causes
netdev_fix_features() to drop NETIF_F_GRO_HW. That turns off SHAMPO while
cfg->hds_config stays ETHTOOL_TCP_DATA_SPLIT_ENABLED, blocking subsequent
ring parameter changes.
In addition, mlx5e_fix_features() forces NETIF_F_GRO_HW back on for HDS
even after clearing it earlier for a legacy cyclic RQ:
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:mlx5e_fix_features() {
...
if (!MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_STRIDING_RQ)) {
...
if (features & NETIF_F_GRO_HW) {
netdev_warn(netdev, "Disabling HW-GRO, not supported in legacy RQ\n");
features &= ~NETIF_F_GRO_HW;
}
}
...
if (cfg && cfg->hds_config == ETHTOOL_TCP_DATA_SPLIT_ENABLED &&
!(features & NETIF_F_GRO_HW)) {
netdev_warn(netdev, "Keeping HW-GRO enabled, TCP header-data split depends on it\n");
features |= NETIF_F_GRO_HW;
}
...
}
If rx_striding_rq is disabled while SHAMPO is off and NETIF_F_RXCSUM is
then re-enabled, SHAMPO is enabled on a cyclic RQ. mlx5e_open_rq() sets
MLX5E_RQ_STATE_SHAMPO while mlx5e_alloc_rq() skips mlx5_rq_shampo_alloc(),
and mlx5e_create_rq() dereferences rq->mpwqe.shampo while NULL.
[1] https://sashiko.dev/#/bug/linux-5e98dbaa-290f-464e-8d13-a0e3360d73b7
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118232315.3593731-1-kuba@kernel.org?part=4
next prev parent reply other threads:[~2026-11-19 23:24 UTC|newest]
Thread overview: 16+ 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-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-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-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-19 23:24 ` sashiko-bot [this message]
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-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-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
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-224183@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