DPDK patches and discussions
 help / color / mirror / Atom feed
From: <wanry@3snic.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@amd.com>, Renyong Wan <wanry@3snic.com>,
	Steven Song <steven.song@3snic.com>
Subject: [PATCH v4 27/32] net/sssnic: support dev queue info get
Date: Fri, 1 Sep 2023 17:35:09 +0800	[thread overview]
Message-ID: <20230901093514.224824-28-wanry@3snic.com> (raw)
In-Reply-To: <20230901093514.224824-1-wanry@3snic.com>

From: Renyong Wan <wanry@3snic.com>

Signed-off-by: Steven Song <steven.song@3snic.com>
Signed-off-by: Renyong Wan <wanry@3snic.com>
---
 drivers/net/sssnic/sssnic_ethdev.c    |  2 ++
 drivers/net/sssnic/sssnic_ethdev_rx.c | 13 +++++++++++++
 drivers/net/sssnic/sssnic_ethdev_rx.h |  2 ++
 drivers/net/sssnic/sssnic_ethdev_tx.c | 11 +++++++++++
 drivers/net/sssnic/sssnic_ethdev_tx.h |  2 ++
 5 files changed, 30 insertions(+)

diff --git a/drivers/net/sssnic/sssnic_ethdev.c b/drivers/net/sssnic/sssnic_ethdev.c
index b086e91d2d..bde8d89ddc 100644
--- a/drivers/net/sssnic/sssnic_ethdev.c
+++ b/drivers/net/sssnic/sssnic_ethdev.c
@@ -777,6 +777,8 @@ static const struct eth_dev_ops sssnic_ethdev_ops = {
 	.reta_update = sssnic_ethdev_rss_reta_update,
 	.reta_query = sssnic_ethdev_rss_reta_query,
 	.mtu_set = sssnic_ethdev_mtu_set,
+	.rxq_info_get = sssnic_ethdev_rx_queue_info_get,
+	.txq_info_get = sssnic_ethdev_tx_queue_info_get,
 };
 
 static int
diff --git a/drivers/net/sssnic/sssnic_ethdev_rx.c b/drivers/net/sssnic/sssnic_ethdev_rx.c
index 2874a93a54..6c5f209262 100644
--- a/drivers/net/sssnic/sssnic_ethdev_rx.c
+++ b/drivers/net/sssnic/sssnic_ethdev_rx.c
@@ -1363,3 +1363,16 @@ sssnic_ethdev_rx_pkt_burst(void *rx_queue, struct rte_mbuf **rx_pkts,
 
 	return nb_rx;
 }
+
+void
+sssnic_ethdev_rx_queue_info_get(struct rte_eth_dev *ethdev,
+	uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo)
+{
+	struct sssnic_ethdev_rxq *rxq = ethdev->data->rx_queues[rx_queue_id];
+
+	qinfo->rx_buf_size = rxq->rx_buf_size;
+	qinfo->nb_desc = rxq->depth;
+	qinfo->queue_state = ethdev->data->rx_queue_state[rx_queue_id];
+	qinfo->mp = rxq->mp;
+	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+}
diff --git a/drivers/net/sssnic/sssnic_ethdev_rx.h b/drivers/net/sssnic/sssnic_ethdev_rx.h
index b0b35dee73..20e4d1ac0e 100644
--- a/drivers/net/sssnic/sssnic_ethdev_rx.h
+++ b/drivers/net/sssnic/sssnic_ethdev_rx.h
@@ -44,5 +44,7 @@ void sssnic_ethdev_rx_queue_stats_clear(struct rte_eth_dev *ethdev,
 	uint16_t qid);
 uint16_t sssnic_ethdev_rx_pkt_burst(void *rx_queue, struct rte_mbuf **rx_pkts,
 	uint16_t nb_pkts);
