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 03378A0548; Thu, 2 Jun 2022 03:55:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B68542B8B; Thu, 2 Jun 2022 03:55:03 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2108.outbound.protection.outlook.com [40.107.223.108]) by mails.dpdk.org (Postfix) with ESMTP id CCE51427EA for ; Thu, 2 Jun 2022 03:55:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GDuWFz5bsVgHxA/yEd/hUtGNS9APQFQY5rmgKkT6PLFCO71UM8I2DHTRegfFGbngqACWwL6jjB+J1/LmpjhQul/3Mf6rffz5fT0H3xbChMwAfdr+xYQb7N5PXTx9+LUXFmPeOje6fu5sgLE4XTpDvEz+glVYCt3VDmEVMIjIrUf8DdzWyMzEmdW9RsalIiuQL8gU9B1gEeiE2gTLfxvgqxHdcjab5dkduSDat3293yRVdMo5oACFQBWYGV/zczNa7xV/iSRYsvaOBbVEwe3cU1IIOjiN4Q+tO4nBcuFgAaCeqEQON1SVoBQxnhnm8WzovkIHQJoOGWoaS0wpZW94dQ== 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=BA4ECEfWpEHsTRhrYdl53bPa5sJqgs5epkE7LnihItU=; b=VESYakmlhtLrCCdTa5j0qva/nt/5KaTtGuf216lWuOGRhUJZ/WCiYEsHjrjGh1BFXdmP/vssUcsu2dduw/h3NSee5MTGgZXYg3/IH2vWmgirnvZx5FGhWV1eU6q2zAsaBgPNoUyq/TddZmeg/8a21qFGScO8/KXVWm3qxSUx/uXu8Gs5oLiQff0B5Ex/ksgsbq2DD59H8Nd3v3BxBI2mZjE/WpP1OI4H1e4Lqtijg+eScW0yASVNMv6ZvP/ZZT6VDFiZcj7BCIPCjumAhmxUArk/p5TvbR8HZjp49r8BrU8h17JXIjhtb5IsvazPsSgFWEm5LCMvPdNpw/l7S3YtBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BA4ECEfWpEHsTRhrYdl53bPa5sJqgs5epkE7LnihItU=; b=QNV42lxUdT1II/eC1aFpL4WILCPaz7YgT8Q6vsgRl6cQE1VX3ovXLcGAJ20LigQLww79aTom3uf/KJo9ZE54soA+oxnDVLelpMRR+QHlcV3W7C8G5JgwG2iHGUhSo5ayLnKZIhClJcKtytpqUWhdSNSAjeUvAOYKtKbeD9enWOA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB3004.namprd13.prod.outlook.com (2603:10b6:5:191::21) by DM4PR13MB5858.namprd13.prod.outlook.com (2603:10b6:8:46::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.11; Thu, 2 Jun 2022 01:54:59 +0000 Received: from DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::d902:ed7d:82bb:c753]) by DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::d902:ed7d:82bb:c753%4]) with mapi id 15.20.5314.013; Thu, 2 Jun 2022 01:54:59 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH 10/14] net/nfp: add queue stop and close helper function Date: Thu, 2 Jun 2022 03:53:00 +0200 Message-Id: <20220602015304.710197-11-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220602015304.710197-1-jin.liu@corigine.com> References: <20220602015304.710197-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0457.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::12) To DM6PR13MB3004.namprd13.prod.outlook.com (2603:10b6:5:191::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6b91a59d-cf4d-45f1-a00b-08da443ae69e X-MS-TrafficTypeDiagnostic: DM4PR13MB5858:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d/o7SFKfbZK/JskS0VdzZkDiuf0Lw93NCSeQzVtkOOI2nekZNyyGfN4lGsoXyE9Y+/X377UEUr+1ev/TGxPGMC+0T1f+UbM8sfx5ALeMKXGNRMRMe37PhaBTSiKTP9392tIFKwAawIzPfpVuQc0+Vz83ghWJNY9a4Dcd+YkkQYSQdIha/1PteytnsHYYR4T1xLaMhVCxLsU7kGsZycIItnsnFANhJUgGtUhoKUx0sFjKreAtQDrbdANRkr9znWy/NT7jeVoYxUwkn8c+oWY+5T33IpQ+mXmzhNWT6tCcLZSzST/HmYKuRbsOsvPUd91+oQaLq1o735vIsJM+go/IECf384cygoqp07L3MWwgnoEAYIdgQ7WrqTU3gO5FsoowscPl0+wLOiGaD0DjBaH0iBaM85pkI6nJzUKSUVhBLs6NxBL8+LBXrOKEK1LLiorF7vIUBzxQU42tlL9yfD64h3uGcskNrHgseJxdpHpQDDLHIEdEF+vv/qw5Qfpds4VqD/4aEMgyHAVMUETqVnKuyKdMCmdEWdCCL3WmRyBsyd5DWUgcxh0Sq1iwK6FlVOg74QC1h5OxOnX+9U6CIdTNavYfvb6WAQ6N4dVr4+bJ492pAKb7mc6s0Jk6f2sQSPk7Ia3Y2ikw4D7f4a4iXGwfJgQj0AxWTsEuLOqmLtvejWsE4WujsNghfZ0F1dv7ic4CFRop1UzB2NIoPE6WGlfG4A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR13MB3004.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(346002)(366004)(396003)(136003)(376002)(39840400004)(36756003)(186003)(66574015)(83380400001)(5660300002)(4326008)(44832011)(8936002)(2906002)(6916009)(54906003)(1076003)(107886003)(6506007)(316002)(2616005)(41300700001)(8676002)(66946007)(66476007)(6666004)(66556008)(26005)(6512007)(52116002)(38100700002)(38350700002)(86362001)(6486002)(508600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MGM1V0Q5S09BVVlocWtLcGlUQnFoaXU2d1V0MGJZaWRDczBiSDMrRE14UkQ3?= =?utf-8?B?UlovQWxQL1JSYndwSGdENkJCOWtIaG9XSDBlSmFsNC92NE8zdDZyU2NwZGk2?= =?utf-8?B?SS9BRVJXUUp0VHkyQkc4UVNlQ1d1SGdGRkZNbW1yRG9oVUZoc3RISnl1Q0dF?= =?utf-8?B?NktIclA1Z09pUzFPV0c3MkpncDVkQ2hMTXJhYzJoYjI3TEZzLzZ1SEhUb3Ew?= =?utf-8?B?QjBiVzFNbXlQSHAwU0x0R1NCUnUxYkFoMndvTml4UU9WMU9MbkRha3N1Nmls?= =?utf-8?B?cUVSdlZlZ3pWVnpBVnlFNTBPemZRTVQ2Qlkvc3h4VVFYc3pROVhKUy9xeGZR?= =?utf-8?B?WGMvTFZV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?= =?utf-8?B?UXpsYTZKRXYzVkFQamNmdS9LSkg1WHQrVUZTaThtaHJYY3dmVGoyMmRDdk1n?= =?utf-8?B?U2FnellMZ0NsQmJka01vUUltUjg5TW5GRS82UmpGcFhreW1oQzJ0R3NKUkZQ?= =?utf-8?B?UTB5SktSVk40SUcrK0xYcjl0bk40WitVWTI3SnNQUTBycnBHVGp2Zz09?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b91a59d-cf4d-45f1-a00b-08da443ae69e X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 01:54:59.6793 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QR0aY0HW+HvR9Dy3LV+dJ4tXh2vWir918fT0+gi789M/V1Z7JMQd7a8LB3+voVoAZpHwK3NqfhlNPq5nFTFqog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR13MB5858 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This commit does not introduce new features, just integrate some common logic into helper functions to reduce the same logic and increase code reuse, include queue stop and queue close logic, will be used when NFP net stop and close. queue stop: reset queue queue close: reset and release queue Modify nfd3 firmware net stop and close function, use helper function to stop and close queue instead of before logic. Signed-off-by: Jin Liu Signed-off-by: Diana Wang Signed-off-by: Peng Zhang Signed-off-by: Chaoyong He Signed-off-by: Niklas Söderlund --- drivers/net/nfp/nfp_common.c | 75 +++++++++++++++++++++++++++++++++ drivers/net/nfp/nfp_common.h | 6 +++ drivers/net/nfp/nfp_ethdev.c | 27 ++---------- drivers/net/nfp/nfp_ethdev_vf.c | 29 ++----------- 4 files changed, 89 insertions(+), 48 deletions(-) diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index 6cd1085c1c..58e20081fc 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -1293,6 +1293,81 @@ nfp_net_rss_config_default(struct rte_eth_dev *dev) return ret; } +void +nfp_net_stop_rx_queue(struct rte_eth_dev *dev) +{ + uint16_t i; + struct nfp_net_rxq *this_rx_q; + + for (i = 0; i < dev->data->nb_rx_queues; i++) { + this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; + nfp_net_reset_rx_queue(this_rx_q); + } +} + +void +nfp_net_close_rx_queue(struct rte_eth_dev *dev) +{ + uint16_t i; + struct nfp_net_rxq *this_rx_q; + + for (i = 0; i < dev->data->nb_rx_queues; i++) { + this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; + nfp_net_reset_rx_queue(this_rx_q); + nfp_net_rx_queue_release(dev, i); + } +} + +void +nfp_net_nfd3_stop_tx_queue(struct rte_eth_dev *dev) +{ + uint16_t i; + struct nfp_net_txq *this_tx_q; + + for (i = 0; i < dev->data->nb_tx_queues; i++) { + this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; + nfp_net_nfd3_reset_tx_queue(this_tx_q); + } +} + +void +nfp_net_nfd3_close_tx_queue(struct rte_eth_dev *dev) +{ + uint16_t i; + struct nfp_net_txq *this_tx_q; + + for (i = 0; i < dev->data->nb_tx_queues; i++) { + this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; + nfp_net_nfd3_reset_tx_queue(this_tx_q); + nfp_net_nfd3_tx_queue_release(dev, i); + } +} + +void +nfp_net_nfdk_stop_tx_queue(struct rte_eth_dev *dev) +{ + uint16_t i; + struct nfp_net_txq *this_tx_q; + + for (i = 0; i < dev->data->nb_tx_queues; i++) { + this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; + nfp_net_nfdk_reset_tx_queue(this_tx_q); + } +} + +void +nfp_net_nfdk_close_tx_queue(struct rte_eth_dev *dev) +{ + uint16_t i; + struct nfp_net_txq *this_tx_q; + + for (i = 0; i < dev->data->nb_tx_queues; i++) { + this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; + nfp_net_nfdk_reset_tx_queue(this_tx_q); + nfp_net_nfdk_tx_queue_release(dev, i); + } +} + RTE_LOG_REGISTER_SUFFIX(nfp_logtype_init, init, NOTICE); RTE_LOG_REGISTER_SUFFIX(nfp_logtype_driver, driver, NOTICE); /* diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h index 346fece527..1489b2ac65 100644 --- a/drivers/net/nfp/nfp_common.h +++ b/drivers/net/nfp/nfp_common.h @@ -409,6 +409,12 @@ int nfp_net_rss_hash_update(struct rte_eth_dev *dev, int nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf); int nfp_net_rss_config_default(struct rte_eth_dev *dev); +void nfp_net_stop_rx_queue(struct rte_eth_dev *dev); +void nfp_net_close_rx_queue(struct rte_eth_dev *dev); +void nfp_net_nfd3_stop_tx_queue(struct rte_eth_dev *dev); +void nfp_net_nfd3_close_tx_queue(struct rte_eth_dev *dev); +void nfp_net_nfdk_stop_tx_queue(struct rte_eth_dev *dev); +void nfp_net_nfdk_close_tx_queue(struct rte_eth_dev *dev); #define NFP_NET_DEV_PRIVATE_TO_HW(adapter)\ (&((struct nfp_net_adapter *)adapter)->hw) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 2bf7a565bc..0a5c703190 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -181,10 +181,7 @@ nfp_net_start(struct rte_eth_dev *dev) static int nfp_net_nfd3_stop(struct rte_eth_dev *dev) { - int i; struct nfp_net_hw *hw; - struct nfp_net_txq *this_tx_q; - struct nfp_net_rxq *this_rx_q; PMD_INIT_LOG(DEBUG, "Stop"); @@ -193,15 +190,9 @@ nfp_net_nfd3_stop(struct rte_eth_dev *dev) nfp_net_disable_queues(dev); /* Clear queues */ - for (i = 0; i < dev->data->nb_tx_queues; i++) { - this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; - nfp_net_nfd3_reset_tx_queue(this_tx_q); - } + nfp_net_nfd3_stop_tx_queue(dev); - for (i = 0; i < dev->data->nb_rx_queues; i++) { - this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; - nfp_net_reset_rx_queue(this_rx_q); - } + nfp_net_stop_rx_queue(dev); if (rte_eal_process_type() == RTE_PROC_PRIMARY) /* Configure the physical port down */ @@ -256,8 +247,6 @@ nfp_net_nfd3_close(struct rte_eth_dev *dev) struct nfp_net_hw *hw; struct rte_pci_device *pci_dev; struct nfp_pf_dev *pf_dev; - struct nfp_net_txq *this_tx_q; - struct nfp_net_rxq *this_rx_q; int i; if (rte_eal_process_type() != RTE_PROC_PRIMARY) @@ -277,17 +266,9 @@ nfp_net_nfd3_close(struct rte_eth_dev *dev) nfp_net_disable_queues(dev); /* Clear queues */ - for (i = 0; i < dev->data->nb_tx_queues; i++) { - this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; - nfp_net_nfd3_reset_tx_queue(this_tx_q); - nfp_net_nfd3_tx_queue_release(dev, i); - } + nfp_net_nfd3_close_tx_queue(dev); - for (i = 0; i < dev->data->nb_rx_queues; i++) { - this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; - nfp_net_reset_rx_queue(this_rx_q); - nfp_net_rx_queue_release(dev, i); - } + nfp_net_close_rx_queue(dev); /* Cancel possible impending LSC work here before releasing the port*/ rte_eal_alarm_cancel(nfp_net_dev_interrupt_delayed_handler, diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index ee9ff977cc..d347c98134 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -145,24 +145,14 @@ nfp_netvf_start(struct rte_eth_dev *dev) static int nfp_netvf_nfd3_stop(struct rte_eth_dev *dev) { - struct nfp_net_txq *this_tx_q; - struct nfp_net_rxq *this_rx_q; - int i; - PMD_INIT_LOG(DEBUG, "Stop"); nfp_net_disable_queues(dev); /* Clear queues */ - for (i = 0; i < dev->data->nb_tx_queues; i++) { - this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; - nfp_net_nfd3_reset_tx_queue(this_tx_q); - } + nfp_net_nfd3_stop_tx_queue(dev); - for (i = 0; i < dev->data->nb_rx_queues; i++) { - this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; - nfp_net_reset_rx_queue(this_rx_q); - } + nfp_net_stop_rx_queue(dev); return 0; } @@ -185,9 +175,6 @@ static int nfp_netvf_nfd3_close(struct rte_eth_dev *dev) { struct rte_pci_device *pci_dev; - struct nfp_net_txq *this_tx_q; - struct nfp_net_rxq *this_rx_q; - int i; if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; @@ -204,17 +191,9 @@ nfp_netvf_nfd3_close(struct rte_eth_dev *dev) nfp_net_disable_queues(dev); /* Clear queues */ - for (i = 0; i < dev->data->nb_tx_queues; i++) { - this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; - nfp_net_nfd3_reset_tx_queue(this_tx_q); - nfp_net_nfd3_tx_queue_release(dev, i); - } + nfp_net_nfd3_close_tx_queue(dev); - for (i = 0; i < dev->data->nb_rx_queues; i++) { - this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; - nfp_net_reset_rx_queue(this_rx_q); - nfp_net_rx_queue_release(dev, i); - } + nfp_net_close_rx_queue(dev); rte_intr_disable(pci_dev->intr_handle); -- 2.27.0