DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix VF reset stats crash
@ 2018-01-11 13:23 David C Harton
  2018-01-11 13:48 ` [dpdk-dev] [PATCH v2] " David C Harton
  2018-01-11 14:51 ` [dpdk-dev] [PATCH] " Van Haaren, Harry
  0 siblings, 2 replies; 9+ messages in thread
From: David C Harton @ 2018-01-11 13:23 UTC (permalink / raw)
  To: jingjing.wu, beilei.xing; +Cc: dev, David C Harton, wei.zhao1

Calling i40evf_dev_xstats_reset can sometimes crash.

Fixed issue by adding a pstats NULL check.

Fixes: da61cd0849766 ("i40evf: add extended stats")
       8210e9e0d805e ("net/i40e: fix clear xstats bug in VF")
Cc: wei.zhao1@intel.com

Signed-off-by: David C Harton <dharton@cisco.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index b96d77a..9c773fe 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -923,7 +923,8 @@ i40evf_dev_xstats_reset(struct rte_eth_dev *dev)
 	i40evf_query_stats(dev, &pstats);
 
 	/* set stats offset base on current values */
-	vf->vsi.eth_stats_offset = *pstats;
+	if (pstats != NULL)
+		vf->vsi.eth_stats_offset = *pstats;
 }
 
 static int i40evf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
-- 
2.10.3.dirty

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-01-13  6:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-11 13:23 [dpdk-dev] [PATCH] net/i40e: fix VF reset stats crash David C Harton
2018-01-11 13:48 ` [dpdk-dev] [PATCH v2] " David C Harton
2018-01-11 15:13   ` [dpdk-dev] [PATCH v3] " David C Harton
2018-01-11 17:35     ` 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

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).