+void sssnic_ethdev_rx_queue_info_get(struct rte_eth_dev *ethdev,
+	uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
 
 #endif
diff --git a/drivers/net/sssnic/sssnic_ethdev_tx.c b/drivers/net/sssnic/sssnic_ethdev_tx.c
index 533befb6ea..51931df645 100644
--- a/drivers/net/sssnic/sssnic_ethdev_tx.c
+++ b/drivers/net/sssnic/sssnic_ethdev_tx.c
@@ -1110,3 +1110,14 @@ sssnic_ethdev_tx_pkt_burst(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 	return nb_tx;
 }
+
+void
+sssnic_ethdev_tx_queue_info_get(struct rte_eth_dev *ethdev,
+	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo)
+{
+	struct sssnic_ethdev_txq *txq = ethdev->data->tx_queues[tx_queue_id];
+
+	qinfo->nb_desc = txq->depth;
+	qinfo->queue_state = ethdev->data->tx_queue_state[tx_queue_id];
+	qinfo->conf.tx_free_thresh = txq->tx_free_thresh;
+}
diff --git a/drivers/net/sssnic/sssnic_ethdev_tx.h b/drivers/net/sssnic/sssnic_ethdev_tx.h
index 3a7cd47080..6130ade4d1 100644
--- a/drivers/net/sssnic/sssnic_ethdev_tx.h
+++ b/drivers/net/sssnic/sssnic_ethdev_tx.h
@@ -39,5 +39,7 @@ void sssnic_ethdev_tx_queue_stats_clear(struct rte_eth_dev *ethdev,
 	uint16_t qid);
 uint16_t sssnic_ethdev_tx_pkt_burst(void *tx_queue, struct rte_mbuf **tx_pkts,
 	uint16_t nb_pkts);
+void sssnic_ethdev_tx_queue_info_get(struct rte_eth_dev *ethdev,
+	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
 
 #endif /* _SSSNIC_ETHDEV_TX_H_ */
-- 
2.27.0


  parent reply	other threads:[~2023-09-01  9:39 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01  9:34 [PATCH v4 00/32] Introduce sssnic PMD for 3SNIC's 9x0 serials Ethernet adapters wanry
2023-09-01  9:34 ` [PATCH v4 01/32] net/sssnic: add build and doc infrastructure wanry
2023-09-01 11:54   ` David Marchand
2023-09-04  3:26     ` Renyong Wan
2023-09-01  9:34 ` [PATCH v4 02/32] net/sssnic: add log type and log macros wanry
2023-09-01  9:34 ` [PATCH v4 03/32] net/sssnic: support probe and remove wanry
2023-09-01  9:34 ` [PATCH v4 04/32] net/sssnic: initialize hardware base wanry
2023-09-01  9:34 ` [PATCH v4 05/32] net/sssnic: add event queue wanry
2023-09-01  9:34 ` [PATCH v4 06/32] net/sssnic/base: add message definition and utility wanry
2023-09-01  9:34 ` [PATCH v4 07/32] net/sssnic/base: add mailbox support wanry
2023-09-01  9:34 ` [PATCH v4 08/32] net/sssnic/base: add work queue wanry
2023-09-01  9:34 ` [PATCH v4 09/32] net/sssnic/base: add control queue wanry
2023-09-01  9:34 ` [PATCH v4 10/32] net/sssnic: add dev configure and infos get wanry
2023-09-01  9:34 ` [PATCH v4 11/32] net/sssnic: add dev MAC ops wanry
2023-09-01  9:34 ` [PATCH v4 12/32] net/sssnic: support dev link status wanry
2023-09-01  9:34 ` [PATCH v4 13/32] net/sssnic: support link status event wanry
2023-09-01  9:34 ` [PATCH v4 14/32] net/sssnic: support Rx queue setup and release wanry
2023-09-01  9:34 ` [PATCH v4 15/32] net/sssnic: support Tx " wanry
2023-09-01  9:34 ` [PATCH v4 16/32] net/sssnic: support Rx queue start and stop wanry
2023-09-01  9:34 ` [PATCH v4 17/32] net/sssnic: support Tx " wanry
2023-09-01  9:35 ` [PATCH v4 18/32] net/sssnic: add Rx interrupt support wanry
2023-09-01  9:35 ` [PATCH v4 19/32] net/sssnic: support dev start and stop wanry
2023-09-01  9:35 ` [PATCH v4 20/32] net/sssnic: support dev close and reset wanry
2023-09-01  9:35 ` [PATCH v4 21/32] net/sssnic: add allmulticast and promiscuous ops wanry
2023-09-01  9:35 ` [PATCH v4 22/32] net/sssnic: add basic and extended stats ops wanry
2023-09-01  9:35 ` [PATCH v4 23/32] net/sssnic: support Rx packet burst wanry
2023-09-01  9:35 ` [PATCH v4 24/32] net/sssnic: support Tx " wanry
2023-09-01  9:35 ` [PATCH v4 25/32] net/sssnic: add RSS support wanry
2023-09-01  9:35 ` [PATCH v4 26/32] net/sssnic: support dev MTU set wanry
2023-09-01  9:35 ` wanry [this message]
2023-09-01  9:35 ` [PATCH v4 28/32] net/sssnic: support dev firmware version get wanry
2023-09-01  9:35 ` [PATCH v4 29/32] net/sssnic: add dev flow control ops wanry
2023-09-01  9:35 ` [PATCH v4 30/32] net/sssnic: support VLAN offload and filter wanry
2023-09-01  9:35 ` [PATCH v4 31/32] net/sssnic: add generic flow ops wanry
2023-09-01  9:35 ` [PATCH v4 32/32] net/sssnic: add VF dev support wanry

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=20230901093514.224824-28-wanry@3snic.com \
    --to=wanry@3snic.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=steven.song@3snic.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).