[dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
Hi Konstantin > +/** > + * Ethernet device RX queue information structure. > + * Used to retieve information about configured queue. > + */ > +struct rte_eth_rxq_info { > + struct rte_mempool *mp; /**< mempool used by that queue. */ > + struct rte_eth_rxconf conf; /**< queue config parameters. */ > + uint8_t scattered_rx; /**< scattered packets RX supported. */ > + uint16_t nb_desc; /**< configured number of RXDs. */ Here i need two more fields in this struct : uint16_t free_desc : for free queue descriptors uint16_t used_desc : for used queue descriptors > +} __rte_cache_aligned; > + > +/** > + * Ethernet device TX queue information structure. > + * Used to retieve information about configured queue. > + */ > +struct rte_eth_txq_info { > + struct rte_eth_txconf conf; /**< queue config parameters. */ > + uint16_t nb_desc; /**< configured number of TXDs. */ And also here. > +} __rte_cache_aligned; > + > struct rte_eth_dev; How to add them without breaking API ? I would prefer to see them now, so I'll send an update on your patch series that i'll use this 2 more fields. The purpose will be to provide analysis of the usage of the RX and TX queues.
[dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
Hi Konstantin > Well, in general I am not opposed to add these fields to the structures. > In fact, I think it is a good thing to have. > But if we'll add them without making queue_info_get() feeling them properly - > it might create a lot of controversy. > So unless you prepared to make changes in all queue_info_get() too, > my opinion - let's leave it as it is for 2.2, and add new fields in later > releases. Thanks for your answer, I'm almost done with all changes in queue_info_get(), so i have just to test and send a series of v6 for your series. Best, Amine Kherbouche
[dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
> > So your v6 will make all implemented queue_info_get()s to fill these two new > fields correctly, right? > Konstantin Yes. Amine Kherbouche
[dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API.
This v6 series is an enhancement to queue information API v5. Amine Kherbouche (6): ethdev: enhance rte_eth_(tx|rx)q_info struct testpmd: enhance the command to display RX/TX queue information virtio: add support for eth_(rxq|txq)_info_get e1000: enhance eth_(rxq|txq)_info_get to retrieve more queue information i40e: enhance eth_(rxq|txq)_info_get to retrieve more queue information ixgbe: enhance eth_(rxq|txq)_info_get to retrieve more queue information app/test-pmd/config.c |8 ++-- drivers/net/e1000/em_rxtx.c|4 drivers/net/e1000/igb_rxtx.c |4 drivers/net/i40e/i40e_rxtx.c |4 drivers/net/ixgbe/ixgbe_rxtx.c |4 drivers/net/virtio/virtio_ethdev.c | 28 drivers/net/virtio/virtio_ethdev.h |4 lib/librte_ether/rte_ethdev.h |4 8 files changed, 58 insertions(+), 2 deletions(-) -- 1.7.10.4
[dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
Add 2 fields in struct rte_eth_(tx|rx)q_info : - used_desc : for used queue descriptors - free_desc : for free queue descriptors for ability to query more information from queues. Signed-off-by: Amine Kherbouche --- lib/librte_ether/rte_ethdev.h |4 1 file changed, 4 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 4d7b6f2..5fc86a0 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -874,6 +874,8 @@ struct rte_eth_rxq_info { struct rte_eth_rxconf conf; /**< queue config parameters. */ uint8_t scattered_rx; /**< scattered packets RX supported. */ uint16_t nb_desc; /**< configured number of RXDs. */ + uint16_t used_desc; /**< number of used descriptors */ + uint16_t free_desc; /**< number of free descriptors */ } __rte_cache_aligned; /** @@ -883,6 +885,8 @@ struct rte_eth_rxq_info { struct rte_eth_txq_info { struct rte_eth_txconf conf; /**< queue config parameters. */ uint16_t nb_desc; /**< configured number of TXDs. */ + uint16_t used_desc; /**< number of used descriptors */ + uint16_t free_desc; /**< number of free descriptors */ } __rte_cache_aligned; struct rte_eth_dev; -- 1.7.10.4
[dpdk-dev] [dpdk-dev, PATCHv6 2/6] testpmd: enhance the command to display RX/TX queue information
Display the additional information added in rte_eth_txq_info struct for queue descriptors. Signed-off-by: Amine Kherbouche --- app/test-pmd/config.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index aad2ab6..761519f 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -321,7 +321,9 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id) (qinfo.conf.rx_deferred_start != 0) ? "on" : "off"); printf("\nRX scattered packets: %s", (qinfo.scattered_rx != 0) ? "on" : "off"); - printf("\nNumber of RXDs: %hu", qinfo.nb_desc); + printf("\nNumber of Total RXDs: %hu", qinfo.nb_desc); + printf("\nNumber of Used RXDs: %hu",qinfo.used_desc); + printf("\nNumber of Free RXDs: %hu",qinfo.free_desc); printf("\n"); } @@ -351,7 +353,9 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id) printf("\nTX flags: %#x", qinfo.conf.txq_flags); printf("\nTX deferred start: %s", (qinfo.conf.tx_deferred_start != 0) ? "on" : "off"); - printf("\nNumber of TXDs: %hu", qinfo.nb_desc); + printf("\nNumber of Total TXDs: %hu", qinfo.nb_desc); + printf("\nNumber of Used TXDs: %hu",qinfo.used_desc); + printf("\nNumber of Free TXDs: %hu",qinfo.free_desc); printf("\n"); } -- 1.7.10.4
[dpdk-dev] [dpdk-dev, PATCHv6 3/6] virtio: add support for eth_(rxq|txq)_info_get
In the case of virtio, there are many fields in rte_eth_(tx|rxq)_info struct that aren't set in this function because those fields are missed in virtqueue struct. Signed-off-by: Amine Kherbouche --- drivers/net/virtio/virtio_ethdev.c | 28 drivers/net/virtio/virtio_ethdev.h |4 2 files changed, 32 insertions(+) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 465d3cd..6118913 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -580,6 +580,8 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .mac_addr_add= virtio_mac_addr_add, .mac_addr_remove = virtio_mac_addr_remove, .mac_addr_set= virtio_mac_addr_set, + .rxq_info_get= virtio_rxq_info_get, + .txq_info_get= virtio_txq_info_get, }; static inline int @@ -1574,4 +1576,30 @@ static struct rte_driver rte_virtio_driver = { .init = rte_virtio_pmd_init, }; +void +virtio_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rxq_info *qinfo) +{ + struct virtqueue *rxq; + + rxq = dev->data->rx_queues[queue_id]; + + qinfo->nb_desc = rxq->vq_nentries; + qinfo->used_desc = rxq->vq_nentries - rxq->vq_free_cnt; + qinfo->free_desc= rxq->vq_free_cnt; +} + +void +virtio_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_txq_info *qinfo) +{ + struct virtqueue *txq; + + txq = dev->data->tx_queues[queue_id]; + + qinfo->nb_desc = txq->vq_nentries; + qinfo->used_desc = txq->vq_nentries - txq->vq_free_cnt; + qinfo->free_desc= txq->vq_free_cnt; +} + PMD_REGISTER_DRIVER(rte_virtio_driver); diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h index 9026d42..1bbe421 100644 --- a/drivers/net/virtio/virtio_ethdev.h +++ b/drivers/net/virtio/virtio_ethdev.h @@ -107,7 +107,11 @@ uint16_t virtio_recv_mergeable_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +void virtio_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, +struct rte_eth_rxq_info *qinfo); +void virtio_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, +struct rte_eth_txq_info *qinfo); /* * The VIRTIO_NET_F_GUEST_TSO[46] features permit the host to send us -- 1.7.10.4
[dpdk-dev] [dpdk-dev, PATCHv6 4/6] e1000: enhance eth_(rxq|txq)_info_get to retrieve more queue information
Enhance both functions of e1000 and igb to retrieve more informations about queue descriptors according to new adds on rte_eth_(tx|rx)q_info struct Signed-off-by: Amine Kherbouche --- drivers/net/e1000/em_rxtx.c |4 drivers/net/e1000/igb_rxtx.c |4 2 files changed, 8 insertions(+) diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 03e1bc2..1ff750b 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -1873,6 +1873,8 @@ em_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->mp = rxq->mb_pool; qinfo->scattered_rx = dev->data->scattered_rx; qinfo->nb_desc = rxq->nb_rx_desc; + qinfo->used_desc = (uint16_t)eth_em_rx_queue_count(dev, queue_id); + qinfo->free_desc = qinfo->nb_desc - qinfo->used_desc; qinfo->conf.rx_free_thresh = rxq->rx_free_thresh; } @@ -1885,6 +1887,8 @@ em_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; diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index cca3300..4956075 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -2483,6 +2483,8 @@ igb_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->mp = rxq->mb_pool; qinfo->scattered_rx = dev->data->scattered_rx; qinfo->nb_desc = rxq->nb_rx_desc; + qinfo->used_desc = eth_igb_rx_queue_count(dev, rxq->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; @@ -2497,6 +2499,8 @@ igb_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->used_desc = txq->tx_tail - txq->tx_head % txq->nb_tx_desc; + qinfo->free_desc = qinfo->nb_desc - qinfo->used_desc; qinfo->conf.tx_thresh.pthresh = txq->pthresh; qinfo->conf.tx_thresh.hthresh = txq->hthresh; -- 1.7.10.4
[dpdk-dev] [dpdk-dev, PATCHv6 5/6] i40e: enhance eth_(rxq|txq)_info_get to retrieve more queue information
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 --- 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
[dpdk-dev] [dpdk-dev, PATCHv6 6/6] ixgbe: enhance eth_(rxq|txq)_info_get to retrieve more queue information
According to new adds on struct rte_eth_rxq_info, some adds are done to this function to retreive information about used and free queue descriptors. Signed-off-by: Amine Kherbouche --- drivers/net/ixgbe/ixgbe_rxtx.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index ba08588..318d50f 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -4641,6 +4641,8 @@ ixgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->mp = rxq->mb_pool; qinfo->scattered_rx = dev->data->scattered_rx; qinfo->nb_desc = rxq->nb_rx_desc; + qinfo->used_desc = (uint16_t)ixgbe_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; @@ -4656,6 +4658,8 @@ ixgbe_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->used_desc = txq->nb_tx_used; + qinfo->free_desc = txq->nb_tx_free + 1; qinfo->conf.tx_thresh.pthresh = txq->pthresh; qinfo->conf.tx_thresh.hthresh = txq->hthresh; -- 1.7.10.4
[dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
> Yep, similar thought here: > In the for Intel HW implementations: > qinfo->used_desc = ixgbe_dev_rx_queue_count(dev, queue_id); > It seems a bit redundant, as if user wants to know HW state it can call > rte_eth_rx_queue_count() directly. > From other side: rte_eth_rx_queue_count() is quite heavyweight function, > as it scans HW descriptors to check their status. > I think it should be better to return here just a snapshot of SW state: > how many free/used RXDs are from PMD perspective > (by collecting info from *_rx_queue structure, without reading actual HW > registers/descriptors - as you done for TX queue info). > > Konstantin > Yes, Konstantin is right, it is a light solution to get an snapshot of the state of the queues.
[dpdk-dev] [PATCH] remove unused ring includes
This patch removes all unused headers. Signed-off-by: Amine Kherbouche --- app/test-pipeline/config.c | 1 - app/test-pipeline/main.c | 1 - app/test-pmd/config.c | 1 - app/test-pmd/csumonly.c| 1 - app/test-pmd/flowgen.c | 1 - app/test-pmd/icmpecho.c| 1 - app/test-pmd/iofwd.c | 1 - app/test-pmd/macfwd.c | 1 - app/test-pmd/macswap.c | 1 - app/test-pmd/parameters.c | 1 - app/test-pmd/rxonly.c | 1 - app/test-pmd/testpmd.c | 1 - app/test-pmd/txonly.c | 1 - app/test/test_mempool.c| 1 - app/test/test_mempool_perf.c | 1 - drivers/crypto/qat/qat_crypto.c| 1 - drivers/net/e1000/em_rxtx.c| 1 - drivers/net/e1000/igb_rxtx.c | 1 - drivers/net/ixgbe/ixgbe_rxtx.c | 1 - drivers/net/vmxnet3/vmxnet3_rxtx.c | 1 - drivers/net/xenvirt/rte_eth_xenvirt.h | 1 - examples/bond/main.c | 1 - examples/dpdk_qat/crypto.c | 1 - examples/dpdk_qat/main.c | 1 - examples/exception_path/main.c | 1 - examples/ip_fragmentation/main.c | 1 - examples/ip_pipeline/pipeline/pipeline_common_be.c | 1 - examples/ip_pipeline/pipeline/pipeline_common_fe.c | 1 - examples/ip_reassembly/main.c | 1 - examples/ipv4_multicast/main.c | 1 - examples/kni/main.c| 1 - examples/l2fwd-crypto/main.c | 1 - examples/l2fwd-jobstats/main.c | 1 - examples/l2fwd-keepalive/main.c| 1 - examples/l2fwd/main.c | 1 - examples/l3fwd-acl/main.c | 1 - examples/l3fwd-power/main.c| 1 - examples/l3fwd-vf/main.c | 1 - examples/l3fwd/l3fwd_em.c | 1 - examples/l3fwd/l3fwd_lpm.c | 1 - examples/l3fwd/main.c | 1 - examples/link_status_interrupt/main.c | 1 - examples/load_balancer/config.c| 1 - examples/load_balancer/main.c | 1 - examples/multi_process/l2fwd_fork/flib.c | 1 - examples/multi_process/symmetric_mp/main.c | 1 - examples/performance-thread/common/lthread_int.h | 1 - examples/quota_watermark/qwctl/qwctl.c | 1 - examples/vmdq/main.c | 1 - examples/vmdq_dcb/main.c | 1 - lib/librte_cryptodev/rte_cryptodev.c | 1 - lib/librte_ether/rte_ethdev.c | 1 - lib/librte_mbuf/rte_mbuf.c | 1 - lib/librte_mempool/rte_mempool.c | 1 - 54 files changed, 54 deletions(-) diff --git a/app/test-pipeline/config.c b/app/test-pipeline/config.c index 72e018c..c7bc937 100644 --- a/app/test-pipeline/config.c +++ b/app/test-pipeline/config.c @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pipeline/main.c b/app/test-pipeline/main.c index 685ebd4..c57e4dd 100644 --- a/app/test-pipeline/main.c +++ b/app/test-pipeline/main.c @@ -64,7 +64,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index bfcbff9..83bebfe 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -84,7 +84,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index ac4bd8f..21cb78f 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index a6abe91..379ee01 100644 --- a/app/test-pmd/flowgen.c +++ b/app/test-pmd/flowgen.c @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c index be308c9..6a4e750 100644 --- a/app/test-pmd/icmpecho.c +++ b/app/test-pmd/icmpecho.c @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/iofwd.c b/app/test-pmd/iofwd.c index 7b6033a..26936b7 100644 --- a/app/test-pmd/iofwd.c +++ b/app/test-pmd/iofwd.c @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test