Article View: linux.kernel.netdev
Article #23753Re: [PATCH net 01/10] net/mlx5e: Initialize IPsec XArrays with XA_FLAGS_LOCK_BH
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 22:32
Date: Fri, 27 Nov 2026 22:32
88 lines
11507 bytes
11507 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message overstates what the change to
`ipsec_obj_id_map` fixes.
--
net/mlx5e: Initialize IPsec XArrays with XA_FLAGS_LOCK_BH
This commit adds XA_FLAGS_LOCK_BH when ipsec->sadb and
ipsec->ipsec_obj_id_map are initialized, because every mutation of
these arrays uses the _bh xarray accessors. The commit message says the
mismatch leaves bottom halves disabled while __xas_nomem() allocates a
node. It carries Fixes tags for both 403b383a3ce3 and 91bafc638ed4.
> Node insertion drops+reacquires the lock with the lock variants
> corresponding to the configured type. Using the wrong type therefore
> leaves bottom halves disabled during the allocation.
[ ... ]
> Fixes: 403b383a3ce3 ("net/mlx5e: Store all XFRM SAs in Xarray")
> Fixes: 91bafc638ed4 ("net/mlx5e: Handle IPsec offload for RX datapath in switchdev mode")
[ ... ]
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
> index 5c69e89b13a72..502d89a18f9ec 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
> @@ -2804,7 +2804,8 @@ int mlx5e_accel_ipsec_fs_init(struct mlx5e_ipsec *ipsec,
> mutex_init(&ipsec->tx_esw->ft.mutex);
> mutex_init(&ipsec->rx_esw->ft.mutex);
> ipsec->tx_esw->ns = ns_esw;
> - xa_init_flags(&ipsec->ipsec_obj_id_map, XA_FLAGS_ALLOC1);
> + xa_init_flags(&ipsec->ipsec_obj_id_map,
> + XA_FLAGS_ALLOC1 | XA_FLAGS_LOCK_BH);
[Severity: Low]
Is the Fixes: 91bafc638ed4 tag accurate for this hunk?
The description fits sadb. In mlx5e_xfrm_add_state(), xa_insert_bh() on
sadb is called with GFP_KERNEL, so __xas_nomem() drops and retakes the
lock using the configured lock type.
For ipsec_obj_id_map, the only call that allocates passes gfp == 0:
drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c:mlx5_esw_ipsec_rx_setup_modify_header() {
...
err = xa_alloc_bh(&ipsec->ipsec_obj_id_map, &mapped_id,
xa_mk_value(sa_entry->ipsec_obj_id),
XA_LIMIT(1, ESW_IPSEC_RX_MAPPED_ID_MASK), 0);
...
}
With gfp == 0, gfpflags_allow_blocking() returns false. __xas_nomem()
then allocates with the lock still held and never calls
xas_unlock_type() or xas_lock_type():
lib/xarray.c:__xas_nomem() {
...
if (gfpflags_allow_blocking(gfp)) {
xas_unlock_type(xas, lock_type);
xas->xa_alloc = kmem_cache_alloc_lru(radix_tree_node_cachep, xas->xa_lru, gfp);
xas_lock_type(xas, lock_type);
} else {
xas->xa_alloc = kmem_cache_alloc_lru(radix_tree_node_cachep, xas->xa_lru, gfp);
}
...
}
The other users of this array are xa_erase_bh() and xa_load(), and
neither of them allocates. The gfp was already 0 when 91bafc638ed4
added this code.
That would make this hunk a harmless consistency change rather than a
fix. Could the commit message say that the ipsec_obj_id_map change is
only for consistency? Alternatively, could the second Fixes tag be
dropped, so backporters don't assume 91bafc638ed4 had a live
sleep-in-atomic bug?
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126215614.792598-1-tariqt%40nvidia.com
Technical Details
Message-ID:
<179581872338.3135.9809199278681466764@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372964-linux-kernel-netdev=dewy.ruReferences:
<20261126215614.792598-2-tariqt@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372964-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 01/10] net/mlx5e: Initialize IPsec XArrays with XA_FLAGS_LOCK_BH Date: Fri, 27 Nov 2026 22:32:03 +0000 Organization: Usenet Network Message-ID: <179581872338.3135.9809199278681466764@kernel.org> References: <20261126215614.792598-2-tariqt@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="834113"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Loa0vk8Dp9wDoIBh3dA9QWglXmw= sha256:d/vGmSYkN9ptghZFGQet3Lc7ri6YXmK+8R9H/nkuNnc= sha1:YzOX3++Ho72iNnX7+n4j8Y1gsYA= sha256:YzbCNTHjUNPztKYaF/EkjmdAZJ5e1l3pndbxdPGfMqA= 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 EA426125F6B; Sat, 28 Nov 2026 01:32:27 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 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] 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 VJAxXREU5z8f; Sat, 28 Nov 2026 01:32:24 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372964-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 DABD9125F69; Sat, 28 Nov 2026 01:32:13 +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 263C12DDB8; Fri, 27 Nov 2026 22:32:08 +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=1795818727; b=hY2CmdnOwxK8bzZp536oOHdH9PYS5q+MPkw5ezE6dt+jI3MADX+zOc9kS+nErynXBCmv Qre6j0wdRZr3uxvfEjZXrENGuJjrKQbmhgHCO5XKmhH1csEkBvsciTuFIhXDQRHQSsF2P Mdp+r6g0Nc5VlNc7nUAVizxmX1HEyYiztnP4Te/7s+y3y54HlKevL8KwS9W0pM8O3mPsR hH2sEWBrZD0Gtu4fFsC3D4+IJ5bRoOSKAHhqvvFU0QjUi8hwIN0F9v/S//1wJrV5Mijos nRFm0T/A5mo5SbIoDB5SFFpWRXC2b6E9BD8ckNOdQP9zB/T9cJG9xtgkQO6jol8AweA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795818727; 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=FiqdaV7zUp63ODbs67Dxl+vNZIGjUZ6TW4mNWPQdGMI=; b=ZuJs89FsMJ0dtyfhYn7YZd3YCkZ80IYBTP3WGgGlITdzYp5/EI20bIU8Fl35Thq3aPpE 8CYsQcnkCtpGpb0HpQGV8RRs24L5fNCBWpj8jN+PKhQ4iWofCSCN9Z/+oi4ctKT81kwV0 Dr4uCYRSrvSqyzQQDFIjvWrcnEjeZocR9HBVk4wDLi31//VWw+7F7Fo4IIg9+dXEV+56I GIpKHr8SSfxjOwbf+umllx16hCgiPR4HegDlnyKhJs5Bdu3uEiiA1ewKSlyRMDQi8id+9 Y8BQsQYdA8emNcF2EdIifLdH9+npu/0Ck1ShQ6CBIu2JW7SO2pB1IGlOU2Y0rj2U7sw== 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=P5doRaw4; 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 E11E0606A32C; Fri, 27 Nov 2026 22:32:06 +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=P5doRaw4 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=1795818726; b=Cv+yjt54Z0kohXYvIVZIgDyCPrSyxuTy8VSHsftNOIIUWrDapS+p3rDvtOSnrpfcQrxw sfoI4PiLIYBL6mdbnHgnfIO05+06zXiZlqqAShx2Lo33msb7QJXDILuTVUiRof/RFwn+6 /4/d7kvtDmwI9auG824UM6lNsKelxFdrcFUh7qq+ix4Jo9MsOBHiMy8STuorWYG8QOHRK mcc7o5wahtl3tPu965Wvzv+3S+/78X3kPOD0Zr+JtfBiDlyPx83SV9TwrnqqJq9k2AJfU ZO3HNRKafZJhVs+lKFIHywvPbxnOX6/BQlHw8heP7X1VEQiYDTc1p8YEvBaeS5dGMyQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795818726; 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=FiqdaV7zUp63ODbs67Dxl+vNZIGjUZ6TW4mNWPQdGMI=; b=lBhA2q7WAmATzy/OPP3izabebNUvcBaGVYU3coPDScmHV7w68lLLuCnUQSO9iGEyeFAE Qk7Cu2P2PnNQKZRs4KK8lVHhFPZ8aNpLh4w/mck1eMQHyhAC/RB62WUwg3sRTtikLPS8r YxsbAxiZbtByvdA7o5H1bEBZ/QEpISfLbmVN10bwfMJ3fac1X6fVcYVKyfM67tw1u7ZFX TZEeZT3nbTIDbXc7HHQ2EP+566j0zxrz6h/pTAw29ZrIDuBDdfTAVqQNtVxk3ECkVKEUs c3k0ScGyCk5H1HpInWkeYFoINRQ9EeeI4OozzG9qk45D+S2dvRChdKeKPgFsxVmEq9g== 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=P5doRaw4; 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 0A05A606A31C; Fri, 27 Nov 2026 22:32:05 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D78501F00893; Fri, 27 Nov 2026 22:32:03 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795818725; bh=FiqdaV7zUp63ODbs67Dxl+vNZIGjUZ6TW4mNWPQdGMI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=P5doRaw4sMq0LjAqMnvj3ECiMeanlsuNtvpJsPOwg5K0LiM9Rknjfy29ld2ghvUs6 XEANU7ioqFpgl2WnJs1XAjKuOeWVjrPYIwxbYD2+L3Ad+sKYpUJUpC58Qb1CiO+2t2 zgAgnvyiKn+h/4x7Wa07ghmrHaKYjvBc60fCowU4bN1Mjb0mnMoQbMxPcbqqhIt0qq PpTAZJqrCDtSz75XKom0hL+T91U0A+RwaGbXbAReZ4FbPggygm5NILGxtGX4mCdBAM 9XIfcOo1rDZTZMD/G+49OGVO67IrST4fD8QAqcMwswwdtQ+flIU+sjiqrlchltBadp uFt7I9nqcPyvQ== X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, willemb@google.com, parri.andrea@gmail.com, borisp@nvidia.com, cratiu@nvidia.com, eedmunds@nvidia.com, gal@nvidia.com, jmassar@nvidia.com, jianbol@nvidia.com, kuniyu@google.com, leon@kernel.org, linux-rdma@vger.kernel.org, mbloch@nvidia.com, phaddad@nvidia.com, raeds@nvidia.com, saeedm@nvidia.com, horms@kernel.org, sridhar.samudrala@intel.com, steffen.klassert@secunet.com X-In-Reply-To: <20261126215614.792598-2-tariqt@nvidia.com> X-sashiko-severity: Low 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