From: "Ido Barnea (ibarnea)" <ibarnea@cisco.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "helin.zhang@intel.com" <helin.zhang@intel.com>,
"konstantin.ananyev@intel.com" <konstantin.ananyev@intel.com>
Subject: [dpdk-dev] [PATCH] net/ixgbe: Put correct id values in ixgbevf_dev_xstats_get
Date: Tue, 7 Mar 2017 14:28:22 +0000 [thread overview]
Message-ID: <2C3EBBD2-41D9-4E03-B53A-2EF140C3B15D@cisco.com> (raw)
In-Reply-To: <20170307141824.69411-1-ibarnea@cisco.com>
Without setting the id, calling xstats_get twice with same array causes memory corruption.
Also, if IXGBEVF_NB_XSTATS will be different than 1 in the future, this will cause issues.
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 7169007..b699252 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3249,6 +3249,7 @@ ixgbevf_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
/* Extended stats */
for (i = 0; i < IXGBEVF_NB_XSTATS; i++) {
+ xstats[i].id = i;
xstats[i].value = *(uint64_t *)(((char *)hw_stats) +
rte_ixgbevf_stats_strings[i].offset);
}
--
2.8.3
next parent reply other threads:[~2017-03-07 14:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170307141824.69411-1-ibarnea@cisco.com>
2017-03-07 14:28 ` Ido Barnea (ibarnea) [this message]
2017-03-09 16:46 ` Ferruh Yigit
2017-03-09 17:16 ` 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=2C3EBBD2-41D9-4E03-B53A-2EF140C3B15D@cisco.com \
--to=ibarnea@cisco.com \
--cc=dev@dpdk.org \
--cc=helin.zhang@intel.com \
--cc=konstantin.ananyev@intel.com \
/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).