From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 56024428F8 for ; Sun, 9 Apr 2023 17:35:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50A1341149; Sun, 9 Apr 2023 17:35:28 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2066.outbound.protection.outlook.com [40.107.237.66]) by mails.dpdk.org (Postfix) with ESMTP id 86FA041149 for ; Sun, 9 Apr 2023 17:35:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iFuJ3PdNBaA0bM9HdUNOXO5I4C3FfjJTGZFH6Pe53Lsf76va26XWrpKCaxNAlW53aBTREqKlYYDolIZijhAveXyJjTn6lhwPXzalc6jC9LWLeRFd22yaVSr2DetjLROQW7OiLGsaWXxOXlbfkBWccg6H9RDKMnzS+SolH1TFr2f/sgsQu5DV3112Bdauj2VfqeCTm2PjER1rubzkm+3exPqSemUAaYeLkf1d3xVLZJTcNxHvPSJ4L0y/4Hpft9AX8RA3WoTl4lhthOe4uCfFoU2jdJaC2NP+TB/wCbYApR6ivnS4MsbmXPKnboyZuSUZ6KLwkKbCmReK5J6R9IPViQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=vS/v2CrpmOsOSzDSvmxx2dCJXnSUHqdHVstPO1xFL2k=; b=aATeVZIgYAsBHHb+Xdx4a3ao+nxCUn3bsoNFpPjAcPf/RA4VbLqBQXt/6ravJ+bMe3HjcXZPUn5Fu7PXggI7ab49ml3t+bqY/yUfKRWH86nYKyUaJKiNpH5+4cB8WkbILM7lgOfLDVrM57EBa5aS7Ybak67vZaV+P52O+4mjY0ObaSrHWOHNi1osTS2MrsnLm1fGS5Ki4VkIPrkWkCvDMYTQFi6ab35Cf3L6t6YEvVTYGc3lojLzQjfRLJXOPWuVDHITTPVF1sZmgRR/Lu4WQCmVcpMVEynhd0LpWPjp82jCsVbTizSnYZBnIb3zsO9ylgUrpGXNSzL3RwSfElckcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=arknetworks.am 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 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=vS/v2CrpmOsOSzDSvmxx2dCJXnSUHqdHVstPO1xFL2k=; b=WCPsMs6HBWZHPxfN/Ktfe9Gc1NBe93ItcgaoudfV6oFiXwr9U7vsCYk7/PxFncuAmQU4CnG65mm/W9Ey1zE9dDRLYAT6jsXkUO8kYbM/BAJt8F+U/AXrySdD4zayxKNuYgf8+YOsGxCm4OB4E/K+qpntcwfsYWvqLKnt/LAiHxaJZYo2ToBuhSN43XJ9jaPAH1tjhZ1IsBUMIxLTGxXW7bK58T8qNy/tASWY62dwpWaDZmuoiJdCuT7KRzM6mjT4/kRkwywMKE7Ig2aMVj0x7BW9iycHlxlWzIBpX9+NJjBtVNvsOMW9PaiggcebpMLSIkGKrN6vzqcCZ1bO8/mdow== Received: from MW4PR04CA0250.namprd04.prod.outlook.com (2603:10b6:303:88::15) by CO6PR12MB5412.namprd12.prod.outlook.com (2603:10b6:5:35e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Sun, 9 Apr 2023 15:35:23 +0000 Received: from CO1NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:303:88:cafe::47) by MW4PR04CA0250.outlook.office365.com (2603:10b6:303:88::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38 via Frontend Transport; Sun, 9 Apr 2023 15:35:23 +0000 X-MS-Exchange-Authentication-Results: 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 CO1NAM11FT033.mail.protection.outlook.com (10.13.174.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.25 via Frontend Transport; Sun, 9 Apr 2023 15:35:22 +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.986.5; Sun, 9 Apr 2023 08:35:14 -0700 Received: from nvidia.com (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.986.37; Sun, 9 Apr 2023 08:35:12 -0700 From: Xueming Li To: Ivan Malov CC: Andy Moreton , Andrew Rybchenko , dpdk stable Subject: patch 'net/sfc: invalidate switch port entry on representor unplug' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:25:01 +0800 Message-ID: <20230409152529.5308-114-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] 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: CO1NAM11FT033:EE_|CO6PR12MB5412:EE_ X-MS-Office365-Filtering-Correlation-Id: 64a321b6-09d6-45ca-9f3e-08db39100897 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VcA9+VLel8cQk7PUrdFIoQhfoHD6siTCoFRq/knnOZw/2mAnJuQfhEAbqLrMLHyM72JNOzRq84oAsXjZJbURf5m56nX6T2ZcxtP0rbNdKstebs1bGnj83ehH2SR1l3nT5uvWSVU0QNF2WHhA3Z9MZcpkGw2ExPv5dwSxwlJVbjKq2rWnz5xQmfDyGvLgYFCMcgouPXSZPXut+3ywYCw0Nu+75XgRpMyZDRIiISLl2+vnLUOaqm3eQwANYufOo+0kA+S77YzjPqhbqMc0443pQm56krcu3busgUb9L4o49bHMUd//tMNA8AntKfOxV9QdGAyN0LVWvUx/0WPMTT1UfK0b3x/SwyucCFBb2xhg/v63ry34ki8SnTF6eUPlE3aEDh9SqT7CD7VLeyYg7vrvbiWaLXsNgoflIMCdFPEOZ9wa0Xnomliyc0mCke/KajqqIBdppRjsHNEzr+o3FqDzqhz43XNHsYRw/COBZRkoGOZRcZNhE2d+8xxLdeeqwSKoP9zertNWwxTtAauAemn4DosAOW8oMtw2P3jI84QozVTSUfVIh/zSpgUpSJR4CuFBPpMWs1C+Os7c8kFSqNPy0pPw2kQev6KAYWNG6jW9IBp/qiflRsp5lstLyv2etwL7579C7/xCE+Y+a5Q0VdcaYsJZTfDFS5M54lvsGUZSrxCQyu19vgc+zH55Ujd/MXkaLV6bVN9eF7gaNqhbnbXIvDSMbwb0GP8c/It/FJG4wZLXxd9KkorBhuKVdjnAyVr1wRO6lfdZMJnWmERFKly7eQTTBgLRR+OajB+Ut+vjYgr4opjWWRziIWW8e0yUH2XT5QLOlSLVwmMPKHm+3OxLVA== 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:(13230028)(4636009)(346002)(39860400002)(396003)(136003)(376002)(451199021)(40470700004)(36840700001)(46966006)(86362001)(36756003)(316002)(41300700001)(8676002)(70206006)(4326008)(966005)(6916009)(7696005)(70586007)(54906003)(478600001)(40480700001)(55016003)(82310400005)(5660300002)(8936002)(2906002)(36860700001)(82740400003)(356005)(7636003)(16526019)(6286002)(186003)(6666004)(53546011)(1076003)(26005)(336012)(2616005)(426003)(47076005)(83380400001)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:35:22.8534 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 64a321b6-09d6-45ca-9f3e-08db39100897 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: CO1NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5412 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/11/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/8a6d064801721157e4d9bbf375616d5e1d5ea552 Thanks. Xueming Li --- >From 8a6d064801721157e4d9bbf375616d5e1d5ea552 Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Fri, 10 Mar 2023 21:07:17 +0400 Subject: [PATCH] net/sfc: invalidate switch port entry on representor unplug Cc: Xueming Li [ upstream commit 723327bed49fb434bfb24b1e4393d5c4db537fda ] Once allocated, a switch port list entry always stays there, even after unplugging the ethdev that created it. Currently, the entry's ethdev ID is not cleared on unplug. Referencing the ethdev ID of a detached representor from a flow rule is going to succeed, which is a bug. Also, if the user unplugs endpoint "A" representor and plugs one for "B" instead, the latter will pick the same ethdev ID as the gone representor, but it will have a new port list entry added for it. If the user tries to reference the ethdev ID from a flow rule, the code will fetch the wrong entry ("A" rather than "B") since it sits closer to the list head. That is a serious bug, too. Make the driver invalidate ethdev ID field on ethdev unplug. Fixes: 1fb65e4dae8a ("net/sfc: support flow action port ID in transfer rules") Fixes: a62ec90522a6 ("net/sfc: add port representors infrastructure") Signed-off-by: Ivan Malov Reviewed-by: Andy Moreton Acked-by: Andrew Rybchenko --- drivers/net/sfc/sfc_repr.c | 2 ++ drivers/net/sfc/sfc_switch.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c index 4b03b101d8..919048e278 100644 --- a/drivers/net/sfc/sfc_repr.c +++ b/drivers/net/sfc/sfc_repr.c @@ -836,6 +836,8 @@ sfc_repr_dev_close(struct rte_eth_dev *dev) (void)sfc_repr_proxy_del_port(srs->pf_port_id, srs->repr_id); + sfc_mae_clear_switch_port(srs->switch_domain_id, srs->switch_port_id); + dev->rx_pkt_burst = NULL; dev->tx_pkt_burst = NULL; dev->dev_ops = NULL; diff --git a/drivers/net/sfc/sfc_switch.c b/drivers/net/sfc/sfc_switch.c index 5c10e8fc74..8f1ee97fa8 100644 --- a/drivers/net/sfc/sfc_switch.c +++ b/drivers/net/sfc/sfc_switch.c @@ -489,6 +489,7 @@ sfc_mae_clear_switch_port(uint16_t switch_domain_id, uint16_t switch_port_id) { struct sfc_mae_switch_domain *domain; + struct sfc_mae_switch_port *port; rte_spinlock_lock(&sfc_mae_switch.lock); @@ -504,6 +505,17 @@ sfc_mae_clear_switch_port(uint16_t switch_domain_id, domain->mae_admin_port = NULL; } + TAILQ_FOREACH(port, &domain->ports, switch_domain_ports) { + if (port->id == switch_port_id) { + /* + * Invalidate the field to prevent wrong + * look-ups from flow rule handling path. + */ + port->ethdev_port_id = RTE_MAX_ETHPORTS; + break; + } + } + rte_spinlock_unlock(&sfc_mae_switch.lock); return 0; } -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:41.670323900 +0800 +++ 0113-net-sfc-invalidate-switch-port-entry-on-representor-.patch 2023-04-09 21:45:38.769042200 +0800 @@ -1 +1 @@ -From 723327bed49fb434bfb24b1e4393d5c4db537fda Mon Sep 17 00:00:00 2001 +From 8a6d064801721157e4d9bbf375616d5e1d5ea552 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 723327bed49fb434bfb24b1e4393d5c4db537fda ] @@ -22 +24,0 @@ -Cc: stable@dpdk.org