[dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct

Ananyev, Konstantin konstantin.ananyev at intel.com
Tue Oct 20 11:52:02 CEST 2015



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Stephen Hemminger
> Sent: Monday, October 19, 2015 11:44 PM
> To: Amine Kherbouche
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
> 
> On Tue, 20 Oct 2015 00:06:19 +0200
> Amine Kherbouche <amine.kherbouche at 6wind.com> wrote:
> 
> > +	uint16_t used_desc;         /**< number of used descriptors */
> > +	uint16_t free_desc;         /**< number of free descriptors */
> 
> These two fields are obviously not SMP sfe.

I don't think they have to be.
>From my thinking it is just a snapshot of SW state of the queue, that could be used for statistics/watchdog/debugging purposes.

> Also, they are redundant with the existing queue_count API?

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


More information about the dev mailing list