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 E55E045ED6; Wed, 18 Dec 2024 07:31:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B790B4066E; Wed, 18 Dec 2024 07:31:00 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2117.outbound.protection.outlook.com [40.107.236.117]) by mails.dpdk.org (Postfix) with ESMTP id E32D1402AE for ; Wed, 18 Dec 2024 07:30:58 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WW0ppgHteYjBbf1mLFsxjuf7FS6+qLWdw2ucs0Xn4rH5cDt6iRY8dyaFgMuW1+3JDK9vO09Zque/mNBRgbWXUgQe/4qTuZ6valrtFo0nC8glG3tZNbfd5fOGDz8WFklpX0HmmlaObRYcxKN5GwNw+Jk6uMGNrAGhs3Gebdq43K5jhCAK5Rdzo5ruS0IEo4bC6o8Ed3ZhOuU3IqpY61C8qS0Kba8QArxocvNt2ZryMCUEG20Z1nCYsuaj4+BQMuCYntjtqxas6ZYNwu4RYFQ6BrMm3ezgPxyg2c9kQ+TLK/dpxNBErgnfFUiAxUC3Jn6D7WkQpiO4h5hRiY8vetMfUQ== 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=ixT0z9Zni9iwLROfXobm1E9TWvKHaT9DbRpCDdrIJzM=; b=upEkj1R+IPGVQb8rn3TdFy9RWihpYsjALWprWR7DXs3qlzp8P3Ri4rIjyrHGhVhFmbCXmjQPlPm1QsFbhbJrO3cuVCEYJ+yTZZvaMl2U9CTuQ3Z8r2tRBSYFs7lj/s0hvb9cT2KmNwde257oalRjJgJuLR1Hn20+7MYV3abjaKEYPND7Z3odPPYcp6zHrq/ob0n+j07ExGJ9mzifJeltoinVTXVvsfEXF9UbsRZVl8mm9WCTm0ZEGK3ZvMFoplbH76SOhB7f5MYX1AerTLrYjHOPtj6xUMkSNhMdS9LBQ9+qZTIR8ghuEeZtPxgITzON5tscwzzCUaloreb8jPnKgg== 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=ixT0z9Zni9iwLROfXobm1E9TWvKHaT9DbRpCDdrIJzM=; b=A+OT3Mw8JwzIYTAErfgDW0uCqcMTp6Zt5b6mbdAc5g6cMol/UnSwosuljNwgO4omNqNZSs/YydFVBhR9zLZ68/Dc9TFtmwwD9qWypXYKrmVb+vKM5ejo2Nublxljkhd+8aJ6Vr/KAxL2Wcl4BhBBr45huHoWsvWfIU5PCoheSI8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH8PR13MB6181.namprd13.prod.outlook.com (2603:10b6:510:258::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 06:30:55 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%6]) with mapi id 15.20.8251.008; Wed, 18 Dec 2024 06:30:55 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Peng Zhang Subject: [PATCH] net/nfp: implement the burst mode get operation Date: Wed, 18 Dec 2024 14:30:36 +0800 Message-ID: <20241218063036.1697438-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.43.5 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR04CA0002.namprd04.prod.outlook.com (2603:10b6:a03:40::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH8PR13MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: f3f00540-b1ed-4bfb-9826-08dd1f2d86f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?l/qAbv/Y+hRQzH86R1Pyo4ctWZaOhsBg+yZ9D2Sm0RZt0R2xB4G+Fe/JLo4k?= =?us-ascii?Q?N1Mfl50It2GDZKXrgL4ioqJDwugzqKb63CWjKMvoydxtZhN7r8VXvDVRt4Pf?= =?us-ascii?Q?2hjk66m+UTERUAdv99u1MfPvaKtR4UEEzLSJf6r0aQv7/arpKm3UAL1X4H4X?= =?us-ascii?Q?3jrCx2HH6MZYG+s4C//z9n2vI2RQThQTLO+aOnnWVnYE07TINllv7U0ZpBOv?= =?us-ascii?Q?Rgr+DroStQsV6AAfuVXiQ7XYhDuxFAmcvMTLNeolT68dQbUTnvydOOAyHPp6?= =?us-ascii?Q?5Iod5x+oENlwkgsmeM68k17GEcRGuzv5XBxR3FC41hWmSRE3tYj5R/dKJNMN?= =?us-ascii?Q?YyNIGAovfbV6I9RqnbdlwE89VGhQKN7cxlnL+zuW0sXxZ0114jYpgGSkGq5c?= =?us-ascii?Q?RKnxyu0gdf0qBO/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us-ascii?Q?dkUcFtUXSX8exWHXC1Z7z+mr8R4kWqWmxICRJzEtQSrf5MMzMAQX72Aepuw2?= =?us-ascii?Q?gFg5b3NxT6twMdOANmjreRPp/WeyIRb/tZ+UM6WouhLlyWCGSH+gDqKv0eQ3?= =?us-ascii?Q?nUUSlMQ5ECSIvA1Stf1MqBiDORTSClJh?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?wLTORLjJWgemp9SOB7pi5dsNy1EvWRae/xHXV4MKRDXArCFMC2FgJNFtinMN?= =?us-ascii?Q?hPryf2EEtS+6rJR2MBZWz89kvhFFrh3ndD4lbviPCuxO78q3jorbadMJz7Z8?= =?us-ascii?Q?OfQNgswZuVm3mJMUrbVx+zTYgYEpAQBwYUv3FIaS5+lWXIjDjrHBiJJ+2Wid?= =?us-ascii?Q?02AuYf1usAMa1II7E4LSbqOBN2+JNNEh83wDzBES0b8zgtX0WbzEoNhBI6h7?= =?us-ascii?Q?qiH/swOSLeBkVyqPKxXmbtKqNb1+7mBS2EhdJ6uyQTuqTiwILnyBmz7FwKnR?= =?us-ascii?Q?5+EM5C01lxzYd3eq4YQjDyhTbuChVXLAKL8pJ2n8leMCRNiXsac08G9b3xb3?= =?us-ascii?Q?+ekuT46Bj9093nOU5jnKHYpZU5QOFrOJROJGrsrfac5p+0nhRywCS9r9ZgN5?= =?us-ascii?Q?VOUBYgyvTYA4dcOmVrHCRHxvdxQT5shS9wSNYUgGMD165oJM5FJOGAD/hVm9?= =?us-ascii?Q?93+HdKgX+qR3Jbd/+uzuO+/xzCqLi8HV0iDKk7HwoKRR2U6IUMf6S0Uh+p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S6xxdCe9MjovqRsdH3H6haGBa9PFXzkqcqKTTSW?= =?us-ascii?Q?EEkYpcPhGUPcQelg4I03ivR70wBZi5YHjKVwxVHDxA4XP+l9CDZ+uHX76J+w?= =?us-ascii?Q?mmTiR6z7yPGuuqFrYCyrJN5BRs4JojfWawJPfbKw8aLRDnuR5MUzi8YpNjQr?= =?us-ascii?Q?ZUAoydkJpVU9/PejhshJYEwPhvJ/lHrw7Fj/Z4RKNFmfzw328dF9j4Ddn0gt?= =?us-ascii?Q?Bg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3f00540-b1ed-4bfb-9826-08dd1f2d86f5 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 06:30:55.7901 (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: ItMTh709juRD2XnxmcpIrTVjv3zcpxZ6WDC8CazwU3134abHl7pa9tnIHZfDmzifevXn7xPyRxmw2ucX2zxJs2wdQ+UXso5/PPNZpzkbNEg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR13MB6181 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 Implement the burst mode get operation functions for both Rx and Tx. Signed-off-by: Chaoyong He Reviewed-by: Peng Zhang --- drivers/net/nfp/nfp_ethdev.c | 2 ++ drivers/net/nfp/nfp_ethdev_vf.c | 2 ++ drivers/net/nfp/nfp_rxtx.c | 46 +++++++++++++++++++++++++++++++++ drivers/net/nfp/nfp_rxtx.h | 4 +++ 4 files changed, 54 insertions(+) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index f54483822f..df5482f74a 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -985,6 +985,8 @@ static const struct eth_dev_ops nfp_net_eth_dev_ops = { .get_module_eeprom = nfp_net_get_module_eeprom, .dev_led_on = nfp_net_led_on, .dev_led_off = nfp_net_led_off, + .rx_burst_mode_get = nfp_net_rx_burst_mode_get, + .tx_burst_mode_get = nfp_net_tx_burst_mode_get, }; static inline void diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index 36b98dc0c2..23fa5b82ad 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -232,6 +232,8 @@ static const struct eth_dev_ops nfp_netvf_eth_dev_ops = { .tx_queue_release = nfp_net_tx_queue_release, .rx_queue_intr_enable = nfp_rx_queue_intr_enable, .rx_queue_intr_disable = nfp_rx_queue_intr_disable, + .rx_burst_mode_get = nfp_net_rx_burst_mode_get, + .tx_burst_mode_get = nfp_net_tx_burst_mode_get, }; static inline void diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 35fb637b21..3435371aaa 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -12,6 +12,7 @@ #include "nfd3/nfp_nfd3.h" #include "nfdk/nfp_nfdk.h" +#include "nfdk/nfp_nfdk_vec.h" #include "flower/nfp_flower.h" #include "nfp_ipsec.h" @@ -893,3 +894,48 @@ nfp_net_recv_pkts_set(struct rte_eth_dev *eth_dev) else eth_dev->rx_pkt_burst = nfp_net_recv_pkts; } + +int +nfp_net_rx_burst_mode_get(struct rte_eth_dev *eth_dev, + uint16_t queue_id __rte_unused, + struct rte_eth_burst_mode *mode) +{ + eth_rx_burst_t pkt_burst; + + pkt_burst = eth_dev->rx_pkt_burst; + if (pkt_burst == nfp_net_recv_pkts) { + snprintf(mode->info, RTE_ETH_BURST_MODE_INFO_SIZE, "%s", + "Scalar"); + } else if (pkt_burst == nfp_net_vec_avx2_recv_pkts) { + snprintf(mode->info, RTE_ETH_BURST_MODE_INFO_SIZE, "%s", + "Vector AVX2"); + } else { + return -EINVAL; + } + + return 0; +} + +int +nfp_net_tx_burst_mode_get(struct rte_eth_dev *eth_dev, + uint16_t queue_id __rte_unused, + struct rte_eth_burst_mode *mode) +{ + eth_tx_burst_t pkt_burst; + + pkt_burst = eth_dev->tx_pkt_burst; + if (pkt_burst == nfp_net_nfd3_xmit_pkts) { + snprintf(mode->info, RTE_ETH_BURST_MODE_INFO_SIZE, "%s", + "NFD3 Scalar"); + } else if (pkt_burst == nfp_net_nfdk_xmit_pkts) { + snprintf(mode->info, RTE_ETH_BURST_MODE_INFO_SIZE, "%s", + "NFDk Scalar"); + } else if (pkt_burst == nfp_net_nfdk_vec_avx2_xmit_pkts) { + snprintf(mode->info, RTE_ETH_BURST_MODE_INFO_SIZE, "%s", + "NFDk Vector AVX2"); + } else { + return -EINVAL; + } + + return 0; +} diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index c717d97003..48cbd83787 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -245,6 +245,10 @@ void nfp_net_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id, struct rte_eth_txq_info *qinfo); void nfp_net_recv_pkts_set(struct rte_eth_dev *eth_dev); +int nfp_net_rx_burst_mode_get(struct rte_eth_dev *eth_dev, uint16_t queue_id, + struct rte_eth_burst_mode *mode); +int nfp_net_tx_burst_mode_get(struct rte_eth_dev *eth_dev, uint16_t queue_id, + struct rte_eth_burst_mode *mode); void nfp_net_parse_ptype(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxds, struct rte_mbuf *mb); -- 2.43.5