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 97A3AA04B1; Sat, 10 Oct 2020 14:42:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E787D1D8CC; Sat, 10 Oct 2020 14:42:37 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id A4ADC1D8CB for ; Sat, 10 Oct 2020 14:42:36 +0200 (CEST) IronPort-SDR: alHQIOCIHUPARX57iHH4vwe3XQWOPePAiQER9epIOeWQpkNfJMOZUreawPTUWcfGxOoDORWz4U aAWhvJE71E9A== X-IronPort-AV: E=McAfee;i="6000,8403,9769"; a="250273913" X-IronPort-AV: E=Sophos;i="5.77,358,1596524400"; d="scan'208";a="250273913" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2020 05:42:34 -0700 IronPort-SDR: EwWXXZR1my9Z2bBVcXVwPq+MubsynFsf+w4BxUibxclPKkXz3tVIA3iU8YxcB04k7KiCVZOrGb EJFupS6D5E0g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,358,1596524400"; d="scan'208";a="350136368" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga002.fm.intel.com with ESMTP; 10 Oct 2020 05:42:34 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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; Sat, 10 Oct 2020 05:42:33 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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; Sat, 10 Oct 2020 05:42:33 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sat, 10 Oct 2020 05:42:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g6f1XSu+h9FABaTDpRQi/0T8XVe0+Oa0b5TYQgyNICQn7PFf/hdVrllelfbevg916ZpJJvb7dKZQvcHvqlwe1OeZhAPImMJz6PhUxbrTs99v33MDFktBWmFuBw0YTn6hxqG/omns+oG5rIKsVN88d5CugmJ1jcgWv2lBqVx4jPRVJ2DMfGDyzPxEBA9B9P7Mg8FPH43H14WO59BCf3xua+ZNP0W4i48eM4dttSgWRNL46OpTA77B4a/wHIJRjCR1M5X1+smb+QlKe7rhSn/9lwn9s5XgWvIbqlbyDiuwVSYHh5sqqQt8EUeDXDLxf9FMvBLSjo9l6wbHox9K//Klvw== 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=biK4HWgVW0NiCT+BH3f5Mba6u6/qf78xx+1PFwgmqvg=; b=J8LBPiML81YhMAbYMpSae1kQFOYm5Aju8f9+wO4klU8iTmaFwlMZ4pONgEKhXQi4tI6+jQwTGfcslORXXhjs/s5znwWX3/5ZW3vNYV1PH+hLfY4CQqYAXxn9E2KEBFlnNzdUNGLnUOEdGO1dOHLi5v0b9PO77U+5j+dGm4VQGnqdXZwBvhmY8Cm4fnjNAOTHLHN67gwmswKos40UndOewm9tPxE5+nWL9eSsFLW/dm6w5+TpxmyvIzd08LGXHIG2DVfXOvlVM/Sf8NEz3apf+U5syDz5OlZMye/StMKneLbxMnWXXPLU/plVd3VZLVoswUuY66tClgE813yfOha+vw== 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=biK4HWgVW0NiCT+BH3f5Mba6u6/qf78xx+1PFwgmqvg=; b=jEtSQZpjVmhIUvAqlKAb+v+w/1gnlZCdTCVTem84JrvOfQD896DEqRPxLk+dP0PJstQB15qBbu7iFiQ7UTDpE/VCB6b2oEAu8QP9UOw1n9Sdc7lLhEUEzlvAO/MrzuUUJyyZqpD+F33F3I4EitvvSOxK8qFyrUNdUOZXhw41TeY= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BY5PR11MB4388.namprd11.prod.outlook.com (2603:10b6:a03:1c9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Sat, 10 Oct 2020 12:42:31 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f5a4:3f6b:ade3:296b]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f5a4:3f6b:ade3:296b%3]) with mapi id 15.20.3455.027; Sat, 10 Oct 2020 12:42:31 +0000 From: "Ananyev, Konstantin" To: "Coyle, David" , "O'loingsigh, Mairtin" , "Singh, Jasvinder" , "Richardson, Bruce" , "De Lara Guarch, Pablo" CC: "dev@dpdk.org" , "Ryan, Brendan" , "O'loingsigh, Mairtin" Thread-Topic: [dpdk-dev] [PATCH v4 1/2] net: add run-time architecture specific CRC selection Thread-Index: AQHWm/1wHYj+FT4p1UG9Gswdu4W1mKmMOZ+QgAMYtACAAXrwAA== Date: Sat, 10 Oct 2020 12:42:30 +0000 Message-ID: References: <1601393761-11588-1-git-send-email-mairtin.oloingsigh@intel.com> <20201006162319.7981-1-mairtin.oloingsigh@intel.com> <20201006162319.7981-2-mairtin.oloingsigh@intel.com> In-Reply-To: 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: ca1fec38-87ed-4ad9-adff-08d86d19f422 x-ms-traffictypediagnostic: BY5PR11MB4388: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4ot9V8ME/a2QZNmZVMN+aW/Ngk/MPANZUseQowAlYF6AACR41CLizi4uIu7Bd9n4IMRJsqKv4FuWAfTfs0txwWZBG/KOBrQgTKKAcsC3o74OK9SrdbX65DR7wvDKQ55nQAIRTeOpf6fWDdzPbT0uUdw9YUGkFMJLQGrj2zdGm1znYie96eonW40A5gMCYU2I+UUBfvsMSKUmMVcOMCS5nLNDkbbezA8udvkAB6IrJb+Fd9UtguwpxPeJZ0db0G1l6W6Q8t0lHzfLPEnKcPBhiF1xZS5QjEgP78EBmHW/pcWVfQ2lsjBJze5Fc3P/0VKAZTSMUbRb+EpTPc7fcctVz6dTiKX44LGAR3fZmMHXUE+QDXDiHZHT+VrhgIqMCeLy x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(136003)(346002)(376002)(366004)(66446008)(478600001)(7696005)(6506007)(316002)(86362001)(2906002)(83380400001)(33656002)(52536014)(9686003)(6636002)(5660300002)(8936002)(76116006)(66946007)(26005)(64756008)(66556008)(4326008)(66476007)(107886003)(55016002)(71200400001)(186003)(110136005)(54906003)(921003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: TMzPhwr6gvaRETQHriLoSmmKnL99oKhCAZNoXuA0fhSvekiOiPEYMSDsJ6nbh5a+NkNIT1xXLxQ47jAmOqmyBJxWO+qompFFid5Q/uZqP0uA8mbvUpKp542F7lHtRvjPkmCBGubpTCUbdnIH2zv1tZkYiZPuELPtvxYPNzaO6Zt3q/WlWzk1We76LTjZ/MK4tEPPWBNd9A2UIvK4bcFriAZ7CunvO9PFYINRqgocDJ2g8PmrQ6dwPmtGN6svDl8mWr43Q0C8cVixxkGWEJOIrscJ6E1T4tZNfBEkF0Lz7U31CH1x1RgUfiBMbaBAHgzoK+E6ucN5SPA4k576PHi/gp+aEl01ZV1j2ivHx0saqR/hPxQDcW3Np9uQan+0/vUVpfwXPSG8BE3SV+/TJYJ/EXwcXft7GH7JbxHwJazh1vi90ZSpBO0GRS+qNW+7Jaz4MRVRDj7Cn0JhfL7TVKb/IOj1GiOhLugrbC6GyxAoUM2KNbsCCEnl0KlO293+VwY8oerE8HKFHIcUF75WH4G/isYTzoVbG3Z0f71EaBqXkYgCvPX2YWfKVkoEl4TtbfLbKlG8xntajx7p1r69DFn54EF6lzDMWMSNdC+bRT8D83+H35qOHzva/wohyDsbLTUU/qlgBS6H2HAQrpLh+hTc5A== 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: BYAPR11MB3301.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca1fec38-87ed-4ad9-adff-08d86d19f422 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2020 12:42:30.8939 (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: fWgEPWWC4k9lNV5QvdoVLShJBTET50Sw2FnEvOVWhWrFXoxUcEdt8qPqmWgrKU7WOJXrEjw/eXDv5SojqWWjAACC6SKc0ax+3Rg4ySMhiKw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4388 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4 1/2] net: add run-time architecture specific CRC selection 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" Hi David, > > > This patch adds support for run-time selection of the optimal > > > architecture-specific CRC path, based on the supported instruction > > > set(s) of the CPU. > > > > > > The compiler option checks have been moved from the C files to the > > > meson script. The rte_cpu_get_flag_enabled function is called > > > automatically by the library at process initialization time to > > > determine which instructions the CPU supports, with the most optimal > > > supported CRC path ultimately selected. > > > > > > Signed-off-by: Mairtin o Loingsigh > > > Signed-off-by: David Coyle > > > > LGTM, just one nit see below. > > With that: > > Series acked-by: Konstantin Ananyev > > > > > --- > > > doc/guides/rel_notes/release_20_11.rst | 4 ++ > > > lib/librte_net/meson.build | 34 +++++++++++- > > > lib/librte_net/net_crc.h | 34 ++++++++++++ > > > lib/librte_net/{net_crc_neon.h =3D> net_crc_neon.c} | 26 +++------ > > > lib/librte_net/{net_crc_sse.h =3D> net_crc_sse.c} | 34 ++++-------= - > > > lib/librte_net/rte_net_crc.c | 67 +++++++++++++= +--------- > > > 6 files changed, 131 insertions(+), 68 deletions(-) create mode > > > 100644 lib/librte_net/net_crc.h rename lib/librte_net/{net_crc_neon.= h > > > =3D> net_crc_neon.c} (95%) rename lib/librte_net/{net_crc_sse.h =3D> > > > net_crc_sse.c} (94%) > > > > > > >=20 > >=20 > > > +#ifdef CC_X86_64_SSE42_PCLMULQDQ_SUPPORT static uint8_t > > > +sse42_pclmulqdq_cpu_supported(void) > > > +{ > > > + return rte_cpu_get_flag_enabled(RTE_CPUFLAG_PCLMULQDQ); > > > +} > > > > As a nit, I think it would be better to hide #fidef inside the function= , and > > return an 0 when define is not set. > > Something like: > > > > static int > > sse42_pclmulqdq_cpu_supported(void) > > { > > #ifdef CC_X86_64_SSE42_PCLMULQDQ_SUPPORT > > return rte_cpu_get_flag_enabled(RTE_CPUFLAG_PCLMULQDQ); > > #else > > return 0; > > } > > > > Same for other cpu_supported functions. > > And then you can remove these ifdefs in set_alg and other palces, i.e.: > > > > void > > rte_net_crc_set_alg(enum rte_net_crc_alg alg) { > > switch (alg) { > > #ifdef RTE_ARCH_X86_64 > > case RTE_NET_CRC_AVX512: > > if (avx512_vpclmulqdq_cpu_supported()) { > > handlers =3D handlers_avx512; > > break; > > } > > /* fall-through */ > > case RTE_NET_CRC_SSE42: > > if (sse42_pclmulqdq_cpu_supported()) { > > handlers =3D handlers_sse42; > > break; > > } > > #endif > > ... > > > > Same for rte_net_crc_init() >=20 > [DC] I have reworked the ifdefs in this file based on your comments here = and off-list discussions. > These are available now in the v5. >=20 > All ifdef's have been removed out the API function definitions and moved = down into 'helper' type > functions - looks much cleaner now. > > Your Ack has been carried through too to v5 as you mentioned LGTM, thanks. Konstantin =20