From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6E42EA0AC5 for ; Thu, 2 May 2019 12:00:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0CEFF3253; Thu, 2 May 2019 12:00:53 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 064602C6A for ; Thu, 2 May 2019 12:00:50 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x429r6j6004883; Thu, 2 May 2019 03:00:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=xjsVj/jG3M04Vb74z426DRmpaT2jlFmlHEzm+G2GQHM=; b=J4Jaii77ynpegNKn4d4G1gMnz60N5xQHs9p24l0qrL4lSZrtHqm4Od702QpmDuBL2ArE a2EDLb3sJxL2kkvKwAJEf7m4kSY81g0lIXT8h9QbxjNGTqsAWV/9kinY0mt1kd16DFBZ +kLY6RJw1Fj5Y5reOtP3iNiab4iL53Nk5rO2ZcY7bIVZuhsy4nyC0vHfj/r6v7lu/XNO Uk8Uy8Hw5G484fnBCdq5+CI1C9Lw71lVDMtbKif2sUm1eUlgnuR0k4uD/wGTV/eSBQXO LqQ+SDSYn3dNOVE5VQdQ9XoAnEsH5QNloQI4BT87b7ZAUCcjV2QR0xHgEOCn5SlCAco/ hg== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2s7gk4aqtw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 02 May 2019 03:00:46 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 May 2019 03:00:45 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.55) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Thu, 2 May 2019 03:00:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xjsVj/jG3M04Vb74z426DRmpaT2jlFmlHEzm+G2GQHM=; b=az2jO0Qudfk06KRsLEnpKYNDzPtHT/i3wOUy+VMcP/UKC5RZrQpuDaXnNLPKTB7cIQlHiObssRuoREo0nf2WSJ1dzMtWuSilRQfy2gxrYMgZtTq/NwVOOJOl8UfKLlTHVzvW5WzLFn14E7u7voxS1aKpnS11IO5dbrpJEnpIAnY= Received: from BYAPR18MB2424.namprd18.prod.outlook.com (20.179.91.149) by BYAPR18MB2981.namprd18.prod.outlook.com (20.179.60.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Thu, 2 May 2019 10:00:43 +0000 Received: from BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::5827:68d1:b66c:bd2d]) by BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::5827:68d1:b66c:bd2d%3]) with mapi id 15.20.1856.008; Thu, 2 May 2019 10:00:43 +0000 From: Jerin Jacob Kollanukkaran To: Yongseok Koh , Honnappa Nagarahalli CC: Shahaf Shuler , Thomas Monjalon , "dev@dpdk.org" , "bruce.richardson@intel.com" , "Pavan Nikhilesh Bhagavatula" , "Gavin Hu (Arm Technology China)" , nd Thread-Topic: [dpdk-dev] [PATCH 1/2] build: add option for armv8 crypto extension Thread-Index: AQHVAKqBD4m3OTMdTUi2lU8y+RRN5KZXmURQ Date: Thu, 2 May 2019 10:00:43 +0000 Message-ID: References: <20190502015806.41497-1-yskoh@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [116.68.105.47] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5db2a0bb-01fe-45ee-08c8-08d6cee50a5c x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:BYAPR18MB2981; x-ms-traffictypediagnostic: BYAPR18MB2981: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0025434D2D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(396003)(346002)(376002)(366004)(199004)(189003)(13464003)(446003)(71200400001)(71190400001)(8936002)(9686003)(4326008)(81166006)(11346002)(76176011)(6246003)(102836004)(186003)(53936002)(26005)(6506007)(25786009)(66066001)(66476007)(66446008)(55016002)(6306002)(86362001)(53546011)(68736007)(55236004)(66946007)(76116006)(476003)(486006)(52536014)(256004)(33656002)(5660300002)(7696005)(66556008)(7736002)(74316002)(73956011)(305945005)(14444005)(64756008)(99286004)(81156014)(14454004)(54906003)(229853002)(966005)(6436002)(316002)(2906002)(6116002)(3846002)(478600001)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR18MB2981; H:BYAPR18MB2424.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Lx3NL9N1wYe9Z47HLVCnZfvg1o8tTQZ13U/LR7o6eDSyv5MFWJEtfB3eNkKjGlrVX5P7z89N4deg21m+dhDmZ5TAKZzm2mc61YvBzzHTNzx0RjUX9jtW49Cjk0ph9iGZUTzBX2ne+zD8DXcvsXhSVLzxYf17x+issXYkVrvhcj6TqwQ8tkLli5LkutS5zDubebwlurSCVvoQ0BtbluJlZ6I2+WMMk8LLcw9/8zqpptM5cs5GrRnMgCmuNdhfWNIwc5WBx4hUMmF170dKY1b5ZIB29Z2BIidjn5gjxMep2o3BqpgPeaNRlztPRvoA7RkVoTqL5iOQ5RfUEigV/+trHJkhTTUXZ93eId6nlSsqvIcYZgq4YlS7rzoan3Rre6a2EYqy1eYLFtZ8mg8daS/bYmwRXOFPwQ+scTtB+/caB+E= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 5db2a0bb-01fe-45ee-08c8-08d6cee50a5c X-MS-Exchange-CrossTenant-originalarrivaltime: 02 May 2019 10:00:43.4398 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2981 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-02_05:, , signatures=0 Subject: Re: [dpdk-dev] [PATCH 1/2] build: add option for armv8 crypto extension 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" Message-ID: <20190502100043.llIVQjF3OcLia6Kl4bzSK9UJ4_ZhCLm9pdH0Ria-i0s@z> > -----Original Message----- > From: dev On Behalf Of Yongseok Koh > Sent: Thursday, May 2, 2019 11:17 AM > To: Honnappa Nagarahalli > Cc: Jerin Jacob Kollanukkaran ; Shahaf Shuler > ; Thomas Monjalon ; > dev@dpdk.org; bruce.richardson@intel.com; Pavan Nikhilesh Bhagavatula > ; Gavin Hu (Arm Technology China) > ; nd > Subject: Re: [dpdk-dev] [PATCH 1/2] build: add option for armv8 crypto > extension >=20 > > On May 1, 2019, at 9:13 PM, Honnappa Nagarahalli > wrote: > > > >> Per armv8 crypto extension support, make build always enable it by > >> default as long as compiler supports the feature while meson build > >> only enables it for 'default' machine of generic armv8 architecture. > >> For example, specifying '- mcpu=3Dcortex-a72' doesn't enable it but > >> '+crypto' is required in order to enable the feature. > >> > >> It is also known that not all the armv8 platforms have the crypto exte= nsion. > >> For example, Mellanox BlueField has a variant which doesn't have it. > >> If crypto enabled binary runs on such a platform, rte_eal_init() fails= . > >> > >> Therefore, an option to control this feature is necessary. It is > >> still enabled by default but can be selectively disabled by vendors. > > The distro/binary portable image needs to be built without crypto. Only= the > crypto drivers need to be built with crypto and at run time we need to ho= ok up > the correct function pointers. So, IMO, by default crypto should be disab= led and > should be enabled in specific target machine configs. >=20 > I make it enabled by default simply because I don't want to change the cu= rrent > behavior, no breakage. >=20 > I also want to hear from others. Jerin, Thomas? I think, Honnapa suggestion would work as core crypto driver is build as se= parate binary now. https://github.com/caviumnetworks/armv8_crypto=09 If so, It makes sense to disable crypto by default for DPDK as DPDK directl= y not using any crypto instructions. >=20 > >> > >> Signed-off-by: Yongseok Koh > >> --- > >> config/arm/meson.build | 16 +++++++++------- > >> config/common_armv8a_linux | 1 + > >> drivers/crypto/armv8/Makefile | 4 ++++ > >> meson_options.txt | 2 ++ > >> mk/machine/armv8a/rte.vars.mk | 4 ++++ > >> 5 files changed, 20 insertions(+), 7 deletions(-) > >> > >> diff --git a/config/arm/meson.build b/config/arm/meson.build index > >> 7fa6ed3105..3b53842d08 100644 > >> --- a/config/arm/meson.build > >> +++ b/config/arm/meson.build > >> @@ -8,6 +8,8 @@ march_opt =3D '-march=3D@0@'.format(machine) > >> arm_force_native_march =3D false arm_force_default_march =3D (machine= =3D=3D > >> 'default') > >> > >> +crypto_flag =3D get_option('enable_armv8_crypto') ? '+crypto' : '' > >> + > >> flags_common_default =3D [ > >> # Accelarate rte_memcpy. Be sure to run unit test > >> (memcpy_perf_autotest) > >> # to determine the best threshold in code. Refer to notes in source > >> file @@ -74,14 +76,14 @@ flags_octeontx2_extra =3D [ > >> ['RTE_USE_C11_MEM_MODEL', true]] > >> > >> machine_args_generic =3D [ > >> - ['default', ['-march=3Darmv8-a+crc+crypto']], > >> + ['default', ['-march=3Darmv8-a+crc' + crypto_flag]], > >> ['native', ['-march=3Dnative']], > >> - ['0xd03', ['-mcpu=3Dcortex-a53']], > >> - ['0xd04', ['-mcpu=3Dcortex-a35']], > >> - ['0xd07', ['-mcpu=3Dcortex-a57']], > >> - ['0xd08', ['-mcpu=3Dcortex-a72']], > >> - ['0xd09', ['-mcpu=3Dcortex-a73']], > >> - ['0xd0a', ['-mcpu=3Dcortex-a75']]] > >> + ['0xd03', ['-mcpu=3Dcortex-a53' + crypto_flag]], > >> + ['0xd04', ['-mcpu=3Dcortex-a35' + crypto_flag]], > >> + ['0xd07', ['-mcpu=3Dcortex-a57' + crypto_flag]], > >> + ['0xd08', ['-mcpu=3Dcortex-a72' + crypto_flag]], > >> + ['0xd09', ['-mcpu=3Dcortex-a73' + crypto_flag]], > >> + ['0xd0a', ['-mcpu=3Dcortex-a75' + crypto_flag]]] > >> > >> machine_args_cavium =3D [ > >> ['default', ['-march=3Darmv8-a+crc+crypto','-mcpu=3Dthunderx']], > >> diff --git a/config/common_armv8a_linux b/config/common_armv8a_linux > >> index 72091de1c7..0efa3e2eb2 100644 > >> --- a/config/common_armv8a_linux > >> +++ b/config/common_armv8a_linux > >> @@ -5,6 +5,7 @@ > >> #include "common_linux" > >> > >> CONFIG_RTE_MACHINE=3D"armv8a" > >> +CONFIG_RTE_ENABLE_ARMV8_CRYPTO=3Dy > >> > >> CONFIG_RTE_ARCH=3D"arm64" > >> CONFIG_RTE_ARCH_ARM64=3Dy > >> diff --git a/drivers/crypto/armv8/Makefile > >> b/drivers/crypto/armv8/Makefile index f71f6b14a4..867a5206cf 100644 > >> --- a/drivers/crypto/armv8/Makefile > >> +++ b/drivers/crypto/armv8/Makefile > >> @@ -4,6 +4,10 @@ > >> > >> include $(RTE_SDK)/mk/rte.vars.mk > >> > >> +ifneq ($(CONFIG_RTE_ENABLE_ARMV8_CRYPTO),y) > >> +$(error "Please enable CONFIG_RTE_ENABLE_ARMV8_CRYPTO") endif > >> + > >> ifneq ($(MAKECMDGOALS),clean) > >> ifneq ($(MAKECMDGOALS),config) > >> ifeq ($(ARMV8_CRYPTO_LIB_PATH),) > >> diff --git a/meson_options.txt b/meson_options.txt index > >> 16d9f92c65..4ca09771de 100644 > >> --- a/meson_options.txt > >> +++ b/meson_options.txt > >> @@ -4,6 +4,8 @@ option('allow_invalid_socket_id', type: 'boolean', val= ue: > >> false, > >> description: 'allow out-of-range NUMA socket id\'s for platforms > >> that don\'t report the value correctly') option('drivers_install_subd= ir', type: > >> 'string', value: 'dpdk/pmds-', > >> description: 'Subdirectory of libdir where to install PMDs. Defaults > >> to using a versioned subdirectory.') > >> +option('enable_armv8_crypto', type: 'boolean', value: true, > >> + description: 'enable armv8 crypto extension') > >> option('enable_docs', type: 'boolean', value: false, > >> description: 'build documentation') > >> option('enable_kmods', type: 'boolean', value: true, diff --git > >> a/mk/machine/armv8a/rte.vars.mk b/mk/machine/armv8a/rte.vars.mk index > >> 8252efbb7b..4893d01a2d 100644 > >> --- a/mk/machine/armv8a/rte.vars.mk > >> +++ b/mk/machine/armv8a/rte.vars.mk > >> @@ -28,4 +28,8 @@ > >> # CPU_LDFLAGS =3D > >> # CPU_ASFLAGS =3D > >> > >> +ifeq ($(CONFIG_RTE_ENABLE_ARMV8_CRYPTO),y) > >> MACHINE_CFLAGS +=3D -march=3Darmv8-a+crc+crypto > >> +else > >> +MACHINE_CFLAGS +=3D -march=3Darmv8-a+crc endif > >> -- > >> 2.11.0 > >