From: David C Harton <dharton@cisco.com>
To: jingjing.wu@intel.com, beilei.xing@intel.com
Cc: dev@dpdk.org, David C Harton <dharton@cisco.com>, wei.zhao1@intel.com
Subject: [dpdk-dev] [PATCH v3] net/i40e: fix VF reset stats crash
Date: Thu, 11 Jan 2018 10:13:58 -0500 [thread overview]
Message-ID: <20180111151358.20102-1-dharton@cisco.com> (raw)
In-Reply-To: <20180111134814.1224-1-dharton@cisco.com>
Calling i40evf_dev_xstats_reset can sometimes crash.
Fixed issue by checking return code before using pstats.
Fixes: 8210e9e0d805e ("net/i40e: fix clear xstats bug in VF")
Cc: wei.zhao1@intel.com
Signed-off-by: David C Harton <dharton@cisco.com>
---
v2:
* Fixed fixes line in commit message.
v3:
* Modified conditional to check ret code instead of pointer.
drivers/net/i40e/i40e_ethdev_vf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index b96d77a..d5a9edb 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -916,14 +916,16 @@ i40evf_update_stats(struct i40e_vsi *vsi,
static void
i40evf_dev_xstats_reset(struct rte_eth_dev *dev)
{
+ int ret;
struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
struct i40e_eth_stats *pstats = NULL;
/* read stat values to clear hardware registers */
- i40evf_query_stats(dev, &pstats);
+ ret = i40evf_query_stats(dev, &pstats);
/* set stats offset base on current values */
- vf->vsi.eth_stats_offset = *pstats;
+ if (ret == 0)
+ vf->vsi.eth_stats_offset = *pstats;
}
static int i40evf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
--
2.10.3.dirty
next prev parent reply other threads:[~2018-01-11 15:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 13:23 [dpdk-dev] [PATCH] " David C Harton
2018-01-11 13:48 ` [dpdk-dev] [PATCH v2] " David C Harton
2018-01-11 15:13 ` David C Harton [this message]
2018-01-11 17:35 ` [dpdk-dev] [PATCH v3] " Van Haaren, Harry
2018-01-13 6:11 ` Zhang, Helin
2018-01-12 2:01 ` Zhao1, Wei
2018-01-11 14:51 ` [dpdk-dev] [PATCH] " Van Haaren, Harry
2018-01-11 14:59 ` David Harton (dharton)
2018-01-11 15:02 ` Van Haaren, Harry
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=20180111151358.20102-1-dharton@cisco.com \
--to=dharton@cisco.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=wei.zhao1@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).