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 130C445610 for ; Fri, 12 Jul 2024 12:46:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A1D6402E5; Fri, 12 Jul 2024 12:46:35 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2058.outbound.protection.outlook.com [40.107.220.58]) by mails.dpdk.org (Postfix) with ESMTP id E4D9740261 for ; Fri, 12 Jul 2024 12:46:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NRY5iCNT+yE9fUngSDtI8clSTF8D5rfhMcHaoRfRtgYvTUep+GPRxq7Lf8QrWu016m2GPKq8BA4k+CuFgt90UCwUaGJ6GMBYKMLzVw0aABchEH1n1sgtxD+sJKwSYR3km4BpLwBvXBHEOFf8XTce0TrvYt1PRjm2JYtt6a4Isve1/jSDoAV7NaoI4eXrJ/vXcozyPvKwBmPvV7F9cb7W1a66xhnuXbhvNlfEZvKVl2dSg5KHSR+GvaqAcx/CAPFdscvCIlHigEGqiyz37Z9GT9dNlFO0+6g5KqpAUnaHbcVVFwVQSwCMAUqmzESeBtLunFGV5SbD30ebz//DZlUmng== 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=AVLM5BljwZWEhbu/Jvg3ppN/ktWrugLnmX1QzAk8DUM=; b=iF1/lGB428Ss+VzLGZyCHxDCg6kXy+Sx+sMTa1GIlT3OAatRH78n0O1zjimODJhNNANYjcJKsjPwdyW+sy8LhYKQbzm4daHZEQvtX1+OFI6CxZxcz8oJ5+aaPnEXX1X+RJpbcUHuXhMNcW1HQIzfzWfwVdi5riBsOwAKE0H6w3r61YkrVZfWWdGXNBUj8/SwXya+LrBJZ6lcrLJ6hvF3V6jDD7UOJbaQ7PVkHUTBxO8aW4jfdtWlcQQ2mGPwFYO+atYzzEXlHgkGH7UKrVjHbM6XFN54QjG51fJWAVRWxDWG+xRiiTKu7OLp9eV+DKHnu9e4Wd19b0rYDmdggTZm3g== 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=AVLM5BljwZWEhbu/Jvg3ppN/ktWrugLnmX1QzAk8DUM=; b=MgwhniU/oIobuxhBwarL5mz+DDQ7e5UzNYZXiP9gYUfAmcP7gsUgjVGYPmpmW7m4AJgjF7ZabbpeQ3aIb2Wv7LaBcjT9+D0CbKYrEMpLrXDyZHRBBqQABL4Oo4fnO9LxZ1cqMgseUlz2FYtVDCiMulYIMSfByqXMHSTBVB1uK0Bb9b5cqCTvhICLPh53j+ITq0s2yr7iltm7EB9WNhUk2vEODci4BOC8MgahNcG+KGvqKu0BFjhVm2lLTgbe0PXlSKZ9KKCyISb+qUbAleP2NDDpjJHqqIkAQAY8sIWL5qJe21rpU8rNUeCvL4AtVFJWZoIreV9rOM836uj+wpdNEw== Received: from CH0P221CA0001.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11c::27) by DM6PR12MB4355.namprd12.prod.outlook.com (2603:10b6:5:2a3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23; Fri, 12 Jul 2024 10:46:29 +0000 Received: from CH1PEPF0000A348.namprd04.prod.outlook.com (2603:10b6:610:11c:cafe::89) by CH0P221CA0001.outlook.office365.com (2603:10b6:610:11c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23 via Frontend Transport; Fri, 12 Jul 2024 10:46:29 +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 CH1PEPF0000A348.mail.protection.outlook.com (10.167.244.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Fri, 12 Jul 2024 10:46:29 +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; Fri, 12 Jul 2024 03:46:20 -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; Fri, 12 Jul 2024 03:46:17 -0700 From: Xueming Li To: Long Wu CC: Chaoyong He , Peng Zhang , dpdk stable Subject: patch 'net/nfp: fix representor port queue release' has been queued to stable release 23.11.2 Date: Fri, 12 Jul 2024 18:43:54 +0800 Message-ID: <20240712104528.308638-9-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240712104528.308638-1-xuemingl@nvidia.com> References: <20240712104528.308638-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: 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: CH1PEPF0000A348:EE_|DM6PR12MB4355:EE_ X-MS-Office365-Filtering-Correlation-Id: 1812d4cc-493f-4c54-cfed-08dca25fe32b 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?/ykIyDJ/pIj2V7/wtmpZ7xjAobYhMyITNP3SuLmQtwvTDNO7Rq+/SyynY0or?= =?us-ascii?Q?MK07CxOO26pls8i17qc1DXj6PUj4mEs1HK77P1XBD+cxdq6SBB14vfku/BKB?= =?us-ascii?Q?XL0etiDUoSH227ie84P9dG7g4K767ITmKQx+DVQlOhhvNypRkr7DPz6iTfVM?= =?us-ascii?Q?1ZNXWWaCokaBM9pt9gTMuPoJwfKMe3FhdHk8+nsHaj8K1B2ActABSeEhwWXK?= =?us-ascii?Q?WW0rhIBk6JFPMwB1PWs4cssTtmkG7zKs+7ia3AjEWF+73t1kEE16Xfec6Pa5?= =?us-ascii?Q?ll90/5PQw8dyABLFcS7Zzo/W7psWIsyZlD7VaObpX+IoeDbBiyB0mNtZUzmi?= =?us-ascii?Q?mP6glylRAC9WTWgOxWE5YhQPvsZ3fTnwVcpevjWBhjZjU7UYJAvoeiH0bl1C?= =?us-ascii?Q?VB0OYtOptVpbdT67qNK09Q46x2Wl9cwu75sV8Y3cGivqpOb/sMkPd/fPZmLg?= =?us-ascii?Q?MpSnoxM9nNEDM79cpyu8cN1EJwe97L1k5hGwcBO9mq2seIDcEw8x/UtK+vip?= =?us-ascii?Q?RasoPAaGz2bnxidjZZaz+G0NcvCrHW5Ec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U4j9qX6oJJ8ipw4jPjEieJ?= 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 Jul 2024 10:46:29.5097 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1812d4cc-493f-4c54-cfed-08dca25fe32b 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: CH1PEPF0000A348.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4355 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 07/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=884c6d943aaea21cda14fe9a37d7d4c61f7976c8 Thanks. Xueming Li --- >From 884c6d943aaea21cda14fe9a37d7d4c61f7976c8 Mon Sep 17 00:00:00 2001 From: Long Wu Date: Tue, 19 Mar 2024 15:07:54 +0800 Subject: [PATCH] net/nfp: fix representor port queue release Cc: Xueming Li [ upstream commit 57f62be098be4c95964691183504c77e31797a42 ] The PF representor port's queue is different from the VF/physical representor port. So the release process in close port should be different too. Fixes: a256a1227dbe ("net/nfp: fix resource leak for exit of flower firmware") Signed-off-by: Long Wu Reviewed-by: Chaoyong He Reviewed-by: Peng Zhang --- .../net/nfp/flower/nfp_flower_representor.c | 69 ++++++++++++++----- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 4937c0780a..dba9ceee95 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -291,6 +291,54 @@ nfp_flower_repr_tx_burst(void *tx_queue, return sent; } +static void +nfp_flower_repr_free_queue(struct nfp_flower_representor *repr) +{ + uint16_t i; + struct rte_eth_dev *eth_dev = repr->eth_dev; + + for (i = 0; i < eth_dev->data->nb_tx_queues; i++) + rte_free(eth_dev->data->tx_queues[i]); + + for (i = 0; i < eth_dev->data->nb_rx_queues; i++) + rte_free(eth_dev->data->rx_queues[i]); +} + +static void +nfp_flower_pf_repr_close_queue(struct nfp_flower_representor *repr) +{ + struct rte_eth_dev *eth_dev = repr->eth_dev; + + /* + * We assume that the DPDK application is stopping all the + * threads/queues before calling the device close function. + */ + nfp_net_disable_queues(eth_dev); + + /* Clear queues */ + nfp_net_close_tx_queue(eth_dev); + nfp_net_close_rx_queue(eth_dev); +} + +static void +nfp_flower_repr_close_queue(struct nfp_flower_representor *repr) +{ + switch (repr->repr_type) { + case NFP_REPR_TYPE_PHYS_PORT: + nfp_flower_repr_free_queue(repr); + break; + case NFP_REPR_TYPE_PF: + nfp_flower_pf_repr_close_queue(repr); + break; + case NFP_REPR_TYPE_VF: + nfp_flower_repr_free_queue(repr); + break; + default: + PMD_DRV_LOG(ERR, "Unsupported repr port type."); + break; + } +} + static int nfp_flower_repr_uninit(struct rte_eth_dev *eth_dev) { @@ -348,8 +396,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev) uint16_t i; struct nfp_net_hw *hw; struct nfp_pf_dev *pf_dev; - struct nfp_net_txq *this_tx_q; - struct nfp_net_rxq *this_rx_q; struct nfp_flower_representor *repr; struct nfp_app_fw_flower *app_fw_flower; @@ -361,26 +407,11 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev) hw = app_fw_flower->pf_hw; pf_dev = hw->pf_dev; - /* - * We assume that the DPDK application is stopping all the - * threads/queues before calling the device close function. - */ - nfp_net_disable_queues(dev); - - /* Clear queues */ - for (i = 0; i < dev->data->nb_tx_queues; i++) { - this_tx_q = dev->data->tx_queues[i]; - nfp_net_reset_tx_queue(this_tx_q); - } - - for (i = 0; i < dev->data->nb_rx_queues; i++) { - this_rx_q = dev->data->rx_queues[i]; - nfp_net_reset_rx_queue(this_rx_q); - } - if (pf_dev->app_fw_id != NFP_APP_FW_FLOWER_NIC) return -EINVAL; + nfp_flower_repr_close_queue(repr); + nfp_flower_repr_free(repr, repr->repr_type); for (i = 0; i < MAX_FLOWER_VFS; i++) { -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-12 18:40:14.719638353 +0800 +++ 0008-net-nfp-fix-representor-port-queue-release.patch 2024-07-12 18:40:13.906594251 +0800 @@ -1 +1 @@ -From 57f62be098be4c95964691183504c77e31797a42 Mon Sep 17 00:00:00 2001 +From 884c6d943aaea21cda14fe9a37d7d4c61f7976c8 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 57f62be098be4c95964691183504c77e31797a42 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ -index b2c55879ca..d4c3c30682 100644 +index 4937c0780a..dba9ceee95 100644 @@ -24 +26 @@ -@@ -305,6 +305,54 @@ nfp_flower_repr_tx_burst(void *tx_queue, +@@ -291,6 +291,54 @@ nfp_flower_repr_tx_burst(void *tx_queue, @@ -79 +81 @@ -@@ -362,8 +410,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev) +@@ -348,8 +396,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev) @@ -88 +90 @@ -@@ -375,26 +421,11 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev) +@@ -361,26 +407,11 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)