From: Wenbo Cao <caowenbo@mucse.com>
To: thomas@monjalon.net, Wenbo Cao <caowenbo@mucse.com>
Cc: stephen@networkplumber.org, dev@dpdk.org, yaojun@mucse.com
Subject: [PATCH v15 27/29] net/rnp: add queue info operation
Date: Tue, 25 Feb 2025 16:41:24 +0800 [thread overview]
Message-ID: <1740472886-30411-28-git-send-email-caowenbo@mucse.com> (raw)
In-Reply-To: <1740472886-30411-1-git-send-email-caowenbo@mucse.com>
add support get queue configure info for user debug
Signed-off-by: Wenbo Cao <caowenbo@mucse.com>
---
doc/guides/nics/rnp.rst | 2 ++
drivers/net/rnp/rnp_ethdev.c | 2 ++
drivers/net/rnp/rnp_rxtx.c | 42 ++++++++++++++++++++++++++++++++++++
drivers/net/rnp/rnp_rxtx.h | 4 ++++
4 files changed, 50 insertions(+)
diff --git a/doc/guides/nics/rnp.rst b/doc/guides/nics/rnp.rst
index becedacbdd..8854b45220 100644
--- a/doc/guides/nics/rnp.rst
+++ b/doc/guides/nics/rnp.rst
@@ -111,7 +111,9 @@ Listed below are the rte_eth functions supported:
* ``rte_eth_promiscuous_get``
* ``rte_eth_allmulticast_get``
* ``rte_eth_rx_queue_setup``
+* ``rte_eth_rx_queue_info_get``
* ``rte_eth_tx_queue_setup``
+* ``rte_eth_tx_queue_info_get``
* ``rte_eth_link_get``
* ``rte_eth_link_get_nowait``
* ``rte_eth_stats_get``
diff --git a/drivers/net/rnp/rnp_ethdev.c b/drivers/net/rnp/rnp_ethdev.c
index 2458f6b866..92063f3c40 100644
--- a/drivers/net/rnp/rnp_ethdev.c
+++ b/drivers/net/rnp/rnp_ethdev.c
@@ -1479,6 +1479,8 @@ static const struct eth_dev_ops rnp_eth_dev_ops = {
.rx_queue_release = rnp_dev_rx_queue_release,
.tx_queue_setup = rnp_tx_queue_setup,
.tx_queue_release = rnp_dev_tx_queue_release,
+ .rxq_info_get = rnp_rx_queue_info_get,
+ .txq_info_get = rnp_tx_queue_info_get,
/* rss impl */
.reta_update = rnp_dev_rss_reta_update,
.reta_query = rnp_dev_rss_reta_query,
diff --git a/drivers/net/rnp/rnp_rxtx.c b/drivers/net/rnp/rnp_rxtx.c
index e23e16948d..bcd340ec35 100644
--- a/drivers/net/rnp/rnp_rxtx.c
+++ b/drivers/net/rnp/rnp_rxtx.c
@@ -1722,3 +1722,45 @@ int rnp_tx_func_select(struct rte_eth_dev *dev)
return 0;
}
+
+void
+rnp_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo)
+{
+ struct rnp_rx_queue *rxq;
+
+ rxq = dev->data->rx_queues[queue_id];
+ if (!rxq)
+ return;
+ qinfo->mp = rxq->mb_pool;
+ qinfo->scattered_rx = dev->data->scattered_rx;
+ qinfo->queue_state = rxq->rxq_started;
+ qinfo->nb_desc = rxq->attr.nb_desc;
+ qinfo->rx_buf_size = rxq->rx_buf_len;
+
+ qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
+ qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+ qinfo->conf.rx_thresh.pthresh = rxq->pthresh;
+ qinfo->conf.rx_thresh.hthresh = rxq->pburst;
+ qinfo->conf.offloads = rxq->rx_offloads;
+}
+
+void
+rnp_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo)
+{
+ struct rnp_tx_queue *txq;
+
+ txq = dev->data->tx_queues[queue_id];
+ if (!txq)
+ return;
+ qinfo->queue_state = txq->txq_started;
+ qinfo->nb_desc = txq->attr.nb_desc;
+
+ qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
+ qinfo->conf.tx_free_thresh = txq->tx_free_thresh;
+ qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh;
+ qinfo->conf.tx_thresh.pthresh = txq->pthresh;
+ qinfo->conf.tx_thresh.hthresh = txq->pburst;
+ qinfo->conf.offloads = txq->tx_offloads;
+}
diff --git a/drivers/net/rnp/rnp_rxtx.h b/drivers/net/rnp/rnp_rxtx.h
index 51e5d4b600..dc4a8ea9dd 100644
--- a/drivers/net/rnp/rnp_rxtx.h
+++ b/drivers/net/rnp/rnp_rxtx.h
@@ -148,5 +148,9 @@ int rnp_rx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t qidx);
int rnp_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t qidx);
int rnp_rx_func_select(struct rte_eth_dev *dev);
int rnp_tx_func_select(struct rte_eth_dev *dev);
+void rnp_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo);
+void rnp_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo);
#endif /* _RNP_RXTX_H_ */
--
2.25.1
next prev parent reply other threads:[~2025-02-25 8:44 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 8:40 [PATCH v14 00/28] [v14]drivers/net Add Support mucse N10 Pmd Driver Wenbo Cao
2025-02-25 8:40 ` [PATCH v15 01/29] net/rnp: add skeleton Wenbo Cao
2025-02-25 8:40 ` [PATCH v15 02/29] net/rnp: add ethdev probe and remove Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 03/29] net/rnp: add log Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 04/29] net/rnp: support mailbox basic operate Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 05/29] net/rnp: add device init and uninit Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 06/29] net/rnp: add get device information operation Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 07/29] net/rnp: add support MAC promisc mode Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 08/29] net/rnp: add queue setup and release operations Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 09/29] net/rnp: add queue stop and start operations Wenbo Cao
2025-02-25 16:08 ` Stephen Hemminger
2025-02-25 8:41 ` [PATCH v15 10/29] net/rnp: add support device start stop operations Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 11/29] net/rnp: add RSS support operations Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 12/29] net/rnp: add support link update operations Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 13/29] net/rnp: add support link setup operations Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 14/29] net/rnp: add Rx burst simple support Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 15/29] net/rnp: add Tx " Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 16/29] net/rnp: add MTU set operation Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 17/29] net/rnp: add Rx scatter segment version Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 18/29] net/rnp: add Tx multiple " Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 19/29] net/rnp: add support basic stats operation Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 20/29] net/rnp: add support xstats operation Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 21/29] net/rnp: add unicast MAC filter operation Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 22/29] net/rnp: add supported packet types Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 23/29] net/rnp: add support Rx checksum offload Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 24/29] net/rnp: add support Tx TSO offload Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 25/29] net/rnp: support VLAN offloads Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 26/29] net/rnp: add support VLAN filters operations Wenbo Cao
2025-02-25 8:41 ` Wenbo Cao [this message]
2025-02-25 8:41 ` [PATCH v15 28/29] net/rnp: support Rx/Tx burst mode info Wenbo Cao
2025-02-25 8:41 ` [PATCH v15 29/29] net/rnp: add multicast MAC filter operation Wenbo Cao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1740472886-30411-28-git-send-email-caowenbo@mucse.com \
--to=caowenbo@mucse.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
--cc=yaojun@mucse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).