[dpdk-dev,PATCHv4,1/5] ethdev: add new API to retrieve RX/TX queue information

Message ID 1437589735-30041-2-git-send-email-konstantin.ananyev@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Ananyev, Konstantin July 22, 2015, 6:28 p.m. UTC
  Add the ability for the upper layer to query RX/TX queue information.

Add new structures:
struct rte_eth_rxq_info
struct rte_eth_txq_info

new functions:
rte_eth_rx_queue_info_get
rte_eth_tx_queue_info_get

into rte_etdev API.

Left extra free space in the queue info structures,
so extra fields could be added later without ABI breakage.

v2 changes:
- Add formal check for the qinfo input parameter.
- As suggested rename 'rx_qinfo/tx_qinfo' to 'rxq_info/txq_info'

v3 changes:
- Updated rte_ether_version.map
- Merged with latest changes

v4 changes:
- rte_ether_version.map: move new functions into DPDK_2.1 sub-space.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 lib/librte_ether/rte_ethdev.c          | 54 +++++++++++++++++++++
 lib/librte_ether/rte_ethdev.h          | 87 +++++++++++++++++++++++++++++++---
 lib/librte_ether/rte_ether_version.map |  2 +
 3 files changed, 137 insertions(+), 6 deletions(-)
  

Comments

Stephen Hemminger July 22, 2015, 7:48 p.m. UTC | #1
On Wed, 22 Jul 2015 19:28:51 +0100
Konstantin Ananyev <konstantin.ananyev@intel.com> wrote:

> Add the ability for the upper layer to query RX/TX queue information.
> 
> Add new structures:
> struct rte_eth_rxq_info
> struct rte_eth_txq_info
> 
> new functions:
> rte_eth_rx_queue_info_get
> rte_eth_tx_queue_info_get
> 
> into rte_etdev API.
> 
> Left extra free space in the queue info structures,
> so extra fields could be added later without ABI breakage.
> 
> v2 changes:
> - Add formal check for the qinfo input parameter.
> - As suggested rename 'rx_qinfo/tx_qinfo' to 'rxq_info/txq_info'
> 
> v3 changes:
> - Updated rte_ether_version.map
> - Merged with latest changes
> 
> v4 changes:
> - rte_ether_version.map: move new functions into DPDK_2.1 sub-space.
> 
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Since all this data should be rxconf already, Is it possible
to do a generic version of this and not have to change every driver.

You only handled the Intel hardware drivers. But there also
all the virtual drivers, other vendors etc.
  
Ananyev, Konstantin July 23, 2015, 10:52 a.m. UTC | #2
> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Wednesday, July 22, 2015 8:48 PM
> To: Ananyev, Konstantin
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCHv4 1/5] ethdev: add new API to retrieve RX/TX queue information
> 
> On Wed, 22 Jul 2015 19:28:51 +0100
> Konstantin Ananyev <konstantin.ananyev@intel.com> wrote:
> 
> > Add the ability for the upper layer to query RX/TX queue information.
> >
> > Add new structures:
> > struct rte_eth_rxq_info
> > struct rte_eth_txq_info
> >
> > new functions:
> > rte_eth_rx_queue_info_get
> > rte_eth_tx_queue_info_get
> >
> > into rte_etdev API.
> >
> > Left extra free space in the queue info structures,
> > so extra fields could be added later without ABI breakage.
> >
> > v2 changes:
> > - Add formal check for the qinfo input parameter.
> > - As suggested rename 'rx_qinfo/tx_qinfo' to 'rxq_info/txq_info'
> >
> > v3 changes:
> > - Updated rte_ether_version.map
> > - Merged with latest changes
> >
> > v4 changes:
> > - rte_ether_version.map: move new functions into DPDK_2.1 sub-space.
> >
> > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 
> Since all this data should be rxconf already, Is it possible
> to do a generic version of this and not have to change every driver.

