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 568EE457A1 for ; Mon, 12 Aug 2024 14:59:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72BAD406B7; Mon, 12 Aug 2024 14:59:55 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2071.outbound.protection.outlook.com [40.107.100.71]) by mails.dpdk.org (Postfix) with ESMTP id 884BC4066D for ; Mon, 12 Aug 2024 14:59:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EMwLDjLshKbFxPkjOMjZS2L3xjtmo/rt+YNyF3WzU2PzrEF7krTQFFYTlDJhEN9nlFqIxGSs0l5hJ5mjcQRTWVeMMGiK9ec11XPbPe14lskadq677RySLqa3cco48kbJlYeCxbyeFjdsBe1N84UVHaJEMolGvNexpOEPttSSZRII2nw8jxfi++cu7JsYMleX2VL+W8TbBd5/lPfSuck4+WJW6YFMo76Xm2ILWPeY7CrxdiWiFqS2MTSITxPcttN/aIoO+rPjF44f3+Z7u/fChESUYQayx2vuUjOliAI+fb51dqXf7404ksGHirY23IC1akMwbUb/o/LK+undy6kY3A== 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=9neG74F8gtDWm4zdXTVFl/82vkltGPVTwXoCUWwH2D4=; b=RyvxH3kq5tb+n4tCj3skY0jAprQdgUM+xvuYlCD016aNXHPcMS14qaB2JtDRFDEAC5Y520MOqYjwjoUY3hHuO14zlfIzXtQOYRn16EklCo2+dvlYy5cnJWI2ICE6mXuX2xbKSxtdWLHxr1ObVlXFIMBVgiiTswwirgWvINATOBn4WaKPjTr/veUkeovGHzT9szQtM033YEjW3qqb/fNxlu6FyIqB10FEuuXAZpIt2XhPc0kOjCS8E9RAqVTUtFT9r9Jnj2yYgrXbHcyp7HKnGYIP/IH5kOikTJ/F0M4gAyjLBmMwox6TTluDYWxk0uA6rFOp+x/8UMxHjseKEbYi1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=corigine.com 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=9neG74F8gtDWm4zdXTVFl/82vkltGPVTwXoCUWwH2D4=; b=uRtyYPWuoNxnqxZqjGUErcmlXAbWyPNrjl/YZbtXSG/wNvISeX4TCl924gER9AuSgYWHHdwuEv6NlIME5cjw6yByMyHKKJOw3uoCllShhgs8yrdcgczCU9Alp8+UY9/qNuwSji6kEVTXEFJ1Csypl7vS9VuwzVEp/wZs3pbevJFJpeyHy+SIFlMn2uD8tGagcVvqHGtqK855MmWZNbrKY4RFmcac86BOGU+k8L5s79INJB/7lNQY/27u6tIHjn8tISTCkM6Tw9WtqeIe71TbOY8T5KhWx8n7e09AA7p80nx2aePMVYa00NyKFaB987APRaQJ6R03ZEj4WSYnlBTxcQ== Received: from SJ0PR13CA0150.namprd13.prod.outlook.com (2603:10b6:a03:2c6::35) by SA1PR12MB6678.namprd12.prod.outlook.com (2603:10b6:806:251::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33; Mon, 12 Aug 2024 12:59:49 +0000 Received: from CO1PEPF000042A8.namprd03.prod.outlook.com (2603:10b6:a03:2c6:cafe::c) by SJ0PR13CA0150.outlook.office365.com (2603:10b6:a03:2c6::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Mon, 12 Aug 2024 12:59:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1PEPF000042A8.mail.protection.outlook.com (10.167.243.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Mon, 12 Aug 2024 12:59:48 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 12 Aug 2024 05:59:28 -0700 Received: from nvidia.com (10.126.231.35) 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.1544.4; Mon, 12 Aug 2024 05:59:26 -0700 From: Xueming Li To: Peng Zhang CC: , Chaoyong He , Long Wu , dpdk stable Subject: patch 'net/nfp: fix repeat disable port' has been queued to stable release 23.11.2 Date: Mon, 12 Aug 2024 20:49:30 +0800 Message-ID: <20240812125035.389667-94-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240812125035.389667-1-xuemingl@nvidia.com> References: <20240712110153.309690-23-xuemingl@nvidia.com> <20240812125035.389667-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042A8:EE_|SA1PR12MB6678:EE_ X-MS-Office365-Filtering-Correlation-Id: aadc92f6-9bf4-40b7-7ae7-08dcbacea5a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?6ZmeaH2HRkQu7bTtWRoIMF8JuxosHt4lO5uRjkvm8pKp9osmVPXnfA7TgBsi?= =?us-ascii?Q?k0EzgBROKGFUV1rB2pwXrudNGszzUzFP/K999KF/VvOAHpbDZFUivXM38+rr?= =?us-ascii?Q?PIZkMJLJjcozMfq3O6DG4qU1/FzUdMTD+unov44BlGFSuqUR8o/PbZj5JtPI?= =?us-ascii?Q?1DGbr8Ij9Stqwacn9PI/VJkODUXz0TsVAzmiU68LJILnJD0z2Dd4W7kXutqU?= =?us-ascii?Q?74xJHxUwGcb+YPDIkJqgdqEyE9joIC7EjqN+ieAaFOcxXSmPP9LwBBLROsyt?= =?us-ascii?Q?D8WXZ+DgFB+79Wz/1aEXQpA4DbiSkcH6Nmar9VYSmnHjbLyd4oG21aNLTYoa?= =?us-ascii?Q?/G5hXBKWTlL6B+OLmOjSMbNAH0t/CDwAYP7w0b+56t3wbb1CZyvAF1T/h0Ua?= =?us-ascii?Q?CvpSf1Ag0dSzyLccGyrJtdSZSzlBZP1IIekJm0G3SdA/220xCSIo80Q7stZ6?= =?us-ascii?Q?3FEMG9wqCc3c8xJHQztEQSNr0IbGtWhMYO3mBlRA0WJEL3l0Wz0/XS5FVIBT?= =?us-ascii?Q?j+6IR6cUXh4inHDlqPar1YV6YBtjTsb4dWT9xo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yBva2djgNaWQIEc1kSbW3D?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 12:59:48.3269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aadc92f6-9bf4-40b7-7ae7-08dcbacea5a9 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042A8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6678 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 23.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 08/14/24. 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=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=5453c7a0b0a10851b2e23fba077d191c981a1906 Thanks. Xueming Li --- >From 5453c7a0b0a10851b2e23fba077d191c981a1906 Mon Sep 17 00:00:00 2001 From: Peng Zhang Date: Wed, 19 Jun 2024 17:58:11 +0800 Subject: [PATCH] net/nfp: fix repeat disable port Cc: Xueming Li [ upstream commit bd4969ab939e0f188926f64e410a8ab285392b3a ] For firmware with multiple PFs, all the PFs share the same 'nfp_eth_table' data structure. So the original logic loop the ports in 'nfp_eth_table' will make other PFs suddently down, which will cause problem. Fix this by adding the special logic for firmware with multiple PFs. Fixes: 3b00109d2b65 ("net/nfp: add PF ID used to format symbols") Signed-off-by: Peng Zhang Reviewed-by: Chaoyong He Reviewed-by: Long Wu --- drivers/net/nfp/nfp_ethdev.c | 35 +++++++++++++++++++++++++------- drivers/net/nfp/nfp_net_common.c | 10 +++++++++ drivers/net/nfp/nfp_net_common.h | 2 ++ 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 7d86618bc9..8bb6715450 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -1187,14 +1187,35 @@ app_cleanup: return ret; } +/* Force the physical port down to clear the possible DMA error */ static int -nfp_pf_init(struct rte_pci_device *pci_dev) +nfp_net_force_port_down(struct nfp_pf_dev *pf_dev, + struct nfp_eth_table *nfp_eth_table, + struct nfp_cpp *cpp) { + int ret; uint32_t i; uint32_t id; + uint32_t index; + uint32_t count; + + count = nfp_net_get_port_num(pf_dev, nfp_eth_table); + for (i = 0; i < count; i++) { + id = nfp_function_id_get(pf_dev, i); + index = nfp_eth_table->ports[id].index; + ret = nfp_eth_set_configured(cpp, index, 0); + if (ret < 0) + return ret; + } + + return 0; +} + +static int +nfp_pf_init(struct rte_pci_device *pci_dev) +{ int ret = 0; uint64_t addr; - uint32_t index; uint32_t cpp_id; uint8_t function_id; struct nfp_cpp *cpp; @@ -1266,11 +1287,11 @@ nfp_pf_init(struct rte_pci_device *pci_dev) pf_dev->multi_pf.enabled = nfp_check_multi_pf_from_nsp(pci_dev, cpp); pf_dev->multi_pf.function_id = function_id; - /* Force the physical port down to clear the possible DMA error */ - for (i = 0; i < nfp_eth_table->count; i++) { - id = nfp_function_id_get(pf_dev, i); - index = nfp_eth_table->ports[id].index; - nfp_eth_set_configured(cpp, index, 0); + ret = nfp_net_force_port_down(pf_dev, nfp_eth_table, cpp); + if (ret != 0) { + PMD_INIT_LOG(ERR, "Failed to force port down"); + ret = -EIO; + goto eth_table_cleanup; } if (nfp_fw_setup(pci_dev, cpp, nfp_eth_table, hwinfo, diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index 10732f459c..effb104af5 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -2250,3 +2250,13 @@ nfp_net_flow_ctrl_set(struct rte_eth_dev *dev, return 0; } + +uint32_t +nfp_net_get_port_num(struct nfp_pf_dev *pf_dev, + struct nfp_eth_table *nfp_eth_table) +{ + if (pf_dev->multi_pf.enabled) + return 1; + else + return nfp_eth_table->count; +} diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h index c96f55976a..827aa2c0e2 100644 --- a/drivers/net/nfp/nfp_net_common.h +++ b/drivers/net/nfp/nfp_net_common.h @@ -274,6 +274,8 @@ int nfp_net_flow_ctrl_get(struct rte_eth_dev *dev, int nfp_net_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf); void nfp_pf_uninit(struct nfp_pf_dev *pf_dev); +uint32_t nfp_net_get_port_num(struct nfp_pf_dev *pf_dev, + struct nfp_eth_table *nfp_eth_table); #define NFP_PRIV_TO_APP_FW_NIC(app_fw_priv)\ ((struct nfp_app_fw_nic *)app_fw_priv) -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-08-12 20:44:05.523373860 +0800 +++ 0093-net-nfp-fix-repeat-disable-port.patch 2024-08-12 20:44:02.365069347 +0800 @@ -1 +1 @@ -From bd4969ab939e0f188926f64e410a8ab285392b3a Mon Sep 17 00:00:00 2001 +From 5453c7a0b0a10851b2e23fba077d191c981a1906 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit bd4969ab939e0f188926f64e410a8ab285392b3a ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ - drivers/net/nfp/nfp_ethdev.c | 35 ++++++++++++++++++++++++++------ + drivers/net/nfp/nfp_ethdev.c | 35 +++++++++++++++++++++++++------- @@ -24 +26 @@ - 3 files changed, 41 insertions(+), 6 deletions(-) + 3 files changed, 40 insertions(+), 7 deletions(-) @@ -27 +29 @@ -index a3c237e607..d706f27ac2 100644 +index 7d86618bc9..8bb6715450 100644 @@ -30,2 +32,2 @@ -@@ -1772,6 +1772,30 @@ nfp_net_speed_capa_get(struct nfp_pf_dev *pf_dev, - return 0; +@@ -1187,14 +1187,35 @@ app_cleanup: + return ret; @@ -35 +37,2 @@ -+static int + static int +-nfp_pf_init(struct rte_pci_device *pci_dev) @@ -39 +42 @@ -+{ + { @@ -41,2 +44,2 @@ -+ uint32_t i; -+ uint32_t id; + uint32_t i; + uint32_t id; @@ -58,5 +61,3 @@ - static int - nfp_pf_init(struct rte_pci_device *pci_dev) - { -@@ -1780,7 +1804,6 @@ nfp_pf_init(struct rte_pci_device *pci_dev) - uint32_t id; ++static int ++nfp_pf_init(struct rte_pci_device *pci_dev) ++{ @@ -69 +70 @@ -@@ -1874,11 +1897,11 @@ nfp_pf_init(struct rte_pci_device *pci_dev) +@@ -1266,11 +1287,11 @@ nfp_pf_init(struct rte_pci_device *pci_dev) @@ -85 +86 @@ - ret = nfp_devargs_parse(&pf_dev->devargs, pci_dev->device.devargs); + if (nfp_fw_setup(pci_dev, cpp, nfp_eth_table, hwinfo, @@ -87 +88 @@ -index 260920ecff..30ad6fc29e 100644 +index 10732f459c..effb104af5 100644 @@ -90 +91 @@ -@@ -2554,3 +2554,13 @@ nfp_net_fec_set(struct rte_eth_dev *dev, +@@ -2250,3 +2250,13 @@ nfp_net_flow_ctrl_set(struct rte_eth_dev *dev, @@ -92 +93 @@ - return nfp_eth_set_fec(hw_priv->pf_dev->cpp, eth_port->index, fec); + return 0; @@ -105 +106 @@ -index 2feeb6f5bd..4016652cf9 100644 +index c96f55976a..827aa2c0e2 100644 @@ -108,4 +109,4 @@ -@@ -326,6 +326,8 @@ void nfp_net_get_fw_version(struct nfp_cpp *cpp, - uint32_t *fw_version); - int nfp_net_txrwb_alloc(struct rte_eth_dev *eth_dev); - void nfp_net_txrwb_free(struct rte_eth_dev *eth_dev); +@@ -274,6 +274,8 @@ int nfp_net_flow_ctrl_get(struct rte_eth_dev *dev, + int nfp_net_flow_ctrl_set(struct rte_eth_dev *dev, + struct rte_eth_fc_conf *fc_conf); + void nfp_pf_uninit(struct nfp_pf_dev *pf_dev);