From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id A75354D3A for ; Thu, 11 Jan 2018 15:51:30 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jan 2018 06:51:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,344,1511856000"; d="scan'208";a="19307065" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga003.jf.intel.com with ESMTP; 11 Jan 2018 06:51:27 -0800 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.180]) by IRSMSX154.ger.corp.intel.com ([169.254.12.83]) with mapi id 14.03.0319.002; Thu, 11 Jan 2018 14:51:26 +0000 From: "Van Haaren, Harry" To: David C Harton , "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "Zhao1, Wei" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: fix VF reset stats crash Thread-Index: AQHTit98iFGDe2K9lUqOHeLAJtSOD6Nuv72w Date: Thu, 11 Jan 2018 14:51:26 +0000 Message-ID: References: <20180111132337.14389-1-dharton@cisco.com> In-Reply-To: <20180111132337.14389-1-dharton@cisco.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjljNTc0MmEtMWViNy00MTJjLTljOWMtZjg2NzI5YmM1OTRkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik1NT0hBRG9vZE9Oa3V3V1gwcVZkUVFrNUJwNDlBXC9DS1BNRWFmMnFhb2RrPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Thu, 11 Jan 2018 14:51:31 -0000 > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David C Harton > Sent: Thursday, January 11, 2018 1:24 PM > To: Wu, Jingjing ; Xing, Beilei > > Cc: dev@dpdk.org; David C Harton ; Zhao1, Wei > > Subject: [dpdk-dev] [PATCH] net/i40e: fix VF reset stats crash >=20 > Calling i40evf_dev_xstats_reset can sometimes crash. >=20 > Fixed issue by adding a pstats NULL check. Perhaps add a note here, that the root cause of (pstats =3D=3D NULL) is a valid error return from i40evf_query_stats(), if the vf command fails to execute. Hence, we are not hiding symptoms of a different issue here, this NULL check is required to validate the returned values. > Fixes: da61cd0849766 ("i40evf: add extended stats") > 8210e9e0d805e ("net/i40e: fix clear xstats bug in VF") > Cc: wei.zhao1@intel.com >=20 > 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(-) >=20 > 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); >=20 > /* set stats offset base on current values */ > - vf->vsi.eth_stats_offset =3D *pstats; > + if (pstats !=3D NULL) > + vf->vsi.eth_stats_offset =3D *pstats; > } >=20 > static int i40evf_dev_xstats_get_names(__rte_unused struct rte_eth_dev > *dev, > -- > 2.10.3.dirty