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 20F07A04B7; Wed, 14 Oct 2020 10:24:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 758AF1DB81; Wed, 14 Oct 2020 10:24:55 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00070.outbound.protection.outlook.com [40.107.0.70]) by dpdk.org (Postfix) with ESMTP id A10B71C12D for ; Wed, 14 Oct 2020 10:24:52 +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=GBJo5Wr7Uyj42RkkzrqPeUVeEAjpF0czMLp/5jiKkpA=; b=oW/YUwEAUdYYbNM4ZOOf+ag/Jrut/ZWma3d8Cg7tqsq8pzD7ucX6+j4bkCakxMvQw5beUHthwvcB3vbRookmsLpmFqz6FJY4sVsSpihtzZMjuuveT+6AerLZQ+q0pCPHVJsV4oazBSv2eTEgEx9e/NAgKuw6vPj28aqUGFcM7oU= Received: from AM5PR1001CA0009.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::22) by PR3PR08MB5723.eurprd08.prod.outlook.com (2603:10a6:102:89::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.24; Wed, 14 Oct 2020 08:24:50 +0000 Received: from VE1EUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:2:cafe::86) by AM5PR1001CA0009.outlook.office365.com (2603:10a6:206:2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20 via Frontend Transport; Wed, 14 Oct 2020 08:24:50 +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 VE1EUR03FT028.mail.protection.outlook.com (10.152.18.88) 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 08:24:49 +0000 Received: ("Tessian outbound a64c3afb6fc9:v64"); Wed, 14 Oct 2020 08:24:49 +0000 X-CR-MTA-TID: 64aa7808 Received: from e343f8c72e07.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 039ACC05-011F-4AEE-81F4-23C3A5FABBCC.1; Wed, 14 Oct 2020 08:24:44 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e343f8c72e07.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 14 Oct 2020 08:24:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QSNylk+2h/wvSPKLxyYO50DqZHSqUe1A0YQ3MYZiGq88mBuCR8ssDq5XlGAzIXGwLxMk57+6f6G6lvzlry+R+GWVCg8bMV0UTS12mMsIgTxIA06Urf5ApS0gg4MrJ20lwjtwQ695cfcZEHL3901AavamBkm4VyMTun9hZRZGEF15XOC1G3p1PUOiIitfdb6LI2YmfAbgZWhdJ02DX6HIJh+u02ZjMkinSZDgRKHTIpqQXr3EYyKNvjR0MNqQr9wxafEDcE7SHM+scD0fyrtpFf627bRb1XROzVEiFm1gZ7YfCZHA33GX6Lc7UKmqsktYsaDQzYMg67QXuFE2Ky4meg== 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=GBJo5Wr7Uyj42RkkzrqPeUVeEAjpF0czMLp/5jiKkpA=; b=aEADZqIA9Q8bcNUmcEl89MPpl7Q5gCUPZJPFkS7WqLMwSi4MJ6O7+yHnuwf8atlbCDYkNRgM+Rzc1otx0ujoXOJUEJQPtizkEnW2jaI8hN1moO/kbHat3vCgGF0o9NCqwU7G7eM1Otx1jJqbMA51qACaEFoPEM9DY46Gptim4x1mt1eEeIat+WlY2kie2/sh3e74hdD/13Ne/DcB8SF4AxSKcT+vMgpiIzPAd0oypl8yxOKxIIh/oJae9vP0BvWCt75aA3j08TEnU4k3gM+Q72F+IczcamOthTTEfJzcsMzqqO9cvbucaMF6k58BF4P7FeBwNLhBm7cmgJWq7rtWfw== 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=GBJo5Wr7Uyj42RkkzrqPeUVeEAjpF0czMLp/5jiKkpA=; b=oW/YUwEAUdYYbNM4ZOOf+ag/Jrut/ZWma3d8Cg7tqsq8pzD7ucX6+j4bkCakxMvQw5beUHthwvcB3vbRookmsLpmFqz6FJY4sVsSpihtzZMjuuveT+6AerLZQ+q0pCPHVJsV4oazBSv2eTEgEx9e/NAgKuw6vPj28aqUGFcM7oU= Received: from VI1PR0802MB2351.eurprd08.prod.outlook.com (2603:10a6:800:a0::10) by VI1PR08MB5456.eurprd08.prod.outlook.com (2603:10a6:803:12d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.22; Wed, 14 Oct 2020 08:24:42 +0000 Received: from VI1PR0802MB2351.eurprd08.prod.outlook.com ([fe80::14d4:6ade:368a:204b]) by VI1PR0802MB2351.eurprd08.prod.outlook.com ([fe80::14d4:6ade:368a:204b%3]) with mapi id 15.20.3455.031; Wed, 14 Oct 2020 08:24:42 +0000 From: Ruifeng Wang To: 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" , Anatoly Burakov , John McNamara , Marko Kovacevic , nd Thread-Topic: [PATCH v5 02/17] doc: add detail on using max SIMD bitwidth Thread-Index: AQHWoVDPjn9TGhwEs0K5RBnhV9hn9qmWwowQ Date: Wed, 14 Oct 2020 08:24:42 +0000 Message-ID: References: <20200807155859.63888-1-ciara.power@intel.com> <20201013110437.309110-1-ciara.power@intel.com> <20201013110437.309110-3-ciara.power@intel.com> In-Reply-To: <20201013110437.309110-3-ciara.power@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 1A1279A194EB23478F82EFDAB92DCE9D.0 x-checkrecipientchecked: true Authentication-Results-Original: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [203.126.0.112] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d03c5c05-0a27-4830-1c9d-08d8701a9e57 x-ms-traffictypediagnostic: VI1PR08MB5456:|PR3PR08MB5723: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: nSxV1lOZ3BMrU+U96fgGZ+vZFQg6BOtj8hjPx90FjnSsYKXR34B4L06oNT7coHrKvJeHWOkHycDip7HHbY+tqkWq8HmI+4g0PwqhSsfV07vEx+1ESwlB88ZapMscyNWq5idKtVTkrP18yK7E3+RNBVr0SZfmPo9j6kvJdbEDKwXbZHqN4fLRf3/uCB3pDFwj/oH/lOEY1YSt61DrRm0Dk6dS4IvKlOQNpxpXR2hSdjLXRBHFGrVsMOdaTY/0MZRN5Crf02ExaXfcKJczFuXsHHE2bjDiZf/MRdNP1NS2fnwCM0cKbcOUoHOQAlrGiHt68Kjq3nx0xaTGJ8ykyF5tlA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0802MB2351.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(376002)(366004)(346002)(39860400002)(396003)(5660300002)(64756008)(4326008)(66946007)(316002)(7416002)(66446008)(71200400001)(54906003)(66476007)(66556008)(33656002)(76116006)(83380400001)(9686003)(478600001)(55016002)(8676002)(26005)(2906002)(53546011)(86362001)(52536014)(8936002)(110136005)(7696005)(6506007)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: UF81sh50kpiKIHMStsafFOvefrG6ZsTCKD7sb6dHzhah/pr+xuzHI2nCS91ND8Bh8rOAnx2454WlyFxESzwxjUpr4vSOtIDOMt2s/cEz0x40oPZ8P2hb8BbxE95yuqMI/7JBWXdFt3bzJX1hmRRku+Zwym8mWFGdVUzFHxY7XXiXal/Z6m1zE/9fTYpp/bg8UmQ81Xi/gCp/CqOcT2ZKwcaBLoYgc+ErKtnvH/+gSQ2Xreugp6cRh7+NkVKiK5w/2ezTdbiQmDAOekenHBdpi/dKO7o36HAaVhILgE56y3HX9JL5P3CjI13ECQpO9pTMARW94u6WlYifPb0lDVFKnJ5TJwLOhCPUSdXPZ8hJXmgb5BxIiLqIT62j6cVl1cZLM82VHdsSEjAnnZ4kjfy5xhm2ucrCxMOHT0FvxNH8V2gutFvdvVyioqvvPtGIs/lfNYw6yTfvi+6jhKSD0ww/alF6LjIdMMQiJ05q8EHYjJ3I2QU7IlUaVx/g25epJvX6d1UZAHgubcsGU+19yl4kg4iJyD2tx0G7jSM1DPc9VDazbrt9+/YN62LRCSNjyoCQHtybKK59eyIxT3IVmTaF1eAGJtPTX56AffagXl8uD6WicDtkIFTg8saDn2JVQoz4iRNpRbqvSYkyB1fI7ljdIg== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5456 Original-Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 55e7a3f7-a66b-48a6-2ace-08d8701a99f3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J2O8gSXsfjnzzVAnLdNP0QYBHgnyh+bkKXSJ35uv8wyxelFXsdkbOoubmtc9RuX3LZn3Zo6osm1ZkW8FCoKdn/Da/A8MWyFdK6HZcnXBYn1Gsg6Rm1R41T5HmAR3N0Y7Ci1AXkHPDu8mxWMoHP4ZJDFdqK0GxyOE3XIZ2T8o5lK6/WnmHtRk2o0KxUFy0C7QDdsw/ApHBkou9WTisfGDDuHwBath+fiiUZ8GMd+9TRZDpYB8Zjqg1mHW6CHg7jzzrs+ZsrB11XZflP/ydYDZFnbOikRl91O9KZ4juKBpbObsUsVy4MUiIhDAEOr0plgLKRf+ojmCRa0mjGX0Pmtqd0jLX+zlEl93NNpC286Axqi/BowvR2u3ynHER/MmIzb4bfXJ4M4T270wKbf5yN4kLw== 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)(136003)(396003)(39860400002)(46966005)(47076004)(36906005)(82740400003)(53546011)(9686003)(110136005)(54906003)(336012)(55016002)(7696005)(83380400001)(26005)(2906002)(316002)(33656002)(6506007)(82310400003)(5660300002)(8936002)(4326008)(81166007)(186003)(356005)(478600001)(70206006)(52536014)(70586007)(8676002)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2020 08:24:49.9665 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d03c5c05-0a27-4830-1c9d-08d8701a9e57 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: VE1EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5723 Subject: Re: [dpdk-dev] [PATCH v5 02/17] doc: add detail on using 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: Ciara Power > Sent: Tuesday, October 13, 2020 7:04 PM > To: dev@dpdk.org > Cc: viktorin@rehivetech.com; Ruifeng Wang ; > jerinj@marvell.com; drc@linux.vnet.ibm.com; bruce.richardson@intel.com; > konstantin.ananyev@intel.com; Ciara Power ; > Anatoly Burakov ; John McNamara > ; Marko Kovacevic > > Subject: [PATCH v5 02/17] doc: add detail on using max SIMD bitwidth >=20 > This patch adds documentation on the usage of the max SIMD bitwidth EAL > setting, and how to use it to enable AVX-512 at runtime. >=20 > Cc: Anatoly Burakov > Cc: John McNamara > Cc: Marko Kovacevic >=20 > Signed-off-by: Ciara Power >=20 > --- > v4: Updated docs to reflect renamed enum. > v3: > - Added enum value for disabling use of max SIMD to doc. > - Added entry to HowTo index. > --- > doc/guides/howto/avx512.rst | 36 +++++++++++++++++++ > doc/guides/howto/index.rst | 1 + > doc/guides/linux_gsg/eal_args.include.rst | 16 +++++++++ > .../prog_guide/env_abstraction_layer.rst | 32 +++++++++++++++++ > 4 files changed, 85 insertions(+) > create mode 100644 doc/guides/howto/avx512.rst >=20 > diff --git a/doc/guides/howto/avx512.rst b/doc/guides/howto/avx512.rst > new file mode 100644 index 0000000000..6eb3755775 > --- /dev/null > +++ b/doc/guides/howto/avx512.rst > @@ -0,0 +1,36 @@ > +.. SPDX-License-Identifier: BSD-3-Clause > + Copyright(c) 2020 Intel Corporation. > + > + > +Using AVX-512 with DPDK > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +AVX-512 is not used by default in DPDK, but it can be selected at > +runtime by apps through the use of EAL API, and by the user with a > +commandline argument. DPDK has a setting for max SIMD bitwidth, which > can be modified and will then limit the vector path taken by the code. > + > + > +Using the API in apps > +--------------------- > + > +Apps can request DPDK uses AVX-512 at runtime, if it provides improved > application performance. > +This can be done by modifying the EAL setting for max SIMD bitwidth to > +512, as by default it is 256, which does not allow for AVX-512. > + > +.. code-block:: c > + > + rte_set_max_simd_bitwidth(RTE_SIMD_512); > + > +This API should only be called once at initialization, before EAL init. > +For more information on the possible enum values to use as a parameter, > go to :ref:`max_simd_bitwidth`: > + > + > +Using the command-line argument > +--------------------------------------------- > + > +The user can select to use AVX-512 at runtime, using the following > argument to set the max bitwidth:: > + > + ./app/dpdk-testpmd --force-max-simd-bitwidth=3D512 > + > +This will override any further changes to the max SIMD bitwidth in > +DPDK, which is useful for testing purposes. > diff --git a/doc/guides/howto/index.rst b/doc/guides/howto/index.rst inde= x > 5a97ea508c..c2a2c60ddb 100644 > --- a/doc/guides/howto/index.rst > +++ b/doc/guides/howto/index.rst > @@ -20,3 +20,4 @@ HowTo Guides > telemetry > debug_troubleshoot > openwrt > + avx512 > diff --git a/doc/guides/linux_gsg/eal_args.include.rst > b/doc/guides/linux_gsg/eal_args.include.rst > index 0fe4457968..a0bfbd1a98 100644 > --- a/doc/guides/linux_gsg/eal_args.include.rst > +++ b/doc/guides/linux_gsg/eal_args.include.rst > @@ -210,3 +210,19 @@ Other options > * ``--no-telemetry``: >=20 > Disable telemetry. > + > +* ``--force-max-simd-bitwidth=3D``: > + > + Specify the maximum SIMD bitwidth size to handle. This limits which > vector paths, > + if any, are taken, as any paths taken must use a bitwidth below the = max > bitwidth limit. > + For example, to allow all SIMD bitwidths up to and including AVX-512= :: > + > + --force-max-simd-bitwidth=3D512 > + > + The following example shows limiting the bitwidth to 64-bits to disa= ble all > vector code:: > + > + --force-max-simd-bitwidth=3D64 > + > + To disable use of max SIMD bitwidth limit:: > + > + --force-max-simd-bitwidth=3D0 > diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst > b/doc/guides/prog_guide/env_abstraction_layer.rst > index 936c885081..04bb910386 100644 > --- a/doc/guides/prog_guide/env_abstraction_layer.rst > +++ b/doc/guides/prog_guide/env_abstraction_layer.rst > @@ -486,6 +486,38 @@ the desired addressing mode when virtual devices > that are not directly attached To facilitate forcing the IOVA mode to a = specific > value the EAL command line option ``--iova-mode`` can be used to select > either physical addressing('pa') or virtual addressing('va'). >=20 > +.. _max_simd_bitwidth: > + > + > +Max SIMD bitwidth > +~~~~~~~~~~~~~~~~~ > + > +The EAL provides a single setting to limit the max SIMD bitwidth used > +by DPDK, which is used in determining the vector path, if any, chosen by= a > component. > +The value can be set at runtime by an application using the > +'rte_set_max_simd_bitwidth(uint16_t bitwidth)' function, which should > only be called once at initialization, before EAL init. > +The value can be overridden by the user using the EAL command-line > option '--force-max-simd-bitwidth'. > + > +When choosing a vector path, along with checking the CPU feature > +support, the value of the max SIMD bitwidth must also be checked, and ca= n > be retrieved using the 'rte_get_max_simd_bitwidth()' function. > +The value should be compared against the enum values for accepted max > SIMD bitwidths: > + > +.. code-block:: c > + > + enum rte_max_simd { > + RTE_SIMD_DISABLED =3D 64, > + RTE_SIMD_128 =3D 128, > + RTE_SIMD_256 =3D 256, > + RTE_SIMD_512 =3D 512, > + RTE_SIMD_MAX =3D UINT16_MAX, RTE_SIMD_MAX is inconsistent with patch 1/17. Needs update. > + }; > + > + if (rte_get_max_simd_bitwidth() >=3D RTE_SIMD_512) > + /* Take AVX-512 vector path */ > + else if (rte_get_max_simd_bitwidth() >=3D RTE_SIMD_256) > + /* Take AVX2 vector path */ > + > + > Memory Segments and Memory Zones (memzone) > ------------------------------------------ >=20 > -- > 2.22.0