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 C610E4415C; Wed, 5 Jun 2024 11:32:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA28940DFB; Wed, 5 Jun 2024 11:32:29 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2081.outbound.protection.outlook.com [40.107.101.81]) by mails.dpdk.org (Postfix) with ESMTP id 81B6140A81 for ; Wed, 5 Jun 2024 11:32:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dDBbtyPnYvESb11/MHkljSg/PP/mVvfziLge2DelJ0yFlKz9JkjRGsK2L2WJ+mkAzYjTfuAEaLy7e/SYFis3Kj4nWN0Fmsfyyp8v49xHlBf4DxMBtXS02F95RxWsx3ltrrHCqiIsH6EdJaiZLnNrmY5kj7vQ4kNvVBcw2K5r2UUu1UAEDNQCUx99bWjzYGMdo6Y9tO4djwgfQpn/KsdklFW/lNe7esa8snzOGGtOtoxvZeMSQdK4eOvP5yNcPgHQfHdgsFo6vMljnwurhkPYF8zuyu7tvZmg/+FDTlab41cFNZSOma80BH8dtDm4yp4z+q76j5MuQcV5zmkYXEVc6Q== 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=DwN6LhvDGx6qdo03RWv/k1sWiWTnsXBdtPTFVMTMHIQ=; b=LUoUzbDTmz04iCSnwviRIoaMssZl/3ZYJ+xCkBknr4xirAY3yDParylhZpCesJwLPZ38XjK4EwXUU4aZumFAwH6yuU/Dl20vyfhRdKW6uRHl9FDyXyudbdVX4Urp85CrgVwsHXtudabuxxIF7M06O7dY190fc5v7GTc9vrPvXr8FSLz4kI3rIGVJji9gJfSkpiwiIqxhjhTj0jJtbdsteWaKz5UEaSgKnu8uN91svixaov0V5UmrXUtpM+5A0wWqinhTF1zIqfLgpJS8sjh/mxkXkftfQAjnhH+LDOOMyrbVcT+x4DoEkuaTqQUbdeYwbp5fMwV91hjhzpkyi+V7IA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=DwN6LhvDGx6qdo03RWv/k1sWiWTnsXBdtPTFVMTMHIQ=; b=Cri6SbIhM9aaLtmH9fhPehM06HY31+P5bytfqtmSrDQEKxJh3rlD0lRvTgOq8571KzTcN29oyYco7Tet+0QZtpR10Sizg7/nmxx7Huxl4jsjuNCNLFQdDScZwJUbs5F4KVxV7DiR60XXaQXqzp8Z4vLRK6lC8BLIxZZgx26jCgJDnX+tzc72lS44decYEfARlQBmeh/2QbGacy6vzFE/5t5RW50OrJftqmBY/ERNC/tCkfMfO7pfKNXynpukLwurF4TOtaAYgnX9rO4x2CE0AmRGs3GddPeZhFiQNNb3KxV4Xrjf/piqTjXocMZpt4Zbm3rTeglS7G5rdE0GDGi6NA== Received: from CY5PR15CA0183.namprd15.prod.outlook.com (2603:10b6:930:81::29) by CY8PR12MB7147.namprd12.prod.outlook.com (2603:10b6:930:5d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Wed, 5 Jun 2024 09:32:25 +0000 Received: from CY4PEPF0000EDD1.namprd03.prod.outlook.com (2603:10b6:930:81:cafe::a7) by CY5PR15CA0183.outlook.office365.com (2603:10b6:930:81::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31 via Frontend Transport; Wed, 5 Jun 2024 09:32:25 +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 CY4PEPF0000EDD1.mail.protection.outlook.com (10.167.241.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Wed, 5 Jun 2024 09:32:24 +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; Wed, 5 Jun 2024 02:31:58 -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; Wed, 5 Jun 2024 02:31:56 -0700 From: Suanming Mou To: Dariusz Sosnowski , Viacheslav Ovsiienko , Ori Kam , Matan Azrad CC: , Subject: [PATCH v2 2/3] net/mlx5: rename external Rx queue to external queue Date: Wed, 5 Jun 2024 17:31:40 +0800 Message-ID: <20240605093141.1826221-2-suanmingm@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240605093141.1826221-1-suanmingm@nvidia.com> References: <20240531035034.1731943-1-suanmingm@nvidia.com> <20240605093141.1826221-1-suanmingm@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: CY4PEPF0000EDD1:EE_|CY8PR12MB7147:EE_ X-MS-Office365-Filtering-Correlation-Id: 9128d994-2373-4f64-86c8-08dc854268ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|82310400017|36860700004|376005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?DNXAncRev0MxSKfpzu6SZXe/RcwU+l9GdPV0l3FzkIRb/J+dhpZE9fSGnqib?= =?us-ascii?Q?RxUw5rpPHrWPgw4pXdKDAdTaf2UWOEod0FoDU9RZ6c14azHjbLKVS+m6QbV1?= =?us-ascii?Q?TOwlKSl8eO1gxhZpWcK5mP9sEj5gUy/24TNN1/C8PheIoNH+Oss1+VFTtQ64?= =?us-ascii?Q?c+ziog4OW9PqhpXnIC8We1SZj4K+FBwUmYkMfnV43XCb9nzLTb9m33VQb73u?= =?us-ascii?Q?+Nw0qee60SVp0VeRp5laNcZUpPlPougAWyNvPD0LUfO7rPV3V2XarI1wiMyt?= =?us-ascii?Q?yg/VR3nsoonrTQkup+Wx72tf3yavkSFTBE2ID6WAio3gJ5vy1M/oYqUbxwtG?= =?us-ascii?Q?1b+frehzpF+ViSF0l+L8NKI0wnDJP3OLzalKPtDfnxvTDnnDMm4mQVeHamCF?= =?us-ascii?Q?rSu1xobCUFcICT2ixZo/4zz1g11ReKP6+lmg7bO2k32Bl91HRKPUqmDy8wHK?= =?us-ascii?Q?de3Y7HNmNOfosCN4cZwlQvmcSpiEtNnezGya8a4lQTe8UQ4pvHc50jjxs8yj?= =?us-ascii?Q?IXxDLbH01+p58UVM6L/h1G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:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(1800799015)(82310400017)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2024 09:32:24.8965 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9128d994-2373-4f64-86c8-08dc854268ae 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: CY4PEPF0000EDD1.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7147 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 Due to external Tx queue will be supported, in order to reuse the external queue struct, rename the current external Rx queue to external queue. Signed-off-by: Suanming Mou Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_devx.c | 2 +- drivers/net/mlx5/mlx5_rx.h | 8 ++++---- drivers/net/mlx5/mlx5_rxq.c | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index de3df17108..99de52936a 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1216,7 +1216,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, */ if (mlx5_imported_pd_and_ctx(sh->cdev) && mlx5_devx_obj_ops_en(sh)) { priv->ext_rxqs = mlx5_malloc(MLX5_MEM_ZERO | MLX5_MEM_RTE, - sizeof(struct mlx5_external_rxq) * + sizeof(struct mlx5_external_q) * MLX5_MAX_EXT_RX_QUEUES, 0, SOCKET_ID_ANY); if (priv->ext_rxqs == NULL) { diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index e2c22ffe97..e85308f6e0 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -1882,7 +1882,7 @@ struct mlx5_priv { /* RX/TX queues. */ unsigned int rxqs_n; /* RX queues array size. */ unsigned int txqs_n; /* TX queues array size. */ - struct mlx5_external_rxq *ext_rxqs; /* External RX queues array. */ + struct mlx5_external_q *ext_rxqs; /* External RX queues array. */ struct mlx5_rxq_priv *(*rxq_privs)[]; /* RX queue non-shared data. */ struct mlx5_txq_data *(*txqs)[]; /* TX queues. */ struct rte_mempool *mprq_mp; /* Mempool for Multi-Packet RQ. */ diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c index 9fa400fc48..cae9d578ab 100644 --- a/drivers/net/mlx5/mlx5_devx.c +++ b/drivers/net/mlx5/mlx5_devx.c @@ -673,7 +673,7 @@ mlx5_devx_ind_table_create_rqt_attr(struct rte_eth_dev *dev, } for (i = 0; i != queues_n; ++i) { if (mlx5_is_external_rxq(dev, queues[i])) { - struct mlx5_external_rxq *ext_rxq = + struct mlx5_external_q *ext_rxq = mlx5_ext_rxq_get(dev, queues[i]); rqt_attr->rq_list[i] = ext_rxq->hw_id; diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h index d008e4dd3a..decb14e708 100644 --- a/drivers/net/mlx5/mlx5_rx.h +++ b/drivers/net/mlx5/mlx5_rx.h @@ -186,7 +186,7 @@ struct mlx5_rxq_priv { }; /* External RX queue descriptor. */ -struct mlx5_external_rxq { +struct mlx5_external_q { uint32_t hw_id; /* Queue index in the Hardware. */ RTE_ATOMIC(uint32_t) refcnt; /* Reference counter. */ }; @@ -227,10 +227,10 @@ uint32_t mlx5_rxq_deref(struct rte_eth_dev *dev, uint16_t idx); struct mlx5_rxq_priv *mlx5_rxq_get(struct rte_eth_dev *dev, uint16_t idx); struct mlx5_rxq_ctrl *mlx5_rxq_ctrl_get(struct rte_eth_dev *dev, uint16_t idx); struct mlx5_rxq_data *mlx5_rxq_data_get(struct rte_eth_dev *dev, uint16_t idx); -struct mlx5_external_rxq *mlx5_ext_rxq_ref(struct rte_eth_dev *dev, +struct mlx5_external_q *mlx5_ext_rxq_ref(struct rte_eth_dev *dev, uint16_t idx); uint32_t mlx5_ext_rxq_deref(struct rte_eth_dev *dev, uint16_t idx); -struct mlx5_external_rxq *mlx5_ext_rxq_get(struct rte_eth_dev *dev, +struct mlx5_external_q *mlx5_ext_rxq_get(struct rte_eth_dev *dev, uint16_t idx); int mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx); int mlx5_rxq_verify(struct rte_eth_dev *dev); @@ -661,7 +661,7 @@ static __rte_always_inline bool mlx5_is_external_rxq(struct rte_eth_dev *dev, uint16_t queue_idx) { struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_external_rxq *rxq; + struct mlx5_external_q *rxq; if (!priv->ext_rxqs || queue_idx < RTE_PMD_MLX5_EXTERNAL_RX_QUEUE_ID_MIN) return false; diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index f67aaa6178..d6c84b84e4 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -2133,10 +2133,10 @@ mlx5_rxq_data_get(struct rte_eth_dev *dev, uint16_t idx) * @return * A pointer to the queue if it exists, NULL otherwise. */ -struct mlx5_external_rxq * +struct mlx5_external_q * mlx5_ext_rxq_ref(struct rte_eth_dev *dev, uint16_t idx) { - struct mlx5_external_rxq *rxq = mlx5_ext_rxq_get(dev, idx); + struct mlx5_external_q *rxq = mlx5_ext_rxq_get(dev, idx); rte_atomic_fetch_add_explicit(&rxq->refcnt, 1, rte_memory_order_relaxed); return rxq; @@ -2156,7 +2156,7 @@ mlx5_ext_rxq_ref(struct rte_eth_dev *dev, uint16_t idx) uint32_t mlx5_ext_rxq_deref(struct rte_eth_dev *dev, uint16_t idx) { - struct mlx5_external_rxq *rxq = mlx5_ext_rxq_get(dev, idx); + struct mlx5_external_q *rxq = mlx5_ext_rxq_get(dev, idx); return rte_atomic_fetch_sub_explicit(&rxq->refcnt, 1, rte_memory_order_relaxed) - 1; } @@ -2172,7 +2172,7 @@ mlx5_ext_rxq_deref(struct rte_eth_dev *dev, uint16_t idx) * @return * A pointer to the queue if it exists, NULL otherwise. */ -struct mlx5_external_rxq * +struct mlx5_external_q * mlx5_ext_rxq_get(struct rte_eth_dev *dev, uint16_t idx) { struct mlx5_priv *priv = dev->data->dev_private; @@ -2336,7 +2336,7 @@ int mlx5_ext_rxq_verify(struct rte_eth_dev *dev) { struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_external_rxq *rxq; + struct mlx5_external_q *rxq; uint32_t i; int ret = 0; @@ -3206,7 +3206,7 @@ mlx5_rxq_timestamp_set(struct rte_eth_dev *dev) * Pointer to concurrent external RxQ on success, * NULL otherwise and rte_errno is set. */ -static struct mlx5_external_rxq * +static struct mlx5_external_q * mlx5_external_rx_queue_get_validate(uint16_t port_id, uint16_t dpdk_idx) { struct rte_eth_dev *dev; @@ -3252,7 +3252,7 @@ int rte_pmd_mlx5_external_rx_queue_id_map(uint16_t port_id, uint16_t dpdk_idx, uint32_t hw_idx) { - struct mlx5_external_rxq *ext_rxq; + struct mlx5_external_q *ext_rxq; uint32_t unmapped = 0; ext_rxq = mlx5_external_rx_queue_get_validate(port_id, dpdk_idx); @@ -3284,7 +3284,7 @@ rte_pmd_mlx5_external_rx_queue_id_map(uint16_t port_id, uint16_t dpdk_idx, int rte_pmd_mlx5_external_rx_queue_id_unmap(uint16_t port_id, uint16_t dpdk_idx) { - struct mlx5_external_rxq *ext_rxq; + struct mlx5_external_q *ext_rxq; uint32_t mapped = 1; ext_rxq = mlx5_external_rx_queue_get_validate(port_id, dpdk_idx); -- 2.34.1