openssl: Enable cryptodev-linux by default
RFC PATCH 1/1 openssl: Enable cryptodev-linux by default
This is a Request for Comment. Would it be a good idea to enable cryptodev-linux by default, gaining hardware acceleration where supported? Are there any unacceptable drawbacks? What happens on hardware without acceleration?
--- meta/recipes-connectivity/openssl/openssl_1.1.1i.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-connectivity/openssl/openssl_1.1.1i.bb +1 -1
@@ -28,7 +28,7 @@ SRC_URI[sha256sum] = "e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee0 inherit lib_package multilib_header multilib_script ptest MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" -PACKAGECONFIG ?= "" +PACKAGECONFIG ?= "cryptodev-linux" PACKAGECONFIG_class-native = "" PACKAGECONFIG_class-nativesdk = ""
Signature · 1 line
2.17.1
Em qui., 28 de jan. de 2021 às 18:36, Tom Hochstein <[email protected]> escreveu:
Quoted 6 lines
This is a Request for Comment. Would it be a good idea to enable cryptodev-linux by default, gaining hardware acceleration where supported? Are there any unacceptable drawbacks? What happens on hardware without acceleration?
Signed-off-by Tom Hochstein <[email protected]>
Tom and I were discussing about this and I suggested him to raise the issue here. We are not aware of drawbacks but as we are not experts on this field we'd like to receive feedback from the community prior sending the formal patch for it.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750
Quoted 4 lines · Tom Hochstein
This is a Request for Comment. Would it be a good idea to enable cryptodev-linux by default, gaining hardware acceleration where supported? Are there any unacceptable drawbacks? What happens on hardware without acceleration?
this perhaps helps with devices that include a hardware crypto device but not as much with one;s thats fine but we use qemu machines quite a bit in testing so it would be good to get a readout on qemu secondly, if it does not, then maybe we should see if defining it via MACHINE_FEATUREs might be an option to enable it.
Quoted 23 lines
Signed-off-by Tom Hochstein <[email protected]>--- meta/recipes-connectivity/openssl/openssl_1.1.1i.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/recipes-connectivity/openssl/openssl_1.1.1i.bb +1
-1@@ -28,7 +28,7 @@ SRC_URI[sha256sum] = "e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee0 inherit lib_package multilib_header multilib_script ptest MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" -PACKAGECONFIG ?= "" +PACKAGECONFIG ?= "cryptodev-linux" PACKAGECONFIG_class-native = "" PACKAGECONFIG_class-nativesdk = ""
Quoted 18 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Khem Raj via lists.openembedded.org
Sent: 29 January 2021 02:16
To: Tom Hochstein <[email protected]>; openembedded- [email protected]
Cc: [email protected]
Subject: Re: [OE-core] [PATCH] [RFC] openssl: Enable cryptodev-linux by defaultQuoted 1 line · Tom Hochstein
This is a Request for Comment. Would it be a good idea to enable
cryptodev-linux
Quoted 2 lines
by default, gaining hardware acceleration where supported? Are there any unacceptable drawbacks? What happens on hardware without
Quoted 9 lines
acceleration?
Quoted 1 line
this perhaps helps with devices that include a hardware crypto device but not as much with one;s thats fine but we use qemu machines quite a bit in testing so it would be good to get a readout on qemu secondly, if it does not, then maybe we should see if defining it via
MACHINE_FEATUREsmight be an option to enable it.
I think that making it a MACHINE_FEATURES would effectively make the task signatures for openssl be machine dependent and that would also make all recipes which depend directly or indirectly on openssl (and there are a lot!) have their task signatures be machine dependent, so they would need to have their PACKAGE_ARCH set to MACHINE_ARCH to avoid triggering spurious rebuilds when switching between machines with and without cryptodev-linux in MACHINE_FEATURES.
So MACHINE_FEATURES does not look like a viable option, a DISTRO_FEATURES might be, although it does not really look like a nice fit either.
Quoted 25 lines
Review
Quoted 6 lines
Signed-off-by Tom Hochstein <[email protected]>--- meta/recipes-connectivity/openssl/openssl_1.1.1i.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0b/meta/recipes-connectivity/openssl/openssl_1.1.1i.bb
meta/recipes-connectivity/openssl/openssl_1.1.1i.bb SRC_URI[sha256sum] =
Quoted 4 lines
index
5617f337e0..d4c19f1a52100644meta/recipes-connectivity/openssl/openssl_1.1.1i.bb +0
-0@@ -28,7 +28,7 @@ SRC_URI[sha256sum] ="
e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee0Quoted 13 lines
meta/recipes-connectivity/openssl/openssl_1.1.1i.bb +1
-1inherit lib_package multilib_header multilib_script ptest MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" -PACKAGECONFIG ?= "" +PACKAGECONFIG ?= "cryptodev-linux" PACKAGECONFIG_class-native = "" PACKAGECONFIG_class-nativesdk = ""
Signature · 3 lines
Diego Santa Cruz, PhD Technology Architect spinetix.com
Quoted 28 lines · Diego Santa Cruz via lists.openembedded.org
Quoted 19 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Khem Raj via lists.openembedded.org
Sent: 29 January 2021 02:16
To: Tom Hochstein <[email protected]>; openembedded- [email protected]
Cc: [email protected]
Subject: Re: [OE-core] [PATCH] [RFC] openssl: Enable cryptodev-linux by defaultQuoted 1 line · Tom Hochstein
This is a Request for Comment. Would it be a good idea to enable
cryptodev-linux
Quoted 2 lines
by default, gaining hardware acceleration where supported? Are there any unacceptable drawbacks? What happens on hardware without
Quoted 8 lines
acceleration?
Quoted 1 line
this perhaps helps with devices that include a hardware crypto device but not as much with one;s thats fine but we use qemu machines quite a bit in testing so it would be good to get a readout on qemu secondly, if it does not, then maybe we should see if defining it via
MACHINE_FEATUREsmight be an option to enable it.
Quoted 3 lines
I think that making it a
MACHINE_FEATURESwould effectively make the task signatures for openssl be machine dependent and that would also make all recipes which depend directly or indirectly on openssl (and there are a lot!) have their task signatures be machine dependent, so they would need to have theirPACKAGE_ARCHset toMACHINE_ARCHto avoid triggering spurious rebuilds when switching between machines with and without cryptodev-linux inMACHINE_FEATURES.So
MACHINE_FEATURESdoes not look like a viable option, aDISTRO_FEATURESmight be, although it does not really look like a nice fit either.
MACHINE and DISTRO features are global variables which should be reserved for configuration decisions which affect multiple recipes (so that multiple recipes can be configured together under the control of one option). It doesn't make much sense to create a new MACHINE or DISTRO feature if it's only going to be used by one recipe.
If a distro or BSP layer wants to enable cryptodev-linux support in openssl they can already do so by creating a .bbappend for openssl which adds the PACKAGECONFIG. ie if we decide that the option should be left disabled by default but controllable by the distro or BSP layer then no further changes are required - we already have a fully functional mechanism to do that.
Going back to the original question of whether cryptodev-linux should be enabled by default, I would say no. It's very much the legacy approach and in the absence of benchmarks to prove otherwise I doubt it gives any advantage in performance on modern platforms (especially CPUs with dedicated crypto instructions).
Em sex., 29 de jan. de 2021 às 17:39, Andre McCurdy <[email protected]> escreveu:
Quoted 7 lines
If a distro or BSP layer wants to enable cryptodev-linux support in openssl they can already do so by creating a .bbappend for openssl which adds the PACKAGECONFIG. ie if we decide that the option should be left disabled by default but controllable by the distro or BSP layer then no further changes are required - we already have a fully functional mechanism to do that.
DISTRO yes, BSP is harder. If we enable it, it becomes MACHNE_ARCH as well as all packages which depends on it.
Quoted 5 lines
Going back to the original question of whether cryptodev-linux should be enabled by default, I would say no. It's very much the legacy approach and in the absence of benchmarks to prove otherwise I doubt it gives any advantage in performance on modern platforms (especially CPUs with dedicated crypto instructions).
Tom, this is indeed the most important aspect to discuss. We need to check if latest openssl with new Linux kernels still require cryptodev-linux to use the acceleration.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750
Quoted 11 lines · Otavio Salvador
Em sex., 29 de jan. de 2021 às 17:39, Andre McCurdy <[email protected]> escreveu:
Quoted 7 lines
If a distro or BSP layer wants to enable cryptodev-linux support in openssl they can already do so by creating a .bbappend for openssl which adds the PACKAGECONFIG. ie if we decide that the option should be left disabled by default but controllable by the distro or BSP layer then no further changes are required - we already have a fully functional mechanism to do that.
Quoted 2 lines
DISTRO yes, BSP is harder. If we enable it, it becomes
MACHNE_ARCHas well as all packages which depends on it.
That's a concern if you're trying to create a package feed. But in that case you should already be taking care that BSP layers don't change the way recipes in common layers are built. ie this is something you would be controlling from a distro layer anyway.
If you don't care about maintaining a package feed (which I guess is the majority of us?) then BSP layers which contain .bbappend files for recipes in common layers works just fine.
Quoted 15 lines
Quoted 5 lines
Going back to the original question of whether cryptodev-linux should be enabled by default, I would say no. It's very much the legacy approach and in the absence of benchmarks to prove otherwise I doubt it gives any advantage in performance on modern platforms (especially CPUs with dedicated crypto instructions).
Tom, this is indeed the most important aspect to discuss. We need to check if latest openssl with new Linux kernels still require cryptodev-linux to use the acceleration.
--
Otavio SalvadorO.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750
Em sex., 29 de jan. de 2021 às 18:14, Andre McCurdy <[email protected]> escreveu:
Quoted 16 lines
Quoted 11 lines · Otavio Salvador
Em sex., 29 de jan. de 2021 às 17:39, Andre McCurdy <[email protected]> escreveu:
Quoted 7 lines
If a distro or BSP layer wants to enable cryptodev-linux support in openssl they can already do so by creating a .bbappend for openssl which adds the PACKAGECONFIG. ie if we decide that the option should be left disabled by default but controllable by the distro or BSP layer then no further changes are required - we already have a fully functional mechanism to do that.
Quoted 2 lines
DISTRO yes, BSP is harder. If we enable it, it becomes
MACHNE_ARCHas well as all packages which depends on it.
Quoted 8 lines
That's a concern if you're trying to create a package feed. But in that case you should already be taking care that BSP layers don't change the way recipes in common layers are built. ie this is something you would be controlling from a distro layer anyway.
If you don't care about maintaining a package feed (which I guess is the majority of us?) then BSP layers which contain .bbappend files for recipes in common layers works just fine.
Also build time is a lot bigger.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750