From patchwork Thu Jan 11 13:48:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Harton X-Patchwork-Id: 33589 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 A0EA8A491; Thu, 11 Jan 2018 14:48:19 +0100 (CET) Received: from rcdn-iport-9.cisco.com (rcdn-iport-9.cisco.com [173.37.86.80]) by dpdk.org (Postfix) with ESMTP id BA8F6A48F for ; Thu, 11 Jan 2018 14:48:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=956; q=dns/txt; s=iport; t=1515678497; x=1516888097; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Y5NgKImLH7Zz2vtHi2cLRKD/XVoyOjYEtBNafZ82sRU=; b=QkfiGmqIQ4nFcNrsgR21vl+604BwEuBIMGVQWeMp2yPOwqVDfpmD9jZN xSGpH+ujS5E1IZAijlc1e+vpwHMc6/GaAcpBvsjlpVyds3Pr3g6IHToFM fNcU4mquDBufaEfZzMv8pLpaf8Ee1M6zh9VSNpaDIC+g+wQI/Hv6h+v8L U=; X-IronPort-AV: E=Sophos;i="5.46,344,1511827200"; d="scan'208";a="335834477" Received: from alln-core-4.cisco.com ([173.36.13.137]) by rcdn-iport-9.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jan 2018 13:48:16 +0000 Received: from cpp-rtpbld-31.cisco.com (cpp-rtpbld-31.cisco.com [172.18.5.114]) by alln-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id w0BDmGdQ014566; Thu, 11 Jan 2018 13:48:16 GMT Received: by cpp-rtpbld-31.cisco.com (Postfix, from userid 140087) id 89FEF791; Thu, 11 Jan 2018 08:48:16 -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:48:14 -0500 Message-Id: <20180111134814.1224-1-dharton@cisco.com> X-Mailer: git-send-email 2.10.3.dirty In-Reply-To: <20180111132337.14389-1-dharton@cisco.com> References: <20180111132337.14389-1-dharton@cisco.com> Subject: [dpdk-dev] [PATCH v2] 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: 8210e9e0d805e ("net/i40e: fix clear xstats bug in VF") Cc: wei.zhao1@intel.com Signed-off-by: David C Harton --- v2: * Fixed fixes line in commit message. 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,