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 8BCB0A04B7; Wed, 14 Oct 2020 16:19:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 582F71DC1D; Wed, 14 Oct 2020 16:19:17 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70078.outbound.protection.outlook.com [40.107.7.78]) by dpdk.org (Postfix) with ESMTP id AF77C1DA4C for ; Wed, 14 Oct 2020 16:19:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=reKk1Ya3pmGq/i8s74DppHAHAYxeTat6tYt9WaOKQYI=; b=LG5GObBNl73voDrALaUfo5c2eVKzScSnpvolX3PfjCIxB9Kt7HDtBbvtbt1i3pHQta4OR39tBbwPonBYDFuHGCtkgOEnnpG+jJ+ZWcMMSW3kWnt0TDV1v0ROJPGHFA+b+2w0pA8KeWJjoUKoso9jIg8dV8JqVsq+DeVeMa4QgXE= Received: from AM6P191CA0096.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::37) by VI1PR08MB4109.eurprd08.prod.outlook.com (2603:10a6:803:e7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20; Wed, 14 Oct 2020 14:19:12 +0000 Received: from VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::74) by AM6P191CA0096.outlook.office365.com (2603:10a6:209:8a::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Wed, 14 Oct 2020 14:19:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT058.mail.protection.outlook.com (10.152.19.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Wed, 14 Oct 2020 14:19:11 +0000 Received: ("Tessian outbound c579d876a324:v64"); Wed, 14 Oct 2020 14:19:10 +0000 X-CR-MTA-TID: 64aa7808 Received: from e46349d24f98.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 44853D15-9D8D-4F57-8FA9-57B568E72C2B.1; Wed, 14 Oct 2020 14:19:05 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e46349d24f98.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 14 Oct 2020 14:19:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lsji+VItvxM55KJmXYKv2cSP2xqFkV5+mXMdQXYcae6RFLCYZc2LOMomjWh0YnU16mFI+lFCjVLZa//3tBI7f0O8KDlB4D6RdpTx/SVImoixEjlCz9elLjuEi/foE28VCmUDyuQeNYE8swUsN4H7Sf2I+0pw424JbrthZf5q3cNNXwlSYBiNnHl4CtlEq8VZHFPQBcwXXXEwC2B8ZeZlAF8vf/ambxhBiFs9w4lgVU8hqIng/0Z/DLn+ZGF/3TIDYN67m7gfICn1WC1ff5tVfeMZmzp4GcxNvzrpC1Zm6gQuiX2EAOc0PM3NSh/bthJgToxMp8N6TP6QJfXueE1ILQ== 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=reKk1Ya3pmGq/i8s74DppHAHAYxeTat6tYt9WaOKQYI=; b=erV+39PTkvYe8YzJ8Tf83sL0FoYRwB6WfzpwWQdZPi+P+VHUorCAGnIt0caUu1rHP/ZIfvxysOa59/iBMpfxxpaQTpS3ShA9L8N0qITV/hCFTLu2Tzfa7EtMxHPEaGuBEcn6m8AzoomQJef/EA/0YJbU6/GuOy2NTjWU1gsBOIw5JO91zNgmqIUsph47F3xQCzx5eAjljq/rqddsoZHDH0Tu1xs3kVIzl3ktXNy41fD6cv6JnfL7Rh2B8OTLh8bIiXF5m2+mxLQoTMSTOXGWjObmtta0XSmdYrAQ7gBi58Vp71q56I3YKOe1koT4Wp0DTZOqleDQsS3uFBAuxWaLYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=reKk1Ya3pmGq/i8s74DppHAHAYxeTat6tYt9WaOKQYI=; b=LG5GObBNl73voDrALaUfo5c2eVKzScSnpvolX3PfjCIxB9Kt7HDtBbvtbt1i3pHQta4OR39tBbwPonBYDFuHGCtkgOEnnpG+jJ+ZWcMMSW3kWnt0TDV1v0ROJPGHFA+b+2w0pA8KeWJjoUKoso9jIg8dV8JqVsq+DeVeMa4QgXE= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB6PR08MB2774.eurprd08.prod.outlook.com (2603:10a6:6:23::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.29; Wed, 14 Oct 2020 14:19:00 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::7814:9c1:781f:475d]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::7814:9c1:781f:475d%4]) with mapi id 15.20.3477.020; Wed, 14 Oct 2020 14:19:00 +0000 From: Honnappa Nagarahalli To: Ruifeng Wang , Ciara Power , "dev@dpdk.org" CC: "viktorin@rehivetech.com" , "jerinj@marvell.com" , "drc@linux.vnet.ibm.com" , "bruce.richardson@intel.com" , "konstantin.ananyev@intel.com" , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Ray Kinsella , Neil Horman , nd , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v5 01/17] eal: add max SIMD bitwidth Thread-Index: AQHWoVC+m2ppuKewMEmLbWlpb9HpSamWy5AAgABZqeA= Date: Wed, 14 Oct 2020 14:19:00 +0000 Message-ID: References: <20200807155859.63888-1-ciara.power@intel.com> <20201013110437.309110-1-ciara.power@intel.com> <20201013110437.309110-2-ciara.power@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 3992604F112DB448B20F07EBEA08882F.0 x-checkrecipientchecked: true Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [217.140.110.7] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9f119864-75e3-4fc7-2d4d-08d8704c1f4a x-ms-traffictypediagnostic: DB6PR08MB2774:|VI1PR08MB4109: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:6430;OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ZYP2ejkHOZsyvXeG1VozmjuCuDiZAFckerDCEIoF3IQKiLKkGVzQjYTqJfiJUC4PcCqKYBb6UHGxdIgSZvvv76iCX2rQqhm+U9J/b4XeolAcoHSUZdJTxR17w/32Ge0HhywlkVr14hTuKy15F9/6sxkKWUe7GaLweWeTQ91v9OhEiJ89R0pdq8Yi4E/eYDsqKHl1K22vhp4QUuIHcCwDbhIKaNCFq7Chhv7ALDSr3E32hNtBAb4ZeuAe/D5qbAcT90iwhSUmueLNbpg2wnP/iKNg1pxGHkiQrfjejjPxIfi6WLUHSC8xygDK2Rhg4ZQYKxUHRnrVRXhBHVD8vqPgVQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(346002)(376002)(136003)(366004)(76116006)(7696005)(8676002)(86362001)(4326008)(26005)(5660300002)(30864003)(33656002)(52536014)(66556008)(64756008)(66446008)(186003)(66476007)(478600001)(6506007)(55016002)(8936002)(66946007)(110136005)(7416002)(83380400001)(9686003)(2906002)(71200400001)(54906003)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 53O8RwvMNT5V1/W3ArT/6Nq677Tz3wZyLwbzimkQ7skrO2upBhjmHd+mmfbdio2GiBYnMmFYhGcCz73tPqMnvtnH5om2/KszcAiKAG7uRZP49Zj4IJ9a6l4+Pa1x05XKz1UznWQMBmSO0tYPCvM4dBBdSvbyndB6Qz9K1HMm2ZJPc74RdL+p/sMHcPnB/MA0KnM4rLrHRHi7C5WXpXpFaH1IEOcRxS3dtdHYD7mfdkK4jrQKe2qDDbw2V4Yi+fHJbE64c2cp2RJjpnHQ+1ZTdprHPd6wAuwx4qACg9KwTWXNHitfVXTZSPYiQObEb/AgEFt0b2sKiRboPAvU1JPAqhOPjoaFPjLz1RCppqxzym/2VJcegGGeY0X+u7WjKNjwwQajLPrjmgkW3EIF7b2lBZBI9l3cCmvjW3x2fgE3EcnWKzTiecbNG4S1UkmGSHqg0zkGvQVi1BnUVlOgQxdKNYCa28vz7HAUO2mMjOc3+ycJYTT8WIYRs4u9g6nSat6idtz+HSIrFw+yoDWdjv3CYdu+KbBoeTRAChxJ0o7lYnMHFd+TqcSAhqf5wbrwkHSO8blVdK9xWDE2ArVIzAt00XLtfyDRetMw3l5e/4UAQKLV9S7FXPbYnLX7/cFqIFYWgAxfT8MI9N12GT1LszCzvA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2774 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 3308d7bb-7d15-4324-35e2-08d8704c1877 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rhBhU2CQ7w0iJ0lBUhNbNQlvPUcJQwSLSJLYGZHXzx0K+772t8DST2rDe91TP45n6qhmZjvT9XG7MkJic+dqXCWog2N2zF5biic9lSPXheBmzktlb5Q5WtVq2E+lfaWAr7LCgr1tO4zTJmOCtG14UWEbKeesYCHnNPxrVz2rMpCx936yItk3fM3iShupJo2PwO2s8C6F9HT32km1/XEcchrGuPur5xSniSuNXgM5Th0wBaWLeqa8KwxGgVNpFRvFf3uIlxvaXeEi3z1HRxk8BncESleWQnMX3OMo90FXiR84jn7zdq3nT2yWX5GjwVXcFgFnAPBhM24J4VVUIDxCSKsjXZcXv5bqICSW4YRBF5ZW+JK5Z2C57Sms7x2QwL5H+pIXuhnOYcP8HcGujL8VTw== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(136003)(46966005)(82310400003)(33656002)(356005)(6506007)(83380400001)(30864003)(70586007)(70206006)(86362001)(54906003)(52536014)(110136005)(316002)(5660300002)(4326008)(81166007)(478600001)(336012)(26005)(55016002)(9686003)(2906002)(186003)(82740400003)(8936002)(47076004)(7696005)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2020 14:19:11.6606 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f119864-75e3-4fc7-2d4d-08d8704c1f4a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4109 Subject: Re: [dpdk-dev] [PATCH v5 01/17] eal: add 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" > > > > This patch adds a max SIMD bitwidth EAL configuration. The API allows > > for an app to set this value. It can also be set using EAL argument > > --force-max-simd- bitwidth, which will lock the value and override any > > modifications made by the app. > > > > Each arch has a define for the default SIMD bitwidth value, this is > > used on EAL init to set the config max SIMD bitwidth. > > > > Cc: Ruifeng Wang > > Cc: Jerin Jacob > > Cc: Honnappa Nagarahalli > > Cc: David Christensen > > > > Signed-off-by: Ciara Power > > > > --- > > v4: > > - Used RTE_SIMD_MAX instead of UINT16_MAX. > > - Renamed enums to better reflect usage. > > - Added functions to windows symbol export file. > > - Modified Doxygen comments. > > - Modified enum name. > > - Changed RTE_SIMD_MAX value to a power of 2. > > - Merged patch 2 into this patch. > > - Enum now used for default value defines. > > - Fixed some small comments on v3. > > v3: > > - Added enum value to essentially disable using max SIMD to choose > > paths, intended for use by ARM SVE. > > - Fixed parsing bitwidth argument to return an error for values > > greater than uint16_t. > > - Removed unnecessary define in generic rte_vect.h > > - Changed default bitwidth for ARM to UINT16_MAX, to allow for SVE. > > v2: > > - Added to Doxygen comment for API. > > - Changed default bitwidth for Arm to 128. > > --- > > lib/librte_eal/arm/include/rte_vect.h | 2 + > > lib/librte_eal/common/eal_common_options.c | 66 > > ++++++++++++++++++++++ > > lib/librte_eal/common/eal_internal_cfg.h | 8 +++ > > lib/librte_eal/common/eal_options.h | 2 + > > lib/librte_eal/include/rte_eal.h | 40 +++++++++++++ > > lib/librte_eal/ppc/include/rte_vect.h | 2 + > > lib/librte_eal/rte_eal_exports.def | 2 + > > lib/librte_eal/rte_eal_version.map | 2 + > > lib/librte_eal/x86/include/rte_vect.h | 2 + > > 9 files changed, 126 insertions(+) > > > > diff --git a/lib/librte_eal/arm/include/rte_vect.h > > b/lib/librte_eal/arm/include/rte_vect.h > > index 01c51712a1..f53c89be97 100644 > > --- a/lib/librte_eal/arm/include/rte_vect.h > > +++ b/lib/librte_eal/arm/include/rte_vect.h > > @@ -14,6 +14,8 @@ > > extern "C" { > > #endif > > > > +#define RTE_DEFAULT_SIMD_BITWIDTH RTE_SIMD_MAX > > + > > typedef int32x4_t xmm_t; > > > > #defineXMM_SIZE(sizeof(xmm_t)) > > diff --git a/lib/librte_eal/common/eal_common_options.c > > b/lib/librte_eal/common/eal_common_options.c > > index a5426e1234..8c79f1b2fc 100644 > > --- a/lib/librte_eal/common/eal_common_options.c > > +++ b/lib/librte_eal/common/eal_common_options.c > > @@ -35,6 +35,7 @@ > > #ifndef RTE_EXEC_ENV_WINDOWS > > #include > > #endif > > +#include > > > > #include "eal_internal_cfg.h" > > #include "eal_options.h" > > @@ -102,6 +103,7 @@ eal_long_options[] =3D > { {OPT_MATCH_ALLOCATIONS, 0, > > NULL, OPT_MATCH_ALLOCATIONS_NUM}, > > {OPT_TELEMETRY, 0, NULL, OPT_TELEMETRY_NUM }, > > {OPT_NO_TELEMETRY, 0, NULL, OPT_NO_TELEMETRY_NUM }, > > +{OPT_FORCE_MAX_SIMD_BITWIDTH, 1, NULL, > > +OPT_FORCE_MAX_SIMD_BITWIDTH_NUM}, > > {0, 0, NULL, 0 } > > }; > > > > @@ -343,6 +345,8 @@ eal_reset_internal_config(struct internal_config > > *internal_cfg) > > internal_cfg->user_mbuf_pool_ops_name =3D NULL; > > CPU_ZERO(&internal_cfg->ctrl_cpuset); > > internal_cfg->init_complete =3D 0; > > +internal_cfg->max_simd_bitwidth.bitwidth =3D > > RTE_DEFAULT_SIMD_BITWIDTH; > > +internal_cfg->max_simd_bitwidth.forced =3D 0; > > } > > > > static int > > @@ -1309,6 +1313,34 @@ eal_parse_iova_mode(const char *name) > return > > 0; } > > > > +static int > > +eal_parse_simd_bitwidth(const char *arg) { char *end; unsigned long > > +bitwidth; int ret; struct internal_config *internal_conf =3D > > +eal_get_internal_configuration(); > > + > > +if (arg =3D=3D NULL || arg[0] =3D=3D '\0') > > +return -1; > > + > > +errno =3D 0; > > +bitwidth =3D strtoul(arg, &end, 0); > > + > > +/* check for errors */ > > +if (errno !=3D 0 || end =3D=3D NULL || *end !=3D '\0' || bitwidth > > > RTE_SIMD_MAX) > > +return -1; > > + > > +if (bitwidth =3D=3D 0) > > +bitwidth =3D (unsigned long) RTE_SIMD_MAX; ret =3D > > +rte_set_max_simd_bitwidth(bitwidth); > > +if (ret < 0) > > +return -1; > > +internal_conf->max_simd_bitwidth.forced =3D 1; return 0; } > > + > > static int > > eal_parse_base_virtaddr(const char *arg) { @@ -1707,6 +1739,13 @@ > > eal_parse_common_option(int opt, const char *optarg, case > > OPT_NO_TELEMETRY_NUM: > > conf->no_telemetry =3D 1; > > break; > > +case OPT_FORCE_MAX_SIMD_BITWIDTH_NUM: > > +if (eal_parse_simd_bitwidth(optarg) < 0) { RTE_LOG(ERR, EAL, "invalid > > +parameter for --" > > +OPT_FORCE_MAX_SIMD_BITWIDTH > > "\n"); > > +return -1; > > +} > > +break; > > > > /* don't know what to do, leave this to caller */ > > default: > > @@ -1903,6 +1942,32 @@ eal_check_common_options(struct > internal_config > > *internal_cfg) return 0; } > > > > +uint16_t > > +rte_get_max_simd_bitwidth(void) > > +{ > > +const struct internal_config *internal_conf =3D > > +eal_get_internal_configuration(); > > +return internal_conf->max_simd_bitwidth.bitwidth; > > +} > > + > > +int > > +rte_set_max_simd_bitwidth(uint16_t bitwidth) { struct internal_config > > +*internal_conf =3D eal_get_internal_configuration(); if > > +(internal_conf->max_simd_bitwidth.forced) { RTE_LOG(NOTICE, EAL, > > +"Cannot set max SIMD bitwidth - user > > runtime override enabled"); > > +return -EPERM; > > +} > > + > > +if (bitwidth < RTE_SIMD_DISABLED || !rte_is_power_of_2(bitwidth)) > > { > > +RTE_LOG(ERR, EAL, "Invalid bitwidth value!\n"); return -EINVAL; } > > +internal_conf->max_simd_bitwidth.bitwidth =3D bitwidth; return 0; } > > + > > void > > eal_common_usage(void) > > { > > @@ -1981,6 +2046,7 @@ eal_common_usage(void) > > " --"OPT_BASE_VIRTADDR" Base virtual address\n" > > " --"OPT_TELEMETRY" Enable telemetry support (on by > > default)\n" > > " --"OPT_NO_TELEMETRY" Disable telemetry support\n" > > + " --"OPT_FORCE_MAX_SIMD_BITWIDTH" Force the max SIMD > > bitwidth\n" > > "\nEAL options for DEBUG use only:\n" > > " --"OPT_HUGE_UNLINK" Unlink hugepage files after init\n= " > > " --"OPT_NO_HUGE" Use malloc instead of hugetlbfs\n" > > diff --git a/lib/librte_eal/common/eal_internal_cfg.h > > b/lib/librte_eal/common/eal_internal_cfg.h > > index 13f93388a7..0c880cbe17 100644 > > --- a/lib/librte_eal/common/eal_internal_cfg.h > > +++ b/lib/librte_eal/common/eal_internal_cfg.h > > @@ -33,6 +33,12 @@ struct hugepage_info { > > int lock_descriptor; /**< file descriptor for hugepage dir */ > > }; > > > > +struct simd_bitwidth { > > +bool forced; > > +/**< flag indicating if bitwidth is forced and can't be modified */ > > +uint16_t bitwidth; /**< bitwidth value */ }; > > + > > /** > > * internal configuration > > */ > > @@ -85,6 +91,8 @@ struct internal_config { volatile unsigned int > > init_complete; /**< indicates whether EAL has completed > > initialization */ unsigned int no_telemetry; /**< true to disable > > Telemetry */ > > +struct simd_bitwidth max_simd_bitwidth; /**< max simd bitwidth path > > +to use */ > > }; > > > > void eal_reset_internal_config(struct internal_config *internal_cfg); > > diff --git a/lib/librte_eal/common/eal_options.h > > b/lib/librte_eal/common/eal_options.h > > index 89769d48b4..ef33979664 100644 > > --- a/lib/librte_eal/common/eal_options.h > > +++ b/lib/librte_eal/common/eal_options.h > > @@ -85,6 +85,8 @@ enum { > > OPT_TELEMETRY_NUM, > > #define OPT_NO_TELEMETRY "no-telemetry" > > OPT_NO_TELEMETRY_NUM, > > +#define OPT_FORCE_MAX_SIMD_BITWIDTH "force-max-simd-bitwidth" > > +OPT_FORCE_MAX_SIMD_BITWIDTH_NUM, > > OPT_LONG_MAX_NUM > > }; > > > > diff --git a/lib/librte_eal/include/rte_eal.h > > b/lib/librte_eal/include/rte_eal.h > > index e3c2ef185e..706d3cca5a 100644 > > --- a/lib/librte_eal/include/rte_eal.h > > +++ b/lib/librte_eal/include/rte_eal.h > > @@ -43,6 +43,23 @@ enum rte_proc_type_t { RTE_PROC_INVALID }; > > > > +/** > > + * The max SIMD bitwidth value to limit vector path selection. > > + */ > > +enum rte_max_simd { > > +RTE_SIMD_DISABLED =3D 64, > > +/**< Limits path selection to scalar, disables all vector paths. */ > > +RTE_SIMD_128 =3D 128, > > +/**< Limits path selection to SSE/NEON/Altivec or below. */ > > +RTE_SIMD_256 =3D 256, /**< Limits path selection to AVX2 or below. */ > > +RTE_SIMD_512 =3D 512, /**< Limits path selection to AVX512 or below. > > */ > > +RTE_SIMD_MAX =3D INT16_MAX + 1, > > +/**< > > + * Disables limiting by max SIMD bitwidth, allows all suitable paths. > > + * This value is used as it is a large number and a power of 2. > > + */ > > +}; > > + > > /** > > * Get the process type in a multi-process setup > > * > > @@ -51,6 +68,29 @@ enum rte_proc_type_t { > > */ > > enum rte_proc_type_t rte_eal_process_type(void); > > > > +/** > > + * Get the supported SIMD bitwidth. > > + * > > + * @return > > + * uint16_t bitwidth. > > + */ > > +__rte_experimental > > +uint16_t rte_get_max_simd_bitwidth(void); > > + > > +/** > > + * Set the supported SIMD bitwidth. > > + * This API should only be called once at initialization, before EAL i= nit. > > + * > > + * @param bitwidth > > + * uint16_t bitwidth. > > + * @return > > + * - 0 on success. > > + * - -EINVAL on invalid bitwidth parameter. > > + * - -EPERM if bitwidth is forced. > > + */ > > +__rte_experimental > > +int rte_set_max_simd_bitwidth(uint16_t bitwidth); > > + > > /** > > * Request iopl privilege for all RPL. > > * > > diff --git a/lib/librte_eal/ppc/include/rte_vect.h > > b/lib/librte_eal/ppc/include/rte_vect.h > > index b0545c878c..a69aabc568 100644 > > --- a/lib/librte_eal/ppc/include/rte_vect.h > > +++ b/lib/librte_eal/ppc/include/rte_vect.h > > @@ -15,6 +15,8 @@ > > extern "C" { > > #endif > > > > +#define RTE_DEFAULT_SIMD_BITWIDTH RTE_SIMD_256 > > + > > typedef vector signed int xmm_t; > > > > #defineXMM_SIZE(sizeof(xmm_t)) > > diff --git a/lib/librte_eal/rte_eal_exports.def > > b/lib/librte_eal/rte_eal_exports.def > > index 7b35beb702..81e99b00d9 100644 > > --- a/lib/librte_eal/rte_eal_exports.def > > +++ b/lib/librte_eal/rte_eal_exports.def > > @@ -26,6 +26,7 @@ EXPORTS > > rte_eal_tailq_register > > rte_eal_using_phys_addrs > > rte_free > > +rte_get_max_simd_bitwidth > > rte_get_tsc_hz > > rte_hexdump > > rte_intr_rx_ctl > > @@ -62,6 +63,7 @@ EXPORTS > > rte_memzone_reserve_aligned > > rte_memzone_reserve_bounded > > rte_memzone_walk > > +rte_set_max_simd_bitwidth > > rte_socket_id > > rte_strerror > > rte_strsplit > > diff --git a/lib/librte_eal/rte_eal_version.map > > b/lib/librte_eal/rte_eal_version.map > > index a93dea9fe6..714be49377 100644 > > --- a/lib/librte_eal/rte_eal_version.map > > +++ b/lib/librte_eal/rte_eal_version.map > > @@ -400,6 +400,8 @@ EXPERIMENTAL { > > # added in 20.11 > > __rte_eal_trace_generic_size_t; > > rte_service_lcore_may_be_active; > > +rte_get_max_simd_bitwidth; > > +rte_set_max_simd_bitwidth; > > }; > > > > INTERNAL { > > diff --git a/lib/librte_eal/x86/include/rte_vect.h > > b/lib/librte_eal/x86/include/rte_vect.h > > index df5a607623..a00d3d5a62 100644 > > --- a/lib/librte_eal/x86/include/rte_vect.h > > +++ b/lib/librte_eal/x86/include/rte_vect.h > > @@ -35,6 +35,8 @@ > > extern "C" { > > #endif > > > > +#define RTE_DEFAULT_SIMD_BITWIDTH RTE_SIMD_256 > > + > > typedef __m128i xmm_t; > > > > #defineXMM_SIZE(sizeof(xmm_t)) > > -- > > 2.22.0 > Arm SVE may not perfectly fit into this. Because SIMD bitwidth is unknown= / > unconcerned by application. > I think vector path will be taken when max SIMD bitwidth is not set to > RTE_SIMD_DISABLED. SVE code will be independent of the width. User either chooses 128b (for NE= ON) or SVE. Internally in DPDK, Arm code will choose SVE when width is set = to max. The default config for Arm is set to SVE (instead of NEON) as the performan= ce will be equivalent to NEON when the SVE implementation is 128b wide. >=20 > Reviewed-by: Ruifeng Wang