I don't think it is possible to implement these two functions at rte_etdev level only.
At least not with current ethdev/PMD implementation:
-  Inside struct rte_eth_dev_info we have only: 'struct rte_eth_rxconf default_rxconf;'.
We don't have rxconf here for each configured rx queue.
That information is maintained by PMD and inside PMD, different devices have different format for queue structure.
- rte_eth_rxq_info contains not only rxconf but some extra information: mempool in use by that queue,
 min/max possible number of descriptors.
 Also my intention was that in future that structure would be extended to provide some RT info about queue:
 (number of free/used descriptors from SW point of view, etc).  

Konstantin

> 
> You only handled the Intel hardware drivers. But there also
> all the virtual drivers, other vendors etc.
  
Thomas Monjalon July 23, 2015, 4:17 p.m. UTC | #3
2015-07-23 10:52, Ananyev, Konstantin:
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Konstantin Ananyev <konstantin.ananyev@intel.com> wrote:
> > > Add the ability for the upper layer to query RX/TX queue information.
[...]
> > Since all this data should be rxconf already, Is it possible
> > to do a generic version of this and not have to change every driver.
> 
> I don't think it is possible to implement these two functions at rte_etdev level only.
> At least not with current ethdev/PMD implementation:
> -  Inside struct rte_eth_dev_info we have only: 'struct rte_eth_rxconf default_rxconf;'.
> We don't have rxconf here for each configured rx queue.
> That information is maintained by PMD and inside PMD, different devices have different format for queue structure.
> - rte_eth_rxq_info contains not only rxconf but some extra information: mempool in use by that queue,
>  min/max possible number of descriptors.
>  Also my intention was that in future that structure would be extended to provide some RT info about queue:
>  (number of free/used descriptors from SW point of view, etc).  

Isn't it what rte_eth_rx_queue_count() provides?
Maybe we should deprecate it in favor of rte_eth_rx_queue_info_get().
  
Thomas Monjalon July 23, 2015, 4:26 p.m. UTC | #4
2015-07-22 19:28, Konstantin Ananyev:
> +	if (!rte_eth_dev_is_valid_port(port_id)) {
> +		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
> +		return -EINVAL;
> +	}

Please use VALID_PORTID_OR_ERR_RET.

> + * Ethernet device RX queue information strcuture.

Typo here (and same for TX).

> +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. */

Shouldn't we move nb_desc in rte_eth_rxconf?
So rte_eth_rx_queue_setup() would have less parameters.

> -#ifdef __cplusplus
> -}
> -#endif
> -
>  /**
>   * Set the list of multicast addresses to filter on an Ethernet device.
>   *
> @@ -3882,4 +3952,9 @@ extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
>   */
>  extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
>  					      struct timespec *timestamp);
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
>  #endif /* _RTE_ETHDEV_H_ */

Please send this change in a separate patch alone.
  
Ananyev, Konstantin July 24, 2015, 9:05 a.m. UTC | #5
Hi Thomas,

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Thursday, July 23, 2015 5:17 PM
> To: Ananyev, Konstantin
> Cc: dev@dpdk.org; Stephen Hemminger
> Subject: Re: [dpdk-dev] [PATCHv4 1/5] ethdev: add new API to retrieve RX/TX queue information
> 
> 2015-07-23 10:52, Ananyev, Konstantin:
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > > Konstantin Ananyev <konstantin.ananyev@intel.com> wrote:
> > > > Add the ability for the upper layer to query RX/TX queue information.
> [...]
> > > Since all this data should be rxconf already, Is it possible
> > > to do a generic version of this and not have to change every driver.
> >
> > I don't think it is possible to implement these two functions at rte_etdev level only.
> > At least not with current ethdev/PMD implementation:
> > -  Inside struct rte_eth_dev_info we have only: 'struct rte_eth_rxconf default_rxconf;'.
> > We don't have rxconf here for each configured rx queue.
> > That information is maintained by PMD and inside PMD, different devices have different format for queue structure.
> > - rte_eth_rxq_info contains not only rxconf but some extra information: mempool in use by that queue,
> >  min/max possible number of descriptors.
> >  Also my intention was that in future that structure would be extended to provide some RT info about queue:
> >  (number of free/used descriptors from SW point of view, etc).
> 
> Isn't it what rte_eth_rx_queue_count() provides?

Not exactly.
rte_eth_rx_queue_count() actually scans HW descriptors to check their status.
I was thinking about returning just a snapshot of SW state: how many free/used RXDs are from PMD perspective
(just by collecting info from *_rx_queue structure, without reading actual HW registers/descriptors).
Anyway, right now it is not implemented - it is just a thought for future expansion.
Konstantin


> Maybe we should deprecate it in favor of rte_eth_rx_queue_info_get().
  
Ananyev, Konstantin July 24, 2015, 9:15 a.m. UTC | #6
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Thursday, July 23, 2015 5:26 PM
> To: Ananyev, Konstantin
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCHv4 1/5] ethdev: add new API to retrieve RX/TX queue information
> 
> 2015-07-22 19:28, Konstantin Ananyev:
> > +	if (!rte_eth_dev_is_valid_port(port_id)) {
> > +		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
> > +		return -EINVAL;
> > +	}
> 
> Please use VALID_PORTID_OR_ERR_RET.
> 
> > + * Ethernet device RX queue information strcuture.
> 
> Typo here (and same for TX).
> 
> > +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. */
> 
> Shouldn't we move nb_desc in rte_eth_rxconf?
> So rte_eth_rx_queue_setup() would have less parameters.

I thought about that too, but it seems more drawbacks then pluses with that idea:
1. Right now it is possible to call rte_eth_rx_queue_setup(..., rx_conf=NULL, ...);
In that case rte_eth_rx_queue_setup()will use default for that device rx_conf.
If we'll move mempool into rxconf, will break that ability.
2.  A bit unclear what mempool should be returned as default_rxconf by rte_eth_dev_info_get().
Should it be just NULL.
3. ABI breakage and we (and all customers) will need  to modify each and every RX setup/configure code.

For me it just seems like too much hassle, without any clear advanatage.

> 
> > -#ifdef __cplusplus
> > -}
> > -#endif
> > -
> >  /**
> >   * Set the list of multicast addresses to filter on an Ethernet device.
> >   *
> > @@ -3882,4 +3952,9 @@ extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
> >   */
> >  extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
> >  					      struct timespec *timestamp);
> > +
> > +#ifdef __cplusplus
> > +}
> > +#endif
> > +
> >  #endif /* _RTE_ETHDEV_H_ */
> 
> Please send this change in a separate patch alone.

Ok, will do.

Konstantin
  
Thomas Monjalon July 24, 2015, 9:24 a.m. UTC | #7
2015-07-24 09:15, Ananyev, Konstantin:
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > 2015-07-22 19:28, Konstantin Ananyev:
> > > +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. */
> > 
> > Shouldn't we move nb_desc in rte_eth_rxconf?
> > So rte_eth_rx_queue_setup() would have less parameters.
> 
> I thought about that too, but it seems more drawbacks then pluses with that idea:
> 1. Right now it is possible to call rte_eth_rx_queue_setup(..., rx_conf=NULL, ...);
> In that case rte_eth_rx_queue_setup()will use default for that device rx_conf.
> If we'll move mempool into rxconf, will break that ability.
> 2.  A bit unclear what mempool should be returned as default_rxconf by rte_eth_dev_info_get().
> Should it be just NULL.

I was only suggesting to move nb_desc, not mempool.
In case rx_conf==NULL, the nb_desc should be the max allowed by the driver.
By the way, we should allow nb_desc==0 as it is done in virtio.
Users shouldn't have to care about queue parameters (including nb_desc) for
a basic usage.

> 3. ABI breakage and we (and all customers) will need  to modify each and every RX setup/configure code.
> 
> For me it just seems like too much hassle, without any clear advanatage.

The advantage is to have a cleaner API. Seems important to me.
  
