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 0A088A0093; Fri, 17 Jun 2022 11:36:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A782442B88; Fri, 17 Jun 2022 11:35:39 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2103.outbound.protection.outlook.com [40.107.94.103]) by mails.dpdk.org (Postfix) with ESMTP id D891C42B7B for ; Fri, 17 Jun 2022 11:35:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HrBRQ+04BUS6BrFV5aJe+EPWl0NtQ7xVCMZ9qUtjbR+8liCe6/GZ4Frbx6t2g4DPfTlfmF1tVkAA3CCEiK6n3uk2l6Zjt89mBTyrrE/PVgQ8f2s4g9IaQaK/jdceJsksYuhNj2yhXaPasLbJCqpN4qdt2srM4babYAsgdVLKcjUB+2LTuFDzItFes8OYbqKNCXieThY/ll3FBVP2qEXZpryonG1U/GQ9B//cU6dB1S2iVeSTKteo5G82OWki5PWImuEQw/dhVgqmVuILAXXxDKHRyRxPixRcLUTLGYQGlnT6HX5V6WQfjXRi2wP/FihewSw/CRQmNe9Pe4ED48hoCg== 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=jFZzr2930Vv2c4QQaVDS7/EwLKkvku48EhdYPEyXKfo=; b=Ro4UdGJgm9DzoIBWrAClZae66J7CZVhM0XFLvWispHlQ1nSDWFn53ow90fZ/whgXZPtnP7jDGgbO3P3aTUB7TT5wiZoa3MtulFYYvoqD2ro76V6Zdg55nTnZClgMX6hT1eTbDnOyyg2LbtpfgqKDaoVIVwtVMs2N+ru2WE5UXkRF0xqOWJj2zIsiZZIdebW4f0O296r0V0zwSmzCjoKYqIkV3YlRlV3PM+qTr4l+ctWKupj9/Dt0oe6SPkMuaPsc5RiisbEUomj9/C6o8+OHyilXlFv+JBv7O+h1muasm16K1wlblkTqVBkbJGE95Q4u0WNPyydRMY5/tBlFOakuRA== 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=jFZzr2930Vv2c4QQaVDS7/EwLKkvku48EhdYPEyXKfo=; b=YpdeWNGsDs/o4u3QIzC0jxZJr6VjD7GKgWGfz0fUgUzmxT6F+pzV/xw73DpyE8iecTDhSTQqS2jvS9tZ23pHMynEN2vaW0OiLuvGA5MEt4TeCaJSTUASM5VL2WXrF3+I4NPVjK3uNJWqYwts702eQiG+aYLCMGfpi4iDSciDKjs= 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 CO3PR13MB5671.namprd13.prod.outlook.com (2603:10b6:303:17a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.9; Fri, 17 Jun 2022 09:35:35 +0000 Received: from DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::ac31:a36a:cc15:cd35]) by DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::ac31:a36a:cc15:cd35%7]) with mapi id 15.20.5373.009; Fri, 17 Jun 2022 09:35:35 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH v3 10/13] net/nfp: add queue stop and close helper function Date: Fri, 17 Jun 2022 11:34:41 +0200 Message-Id: <20220617093444.2004000-11-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220617093444.2004000-1-jin.liu@corigine.com> References: <20220616023939.1798769-1-jin.liu@corigine.com> <20220617093444.2004000-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0192.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a4::17) 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: 151cdce1-3a66-49d3-c0b6-08da5044bb08 X-MS-TrafficTypeDiagnostic: CO3PR13MB5671: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: FIbfkBcOCOeuPV8WiHWjjdp3G5p7DCyGRJaQqAie0yuYL4uRsUHWWIlTnDPqyWnYJP/1zuIHvlJxIPnbPGG8YRVDUrcpObvRrZbsPoiapnJ5nD5dafOgC8Z3VuiVnhJPRzAFVD78YOll5z0chtupS3YTpsjY1a9Xb8/9QZ+77G1T5vcdc3nDawlMKLrG/k/dkpn08HBkMuI1a3dDipI9WDZ00KH78uMCr2vYpyUx1mSgT1miITCkRxjOHCFvCZ8DWgKTCyYDw4E2lGiSHfuA+y9JKrafq5YK7j3+/Njf+5xVDE7+198MvxR1WyPig/Jj+R5KCfOY+oxqC4rgOvkJkKXYt8oSsLQDa+ZtQxG0jFpji/svu1oi1UbCcnrsa7Ymtr7l3G+KVKRaHqHPPBhd5pOwdq1oRXpU7KcwgSm1LztbpRlGGpqjT0J99/DhmpJ5pnNLPApyXAz+TKODZxjx2Mz9kCVU1NTfmv6Dc4xoxenpxPRlAiQpRxI2n2dRXxB5CODYIjSF6Zd+rhbVZ5j+bY4PVS5amUhT+Cw2fkSnu44X0jCKTtdPIva+5sfSo/wzFftHl6UBvGyHGYgt3S2NqBU/Xq5QAZ5ymiEfylVlN1HgKSFqVV9PKEGLn61/eNVpSd4iwnNOr7t7oNlLGgJPjyDo8h0PE1LFHgAAJxXu5ge4tJkOAnmYMAdINb6C/cSjie/JecLUtXGz9o/wuNXIYBJ1cMNEPh9wCtP1AdZaJcwM9IoBTOf61FW30VDnTGIA 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:(13230016)(4636009)(346002)(136003)(366004)(396003)(39840400004)(66476007)(66556008)(26005)(8676002)(66574015)(6666004)(107886003)(66946007)(6506007)(6916009)(44832011)(2906002)(316002)(4326008)(38350700002)(186003)(508600001)(54906003)(5660300002)(6486002)(6512007)(1076003)(8936002)(2616005)(36756003)(52116002)(83380400001)(86362001)(38100700002)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eW5mL2tLMy9DNVd5eFg5NFV4dTgvNmJLWEZ4N2pBaDl2bnpiS2JxTkVld0RN?= =?utf-8?B?TzUydEFiK3RBN0hoUnNDd2JjWEZLWmIyYUJJK05mR0RuSExJZ2JMYlp6QlFX?= =?utf-8?B?eE1ubnAwVjVoOTNGNHVBRUlKaklGMmZMZWdTUEw0THFnaFhzNDhwMW5aNjRu?= =?utf-8?B?S2MxVlFreGwwUnBySk5FMWoyNW9Vb2RFOHdyd0hJYkJwektWUW5aREdxMkhP?= =?utf-8?B?OURqT29PckFXWXk2QURVd21GVk1DYzIrbk96NFBOYmhKSkVzTlpBSkdIUXlJ?= =?utf-8?B?bmZm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zSWNjYWJZeGlPZngyUjAz?= =?utf-8?B?RlVxS3cySUtESjNrWFExejFTYXhpVTNtMmd4bDFJMS9nMzdBR0YrQW5PQ2w2?= =?utf-8?B?dnBmRitDR2lGc2pZN3JyTnVLU3BHSXd3bFZ6Nk1pN1duVDBjR3FqOGYrSzdh?= =?utf-8?B?bitOTnFzTGJJck5yZjRRRS9KQlBLenJJa0FweHpDYnNHRE1tMFBySVlGdmxy?= =?utf-8?B?T2JSeXBHeWw1RVdGVjdacnFzUXByNENwSUt2TGFERVdaclVRSTFBQT09?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 151cdce1-3a66-49d3-c0b6-08da5044bb08 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 09:35:35.4913 (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: vnlAdgNN+QWlNMolStJTmHmHYUxRqhJglxCzYU3sTlJzaAsezbeWyaBin+l/0frhf+RCSTNV2xJ4bj0rtdnoZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR13MB5671 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 NFP 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 | 50 +++++++++++++++++++++++++++++++++ drivers/net/nfp/nfp_common.h | 4 +++ drivers/net/nfp/nfp_ethdev.c | 27 +++--------------- drivers/net/nfp/nfp_ethdev_vf.c | 29 +++---------------- 4 files changed, 62 insertions(+), 48 deletions(-) diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index 9903a1bd5a..755c5ec4d9 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -1320,6 +1320,56 @@ 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_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_reset_tx_queue(this_tx_q); + } +} + +void +nfp_net_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_reset_tx_queue(this_tx_q); + nfp_net_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 19e96414e3..6d917e4b4a 100644 --- a/drivers/net/nfp/nfp_common.h +++ b/drivers/net/nfp/nfp_common.h @@ -413,6 +413,10 @@ 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_stop_tx_queue(struct rte_eth_dev *dev); +void nfp_net_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 0d650efd27..e8a8368d0f 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_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_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_reset_tx_queue(this_tx_q); - } + nfp_net_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_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_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_reset_tx_queue(this_tx_q); - nfp_net_tx_queue_release(dev, i); - } + nfp_net_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 2342f44523..56428814b7 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_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_reset_tx_queue(this_tx_q); - } + nfp_net_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_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_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_reset_tx_queue(this_tx_q); - nfp_net_tx_queue_release(dev, i); - } + nfp_net_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