From: Reshma Pattan Date: Wed, 15 Jun 2016 14:06:20 +0000 (+0100) Subject: ethdev: get queues numbers X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=00851d47f7be47e45bbc4e502a438921642cd965;p=dpdk.git ethdev: get queues numbers The new fields nb_rx_queues and nb_tx_queues are added to the rte_eth_dev_info structure. Changes to API rte_eth_dev_info_get() are done to update these new fields to the rte_eth_dev_info object. Release notes is updated with the changes. The librte_pdump library needs to register Rx and Tx callbacks for all the nb_rx_queues and nb_tx_queues, when application wants to capture the packets on all the software configured number of Rx and Tx queues of the device. So far there is no support to get nb_rx_queues and nb_tx_queues information from the ethdev library. Hence these changes are introduced. Signed-off-by: Reshma Pattan Acked-by: Konstantin Ananyev --- diff --git a/doc/guides/rel_notes/release_16_07.rst b/doc/guides/rel_notes/release_16_07.rst index ff8cc0d8f0..58a49c48ed 100644 --- a/doc/guides/rel_notes/release_16_07.rst +++ b/doc/guides/rel_notes/release_16_07.rst @@ -148,6 +148,9 @@ API Changes * The extended statistics are fetched by ids with ``rte_eth_xstats_get`` after a lookup by name ``rte_eth_xstats_get_names``. +* The function ``rte_eth_dev_info_get`` fill the new fields ``nb_rx_queues`` + and ``nb_tx_queues`` in the structure ``rte_eth_dev_info``. + ABI Changes ----------- @@ -159,6 +162,9 @@ ABI Changes * The ``rte_port_source_params`` structure has new fields to support PCAP file. It was already in release 16.04 with ``RTE_NEXT_ABI`` flag. +* The ``rte_eth_dev_info`` structure has new fields ``nb_rx_queues`` and ``nb_tx_queues`` + to support number of queues configured by software. + Shared Library Versions ----------------------- diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 3a304437f3..53bb865513 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1735,6 +1735,8 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) (*dev->dev_ops->dev_infos_get)(dev, dev_info); dev_info->pci_dev = dev->pci_dev; dev_info->driver_name = dev->data->drv_name; + dev_info->nb_rx_queues = dev->data->nb_rx_queues; + dev_info->nb_tx_queues = dev->data->nb_tx_queues; } int diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index c7983d3c8c..f39199a542 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -882,6 +882,9 @@ struct rte_eth_dev_info { struct rte_eth_desc_lim rx_desc_lim; /**< RX descriptors limits */ struct rte_eth_desc_lim tx_desc_lim; /**< TX descriptors limits */ uint32_t speed_capa; /**< Supported speeds bitmap (ETH_LINK_SPEED_). */ + /** Configured number of rx/tx queues */ + uint16_t nb_rx_queues; /**< Number of RX queues. */ + uint16_t nb_tx_queues; /**< Number of TX queues. */ }; /**