From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 428D8A0526; Tue, 10 Nov 2020 11:16:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD016F90; Tue, 10 Nov 2020 11:16:39 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 093CAF64 for ; Tue, 10 Nov 2020 11:16:37 +0100 (CET) IronPort-SDR: /bJnRBMqpzBCHaRGO2MqbuD/eOqGKMQTbQtdwqkAfMmIt5QRgsye8uF1uvGNAp6rmr+ioU3nHD +wwlxbjwTZAg== X-IronPort-AV: E=McAfee;i="6000,8403,9800"; a="187914165" X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="187914165" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 02:16:33 -0800 IronPort-SDR: AIab9/Adnu6TrmzrXp8HbvaA5R9A8o81MWIvmLoGYBYdsZob5vfgSUmmjscZl0jBO7/3v6JwEK 8VPa7wmMchJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="529722898" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga006.fm.intel.com with ESMTP; 10 Nov 2020 02:16:33 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 10 Nov 2020 02:16:33 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 10 Nov 2020 18:16:31 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Tue, 10 Nov 2020 18:16:31 +0800 From: "Zhang, Qi Z" To: "Ananyev, Konstantin" , "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH] net/ice: fix missed pointer check Thread-Index: AQHWty1LQeUDkyU7dkWQH9N0fyR6aanAnXsAgACJM2A= Date: Tue, 10 Nov 2020 10:16:31 +0000 Message-ID: <7fa4273cdd65420c82f1a027d24b0fc5@intel.com> References: <1604990752-61283-1-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.108.32.68] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ice: fix missed pointer check 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" > -----Original Message----- > From: dev On Behalf Of Ananyev, Konstantin > Sent: Tuesday, November 10, 2020 6:05 PM > To: Lu, Wenzhuo ; dev@dpdk.org > Cc: Lu, Wenzhuo > Subject: Re: [dpdk-dev] [PATCH] net/ice: fix missed pointer check >=20 >=20 >=20 > > -----Original Message----- > > From: dev On Behalf Of Wenzhuo Lu > > Sent: Tuesday, November 10, 2020 6:46 AM > > To: dev@dpdk.org > > Cc: Lu, Wenzhuo > > Subject: [dpdk-dev] [PATCH] net/ice: fix missed pointer check > > > > The return value of rte_mempool_default_cache should be checked as it > > can be NULL. > > > > Fixes: a4e480de268e ("net/ice: optimize Tx by using AVX512") > > > > Reported-by: Konstantin Ananyev > > Signed-off-by: Wenzhuo Lu > > --- > > drivers/net/ice/ice_rxtx_vec_avx512.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/ice/ice_rxtx_vec_avx512.c > > b/drivers/net/ice/ice_rxtx_vec_avx512.c > > index e5e7cc1..af6b324 100644 > > --- a/drivers/net/ice/ice_rxtx_vec_avx512.c > > +++ b/drivers/net/ice/ice_rxtx_vec_avx512.c > > @@ -781,9 +781,14 @@ > > > > if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE && (n & 31) =3D=3D = 0) > { > > struct rte_mempool *mp =3D txep[0].mbuf->pool; > > + void **cache_objs; > > struct rte_mempool_cache *cache =3D > rte_mempool_default_cache(mp, > > rte_lcore_id()); > > - void **cache_objs =3D &cache->objs[cache->len]; > > + > > + if (!cache || cache->len =3D=3D 0) > > + goto normal; > > + > > + cache_objs =3D &cache->objs[cache->len]; > > > > if (n > RTE_MEMPOOL_CACHE_MAX_SIZE) { > > rte_mempool_ops_enqueue_bulk(mp, (void *)txep, n); @@ > -821,6 > > +826,7 @@ > > goto done; > > } > > > > +normal: > > m =3D rte_pktmbuf_prefree_seg(txep[0].mbuf); > > if (likely(m)) { > > free[0] =3D m; > > -- >=20 > Acked-by: Konstantin Ananyev Applied to dpdk-next-net-intel. Thanks Qi >=20 > > 1.9.3