[dpdk-dev] [dpdk-dev, PATCHv6 5/6] i40e: enhance eth_(rxq|txq)_info_get to retrieve more queue information

Amine Kherbouche amine.kherbouche at 6wind.com
Tue Oct 20 00:06:23 CEST 2015


According to new fields in struct rte_eth_rxq_info, those are filled to
add additional information about queue descriptors.

Signed-off-by: Amine Kherbouche <amine.kherbouche at 6wind.com>
---
 drivers/net/i40e/i40e_rxtx.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index fa1451e..e958d56 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3075,6 +3075,8 @@ i40e_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->mp = rxq->mp;
 	qinfo->scattered_rx = dev->data->scattered_rx;
 	qinfo->nb_desc = rxq->nb_rx_desc;
+	qinfo->used_desc = (uint16_t)i40e_dev_rx_queue_count(dev, queue_id);
+	qinfo->free_desc = qinfo->nb_desc  - qinfo->used_desc;
 
 	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
 	qinfo->conf.rx_drop_en = rxq->drop_en;
@@ -3090,6 +3092,8 @@ i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	txq = dev->data->tx_queues[queue_id];
 
 	qinfo->nb_desc = txq->nb_tx_desc;
+	qinfo->free_desc = txq->nb_tx_free;
+	qinfo->used_desc = qinfo->nb_desc - qinfo->free_desc;
 
 	qinfo->conf.tx_thresh.pthresh = txq->pthresh;
 	qinfo->conf.tx_thresh.hthresh = txq->hthresh;
-- 
1.7.10.4



More information about the dev mailing list