Ananyev, Konstantin July 24, 2015, 10:50 a.m. UTC | #8
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Friday, July 24, 2015 10:24 AM
> To: Ananyev, Konstantin
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCHv4 1/5] ethdev: add new API to retrieve RX/TX queue information
> 
> 2015-07-24 09:15, Ananyev, Konstantin:
> > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > 2015-07-22 19:28, Konstantin Ananyev:
> > > > +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. */
> > >
> > > Shouldn't we move nb_desc in rte_eth_rxconf?
> > > So rte_eth_rx_queue_setup() would have less parameters.
> >
> > I thought about that too, but it seems more drawbacks then pluses with that idea:
> > 1. Right now it is possible to call rte_eth_rx_queue_setup(..., rx_conf=NULL, ...);
> > In that case rte_eth_rx_queue_setup()will use default for that device rx_conf.
> > If we'll move mempool into rxconf, will break that ability.
> > 2.  A bit unclear what mempool should be returned as default_rxconf by rte_eth_dev_info_get().
> > Should it be just NULL.
> 
> I was only suggesting to move nb_desc, not mempool.

Ah, sorry didn't read it properly first time.
Yes, I think it makes sense to move nb_desc into rxconf, though that means ABI breakage,
and that patch would definitely not make into 2.1. 

> In case rx_conf==NULL, the nb_desc should be the max allowed by the driver.

In my opinion it should be 'preferable by default' PMD value.
Plus, rte_eth_dev_info should contain  min_rx_desc and max_rx_desc,
so user can select nb_rx_desc from the allowed interval, if he needs to.

Konstantin

> By the way, we should allow nb_desc==0 as it is done in virtio.
> Users shouldn't have to care about queue parameters (including nb_desc) for
> a basic usage.
> 
> > 3. ABI breakage and we (and all customers) will need  to modify each and every RX setup/configure code.
> >
> > For me it just seems like too much hassle, without any clear advanatage.
> 
> The advantage is to have a cleaner API. Seems important to me.
  
Thomas Monjalon July 24, 2015, 12:40 p.m. UTC | #9
2015-07-24 10:50, Ananyev, Konstantin:
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > 2015-07-24 09:15, Ananyev, Konstantin:
> > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > > 2015-07-22 19:28, Konstantin Ananyev:
> > > > > +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. */
> > > >
> > > > Shouldn't we move nb_desc in rte_eth_rxconf?
> > > > So rte_eth_rx_queue_setup() would have less parameters.
> > >
> > > I thought about that too, but it seems more drawbacks then pluses with that idea:
> > > 1. Right now it is possible to call rte_eth_rx_queue_setup(..., rx_conf=NULL, ...);
> > > In that case rte_eth_rx_queue_setup()will use default for that device rx_conf.
> > > If we'll move mempool into rxconf, will break that ability.
> > > 2.  A bit unclear what mempool should be returned as default_rxconf by rte_eth_dev_info_get().
> > > Should it be just NULL.
> > 
> > I was only suggesting to move nb_desc, not mempool.
> 
> Ah, sorry didn't read it properly first time.
> Yes, I think it makes sense to move nb_desc into rxconf, though that means ABI breakage,
> and that patch would definitely not make into 2.1.

You can avoid ABI breakage by using the compat macros and/or NEXT_ABI.
But it shouldn't go into 2.1 as the API shouldn't be changed after RC1.
  

Patch

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 94104ce..a94c119 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3341,6 +3341,60 @@  rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id,
 }
 
 int
+rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo)
+{
+	struct rte_eth_dev *dev;
+
+	if (qinfo == NULL)
+		return -EINVAL;
+
+	if (!rte_eth_dev_is_valid_port(port_id)) {
+		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
+		return -EINVAL;
+	}
+
+	dev = &rte_eth_devices[port_id];
+	if (queue_id >= dev->data->nb_rx_queues) {
+		PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
+		return -EINVAL;
+	}
+
+	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rxq_info_get, -ENOTSUP);
+
+	memset(qinfo, 0, sizeof(*qinfo));
+	dev->dev_ops->rxq_info_get(dev, queue_id, qinfo);
+	return 0;
+}
+
+int
+rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo)
+{
+	struct rte_eth_dev *dev;
+
+	if (qinfo == NULL)
+		return -EINVAL;
+
+	if (!rte_eth_dev_is_valid_port(port_id)) {
+		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
+		return -EINVAL;
+	}
+
+	dev = &rte_eth_devices[port_id];
+	if (queue_id >= dev->data->nb_tx_queues) {
+		PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+		return -EINVAL;
+	}
+
+	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->txq_info_get, -ENOTSUP);
+
+	memset(qinfo, 0, sizeof(*qinfo));
+	dev->dev_ops->txq_info_get(dev, queue_id, qinfo);
+	return 0;
+}
+
+int
 rte_eth_dev_set_mc_addr_list(uint8_t port_id,
 			     struct ether_addr *mc_addr_set,
 			     uint32_t nb_mc_addr)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index c901a2c..0c6705e 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -960,6 +960,30 @@  struct rte_eth_xstats {
 	uint64_t value;
 };
 
