[PATCH] crypto: sa2ul: change unsafe data size limit to 255 bytes

Jayesh Choudhary posted 1 patch 2 years, 9 months ago
drivers/crypto/sa2ul.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] crypto: sa2ul: change unsafe data size limit to 255 bytes
Posted by Jayesh Choudhary 2 years, 9 months ago
From: Tero Kristo <t-kristo@ti.com>

256 bytes is quite often used in performance benchmarks and this size
appears to be also working just fine, so mark it as safe so that we do
not fallback to software implementation for this packet size. Otherwise
there is a strange bump up in crypto performance at 256 byte packet size.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
---
 drivers/crypto/sa2ul.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/sa2ul.h b/drivers/crypto/sa2ul.h
index 92bf97232a29..12c17a68d350 100644
--- a/drivers/crypto/sa2ul.h
+++ b/drivers/crypto/sa2ul.h
@@ -170,7 +170,7 @@ struct sa_tfm_ctx;
  * the following range, so avoid using it.
  */
 #define SA_UNSAFE_DATA_SZ_MIN	240
-#define SA_UNSAFE_DATA_SZ_MAX	256
+#define SA_UNSAFE_DATA_SZ_MAX	255
 
 struct sa_match_data;
 
-- 
2.25.1
Re: [PATCH] crypto: sa2ul: change unsafe data size limit to 255 bytes
Posted by Herbert Xu 2 years, 8 months ago
On Fri, May 12, 2023 at 04:10:44PM +0530, Jayesh Choudhary wrote:
> From: Tero Kristo <t-kristo@ti.com>
> 
> 256 bytes is quite often used in performance benchmarks and this size
> appears to be also working just fine, so mark it as safe so that we do
> not fallback to software implementation for this packet size. Otherwise
> there is a strange bump up in crypto performance at 256 byte packet size.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
> ---
>  drivers/crypto/sa2ul.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt