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 A8B7AA0526; Tue, 10 Nov 2020 11:05:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C79F2C52; Tue, 10 Nov 2020 11:05:17 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 6F0112BAA for ; Tue, 10 Nov 2020 11:05:16 +0100 (CET) IronPort-SDR: L+8yLR4KeYtOB6EQsz8KlTi4W7HvRercdrvlvHOMMtggq7ikuBNhkfuTKy2ufgwCwg1xX+JjE8 cfRl0NpuWX1w== X-IronPort-AV: E=McAfee;i="6000,8403,9800"; a="149798419" X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="149798419" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 02:05:14 -0800 IronPort-SDR: v4qgVqV/TRb1q2a1kZQ/l8LO1ZmdyHFCnNj/b2htNRGFmk1a2QRayXX9Yq/URd3KIqxoSVgbZM I4nsnuAWH07A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="338671600" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga002.jf.intel.com with ESMTP; 10 Nov 2020 02:05:14 -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:13 -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:13 -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:13 -0800 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.55) 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:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jk/kmJekzn8TqTtfJ0q1515IHFcvePcBWLzMvvBAi9FhzSrSm4ELxPIcCAsLryDLiWH6LWxxFZAWYGLZQdkEFtSvlBg/y7SdZHIKrNTxSw3Ld1N5ENbkt0UAWNTbJk/k8+bwas4lt+OcWbfDkTn3EmPLQur2oi/tyc3Vnvs1fPamG01w5S4SuuB8IoODrHK0jL0wmaGPDWXnZTzS5b22FfDUVfaaJGlm6mCJjeM9xCQg4bq3ayvq9co16NMCPl/8yJ947ZFHS+sHq0zja7PFL6LjHLdooa525cV2eAlokEbLdVVYCiVw3wqo7vPdrEksB9at6oXyXn9ZYxa+zjLu3w== 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=VyKJlPkAEedr/s6uxh2tzBHUW1B4KTK/T8vJSFXEfTk=; b=ZnyQo9iPcZTvhIVIXD+llRajPpv7R6kkw1R5dqfF+Ej63D/i0RHRx0+CgT3LzfsV6i12xduuRjbXjy14s0s62UEmOy5TJ+JJHZdgjIZl6N7N9B9Nk0TfVzi68LsIhDNPJYKBwKGOeGC9pXOV0Iu5pbiB1jNPVbNWw8P+vMu7lyBZHslOQUYxMQNQLZ9N6FuW5AL7s4q9OvyB9iN4INGO3CxXU8kBCENA7sY2uMVzf9xbEEIAmTbdQz57f1W6v+7PQa9/0qzLQnZg1u5KFLNoxTzetXWl/mZsPbmpshAClAi1J3nJAQfS40747p3FE6/7anE1brf4Pn6hU/xKKUW9Wg== 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=VyKJlPkAEedr/s6uxh2tzBHUW1B4KTK/T8vJSFXEfTk=; b=ZFHzF0Ko/2InAK766DEZsZ4/KQOnGzCOkWA1G/2UcNw3uupm/qp5TDTnJhyo9WPJZbWAAEce8uaA1BPhvZvkbTchUkV0MtuEUQJKKgEl9i0L9VllJSCCQduTt6UaWepSYKT1irueGKwrtAgcMKHo5UaEV9DfBF2f5DK0b6tamqw= 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:10 +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:10 +0000 From: "Ananyev, Konstantin" To: "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH] net/ice: fix missed pointer check Thread-Index: AQHWty1NFOyfloGHTkW+mUWzn7MxQKnBI1+A Date: Tue, 10 Nov 2020 10:05:10 +0000 Message-ID: References: <1604990752-61283-1-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: <1604990752-61283-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: e09e52b2-5ede-4c30-9a8c-08d885601c27 x-ms-traffictypediagnostic: DM5PR11MB2060: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:466; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mVy+jZLasBP4u1aG5sF+yfRRMPhXN2onwbpDPe7sBXBZxSlhAcdQbqHcKaQKQi2a5zt/liVX1of4r9y0o1SRixeqSTU2UbC2MEXFaaG0ahBd6C/gNUuAidfvdI8kvSLV8yWoDjhRVURsKJHk9RGZuOdnM12jX8nQbnn4huyqF4tpedqpGCZHt4w0zz69mOweJyFBBXRFyJWPwlDSgKT0F8u2zxjPXrIugrSoAaqFI7fwfIPxKTz1ASuQ3WBRQl1bhndKEVmchMJfndaD90CaywlRVxkGRuHNz2PUL57IZoZUvAJrXL5B0wGqK2M8bz8rE9Kvgrhd1AGhfoUXDtx7Mw== 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)(53546011)(83380400001)(9686003)(55016002)(86362001)(478600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: yVUU8o8ZSdJv62IM4+wcf+YncsBdJM1AiMu3uzqeX4TbJiXL/ExKBlHXqvZEZXOfY8dTdEGtMHbOrxChGe13iXGvhlqTl8TG3qydNMbrIalcT23BeuiqOfu0ZhbiJacLNhr0rX4v3Roidy7pcDlP5CyajpFQHCiVIthLb+7Hz6SKDVuB63/t6WXb0Q2wWkjdFabILroS7sGWihR8ncKASwHhwClaPZL1MGYKiyxXqm6J4e7GO31YHHHW/DnSW11l2lfsus8NlaSPABfnv4ujeqhpZVVwKg5xNpkzfxvwZ4VouF20lgc3eMJXVHLUSKzAOv1NT0hkdIeht3USFmqYLMxZjb2YwX0F+AIkQeAMBG4e70v0/pYzcg7ONUgtthcNC67HAKSTRhvNzBoRYqiBiDJoKVlRHeBiMObKi3mqyHr9jRscxn14dXpXqvE4EZM1PFB5KOcz0EGbhS7kM9xBWki1n4Kr8gFg+UhZ4oOpJTrjo146FUCCBAoUR/2G9pkyymfEdr2DFUdXcpmx2HNQn1N8FbjDCkr7Ft8y7yH5N+wNxtNS9epmdW1AGt7Zq8yRD8+d6Apc5oy2jlV//r6bOfNTfzzbpo9SaaOY+ljbMnpvrqRiZubNlsV8GyqGpJcwNOEa9ym1gaTGgw3q+WWPew== 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: e09e52b2-5ede-4c30-9a8c-08d885601c27 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2020 10:05:10.7567 (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: hPerC5m4Z53wzqdA9IAknppooK1kXl3PuBSTXJWJgY72f3aI5F/fB/TBh0JE0sHQ/Rx2VeZwmS7XvuG5j4nPd/+UVGi2mNDJCmz4tLlNY3w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB2060 X-OriginatorOrg: intel.com 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 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 >=20 > The return value of rte_mempool_default_cache should be > checked as it can be NULL. >=20 > Fixes: a4e480de268e ("net/ice: optimize Tx by using AVX512") >=20 > 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(-) >=20 > 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 @@ >=20 > 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]; >=20 > if (n > RTE_MEMPOOL_CACHE_MAX_SIZE) { > rte_mempool_ops_enqueue_bulk(mp, (void *)txep, n); > @@ -821,6 +826,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