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 D5515A00E6 for ; Mon, 15 Apr 2019 22:13:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1342B1B3BA; Mon, 15 Apr 2019 22:13:11 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10054.outbound.protection.outlook.com [40.107.1.54]) by dpdk.org (Postfix) with ESMTP id 8ED111B3B9 for ; Mon, 15 Apr 2019 22:13:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gUxfdDPfz/ZHPLoPtt+S7J8FyA0aFXXxB5IzwDBZ1OM=; b=GmsKZAZ8B5fDvZNUdmbRnJdckOiQecZJl5cDIa+7Pafo970Q2+F3GYlmfcDEcb43Uzsbx0dPvPmGo+dJMqrxXh38+EUEtJTwcMaE7tL6kA7z37Qhvpvo7AY5ljG4sHfUccb/7GKpdDDDYHl15GWZ5ps7sOfaJODrAoTBwi6uo7E= Received: from VE1PR08MB5149.eurprd08.prod.outlook.com (20.179.30.152) by VE1PR08MB4687.eurprd08.prod.outlook.com (10.255.115.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.18; Mon, 15 Apr 2019 20:13:08 +0000 Received: from VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::e0ae:ecad:ec5:8177]) by VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::e0ae:ecad:ec5:8177%2]) with mapi id 15.20.1792.018; Mon, 15 Apr 2019 20:13:08 +0000 From: Honnappa Nagarahalli To: "yskoh@mellanox.com" , "jerinj@marvell.com" CC: "bruce.richardson@intel.com" , Pavan Nikhilesh Bhagavatula , Shahaf Shuler , "dev@dpdk.org" , "thomas@monjalon.net" , "Gavin Hu (Arm Technology China)" , Honnappa Nagarahalli , dpdk-on-arm , nd , nd Thread-Topic: [EXT] [PATCH 5/6] build: add option for armv8 crypto extension Thread-Index: AQHU87skDqGgIb5/akCGo940k1lIHaY9pwyQ Date: Mon, 15 Apr 2019 20:13:08 +0000 Message-ID: References: <20190412232451.30197-1-yskoh@mellanox.com> <20190412232451.30197-6-yskoh@mellanox.com> <8328F59C-14DF-412E-A8F7-6AA1F5061065@mellanox.com> In-Reply-To: <8328F59C-14DF-412E-A8F7-6AA1F5061065@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7bbfd615-7b92-4582-3d41-08d6c1dec6ff x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600140)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:VE1PR08MB4687; x-ms-traffictypediagnostic: VE1PR08MB4687: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 000800954F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(39860400002)(376002)(366004)(396003)(199004)(189003)(102836004)(110136005)(86362001)(76176011)(6116002)(3846002)(5660300002)(93886005)(52536014)(71190400001)(71200400001)(54906003)(7696005)(8676002)(446003)(8936002)(26005)(316002)(186003)(11346002)(476003)(6506007)(2906002)(486006)(81156014)(81166006)(99286004)(7416002)(256004)(6246003)(25786009)(7736002)(14454004)(14444005)(33656002)(97736004)(74316002)(53936002)(68736007)(2501003)(9686003)(72206003)(66066001)(229853002)(106356001)(6436002)(478600001)(4326008)(305945005)(55016002)(105586002)(6314003); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4687; H:VE1PR08MB5149.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: OmW6K/F+gDRrLecCsayrkG8SwjjYQfklok1GMWDHvL4aR0rGp7RcL6jkvKr3vDkkjwQ1vvhAKxnD/gP212CutT6ApKwW+ZtLVu+cpLBaT5S4qDI6LRAURCWP0evxpqlKoOg8ldkDxaBl36s4cV1fPbAIw0dvLCLrne+eTx07ksGwDpmIEtqqEBr7n9iG5EPmsuLIfJYZlOyYb0qpwwmU7L8JYRNQcoIeswzW/CMdvIIccNfZgiRScaTmTgsFJMCkTqjLMJGs1o9EwN0vp+8hdZb/seNOxvnM85wV7tfgCXBHFl8sCRxSjCHF1zySwapAl+WaPBem2kGxjOQOWpF/X/2eE9+7w4UE/dZg162UXcr/DIzGa4Y3N4D8TTF+Hp+9Y6cA8j6L4kLJMC3krAUISlwtdZqrNWmAW2xdLb5sD10= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bbfd615-7b92-4582-3d41-08d6c1dec6ff X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Apr 2019 20:13:08.4149 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4687 Subject: Re: [dpdk-dev] [EXT] [PATCH 5/6] 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: <20190415201308.tNbzUayTKvWR86vjDeBzFiAQkglPzoF1FC3Bg6ajViM@z> > >> Subject: [EXT] [PATCH 5/6] build: add option for armv8 crypto > >> extension > >> > >> CONFIG_RTE_MACHINE=3D"armv8a" > >> +CONFIG_RTE_ENABLE_ARMV8_CRYPTO=3Dy > > > > This approach is not scalable. Even, it is not good for BlueField as > > you you need to maintain two images. > > > > Unlike other CPU flags, arm64's crypto cpu flag is really _optional_. > > Access to crypto instructions is always at under runtime check. > > See the following in rte_armv8_pmd.c > > > > > > /* Check CPU for support for AES instruction set */ > > if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_AES)) { > > ARMV8_CRYPTO_LOG_ERR( > > "AES instructions not supported by CPU"); > > return -EFAULT; > > } > > > > /* Check CPU for support for SHA instruction set */ > > if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_SHA1) || > > !rte_cpu_get_flag_enabled(RTE_CPUFLAG_SHA2)) { > > ARMV8_CRYPTO_LOG_ERR( > > "SHA1/SHA2 instructions not supported by CPU"); > > return -EFAULT; > > } > > > > So In order to avoid one more config flags specific to armv8 in meson > > and makefile build infra And avoid the need for 6/6 patch. IMO, # > > Introduce optional CPU flag scheme in eal. Treat armv8 crypto as > > optional flag # Skip the eal init check for optional flag. > > > > Do you see any issues with that approach? >=20 > I also thought about that approach and that was my number 1 priority. > But, I had one question came to my mind. Maybe, arm people can confirm > it. Is it 100% guaranteed that compiler never makes use of any of crypto > instructions even if there's no specific asm/intrinsic code? The crypto > extension has aes, pmull, > sha1 and sha2. In case of rte_memcpy() for x86, for example, compiler may > optimize code using avx512f instructions even though it is written > specifically with avx2 intrinsics (__mm256_*) unless avx512f is disabled. >=20 > If a complier expert in arm (or anyone else) confirm it is completely > **optional**, then I'd love to take that approach for sure. >=20 > Copied dpdk-on-arm ML. >=20 I do not know the answer, will have to check with the compiler team. I will= get back on this. >=20 > Thanks, > Yongseok >=20