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 E1052454A2; Wed, 19 Jun 2024 04:50:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A4EB42790; Wed, 19 Jun 2024 04:50:03 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2106.outbound.protection.outlook.com [40.107.223.106]) by mails.dpdk.org (Postfix) with ESMTP id 65542427BB for ; Wed, 19 Jun 2024 04:50:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jcl/TXxHjxrTOlNzV5YAoETcsolY9QrnT9okgzALN5kFAZ7kjaRUMbjwe3eHfMrkZ/VqoR9YCHWAPdRgfcq1O1hSigKRdoNuG1E2u/eHwmG9LDXbzBvvLf/40q70lRwuGiIjUyUhr51XJWgJzIWUoSOl6A4XTQ3pqs+eRTavVFgmLgi51f+loOQR0xxy9fDn9m6J/t3XLkVBI5EXZnTEtdmrdf8tYVz3GrcZYnmv8QwqMFqmC9g40VOA+s1e3dyH5ZTqqVJ9OVRFeDKmhgJn1ID2cqeTUW4ZZnvdx7kGoGq6lzNf9zdpGU7nFz7fpSixtEIAHC0eqxO2/zhjaqwtNA== 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=C4dW/4c4HgSdAoj7AmDRoiJ8TdZn+v23zGyJwZGv0X8=; b=Af9K2TZjq2POnwziXQpjSBySfZzXHdtJbEWhQHYs/hXebVVzA+w08F9Rlbph7g6PJo7Aif/Ksd8LGx9cocOo2x55pB+JBUt46v5xw7P7mPHiUS02I+weDETmiODsGNsfei5ip659kDHoUUaMH2VdNSfsMofoEmiSWOQfCsu+wFDIzovg1avcmlV3ozwScI1++TXYIvu15GyYRVR2xYC+qnmkV8sKjhkoxYwnla457VOoqn/xTSYH/yUbEHx5T3Hl8RoqfiKAFgu76E2/NEZOPGZelHSTZVPC/bXdLbnIMa0ipxFy/oCBIQJgmGGd7C71NzAeQxr7+/DSb77qtUJxuA== 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=C4dW/4c4HgSdAoj7AmDRoiJ8TdZn+v23zGyJwZGv0X8=; b=Ye6eectQhVVWyy+nzFm9erc9onZhm2NKPlyktG8dKYJ7DOxI99Ubm4z/GbBqHpIcz9i34brOjeI1Yx2q8Ax80NskaCIKKESEKcEo8rlb1U+WDEttBnBf4PqV3fo+rtv1U4qc+hfSvRSENu7+RvLiBJKKSgMOMV6ybKlg0JQtMKU= 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 SJ2PR13MB6166.namprd13.prod.outlook.com (2603:10b6:a03:4f9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Wed, 19 Jun 2024 02:50:00 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7677.030; Wed, 19 Jun 2024 02:50:00 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He Subject: [PATCH 5/5] net/nfp: support getting Tx queue information Date: Wed, 19 Jun 2024 10:49:23 +0800 Message-Id: <20240619024923.3215843-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240619024923.3215843-1-chaoyong.he@corigine.com> References: <20240619024923.3215843-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: CYZPR02CA0007.namprd02.prod.outlook.com (2603:10b6:930:a1::24) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SJ2PR13MB6166:EE_ X-MS-Office365-Filtering-Correlation-Id: c74530a7-cb5c-4eb2-1c5b-08dc900a82d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|1800799021|52116011|376011|366013|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?vWQfcm3LonYSuevbFDDbZqZgYlb06xmyLA5RZJ3Lc8ASEx4/4sZ2ODS54u30?= =?us-ascii?Q?YqfcNTBVZrc99Bs9tx/F9YfS6leunVNb6BcnwqJtTwRgGdGAwtY2owfvn6Wq?= =?us-ascii?Q?ObsZIso7oWpfGDp7c2yZGfE1bC1EOzt0hUz8MyM6DvSdyv3mmRSaJd4vnlT2?= =?us-ascii?Q?nW7SuP1a8w2v+CIh+YtEhCTDtJbprNr/wPn6/1Ukx+y+o55bFmvB4M2DFAKt?= =?us-ascii?Q?qsvGJ5sJ8tldSLTDqyzUV57AOtvwNtz4I2ut0xp/5qN4dNCCEJBfW6I+ZO9F?= =?us-ascii?Q?f2GN7I7pongDNiayZdZiM8u+lybpvB4k0JzY756KJt6Dav1PjaH2E7qRPP+L?= =?us-ascii?Q?vLShY44qbGocVWuiTF1YiBa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ascii?Q?2RQ2Kxf5CcwdEfTY24wH3ms0gNU9U52Qt6Bijq45RJ22pJM0ww+zCu9/FYFH?= =?us-ascii?Q?wRjFtJF6xAyhrpKGhc5Vt6se1xBvYgXhG6Fh4fHaSWo4J4XHW57XBDSK60zl?= =?us-ascii?Q?YZMhdjE=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230037)(1800799021)(52116011)(376011)(366013)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?4iS4msyFWO6krpe7Ol7baMWeZhxvJxsOd4PyTJMYt/PBKKxyiHPeGF8AAsIF?= =?us-ascii?Q?iB9ZFO79LjLztSD3FzJmu+b0km1MjIjJDPHM0D2nqFoKltY/U4rirLjj0fUd?= =?us-ascii?Q?2Ot1U53/fn3yRsnSW2m/dnQmjs/i4NUPaQF9vnn//thcfATqkp0WBMJxYj93?= =?us-ascii?Q?ytNyjpu9g9nh/uJK04Qc0YeKDbzbtxL/ClXc4dcl9J+rD1zwLu3NCCXZPd3q?= =?us-ascii?Q?LF8+cBmYPHYD2vvtySy7Q7nOPT8HF8DjqgGIpNsPPipzAcolApTZq79yEPMU?= =?us-ascii?Q?Iiy5OgIQf8Cb7K8KajSGC6f1LHSWwDLnrKi+aVRp1Gt3nO/QvPrlFBlV2ex4?= =?us-ascii?Q?Ce6x2Iq0SNNmVy/vYYwP1LFHnWxVUaexIoco10s2ES9GOBbkh5lx/CO3xpRH?= =?us-ascii?Q?c2X87Js+6Y3TWisaWk+v0Yb5i//QxEK+4j+Xy25AvWSrcqPxQPL/6ccgivgX?= =?us-ascii?Q?DV6GEdZJQr5dXkSGz8IoQHMgyIPmzAet8i87EN3n/5omaik8MSx12JE631qj?= =?us-ascii?Q?hh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hRRL7dM?= =?us-ascii?Q?vDX2WG1z4/50aLIPsNHAsFvF+jc9DuEaxOeTEh2q7zHiRBGH/Q9FW4AQRL++?= =?us-ascii?Q?skUJy7D9UKoy1MM1QRTzizIfJra4xMRWuKAAZl+wUnVh3DcOfrdX2Hjpzyzb?= =?us-ascii?Q?+c31p8SU+X75EeQqE/GJrBwC+P7A5IKsfSbNtb/kGO7rxU1cFKO+U3157/Qk?= =?us-ascii?Q?jQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: c74530a7-cb5c-4eb2-1c5b-08dc900a82d2 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 02:50:00.1632 (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: Ipq3XO0R6kvYY1bhAO+McWqZQoMlbMR0zroOsws1+qoqytyazmaD4/zjAp+elm0d1jdlcYaRxiFC8yb6Z4WoBRZJdeiw27kojfM9z9/Kqu0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR13MB6166 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 From: Long Wu Add support for getting Tx queue information on NFP CoreNIC firmware. Signed-off-by: Long Wu Reviewed-by: Chaoyong He --- drivers/net/nfp/nfp_ethdev.c | 1 + drivers/net/nfp/nfp_rxtx.c | 21 +++++++++++++++++++++ drivers/net/nfp/nfp_rxtx.h | 3 +++ 3 files changed, 25 insertions(+) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 8baf459e18..004c725ef8 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -866,6 +866,7 @@ static const struct eth_dev_ops nfp_net_eth_dev_ops = { .rxq_info_get = nfp_net_rx_queue_info_get, .tx_queue_setup = nfp_net_tx_queue_setup, .tx_queue_release = nfp_net_tx_queue_release, + .txq_info_get = nfp_net_tx_queue_info_get, .rx_queue_intr_enable = nfp_rx_queue_intr_enable, .rx_queue_intr_disable = nfp_rx_queue_intr_disable, .udp_tunnel_port_add = nfp_udp_tunnel_port_add, diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 3e7829ed0c..1db79ad1cd 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -846,3 +846,24 @@ nfp_net_rx_queue_info_get(struct rte_eth_dev *dev, info->conf.offloads = dev_info.rx_offload_capa & dev->data->dev_conf.rxmode.offloads; } + +void +nfp_net_tx_queue_info_get(struct rte_eth_dev *dev, + uint16_t queue_id, + struct rte_eth_txq_info *info) +{ + struct rte_eth_dev_info dev_info; + struct nfp_net_hw *hw = nfp_net_get_hw(dev); + struct nfp_net_txq *txq = dev->data->tx_queues[queue_id]; + + if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3) + info->nb_desc = txq->tx_count / NFD3_TX_DESC_PER_PKT; + else + info->nb_desc = txq->tx_count / NFDK_TX_DESC_PER_SIMPLE_PKT; + + info->conf.tx_free_thresh = txq->tx_free_thresh; + + nfp_net_infos_get(dev, &dev_info); + info->conf.offloads = dev_info.tx_offload_capa & + dev->data->dev_conf.txmode.offloads; +} diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index 62b6dab8bc..9806384a63 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -238,5 +238,8 @@ uint32_t nfp_net_tx_free_bufs(struct nfp_net_txq *txq); void nfp_net_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id, struct rte_eth_rxq_info *qinfo); +void nfp_net_tx_queue_info_get(struct rte_eth_dev *dev, + uint16_t queue_id, + struct rte_eth_txq_info *qinfo); #endif /* __NFP_RXTX_H__ */ -- 2.39.1