From patchwork Thu Jan 11 13:23:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Harton X-Patchwork-Id: 33587 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A7C6F4D3A; Thu, 11 Jan 2018 14:23:58 +0100 (CET) Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) by dpdk.org (Postfix) with ESMTP id 6A9CF44BE for ; Thu, 11 Jan 2018 14:23:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=959; q=dns/txt; s=iport; t=1515677037; x=1516886637; h=from:to:cc:subject:date:message-id; bh=d71Cl7PLf9kbJIvmbJ4Xfukz2tYL7s8AE5R8sNZ4Ibk=; b=dLZOfbHiMS7n0zyimws9E+L8SW6Lg6xD4B4ZbN9OVw03rCVg5KrmHk6/ JJMOL/c9DnNFs3VgJ1CZh6xLcpxrg4ptgb2NzxZ3py/g68Wp5WggbVfgc ChbJbc4YuwNcqftgvUq/kqyKXmVFYT5Lx2ZAl1a+3fqPrYIVXu8ASqMys U=; X-IronPort-AV: E=Sophos;i="5.46,344,1511827200"; d="scan'208";a="54722525" Received: from rcdn-core-5.cisco.com ([173.37.93.156]) by alln-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jan 2018 13:23:56 +0000 Received: from cpp-rtpbld-31.cisco.com (cpp-rtpbld-31.cisco.com [172.18.5.114]) by rcdn-core-5.cisco.com (8.14.5/8.14.5) with ESMTP id w0BDNuNK032676; Thu, 11 Jan 2018 13:23:56 GMT Received: by cpp-rtpbld-31.cisco.com (Postfix, from userid 140087) id 2B0507D0; Thu, 11 Jan 2018 08:23:56 -0500 (EST) From: David C Harton To: jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, David C Harton , wei.zhao1@intel.com Date: Thu, 11 Jan 2018 08:23:37 -0500 Message-Id: <20180111132337.14389-1-dharton@cisco.com> X-Mailer: git-send-email 2.10.3.dirty Subject: [dpdk-dev] [PATCH] net/i40e: fix VF reset stats crash X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Harry van Haaren --- 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,