From: Mohsin Mazhar Shaikh Date: Thu, 20 Jun 2019 22:09:23 +0000 (-0700) Subject: net/netvsc: fix xstats id X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b21ad01a82904413485c82a08c154aeacf31fd02;p=dpdk.git net/netvsc: fix xstats id The xstats_get was not setting id correctly for each entry. Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") Cc: stable@dpdk.org Signed-off-by: Mohsin Mazhar Shaikh Signed-off-by: Stephen Hemminger --- diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index e0b7016760..69cf5d1d9f 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -742,9 +742,11 @@ hn_dev_xstats_get(struct rte_eth_dev *dev, continue; stats = (const char *)&txq->stats; - for (t = 0; t < RTE_DIM(hn_stat_strings); t++) - xstats[count++].value = *(const uint64_t *) + for (t = 0; t < RTE_DIM(hn_stat_strings); t++, count++) { + xstats[count].id = count; + xstats[count].value = *(const uint64_t *) (stats + hn_stat_strings[t].offset); + } } for (i = 0; i < dev->data->nb_rx_queues; i++) { @@ -754,9 +756,11 @@ hn_dev_xstats_get(struct rte_eth_dev *dev, continue; stats = (const char *)&rxq->stats; - for (t = 0; t < RTE_DIM(hn_stat_strings); t++) - xstats[count++].value = *(const uint64_t *) + for (t = 0; t < RTE_DIM(hn_stat_strings); t++, count++) { + xstats[count].id = count; + xstats[count].value = *(const uint64_t *) (stats + hn_stat_strings[t].offset); + } } ret = hn_vf_xstats_get(dev, xstats + count, n - count);