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 EA75DA04BA; Wed, 2 Sep 2020 13:02:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 458DB137D; Wed, 2 Sep 2020 13:02:40 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 84941255 for ; Wed, 2 Sep 2020 13:02:37 +0200 (CEST) IronPort-SDR: JyDHLVQIJsyXNU+pfQjwEiErmtXU5QCy40JePND+KAL1bS4CJB3YBrAZjUwUKOZehoZom3SDj0 CnJndunRvH8A== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="145097696" X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="145097696" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 04:02:35 -0700 IronPort-SDR: RYpD9cdbA07kEltla3arvfFIRzFVX9CsUsKrh8zdA32nb+59QVlbCCtKj4V06VMG5mV0ew0Hwm Ttbw9Tee6H9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="283696955" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga008.fm.intel.com with ESMTP; 02 Sep 2020 04:02:35 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) 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; Wed, 2 Sep 2020 04:02:34 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 2 Sep 2020 04:02:34 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 2 Sep 2020 04:02:32 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.173) 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; Wed, 2 Sep 2020 04:02:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y8Ybdcryqd7v0+5zQc+UqkFZr48YqSHQxa0NLueLUDO0VCzPu7MpehFh4QWBKx4Y9wr85o7YqmjAySb+i5sXFvWIrcQjTauLUVpyQSXzgyn9tFdXQvwXXV2SS45Pre6ms/hwRujXPvPt3BuYvZ3UDeptjYMsssTTuEuk3mei1hWRQlSD8IIGG90CKl+RM3sreklyEnmz2BKRm50OcAMuzOdw3ifrDxlomHIXs3yj0Vr00HYnNvQiB9s2VDcuAKFE0D66VVHJrwl+pZlPdmEafYZrg0PLan7LWE8bTzuDZjTZ+voxg9UByl4kcNtv0RdbWoug4CvpvFj8W/8Dp0af6g== 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=CNI2i9fvAlmdHaweW90Vkjm6d//o5Hf9bHBq3HWKoA0=; b=VPv4oVIvb1URqrq05IrU39rz1f/PiFRhRgVd0F98QF71g8LzztlhbsXeEn3WEbevXbs4j8KoOsBTZZE7nVkSzyBUj247dImC5gcLmRchKUX/w3ZKgW9hoGR9OHYPrYJ1+xTxW3YOYUqZKgrKxmbD3ytEpG247IRyfBmp52vIpbESel1630BVl55fOIUu2poCgFe67BenoNH+iVc18cl8/a1O8NjxjulhuHYEsNbdqSkWW+czrJNJb6tUqp7gyvBElNBJ2xqHYVuhmtX1+xTUlB2yDEQdUd/89UjFmrsIt0BMBz27XLOYV5WUPyyVS6XGrqSEFEh32GDkUURtxRRczA== 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=CNI2i9fvAlmdHaweW90Vkjm6d//o5Hf9bHBq3HWKoA0=; b=sDK1gOOJfUZVRRC1g5u9//J5w5kkw6aDSeGVQ9nxTmMOlLReuwrggOgiuF6pKt+kdTh11m7LfeI1eLoGykpEPkp2935ZxCPAVnPAc2R2W5QfATIVBjMQsRNdUyxMzN7lM8EVltt1xbkROm+u2hV/t2I+4uJaZg05j6hgCzdDft4= Received: from BYAPR11MB3352.namprd11.prod.outlook.com (2603:10b6:a03:1d::26) by BYAPR11MB2630.namprd11.prod.outlook.com (2603:10b6:a02:c2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Wed, 2 Sep 2020 11:02:31 +0000 Received: from BYAPR11MB3352.namprd11.prod.outlook.com ([fe80::117b:c1a0:679f:c5fc]) by BYAPR11MB3352.namprd11.prod.outlook.com ([fe80::117b:c1a0:679f:c5fc%3]) with mapi id 15.20.3326.025; Wed, 2 Sep 2020 11:02:31 +0000 From: "Singh, Jasvinder" To: "Power, Ciara" , "dev@dpdk.org" CC: Olivier Matz Thread-Topic: [PATCH v2 17/17] net: add checks for max SIMD bitwidth Thread-Index: AQHWfI19hO0nlPFKt0SZ19Utf0F+wKlVM5bg Date: Wed, 2 Sep 2020 11:02:30 +0000 Message-ID: References: <20200807155859.63888-1-ciara.power@intel.com> <20200827161304.32300-1-ciara.power@intel.com> <20200827161304.32300-18-ciara.power@intel.com> In-Reply-To: <20200827161304.32300-18-ciara.power@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows 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: [109.76.57.40] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 62869a3a-b1b0-4469-46c5-08d84f2fb038 x-ms-traffictypediagnostic: BYAPR11MB2630: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5Bx8us/OxIX7fUxjI91YB0IQ5lbLAz9ZDxOhGp6ATWIQBYbJbxl8NzNmMUvf+YCuJl4ofIk/Lks/mYz2xCw3B18xAzCw4pVSg0wT8G91mBqKD8DVemy8lVGVCMeVxc4Dirq6OxdgiEaKZg4/a4PNkvPCc1u9g9b24a/DQ2mPSB0BBGQS1qwjRKDyrSkSVKgzHXTAUC2lYf5DZilgWNA6v9avdYR0QTE1LmV3a+jitK5aDt1NAHaRsnr/Kw/dGRMMoFhUF3oGFQOUwahrUS04PEdsPDTmSENStO0pPyQ+HGN+gzBwGbe1XnGsl5pxdW6MZ1rxKyVTNppZ5/6Db96YiA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3352.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(396003)(39860400002)(376002)(136003)(8936002)(2906002)(52536014)(71200400001)(4326008)(33656002)(9686003)(186003)(26005)(64756008)(76116006)(5660300002)(53546011)(110136005)(478600001)(66946007)(7696005)(55016002)(8676002)(66476007)(316002)(6506007)(86362001)(66556008)(83380400001)(66446008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: bMYBGa+szFGNRe7gVLoCDHH5sVQmJ+Gl90xopDqSv0+QJZHDdZ/E0Nj07/EX63/z39ZWut2T7ozOUaVfj0qm5zccyxcJvTKcfwNrxEaspRu/46TOxItj/ucHoJkkrtn/1B6RGVr8YprNCww7dU5auV402rPNtlpLitEHijkcmmUheqAw0SHINtBKrAVsRyETMb2h/pv5CSx6oF4UTXi8kYafccf7El+moLuDXr884udE6jlPBOlMb2hSIvaxZEkWLBBkfXNndq1dTLKcp2V8FlQRJ9vyUoN0rNrX7VYmfZ4Oy3Wn4PvXsiPSDMtrpAEfRmmp+9G79JN0uft88P+BLwm8sIW4E7bR8wPXLZAyzp7XM7TQjThC6SE4XHvI+idM97LYMwQROP3G+5kxX1ooeSOuX5kWNddp4gNUq8e0iY8PmBRbHeE39ftFQQSwfkwR4IE4hCBj5mIlUuDKeNNvvOJuPc1I1JSiPALaMbyUoAXhDg8079lMFi+Kh5C2g/RriaBumuhD6ECgQO+fVwFTztFvwBRkx24VWrxUYMniMjqpYH9sc36m/MxPzHR+1YyTwCibQw7alVM6/Lh7VUZicIqqGAJvkAvPDqrkM0CQNl4aOOjyyRuU+ni1CytEzdlzcDQudPxkFg1F526+0puhXw== 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: BYAPR11MB3352.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62869a3a-b1b0-4469-46c5-08d84f2fb038 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2020 11:02:31.0331 (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: fBQ0oc+ZBl1z9iSkm4pSUq3dAbaMJiqnzpwIospswnjNA/pnt8QgXWKjoUZDlMBvX2C55QR8XQwL0D0SbvngdUWOetQIt9nFKHaDz2Sptfg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2630 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 17/17] net: add checks for max SIMD bitwidth 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: Power, Ciara > Sent: Thursday, August 27, 2020 5:13 PM > To: dev@dpdk.org > Cc: Power, Ciara ; Singh, Jasvinder > ; Olivier Matz > Subject: [PATCH v2 17/17] net: add checks for max SIMD bitwidth >=20 > When choosing a vector path to take, an extra condition must be satisfied= to > ensure the max SIMD bitwidth allows for the CPU enabled path. This check = is > done just before the handler is called, it cannot be done when setting th= e > handlers initially as the EAL max simd bitwidth value has not yet been se= t. >=20 > Cc: Jasvinder Singh >=20 > Signed-off-by: Ciara Power > --- > lib/librte_net/rte_net_crc.c | 8 ++++++++ > 1 file changed, 8 insertions(+) >=20 > diff --git a/lib/librte_net/rte_net_crc.c b/lib/librte_net/rte_net_crc.c = index > 9fd4794a9d..d3d3206919 100644 > --- a/lib/librte_net/rte_net_crc.c > +++ b/lib/librte_net/rte_net_crc.c > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include >=20 > #if defined(RTE_ARCH_X86_64) && > defined(RTE_MACHINE_CPUFLAG_PCLMULQDQ) > #define X86_64_SSE42_PCLMULQDQ 1 > @@ -60,6 +61,8 @@ static rte_net_crc_handler handlers_neon[] =3D { }; > #endif >=20 > +static uint16_t max_simd_bitwidth; > + > /** > * Reflect the bits about the middle > * > @@ -175,6 +178,11 @@ rte_net_crc_calc(const void *data, > uint32_t ret; > rte_net_crc_handler f_handle; >=20 > + if (max_simd_bitwidth =3D=3D 0) > + max_simd_bitwidth =3D rte_get_max_simd_bitwidth(); > + if (max_simd_bitwidth < RTE_MAX_128_SIMD && > + handlers !=3D handlers_scalar) > + rte_net_crc_set_alg(RTE_NET_CRC_SCALAR); Above change doesn't seem right as rte_net_crc_set_alg () is invoked everyt= ime when crc is computed. It potentially adds branches in runtime. In my o= pinion, bit width should be checked inside rte_net_crc_set_alg () function= which is supposed to be used during initialization stage after eal sets th= e max simd bit width.=20 > f_handle =3D handlers[type]; > ret =3D f_handle(data, data_len); >=20 > -- > 2.17.1