DPDK patches and discussions
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.ananyev@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCHv3 2/5] i40e: add support for eth_(rxq|txq)_info_get
Date: Mon, 20 Jul 2015 13:19:07 +0100	[thread overview]
Message-ID: <1437394750-5965-3-git-send-email-konstantin.ananyev@intel.com> (raw)
In-Reply-To: <1437394750-5965-1-git-send-email-konstantin.ananyev@intel.com>

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  2 ++
 drivers/net/i40e/i40e_ethdev.h |  5 +++++
 drivers/net/i40e/i40e_rxtx.c   | 42 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 40b0526..6815b6c 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -283,6 +283,8 @@ static const struct eth_dev_ops i40e_eth_dev_ops = {
 	.udp_tunnel_add               = i40e_dev_udp_tunnel_add,
 	.udp_tunnel_del               = i40e_dev_udp_tunnel_del,
 	.filter_ctrl                  = i40e_dev_filter_ctrl,
+	.rxq_info_get                 = i40e_rxq_info_get,
+	.txq_info_get                 = i40e_txq_info_get,
 	.mirror_rule_set              = i40e_mirror_rule_set,
 	.mirror_rule_reset            = i40e_mirror_rule_reset,
 	.timesync_enable              = i40e_timesync_enable,
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 6185657..4748392 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -502,6 +502,11 @@ int i40e_fdir_ctrl_func(struct rte_eth_dev *dev,
 			  enum rte_filter_op filter_op,
 			  void *arg);
 
+void i40e_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo);
+void i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo);
+
 /* I40E_DEV_PRIVATE_TO */
 #define I40E_DEV_PRIVATE_TO_PF(adapter) \
 	(&((struct i40e_adapter *)adapter)->pf)
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 891a221..fadf3e8 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3352,3 +3352,45 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf)
 
 	return I40E_SUCCESS;
 }
+
+void
+i40e_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo)
+{
+	struct i40e_rx_queue *rxq;
+
+	rxq = dev->data->rx_queues[queue_id];
+
+	qinfo->mp = rxq->mp;
+	qinfo->scattered_rx = dev->data->scattered_rx;
+
+	qinfo->nb_desc = rxq->nb_rx_desc;
+	qinfo->max_desc = I40E_MAX_RING_DESC;
+	qinfo->min_desc = I40E_MIN_RING_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;
+}
+
+void
+i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo)
+{
+	struct i40e_tx_queue *txq;
+
+	txq = dev->data->tx_queues[queue_id];
+
+	qinfo->nb_desc = txq->nb_tx_desc;
+	qinfo->max_desc = I40E_MAX_RING_DESC;
+	qinfo->min_desc = I40E_MIN_RING_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.tx_rs_thresh = txq->tx_rs_thresh;
+	qinfo->conf.txq_flags = txq->txq_flags;
+	qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
+}
-- 
1.8.3.1

  parent reply	other threads:[~2015-07-20 12:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 12:19 [dpdk-dev] [PATCHv3 0/5] ethdev: add new API to retrieve RX/TX queue information Konstantin Ananyev
2015-07-20 12:19 ` [dpdk-dev] [PATCHv3 1/5] " Konstantin Ananyev
2015-07-22 16:50   ` Zhang, Helin
2015-07-22 17:00     ` Ananyev, Konstantin
2015-07-22 20:45       ` Thomas Monjalon
2015-07-22 18:28   ` [dpdk-dev] [PATCHv4 0/5] " Konstantin Ananyev
2015-07-23 12:48     ` Thomas Monjalon
2015-07-22 18:28   ` [dpdk-dev] [PATCHv4 1/5] " Konstantin Ananyev
2015-07-22 19:48     ` Stephen Hemminger
2015-07-23 10:52       ` Ananyev, Konstantin
2015-07-23 16:17         ` Thomas Monjalon
2015-07-24  9:05           ` Ananyev, Konstantin
2015-07-23 16:26     ` Thomas Monjalon
2015-07-24  9:15       ` Ananyev, Konstantin
2015-07-24  9:24         ` Thomas Monjalon
2015-07-24 10:50           ` Ananyev, Konstantin
2015-07-24 12:40             ` Thomas Monjalon
2015-07-22 18:28   ` [dpdk-dev] [PATCHv4 2/5] i40e: add support for eth_(rxq|txq)_info_get Konstantin Ananyev
2015-07-22 18:28   ` [dpdk-dev] [PATCHv4 3/5] ixgbe: " Konstantin Ananyev
2015-07-22 18:28   ` [dpdk-dev] [PATCHv4 4/5] e1000: " Konstantin Ananyev
2015-07-22 18:28   ` [dpdk-dev] [PATCHv4 5/5] testpmd: add new command to display RX/TX queue information Konstantin Ananyev
2015-07-20 12:19 ` Konstantin Ananyev [this message]
2015-07-22 17:02   ` [dpdk-dev] [PATCHv3 2/5] i40e: add support for eth_(rxq|txq)_info_get Zhang, Helin
2015-07-20 12:19 ` [dpdk-dev] [PATCHv3 3/5] ixgbe: " Konstantin Ananyev
2015-07-22 17:03   ` Zhang, Helin
2015-07-20 12:19 ` [dpdk-dev] [PATCHv3 4/5] e1000: " Konstantin Ananyev
2015-07-22 17:04   ` Zhang, Helin
2015-07-20 12:19 ` [dpdk-dev] [PATCHv3 5/5] testpmd: add new command to display RX/TX queue information Konstantin Ananyev
2015-07-22 17:16   ` Zhang, Helin

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=1437394750-5965-3-git-send-email-konstantin.ananyev@intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=dev@dpdk.org \
    /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).