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 471E6A0526; Tue, 10 Nov 2020 11:16:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C469323C; Tue, 10 Nov 2020 11:16:52 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7BF14F64 for ; Tue, 10 Nov 2020 11:16:49 +0100 (CET) IronPort-SDR: jnRyu724cDSrnW3n2a1M0JGFCercKAJ2Cbsmhi+wXPO+Mouz/9QRZvyF8/FZwEH1sXA6W0KJOy qPdjzF72aYjg== X-IronPort-AV: E=McAfee;i="6000,8403,9800"; a="166440444" X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="166440444" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 02:16:47 -0800 IronPort-SDR: Cj2h1VhmikL0KMCBS5+cIKguW/YMSTIkMdUjFNzEMgb2Y6C6XtL+XM2hMJTj3OZPYGg+uTwdfo YGIVrmVG+eKg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="541271474" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga005.jf.intel.com with ESMTP; 10 Nov 2020 02:16:46 -0800 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by fmsmsx606.amr.corp.intel.com (10.18.126.86) 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:46 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) 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:44 +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:44 +0800 From: "Zhang, Qi Z" To: "Ananyev, Konstantin" , "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH] net/iavf: fix missed pointer check Thread-Index: AQHWty1UwxvKtknGtEGIj9V5Mn9PQ6nAnZ8AgACJLMA= Date: Tue, 10 Nov 2020 10:16:44 +0000 Message-ID: <1ff1b0741d9e4342a977e0c2f757ac43@intel.com> References: <1604990761-61335-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/iavf: 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:06 PM > To: Lu, Wenzhuo ; dev@dpdk.org > Cc: Lu, Wenzhuo > Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix missed pointer check >=20 >=20 >=20 > > The return value of rte_mempool_default_cache should be checked as it > > can be NULL. > > > > Fixes: 9ab9514c150e ("net/iavf: enable AVX512 for Tx") > > > > Reported-by: Konstantin Ananyev > > Signed-off-by: Wenzhuo Lu > > --- > > drivers/net/iavf/iavf_rxtx_vec_avx512.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c > > b/drivers/net/iavf/iavf_rxtx_vec_avx512.c > > index 8680734..584d12e 100644 > > --- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c > > +++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c > > @@ -1424,7 +1424,12 @@ > > struct rte_mempool *mp =3D txep[0].mbuf->pool; > > struct rte_mempool_cache *cache =3D > rte_mempool_default_cache(mp, > > rte_lcore_id()); > > - void **cache_objs =3D &cache->objs[cache->len]; > > + void **cache_objs; > > + > > + 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); @@ > -1462,6 > > +1467,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