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 194E4A0547; Thu, 21 Oct 2021 11:54:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 281854128B; Thu, 21 Oct 2021 11:51:24 +0200 (CEST) Received: from smtpbg516.qq.com (smtpbg516.qq.com [203.205.250.54]) by mails.dpdk.org (Postfix) with ESMTP id 6541E41277 for ; Thu, 21 Oct 2021 11:51:19 +0200 (CEST) X-QQ-mid: bizesmtp38t1634809874te7o9j9n Received: from jiawenwu.trustnetic.com (unknown [183.129.236.74]) by esmtp6.qq.com (ESMTP) with id ; Thu, 21 Oct 2021 17:51:14 +0800 (CST) X-QQ-SSF: 01400000000000E0I000000A0000000 X-QQ-FEAT: CGxwVt8GOWHKsivMFwM38yT5b2PfGOr5/jjgiU9CfHToVT04fe/mpv8JP2Qz1 DKRyypTA/I6mZFqAla3sTzVpKYB6i5JLQ6xEy+M/FjokNY03LT5QHa/iHIg0N9MkxOMaMvC nYq0XjBFDE1ke5Qz55t5huq9A/sJIQlidQimDQf36bIOCC41F2+tTmUVGR+eJlpztGUbdDb jZLeYMOHq8xrFU/z0boKhO/mZH5FiSu7hHfqIAdS0Ey8SqCsht8s2FfhAVKvGRiFPE/QVRE SNAuVQcBu/HNjfPeuYFLwSoS59PA0lxidI/AJfBg6d677gH028ddfpRRpIGt7m3eHCx6QzC Q6jEXm81KGgjdsSrAdOFZhaCRajd+JmsH5gIaO5 X-QQ-GoodBg: 2 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu Date: Thu, 21 Oct 2021 17:50:21 +0800 Message-Id: <20211021095023.18288-25-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20211021095023.18288-1-jiawenwu@trustnetic.com> References: <20211021095023.18288-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 Subject: [dpdk-dev] [PATCH v2 24/26] net/ngbe: add Rx and Tx queue info get 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 Sender: "dev" Add Rx and Tx queue information get operation. Signed-off-by: Jiawen Wu --- drivers/net/ngbe/ngbe_ethdev.c | 6 ++++-- drivers/net/ngbe/ngbe_ethdev.h | 6 ++++++ drivers/net/ngbe/ngbe_rxtx.c | 37 ++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c index 9c7a17a096..2f83c2e2fc 100644 --- a/drivers/net/ngbe/ngbe_ethdev.c +++ b/drivers/net/ngbe/ngbe_ethdev.c @@ -3085,13 +3085,15 @@ static const struct eth_dev_ops ngbe_eth_dev_ops = { .rss_hash_update = ngbe_dev_rss_hash_update, .rss_hash_conf_get = ngbe_dev_rss_hash_conf_get, .set_mc_addr_list = ngbe_dev_set_mc_addr_list, + .rxq_info_get = ngbe_rxq_info_get, + .txq_info_get = ngbe_txq_info_get, + .rx_burst_mode_get = ngbe_rx_burst_mode_get, + .tx_burst_mode_get = ngbe_tx_burst_mode_get, .timesync_enable = ngbe_timesync_enable, .timesync_disable = ngbe_timesync_disable, .timesync_read_rx_timestamp = ngbe_timesync_read_rx_timestamp, .timesync_read_tx_timestamp = ngbe_timesync_read_tx_timestamp, .get_reg = ngbe_get_regs, - .rx_burst_mode_get = ngbe_rx_burst_mode_get, - .tx_burst_mode_get = ngbe_tx_burst_mode_get, .get_eeprom_length = ngbe_get_eeprom_length, .get_eeprom = ngbe_get_eeprom, .set_eeprom = ngbe_set_eeprom, diff --git a/drivers/net/ngbe/ngbe_ethdev.h b/drivers/net/ngbe/ngbe_ethdev.h index d9f4cfd705..527b0b3be0 100644 --- a/drivers/net/ngbe/ngbe_ethdev.h +++ b/drivers/net/ngbe/ngbe_ethdev.h @@ -221,6 +221,12 @@ int ngbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id); int ngbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); +void ngbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rxq_info *qinfo); + +void ngbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_txq_info *qinfo); + int ngbe_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, struct rte_eth_burst_mode *mode); diff --git a/drivers/net/ngbe/ngbe_rxtx.c b/drivers/net/ngbe/ngbe_rxtx.c index 4e09b79d81..36d6ec1992 100644 --- a/drivers/net/ngbe/ngbe_rxtx.c +++ b/drivers/net/ngbe/ngbe_rxtx.c @@ -3139,3 +3139,40 @@ ngbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) return 0; } + +void +ngbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rxq_info *qinfo) +{ + struct ngbe_rx_queue *rxq; + + rxq = dev->data->rx_queues[queue_id]; + + qinfo->mp = rxq->mb_pool; + qinfo->scattered_rx = dev->data->scattered_rx; + qinfo->nb_desc = rxq->nb_rx_desc; + + qinfo->conf.rx_free_thresh = rxq->rx_free_thresh; + qinfo->conf.rx_drop_en = rxq->drop_en; + qinfo->conf.rx_deferred_start = rxq->rx_deferred_start; + qinfo->conf.offloads = rxq->offloads; +} + +void +ngbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_txq_info *qinfo) +{ + struct ngbe_tx_queue *txq; + + txq = dev->data->tx_queues[queue_id]; + + qinfo->nb_desc = txq->nb_tx_desc; + + qinfo->conf.tx_thresh.pthresh = txq->pthresh; + qinfo->conf.tx_thresh.hthresh = txq->hthresh; + qinfo->conf.tx_thresh.wthresh = txq->wthresh; + + qinfo->conf.tx_free_thresh = txq->tx_free_thresh; + qinfo->conf.offloads = txq->offloads; + qinfo->conf.tx_deferred_start = txq->tx_deferred_start; +} -- 2.21.0.windows.1