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 7483145EE3; Thu, 19 Dec 2024 02:50:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1238140299; Thu, 19 Dec 2024 02:50:17 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2136.outbound.protection.outlook.com [40.107.93.136]) by mails.dpdk.org (Postfix) with ESMTP id EA04E400EF for ; Thu, 19 Dec 2024 02:50:15 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ioar+5BD8MrtSnJBPAYwLecCTnIK2n/lxkq4Wt/zBc3aTMwsAVbliwLRfAh0lmaJsXYrM4lztfirDygeWuvzXvcY0Nfxfkubgg3xTNbpGu9+rPf1Bzp/eu3n20hm+nzM5WIsK7F8756yIJugNL6534UlHvwMHupo4pjylrZyi0z0LTUPYbfOQvDAvYBV82p77KIRGLYR5nrtCaw+lMqX/OkxCpdeKYEKR4VMDuSr1W8/IPzOJvgiZJjljam64YzCMqI9nkBpS1LlFrLVmjmPPXpA5pP1mNU6wHMm7qTfHxoSoSOIwnOnpNyBTBYhJCBXEPVcVPF+7oDaCkWb3782Ng== 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=4Jqu0bQx5r9u8jMUwWBW5Z+B2Ip9dauHxMZLsolLuIA=; b=aJlgWvECwUarAttOATx2ZWcIYbLybH8Gs3iYcS0Sthm1+QoBrEVS9P3f7seMgkWoB81Ewyl5b0YDsD4ygVu6pQyRwD63zGFkGCg0QDSSMCjusFwr55/beMp4cjVBELMU0doWBtiPLT4w6kex/3FoOwYyT20cZ4GI76s55KfjlzopI2R6kN9wxPc3MsLiNtM+ktmhH5bRz7kf26l8lclKA5dRg1xaEVH5hWwqwa+lY0+KV7Cl6CASLAQ5kLSEPPVGiW6Dz0Upi/fkyyc1s9luDtCo3x94VvyZM45AafwHp0C3K1ZIzAAw19ASjiMt+INIddbGYGGS67KgBh4tfYzoTw== 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=4Jqu0bQx5r9u8jMUwWBW5Z+B2Ip9dauHxMZLsolLuIA=; b=E+tY4LCiShiaSrftUYvJeKXcg/TGn5/fsmXLWWkI9sziwtCiPDFaqBdK/yQbg3keWasVJVHzJlfjRlxxwwaSlGjNr0MWtThBvbifW2Hp/Fj6HUbvz42DHO+doyny5dydOtANSC2nkz4QEU+UJEvflVRkxih783t0ZmRShGGkuWA= 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 CH2PR13MB3719.namprd13.prod.outlook.com (2603:10b6:610:97::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Thu, 19 Dec 2024 01:50:11 +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; Thu, 19 Dec 2024 01:50:11 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Peng Zhang Subject: [PATCH v2] net/nfp: implement the burst mode get operation Date: Thu, 19 Dec 2024 09:49:54 +0800 Message-ID: <20241219014954.1763729-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241218063036.1697438-1-chaoyong.he@corigine.com> References: <20241218063036.1697438-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0210.namprd03.prod.outlook.com (2603:10b6:a03:2ef::35) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CH2PR13MB3719:EE_ X-MS-Office365-Filtering-Correlation-Id: 57e242c4-179c-4b7f-6ecb-08dd1fcf7986 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?yDwnku22WP19tgOF/qsqqXVlFHVPMVfSroDxRFpW5q2SbamoD8AJICnbUIq5?= =?us-ascii?Q?ZacARF0hnS5BlV3RJXXD1Zq3J+Lz5p7N2a9iZzy09vKo86HTmdi/0m95DK4q?= =?us-ascii?Q?HgpCzDu0c5W9K+4aiCp8Dw8ywhz5ldCVLJBb2fiPBoqZD5zrTK/lK2M+uiDK?= =?us-ascii?Q?ljl6LpXkaE+TbNSBcKFWdK5jTZMauD7VhNsaX5X1KSsgoyCQE91Bfa32vK/W?= =?us-ascii?Q?iOoexalNWc/PbdTylabGhLqyKJIVNtG+fRIhdxj5qgfZ0GNEcozp9P2zzoeZ?= =?us-ascii?Q?l/y8WJBNMFyIRfD9sbaXe37eYqOJaUnxtVjf1fuXatnS7VldP56cwwDcS4Fj?= =?us-ascii?Q?q4ZdUW6Fk53KOKnYTnlVjvgrLsF+dfDoItF9Y2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VXjgDKBmNVay9kikOKaqjkGJGbhAeyuIN91qH?= =?us-ascii?Q?pwtcaC9PveWV3IU40a9PrYB9yp5fAJxxrasFmRt2gdLjMebSJ01r7XypMd2t?= =?us-ascii?Q?Q4hjZ7Z5GNX8GRe7uFkNxvKgt8aPls4DLJhKH1au4iSeb9Pidjxszj8Udma/?= =?us-ascii?Q?aXTzqmqFBovjX2yXPMztD5HUInXZaaTc?= 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)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?e/3wkXE5tUAT9/VRhUwZgKhDhnBByULrKJGbpClJ51MLFSi2gvzACCmUnrqf?= =?us-ascii?Q?VbFYNDYplUwJ67hsLXsBuTGayaxFeaiF11F5Gd/tQc1PS/uCm9Q8+B/7NmsS?= =?us-ascii?Q?/soqIgeecpKRXaf446vGd7iHkIP31FGyh+qGVIz7Ca1woYP1w0crwGmZ0sMu?= =?us-ascii?Q?cGlLOC2/wR3vcJ4H/KyJVJOpndoxiwS9fvgy16LRRVdq6X5VK06/HBM1NALG?= =?us-ascii?Q?zd5QA+IokKuAvn0hl4ejjo1iNafWLNUbJIjD05lwnQXnqhywK42sOamRXfLa?= =?us-ascii?Q?BtkhaPh7ZMLHZxgEx0e4mCt4UL7JO5hxLDkmkJnI0YJ/MACFQWIC36qC7mBQ?= =?us-ascii?Q?aNzD+NJ1p18xpxodFUn+QvbvejV2CTBSJ9hNWezFAmOysIs/NTe3SbA6mVri?= =?us-ascii?Q?uvB9Nt5ClV2aJw0mH0B3czrbZnBozR12IcLI/Vmtkzo61TMCYL4z53tAtK6L?= =?us-ascii?Q?8owjVF6bwS6+z8iJs6yfG/W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q?NAzbOoslNDdBha3S8ZlouUr29Il+a1Gkz9xxaUJfkDjYucDxQjX2u4DuToNW?= =?us-ascii?Q?rzTlBelSKBFRrqtyckVhVhWeWd8cehU5bbVjYtAhNBJGYipW1fY/iq77fGy4?= =?us-ascii?Q?pMsL9xnGgM8CwPAegDPUnrUA17fevPYVtGTPvuCZn6M2EaepE/gN1apUP72q?= =?us-ascii?Q?kCtrG4xbCX34x4xAAGli0Pr/1t2R0bD8cR97sptd4XB+8x53VNLeY8WC3IRW?= =?us-ascii?Q?NQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57e242c4-179c-4b7f-6ecb-08dd1fcf7986 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2024 01:50:11.7092 (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: t65CptDh13jp+Dg7YO0Lw5EVdXXowC8BrQnKXKXpCtz3mgRMMNISlUZUIBlrAptTzKQC0QQ3caqOZFl+h5sO+NeOzc/CcMaWC8001g72ugU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR13MB3719 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 --- v2: * Replace 'snprintf()' with 'strlcpy()'. --- 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..57c0b7351b 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) { + strlcpy(mode->info, "Scalar", + RTE_ETH_BURST_MODE_INFO_SIZE); + } else if (pkt_burst == nfp_net_vec_avx2_recv_pkts) { + strlcpy(mode->info, "Vector AVX2", + RTE_ETH_BURST_MODE_INFO_SIZE); + } 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) { + strlcpy(mode->info, "NFD3 Scalar", + RTE_ETH_BURST_MODE_INFO_SIZE); + } else if (pkt_burst == nfp_net_nfdk_xmit_pkts) { + strlcpy(mode->info, "NFDk Scalar", + RTE_ETH_BURST_MODE_INFO_SIZE); + } else if (pkt_burst == nfp_net_nfdk_vec_avx2_xmit_pkts) { + strlcpy(mode->info, "NFDk Vector AVX2", + RTE_ETH_BURST_MODE_INFO_SIZE); + } 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