From: Konstantin Ananyev <konstantin.ananyev@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCHv3 4/5] e1000: add support for eth_(rxq|txq)_info_get
Date: Mon, 20 Jul 2015 13:19:09 +0100 [thread overview]
Message-ID: <1437394750-5965-5-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/e1000/e1000_ethdev.h | 12 ++++++++++++
drivers/net/e1000/em_ethdev.c | 2 ++
drivers/net/e1000/em_rxtx.c | 38 ++++++++++++++++++++++++++++++++++++++
drivers/net/e1000/igb_ethdev.c | 4 ++++
drivers/net/e1000/igb_rxtx.c | 36 ++++++++++++++++++++++++++++++++++++
5 files changed, 92 insertions(+)
diff --git a/drivers/net/e1000/e1000_ethdev.h b/drivers/net/e1000/e1000_ethdev.h
index 4e69e44..7ee013a 100644
--- a/drivers/net/e1000/e1000_ethdev.h
+++ b/drivers/net/e1000/e1000_ethdev.h
@@ -307,6 +307,12 @@ void igb_pf_mbx_process(struct rte_eth_dev *eth_dev);
int igb_pf_host_configure(struct rte_eth_dev *eth_dev);
+void igb_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo);
+
+void igb_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo);
+
/*
* RX/TX EM function prototypes
*/
@@ -343,6 +349,12 @@ uint16_t eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
uint16_t eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
uint16_t nb_pkts);
+void em_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo);
+
+void em_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo);
+
void igb_pf_host_uninit(struct rte_eth_dev *dev);
#endif /* _E1000_ETHDEV_H_ */
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index d8c04e7..7cb8b0e 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -166,6 +166,8 @@ static const struct eth_dev_ops eth_em_ops = {
.mac_addr_add = eth_em_rar_set,
.mac_addr_remove = eth_em_rar_clear,
.set_mc_addr_list = eth_em_set_mc_addr_list,
+ .rxq_info_get = em_rxq_info_get,
+ .txq_info_get = em_txq_info_get,
};
/**
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 3b8776d..5778723 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -1881,3 +1881,41 @@ eth_em_tx_init(struct rte_eth_dev *dev)
/* This write will effectively turn on the transmit unit. */
E1000_WRITE_REG(hw, E1000_TCTL, tctl);
}
+
+void
+em_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo)
+{
+ struct em_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->max_desc = EM_MAX_RING_DESC;
+ qinfo->min_desc = EM_MIN_RING_DESC;
+
+ qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+}
+
+void
+em_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo)
+{
+ struct em_tx_queue *txq;
+
+ txq = dev->data->tx_queues[queue_id];
+
+ qinfo->nb_desc = txq->nb_tx_desc;
+ qinfo->max_desc = EM_MAX_RING_DESC;
+ qinfo->min_desc = EM_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;
+}
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index ddc7186..436405c 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -307,6 +307,8 @@ static const struct eth_dev_ops eth_igb_ops = {
.rss_hash_conf_get = eth_igb_rss_hash_conf_get,
.filter_ctrl = eth_igb_filter_ctrl,
.set_mc_addr_list = eth_igb_set_mc_addr_list,
+ .rxq_info_get = igb_rxq_info_get,
+ .txq_info_get = igb_txq_info_get,
.timesync_enable = igb_timesync_enable,
.timesync_disable = igb_timesync_disable,
.timesync_read_rx_timestamp = igb_timesync_read_rx_timestamp,
@@ -337,6 +339,8 @@ static const struct eth_dev_ops igbvf_eth_dev_ops = {
.tx_queue_setup = eth_igb_tx_queue_setup,
.tx_queue_release = eth_igb_tx_queue_release,
.set_mc_addr_list = eth_igb_set_mc_addr_list,
+ .rxq_info_get = igb_rxq_info_get,
+ .txq_info_get = igb_txq_info_get,
.mac_addr_set = igbvf_default_mac_addr_set,
.get_reg_length = igbvf_get_reg_length,
.get_reg = igbvf_get_regs,
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 3a31b21..5f047ca 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -2516,3 +2516,39 @@ eth_igbvf_tx_init(struct rte_eth_dev *dev)
}
}
+
+void
+igb_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo)
+{
+ struct igb_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->max_desc = IGB_MAX_RING_DESC;
+ qinfo->min_desc = IGB_MIN_RING_DESC;
+
+ qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+ qinfo->conf.rx_drop_en = rxq->drop_en;
+}
+
+void
+igb_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo)
+{
+ struct igb_tx_queue *txq;
+
+ txq = dev->data->tx_queues[queue_id];
+
+ qinfo->nb_desc = txq->nb_tx_desc;
+ qinfo->max_desc = IGB_MAX_RING_DESC;
+ qinfo->min_desc = IGB_MIN_RING_DESC;
+
+ qinfo->conf.tx_thresh.pthresh = txq->pthresh;
+ qinfo->conf.tx_thresh.hthresh = txq->hthresh;
+ qinfo->conf.tx_thresh.wthresh = txq->wthresh;
+}
--
1.8.3.1
next prev 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 ` [dpdk-dev] [PATCHv3 2/5] i40e: add support for eth_(rxq|txq)_info_get Konstantin Ananyev
2015-07-22 17:02 ` 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 ` Konstantin Ananyev [this message]
2015-07-22 17:04 ` [dpdk-dev] [PATCHv3 4/5] e1000: " 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-5-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).