[dpdk-dev] [PATCH] ethdev: check number of queues less than RTE_ETHDEV_QUEUE_STAT_CNTRS

Bert van Leeuwen bert.vanleeuwen at netronome.com
Fri Nov 11 10:48:15 CET 2016

> On 11 Nov 2016, at 11:29 AM, Thomas Monjalon <thomas.monjalon at 6wind.com> wrote:
> 2016-11-11 09:16, Alejandro Lucero:
>> Thomas,
>> We are wondering if you realize this patch fixes a bug with current ethdev
>> code as a device can have more than RTE_ETHDEV_QUEUE_STAT_CNTRS.
>> Maybe the commit message is giving the wrong impression and as you
>> commented, it should just focus on the bug it fixes and to leave for
>> another email thread the discussion of how to solve the
>> problem.
>> Should we remove this from patchwork and to send another patch that way?
> Yes please. It was my first comment, we don't understand the exact issue
> you are fixing.

In a nutshell, the rte_eth_xstats_get function was reading memory beyond what was stored in the internal arrays (and thus returning junk values). The patch simply prevents it from going out of bounds, it does not address the issue that the rest of the counters are lost though. This issue is not specific to our device, in fact we found it while using a multiqueue virtio device (32 queues), and traced the issue into this core ethdev functionality.

> And I have a bad feeling it could break something else (really just a feeling).
> It is not the kind of patch we can apply the last day of a release.
> That's why I think it should wait 17.02.
> Of course you can try to convince me and others to apply it as a last minute
> patch. But why are you sending a patch on the generic API in the last days?
> Last argument: it is not fixing a regression of 16.11, so it is not so urgent.

Yes, it looks like this bug was present in DPDK 2.2 even, and possibly before that too.

More information about the dev mailing list