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 5EBAEA0526; Tue, 10 Nov 2020 11:05:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3D6E22B93; Tue, 10 Nov 2020 11:05:49 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id BE2BC2B93 for ; Tue, 10 Nov 2020 11:05:46 +0100 (CET) IronPort-SDR: gC1/1Q6Sq0SF/OGRTNB2VmM0JrCTEw384VYUuM/XhrUpM99Fi9OukRPoVy5rOk61j/OURJrxYT XWTkPEyqPdww== X-IronPort-AV: E=McAfee;i="6000,8403,9800"; a="231576776" X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="231576776" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 02:05:44 -0800 IronPort-SDR: nrJucSWzUShj4VbxQ0FmUSueL02wNXfNu/hExQ0y4mQeahRYLfvJIPMkJUjQ+JYsdVcfH8llhT yU8FqcWFKlPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="338671691" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga002.jf.intel.com with ESMTP; 10 Nov 2020 02:05:44 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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:05:44 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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:05:43 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 10 Nov 2020 02:05:43 -0800 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.52) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 10 Nov 2020 02:05:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FLTnBDp/5XvYYgIozY8TKNzm7Uk1Guv2kue7GHX7/rZN7/51E3IoooWARxNfyhQNWf40ProiaY3UdxyhoQ1Jw+kz7/SyK7/moPd/AenuR5Q4CQLuLsLS2AXXs9G6T9LFUxnkDUQarIbrMrf5TKSRY0BSM4O7JWmrZP1wu1124y5hZZWaIEPIE4P1U+OsIJFOiZKSMEpV9X3tiZr7gLDHczVhMrYkYdfgcwe9L8p3stB4pmtpZH58CV5YPfMN7egbwkkvqGRi7yiSeWK/YTzFsgqhEfFZlhCDi8F1G//yRHPGEs665SYxDOuIC5gFIGKbxdqzFdxqu58xxIyG2+CNBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L0U7fAjpKNZ72hl09S4VODQpGQG8t9qZr/jhVhG9WcM=; b=nROHsxgEAOMLvcIFhXgbCLIAhWzXHAFvYrPzk1/21bAxQSjPcdtXzTUF1R0449ZMcUGaTY+o/0B0IjkedLy8FyaQQ0IsVOKKarjOSW8xgf36GyO13MPPJDNCf2b6YAnk0Lmr1zpFVYjUAT09D0kIhUEH4WfLq5jKWedXKv0JCKiWWvYUQV+wkWzO1A5ZeU2zXl140f8CzYDT2Etpb/j7YPnwTVYyEdJfj8AJorlfl5B2mW2Jj173SbG6alr/9x3koBRfRXilnKgJBwUQOabt4yqPfm/rNhYmN/Gfrj2dNvUKJxOGXyjJGLGxwNt5IbQ5hAFAdRO1vuku+xUtZYm1+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L0U7fAjpKNZ72hl09S4VODQpGQG8t9qZr/jhVhG9WcM=; b=vL49YiRQCvYejBTkBpcGNzb9HnJBq3uepRuy7tdQD7EQg2D7HrLBqJKaejCysHh8FcgUkvRibirW6tEDx8TItuoaF83hG3Huz4purSzt6LmyJn24/UzRigl2KsWOW2wzYq6VEISpiKOIahqyoRN2KztFuHfu3KmdLdyLuWUmH1k= Received: from DM6PR11MB3308.namprd11.prod.outlook.com (2603:10b6:5:d::22) by DM5PR11MB2060.namprd11.prod.outlook.com (2603:10b6:3:13::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.22; Tue, 10 Nov 2020 10:05:41 +0000 Received: from DM6PR11MB3308.namprd11.prod.outlook.com ([fe80::fd2d:9bbb:599e:72dd]) by DM6PR11MB3308.namprd11.prod.outlook.com ([fe80::fd2d:9bbb:599e:72dd%6]) with mapi id 15.20.3541.021; Tue, 10 Nov 2020 10:05:41 +0000 From: "Ananyev, Konstantin" To: "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH] net/iavf: fix missed pointer check Thread-Index: AQHWty1ZQiRRTdXIA0e3w9GSz5fnrKnBI6YA Date: Tue, 10 Nov 2020 10:05:40 +0000 Message-ID: References: <1604990761-61335-1-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: <1604990761-61335-1-git-send-email-wenzhuo.lu@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [46.7.39.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 245cde92-d693-4ec3-ef5c-08d885602e2e x-ms-traffictypediagnostic: DM5PR11MB2060: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Hhl6MHrcarJy6dsKvtJ5ofSxltlO0tSMlsyURzk9O082J6qyg6kmxiAn06Ui2mJKOcqo9ryeenPyfYarqcQPWjiQ6PvdCTOj1hv+mJms2qzarreHrZSS/lQ/z/OeOcnnd7HY47fo5jUx0AJLL+R7UhbPp5BqVGg3frbfoSnXHZcMMfzr6a+mDE+2LiY+adFQttkFf4mEVS8dhHUBAyvelXdGSssKZOA5379sGLogVkb63Z5zaU+CEoCLheokUT4TkAPxu04i3RrD7uu8l/nBL2UNEK7VcwJzao0EDuTibT8ZoQC415twDwrNU7cnhLUbxcWwnLM4rNRKQq2EttzxZw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3308.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(376002)(346002)(39860400002)(110136005)(4326008)(33656002)(107886003)(316002)(2906002)(66946007)(186003)(26005)(8936002)(6506007)(8676002)(7696005)(5660300002)(76116006)(66556008)(66476007)(71200400001)(52536014)(66446008)(64756008)(83380400001)(9686003)(55016002)(86362001)(478600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: iplVfGNl+9redISV/4bzyUoyEqm/smsvb/BMLZdcQA7Neu0mnyYpNxbN7YvaSdB1nJRhgVRr5dvbKQTDVzE1Kv6bhBy7bDIeSgj4NP8yusMqq/w+8RSr9m50R8a7VoTx3+QbeKJ0q+x4nyGmBhfH1NXth3/e0wfwbSKsoC4HZweQWSKdON81J/qqdDgIj/bkPjQdrpP674CZVSlRAV6u7UZ8XUExqHcShKT117hWwK9n6MWV8hqlaMvG1cQdz6Lf0mb1WeM9ghGCdSbpMolzKwwsW26fxb2juMkPC+a3j4PPLcgiKfdidlA5FkFwXHUnCvAzwJ2CzqXqb6/DCP3t5I5jbjkvQ+LPbCHL7d5QknSJbz2hyA78uoonUToS+aOgy1afF2dW+ep9i6Xbh6SwHpHK0TA0Rkq6pNSRnKABcQ/sGCvJn41f67wBDc+xu7EHxuhMeLLKHfLZtFEvMx1x8CGZbKJJfEX2oB4sSgVXlRjtbO682DnmHz5Uspe5ge6NrOFK9kx2R4DvY9PrtRUKFzC1/dtEhj2/LUiw7gMA8vV64uh6DabBmWWqi0TmAJc6sGJkcKyrbZC/iwW/ABa1rhls8ZUMEYh7jwQ4AlGeOW1Bi90PL2umfRPFaX+81NRcOGN3AgJc0JUe2a4gDPJInw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3308.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 245cde92-d693-4ec3-ef5c-08d885602e2e X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2020 10:05:40.9998 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: IjNvkPBU94XiDN9yEZGZks7To3IGWzmoM1Oobd2fuqHPcdeGC6Wfiy4UcUJ1Lxal1W1ECb29GZUNvlT7qxP1EJoBM8tH2t4s/OoxIlf6+Uk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB2060 X-OriginatorOrg: intel.com 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" > The return value of rte_mempool_default_cache should be > checked as it can be NULL. >=20 > Fixes: 9ab9514c150e ("net/iavf: enable AVX512 for Tx") >=20 > 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(-) >=20 > diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/i= avf_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]; >=20 > if (n > RTE_MEMPOOL_CACHE_MAX_SIZE) { > rte_mempool_ops_enqueue_bulk(mp, (void *)txep, n); > @@ -1462,6 +1467,7 @@ > goto done; > } >=20 > +normal: > m =3D rte_pktmbuf_prefree_seg(txep[0].mbuf); > if (likely(m)) { > free[0] =3D m; > -- Acked-by: Konstantin Ananyev > 1.9.3