+/**
+ * Ethernet device RX queue information strcuture.
+ * 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. */
+	uint16_t max_desc;          /**< max allowed number of RXDs. */
+	uint16_t min_desc;          /**< min allowed number of RXDs. */
+} __rte_cache_aligned;
+
+/**
+ * Ethernet device TX queue information strcuture.
+ * 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. */
+	uint16_t max_desc;          /**< max allowed number of TXDs. */
+	uint16_t min_desc;          /**< min allowed number of TXDs. */
+} __rte_cache_aligned;
+
 struct rte_eth_dev;
 
 struct rte_eth_dev_callback;
@@ -1063,6 +1087,12 @@  typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
 typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
 /**< @internal Check DD bit of specific RX descriptor */
 
+typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
+	uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
+
+typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
+	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
+
 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
 /**< @internal Set MTU. */
 
@@ -1451,9 +1481,13 @@  struct eth_dev_ops {
 	rss_hash_update_t rss_hash_update;
 	/** Get current RSS hash configuration. */
 	rss_hash_conf_get_t rss_hash_conf_get;
-	eth_filter_ctrl_t              filter_ctrl;          /**< common filter control*/
+	eth_filter_ctrl_t              filter_ctrl;
+	/**< common filter control. */
 	eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs */
-
+	eth_rxq_info_get_t rxq_info_get;
+	/**< retrieve RX queue information. */
+	eth_txq_info_get_t txq_info_get;
+	/**< retrieve TX queue information. */
 	/** Turn IEEE1588/802.1AS timestamping on. */
 	eth_timesync_enable_t timesync_enable;
 	/** Turn IEEE1588/802.1AS timestamping off. */
@@ -3721,6 +3755,46 @@  int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id,
 		struct rte_eth_rxtx_callback *user_cb);
 
 /**
+ * Retrieve information about given port's RX queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param queue_id
+ *   The RX queue on the Ethernet device for which information
+ *   will be retrieved.
+ * @param qinfo
+ *   A pointer to a structure of type *rte_eth_rxq_info_info* to be filled with
+ *   the information of the Ethernet device.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The port_id or the queue_id is out of range.
+ */
+int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo);
+
+/**
+ * Retrieve information about given port's TX queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param queue_id
+ *   The TX queue on the Ethernet device for which information
+ *   will be retrieved.
+ * @param qinfo
+ *   A pointer to a structure of type *rte_eth_txq_info_info* to be filled with
+ *   the information of the Ethernet device.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The port_id or the queue_id is out of range.
+ */
+int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo);
+
+/*
  * Retrieve number of available registers for access
  *
  * @param port_id
@@ -3793,10 +3867,6 @@  int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info);
  */
 int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info);
 
-#ifdef __cplusplus
-}
-#endif
-
 /**
  * Set the list of multicast addresses to filter on an Ethernet device.
  *
@@ -3882,4 +3952,9 @@  extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
  */
 extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
 					      struct timespec *timestamp);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_ETHDEV_H_ */
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index 23cfee9..2bae2cf 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -117,9 +117,11 @@  DPDK_2.1 {
 	rte_eth_dev_is_valid_port;
 	rte_eth_dev_set_eeprom;
 	rte_eth_dev_set_mc_addr_list;
+	rte_eth_rx_queue_info_get;
 	rte_eth_timesync_disable;
 	rte_eth_timesync_enable;
 	rte_eth_timesync_read_rx_timestamp;
 	rte_eth_timesync_read_tx_timestamp;
+	rte_eth_tx_queue_info_get;
 
 } DPDK_2.0;