From patchwork Thu Sep 28 07:42:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Hai X-Patchwork-Id: 132081 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 955944265D; Thu, 28 Sep 2023 09:46:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F6CC406B8; Thu, 28 Sep 2023 09:46:23 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 7AF0F402CC for ; Thu, 28 Sep 2023 09:46:15 +0200 (CEST) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Rx56R0vBLzNmXk for ; Thu, 28 Sep 2023 15:42:23 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 28 Sep 2023 15:46:12 +0800 From: Jie Hai To: , Yuying Zhang , Beilei Xing CC: , Subject: [PATCH v2 2/8] net/cpfl: support getting queue information Date: Thu, 28 Sep 2023 15:42:59 +0800 Message-ID: <20230928074305.2991100-3-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230928074305.2991100-1-haijie1@huawei.com> References: <20230908112901.1169869-1-haijie1@huawei.com> <20230928074305.2991100-1-haijie1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500020.china.huawei.com (7.221.188.8) X-CFilter-Loop: Reflected 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 patch adds support for querying Rx/Tx queue information. Signed-off-by: Jie Hai --- drivers/net/cpfl/cpfl_ethdev.c | 2 ++ drivers/net/cpfl/cpfl_rxtx.c | 26 ++++++++++++++++++++++++++ drivers/net/cpfl/cpfl_rxtx.h | 4 ++++ 3 files changed, 32 insertions(+) diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c index c4ca9343c3e0..05604f99ed44 100644 --- a/drivers/net/cpfl/cpfl_ethdev.c +++ b/drivers/net/cpfl/cpfl_ethdev.c @@ -1291,6 +1291,8 @@ static const struct eth_dev_ops cpfl_eth_dev_ops = { .tx_queue_stop = cpfl_tx_queue_stop, .rx_queue_release = cpfl_dev_rx_queue_release, .tx_queue_release = cpfl_dev_tx_queue_release, + .rxq_info_get = cpfl_dev_rxq_info_get, + .txq_info_get = cpfl_dev_txq_info_get, .mtu_set = cpfl_dev_mtu_set, .dev_supported_ptypes_get = cpfl_dev_supported_ptypes_get, .stats_get = cpfl_dev_stats_get, diff --git a/drivers/net/cpfl/cpfl_rxtx.c b/drivers/net/cpfl/cpfl_rxtx.c index 2ef6871a8509..7636162b332a 100644 --- a/drivers/net/cpfl/cpfl_rxtx.c +++ b/drivers/net/cpfl/cpfl_rxtx.c @@ -1606,3 +1606,29 @@ cpfl_set_tx_function(struct rte_eth_dev *dev) } #endif /* RTE_ARCH_X86 */ } + +void +cpfl_dev_rxq_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id, + struct rte_eth_rxq_info *qinfo) +{ + struct cpfl_rx_queue *cpfl_rxq; + + cpfl_rxq = dev->data->rx_queues[rx_queue_id]; + qinfo->nb_desc = cpfl_rxq->base.nb_rx_desc; + qinfo->conf.rx_free_thresh = cpfl_rxq->base.nb_rx_desc; + qinfo->conf.rx_free_thresh = cpfl_rxq->base.rx_free_thresh; + qinfo->conf.rx_deferred_start = cpfl_rxq->base.rx_deferred_start; +} + +void +cpfl_dev_txq_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id, + struct rte_eth_txq_info *qinfo) +{ + struct cpfl_tx_queue *cpfl_txq; + + cpfl_txq = dev->data->tx_queues[tx_queue_id]; + qinfo->nb_desc = cpfl_txq->base.nb_tx_desc; + qinfo->conf.tx_rs_thresh = cpfl_txq->base.rs_thresh; + qinfo->conf.tx_free_thresh = cpfl_txq->base.free_thresh; + qinfo->conf.tx_deferred_start = cpfl_txq->base.tx_deferred_start; +} diff --git a/drivers/net/cpfl/cpfl_rxtx.h b/drivers/net/cpfl/cpfl_rxtx.h index aacd087b56cd..1ec14ed24cd6 100644 --- a/drivers/net/cpfl/cpfl_rxtx.h +++ b/drivers/net/cpfl/cpfl_rxtx.h @@ -102,6 +102,10 @@ int cpfl_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); int cpfl_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id); void cpfl_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid); void cpfl_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid); +void cpfl_dev_rxq_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id, + struct rte_eth_rxq_info *qinfo); +void cpfl_dev_txq_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id, + struct rte_eth_txq_info *qinfo); void cpfl_set_rx_function(struct rte_eth_dev *dev); void cpfl_set_tx_function(struct rte_eth_dev *dev); int cpfl_rx_hairpin_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,