From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=40.93.198.12 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796024987; b=mDKcbkO+W6mR4NIG6oOXyJWYi+opCrUWliZ6+/or6T6ERWkYsQXlV0gdAkHnRDjrtoNT hnPN9oYqsryJW0/0aMUntMKtLyeHijkt4r/79MQ8sN3uUaiK43KCRr6Qs1yAMUkVsD9fy 1T0Gi0cUy56Jsa1ex954qGP4brN330+QgpyJZdBeRpCjS10DtozkAXdWGTRGGTf/MTDwh Q8nKBIQ25A09DMWXafvNBX21MXMMpeMtcx1Kgjqd0ePgB3f6vMK1uUyMKB9/CHPbAST6b ZGOO3uz7EktfbML1gebZRpXDlr6C9wuOjcJDqQE6iRcoElQHiDtVM1VE4wqR2xBP5oQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796024987; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To:CC: References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy: X-EOPAttributedMessage:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=djdoMajooFklm3A90Yv3P9gxHY1SwLTeSwkRgG+vC8Y=; b=PijETcstBDmfc5DpffebP70SGqHAqYgBiDiZq9BWMQly6Mb9go69ns2Hqao8krShhJzO Z991iWgAO1vx6ugWl+LWHZMod5cxcpFyRDin/XHZR2XkObvqzjSdSPD+mt9cZlnlJJioh 8nzNW0DhSss6iZWZayJetq4D/R0+3mjzu7l7I3iZkipw+ODxVfD+PJe4dWvzl6cVcCMWG Gsb4vPgfCc3RM/CRBO626WOKHLObKQMS3EZn4Pho5O3IF60YD68ofbknqPq7mfXrwL7/5 GlLYaYM104w6Sz0mFiLC9dVKq6PC5FFmBYOtC7nqLEObbUHCotX91rcfYLzEmHkzPBQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=cVTDC9p1; arc=pass header.oldest-pass=0 smtp.remote-ip=40.93.198.12 Received: from CY7PR03CU001.outbound.protection.outlook.com (mail-westcentralusazon11010012.outbound.protection.outlook.com [40.93.198.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6AAB606A31C; Mon, 30 Nov 2026 07:49:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B6AAB606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=cVTDC9p1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=H8Jhgrz4DrJIzkFyRKL0ySYAyBCmnVmW4kJK+2ZGr/xZGSNUebix5dnFFUsrNNSDqaOcreWzhMqYh6CX/vUTcz9AEKXTCMTQcm6ykCyjC8kFBq1qOzufFlOfmGbJUGfln0D216RVi0d5mbgrZ0LyDE8HzcYPBi0B471/xAOmYWEzVElJ2FcBnnKmaqq62j8Q2QhS5f3Z1pt40/kUfA97s7cs1qmNAe6o62IDemlybukQNryA8KMiZJEI6hGujvQEU4onCK4yrvy3JBDVfabE/aTk5O4r/aDcV41j1R7iohNqDB8Uy5eXv8fJQ0SxoCF5WzFtBseAdnS51OYEDwu1FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=djdoMajooFklm3A90Yv3P9gxHY1SwLTeSwkRgG+vC8Y=; b=aLQ4orP8j4pBRh4WcqgWUZtIl/rK5B16WH5SwxUPnKX/sfA0XzIQsOoaUm+2V3PfjJYYUgbEJ5yM57x+eW70UgTDfQp4cefyvmd38x2XSGOqEzWfs2DyxadNx8c//Wv/hyetzyU5N30c2eh8l9Fl3bECbrSLHNnPpaF3+3NDTPYC77QX0jRLVtRHcGW1hq7F1Q+E9ki0fY+ZHJim8Yvjc7vRuD14p/VtyhexYRLHXIASeLSeQWfHbXYZginzNaxg7pBkfGghcTC2pkWHqRXt6xXI7ZJk9BgJL3YhRBk19ZYio61cVy/7S9FaIryJ2/shl5C3lTBPhiqQfBG5gWC1Hw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=djdoMajooFklm3A90Yv3P9gxHY1SwLTeSwkRgG+vC8Y=; b=cVTDC9p1DgMSC8Ij42vVGgPvo08zyPJxVCtjbhTzCQKU5lLbuXUljxYr+aVx/SGr0j0hRPeiekStuHZQnyabYYJtEs2GJx6XKkB0uI6RTgo5nED77F9FzUAztKEI7RktW/O8N7VEpAw0YOTogID63v6zc6MtWF84LfFnqT823WvIZlP4kgmBKlZeBqmw6hPZPNNshZWG5t5WAo7B/fXWrdo1Kud2/vMGkMrS4KUBNLqIMtT0YExGEBmlU+Wk8BFFteU6sxDkimEx6+EaFEn/qyiUo4KdG6F1M9NuuyZoE0b3gvDuQ/DQFopkVCecLm8S5q225c3mvQRpcwbRzv82PA== Received: from PH8P221CA0061.NAMP221.PROD.OUTLOOK.COM (2603:10b6:510:349::17) by LV3PR12MB9141.namprd12.prod.outlook.com (2603:10b6:408:1a7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Mon, 30 Nov 2026 07:49:41 +0000 Received: from BY1PEPF000264AF.namprd02.prod.outlook.com (2603:10b6:510:349:cafe::21) by PH8P221CA0061.outlook.office365.com (2603:10b6:510:349::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.662.13 via Frontend Transport; Mon, 30 Nov 2026 07:49:41 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BY1PEPF000264AF.mail.protection.outlook.com (10.167.242.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Mon, 30 Nov 2026 07:49:40 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Sun, 29 Nov 2026 23:49:28 -0800 Received: from [10.125.204.195] (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Sun, 29 Nov 2026 23:49:19 -0800 Message-ID: <1b7839bc-e300-4684-a771-5badc8a9c5df@nvidia.com> Date: Mon, 30 Nov 2026 09:49:16 +0200 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] net/mlx5e: TC, use the owner eswitch for encap neigh updates To: , CC: , , , , , , , , , , , , , , , , , , References: <20261125210629.239095-1-tariqt@nvidia.com> <179572951791.3135.13703182913006010599@kernel.org> Content-Language: en-US From: Shay Drori In-Reply-To: <179572951791.3135.13703182913006010599@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PEPF000264AF:EE_|LV3PR12MB9141:EE_ X-MS-Office365-Filtering-Correlation-Id: 44598fe8-d656-4959-3ed2-08df4eb67dab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|23010399003|1800799024|82310400026|7416014|376014|10067099003|56012099006|261028144727099003|261026121527099003|261026140227099003|261021123027099003|261022105027099003|261022075727099003|261009223027099003|18002099003|22082099003|11063799006|4143699003; X-Microsoft-Antispam-Message-Info: t36DT2k1wOIjFqe/cEiobXB4W46BTrz7jKZ/r9zTsrSo13WFKJ7yaHQ2bo0DI5elh3VtFndgTZ0MS+AraEOIIR4LG6filMiuv5HHE+8VP/rL0DAdvVb3U3Pbt1cHoV5FwAOp+uVYlxTSyWanLd4mfPXYEd4ujfdQ/bcnqhSk3Tzv6ExT2RIqBrawlrCLR6717x5ACPlX1hl00UbTw2dbfIp+U8kETaA4BfbAX8kWW63OW3Loj6ZGxYOpBya+0HHs0jLj58tncIpGNoqDX2MkHZBgCkauoxNvhdGNEMiKUzm3oXwfJiThNqTIPd2DFmDBiRKyqBBdq1gQOpaDmSx/YQvoUjwkbLjWYe3QP4wewNQKEYoSS0OPC/puOAeaZ6i66OyR5sXkX2FNS6vNmU6gUT8KkIqedJAk615O0UTtjqzLdSU7sYTnFE++RBQsqPsMmHT6bi1/qvLhS2/QNVepiZWW6tXSoAuhitEWoZHVom+8x7WqQ2dmgvmyp6teahLoMIO8EKzYVV9bI0LuLF57YFqOcNIfz4p0NSM8/DAPRWc9RCgU/modDyySRQ8AAph91Arvy/zCMIsiaOOQ7EFltj5FEPVru0gf7/2jDsTFFXTxxSyztiG/cSyGKCHSUijiz5nqbOlDrKdt4Z+SkjY6OgEJf1ZSZAE9VFtZEG9p0ZHZRHGQf/+6aZ/aIMfywyZyC6IcwFw+7DS6HR7rmo232Q== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(1800799024)(82310400026)(7416014)(376014)(10067099003)(56012099006)(261028144727099003)(261026121527099003)(261026140227099003)(261021123027099003)(261022105027099003)(261022075727099003)(261009223027099003)(18002099003)(22082099003)(11063799006)(4143699003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jqYSDyNr3Ib7B84zbbQUZsxTz1K0dkLRKfSmyPsimHpoFNwSFu3hC8ftbvgtf8RIc0QPnYCM2dyWLJY2TEViXtZNgs35x6z4tiGVWlHzaFxzyIGRQxUUxB4FmKmUMa2vqb3R+XC8QbcBNzrGVwaZrW/rPs/NJlcv1dLX7HxtpouYpFyQUfJo/QgqOkC9icavNz4yN9U+zddQgmA7LIoyDW8eHz1QGYWlaD5K454J9NwwwhnKtmFQVBQi2arCSF7pURiyPofJUDLvJ0wVmWpvG9wIOfdxFtmbiQnLJVjUsTiKOkv81jANdlTUC+vIWSS9SCR7Qo0/4/BZrzoKEZz5dFt32e1napgZZaPbs2WLcSJTix1OmDOTp/6+/dnZ1JxJ8QQKPZUVEYuZZzp7Gni+xNxB8KWW9eyHF0+xip/geVX7w+NXuNzR7GT3Kw5rRFxS X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 07:49:40.9077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 44598fe8-d656-4959-3ed2-08df4eb67dab X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BY1PEPF000264AF.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9141 On 26/11/2026 23:45, netdev-bot+sashiko@kernel.org wrote: > External email: Use caution opening links or attachments > > > Thank you for your contribution! Sashiko AI review found 1 potential > issue(s) to consider. > > Critical: 0 · High: 1 · Medium: 0 · Low: 0 > > 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). > > - [High] The fix does not record the owner eswitch for encap entries > created on a Socket Direct (SD) secondary eswitch, so the neigh-update… > > -- > > net/mlx5e: TC, use the owner eswitch for encap neigh updates > > The neigh update and neigh-used paths used to derive the eswitch from > netdev_priv(e->out_dev). In MPESW, an encap entry of one eswitch can route > through another eswitch's uplink, so that eswitch was not always the owner. > This patch records the owner eswitch uplink priv in the encap entry, uses it > for flow updates and entry release, and keeps out_dev for neigh handling. > >> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c >> index 4f9f8beffbc8d..d23cf60613ea7 100644 >> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c >> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c > > [ ... ] > >> @@ -871,6 +871,7 @@ int mlx5e_attach_encap(struct mlx5e_priv *priv, >> init_completion(&e->res_ready); >> entry_created = true; >> INIT_LIST_HEAD(&e->route_list); >> + e->priv = netdev_priv(mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH)); > > [Severity: High] > > Does this record the owner eswitch for encap entries created on a Socket > Direct secondary eswitch? mlx5_eswitch_uplink_get_proto_dev() redirects to > the SD primary: > > void *mlx5_eswitch_uplink_get_proto_dev(struct mlx5_eswitch *esw, u8 rep_type) > { > struct mlx5_core_dev *primary = mlx5_sd_get_primary(esw->dev); > > if (primary) > esw = primary->priv.eswitch; > > return mlx5_eswitch_get_proto_dev(esw, MLX5_VPORT_UPLINK, rep_type); > } > > SD secondaries also have no uplink representor of their own, as the comment > in mlx5_eswitch_reload_ib_reps() says: > > /* SD secondary devices share the primary's uplink and do not > * have their own uplink representor. Only load VF/SF vports. > */ > > Take a tc flower encap rule added on a VF representor of an SD secondary: > > - is_peer_flow_needed() handles this case explicitly via > mlx5_lag_is_sd(in_mdev) && !mlx5_sd_is_primary(in_mdev). > - mlx5e_tc_add_fdb_flow() installs the original flow in the secondary's > chains. > - e goes into the secondary's encap_tbl under the secondary's > encap_tbl_lock. > - mlx5e_tc_tun_create_header_ipv4() allocates e->pkt_reformat on the > secondary mdev. > > But e->priv->mdev->priv.eswitch is the SD primary's eswitch. > > On a neighbour change, mlx5e_rep_neigh_update() calls > mlx5e_rep_update_flows(e->priv, ...). It looks like that would: > > - take the primary's encap_tbl_lock while walking e->flows in > mlx5e_take_all_encap_flows(). Meanwhile mlx5e_attach_encap() and > mlx5e_detach_encap() change the same list under the secondary's lock. > > - add and remove the slow path and encap rules through the primary's > fs_chains, for flows whose rules live in the secondary's chains. > > - allocate the replacement pkt_reformat on the primary mdev. Later, > mlx5e_detach_encap() frees it through mlx5e_encap_dealloc(priv, e) with > the secondary's priv. > > The other converted paths have the same problem. When > mlx5e_get_next_matching_encap() calls mlx5e_encap_put(e->priv, e) on the > last reference, it would take the primary's lock and call hash_del_rcu() on > an entry in the secondary's encap_tbl. mlx5e_tc_update_neigh_used_value() > also walks e->flows under the primary's lock. > > For SD, the old netdev_priv(e->out_dev) resolved to the same SD primary > uplink, so this behavior is not new. Still, the problem the commit message > describes stays reachable for SD secondary owners, including SD under MPESW. > > Would it work better to record the owner eswitch or mdev directly, for > example priv->mdev->priv.eswitch without the SD primary redirection, instead > of an uplink priv? This is correct, but this is a pre-existing issue; this patch is fixing the MPESW case. a fix for the Socket-Direct will be sent separately > >> >> tun_info = mlx5e_dup_tun_info(tun_info); >> if (!tun_info) { > > [ ... ] > > -- > Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125210629.239095-1-tariqt%40nvidia.com