From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: stable@dpdk.org,
Mohsin Mazhar Shaikh <mohsinmazhar_shaikh@trendmicro.com>,
Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH 1/2] net/netvsc: set id in xstats_get
Date: Thu, 20 Jun 2019 15:09:23 -0700 [thread overview]
Message-ID: <20190620220924.32079-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20190620220924.32079-1-stephen@networkplumber.org>
From: Mohsin Mazhar Shaikh <mohsinmazhar_shaikh@trendmicro.com>
The xstats_get was not setting id correctly for each entry.
Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Signed-off-by: Mohsin Mazhar Shaikh <mohsinmazhar_shaikh@trendmicro.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/netvsc/hn_ethdev.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index 9e7cf2df5472..d37db7c6a232 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -577,9 +577,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++) {
@@ -589,9 +591,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);
--
2.20.1
next prev parent reply other threads:[~2019-06-20 22:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-20 22:09 [dpdk-dev] [PATCH 0/2] net/netvsc: xstat fixes Stephen Hemminger
2019-06-20 22:09 ` Stephen Hemminger [this message]
2019-06-20 22:09 ` [dpdk-dev] [PATCH 2/2] net/netvsc: fix xstats for VF device Stephen Hemminger
2019-06-27 18:33 ` [dpdk-dev] [dpdk-stable] [PATCH 0/2] net/netvsc: xstat fixes Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190620220924.32079-2-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=mohsinmazhar_shaikh@trendmicro.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).