[dpdk-dev] [PATCH] ethdev: fix rte_eth_dev_xstats_get with NULL

2016-03-23 Thread Thomas Monjalon
2016-03-23 09:51, Olivier Matz: > On 03/22/2016 11:09 PM, Stephen Hemminger wrote: > > Normal usage of rte_eth_dev_xstats_get is to call twice. The > > first time the function is called with portid, xstats = NULL > > and n = 0; this returns the number of entries in the statistics > > table that nee

[dpdk-dev] [PATCH] ethdev: fix rte_eth_dev_xstats_get with NULL

2016-03-23 Thread Olivier Matz
Hi Stephen, On 03/22/2016 11:09 PM, Stephen Hemminger wrote: > Normal usage of rte_eth_dev_xstats_get is to call twice. The > first time the function is called with portid, xstats = NULL > and n = 0; this returns the number of entries in the statistics > table that need to be allocated. > > The p

[dpdk-dev] [PATCH] ethdev: fix rte_eth_dev_xstats_get with NULL

2016-03-23 Thread Stephen Hemminger
On Wed, 23 Mar 2016 11:19:12 +0100 Thomas Monjalon wrote: > 2016-03-23 09:51, Olivier Matz: > > On 03/22/2016 11:09 PM, Stephen Hemminger wrote: > > > Normal usage of rte_eth_dev_xstats_get is to call twice. The > > > first time the function is called with portid, xstats = NULL > > > and n = 0; t

[dpdk-dev] [PATCH] ethdev: fix rte_eth_dev_xstats_get with NULL

2016-03-22 Thread Stephen Hemminger
Normal usage of rte_eth_dev_xstats_get is to call twice. The first time the function is called with portid, xstats = NULL and n = 0; this returns the number of entries in the statistics table that need to be allocated. The problem is that the routine adds a count value to NULL (0) and assumes that