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 <mohsinmazhar_shaikh@trendmicro.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Mohsin Mazhar Shaikh 2019-06-20 15:09:23 -07:00 committed by Ferruh Yigit
parent 92d23a57ca
commit b21ad01a82

View File

@ -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);