[1/2] examples/ipsec-secgw: allow single xform SA

Message ID 20230313122938.53716-1-radu.nicolau@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [1/2] examples/ipsec-secgw: allow single xform SA |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Radu Nicolau March 13, 2023, 12:29 p.m. UTC
  Update check capabilities before session create to allow single xform SA
i.e. auth or cipher only

Fixes: a8781df86c14 ("examples/ipsec-secgw: check capabilities before session create")
Cc: gakhil@marvell.com,kai.ji@intel.com

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 examples/ipsec-secgw/ipsec.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

Ji, Kai March 16, 2023, 12:36 p.m. UTC | #1
Acked-by: Kai Ji <kai.ji@intel.com>

> -----Original Message-----
> From: Radu Nicolau <radu.nicolau@intel.com>
> Sent: Monday, March 13, 2023 12:30 PM
> To: Nicolau, Radu <radu.nicolau@intel.com>; Akhil Goyal
> <gakhil@marvell.com>
> Cc: dev@dpdk.org
> Subject: [PATCH 1/2] examples/ipsec-secgw: allow single xform SA
> 
> Update check capabilities before session create to allow single xform SA
> i.e. auth or cipher only
> 
> Fixes: a8781df86c14 ("examples/ipsec-secgw: check capabilities before
> session create")
> Cc: gakhil@marvell.com,kai.ji@intel.com
> 
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
>  examples/ipsec-secgw/ipsec.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
> index a5c2b524a7..a5706bed24 100644
> --- a/examples/ipsec-secgw/ipsec.c
> +++ b/examples/ipsec-secgw/ipsec.c
> @@ -101,13 +101,11 @@ static inline int
>  verify_crypto_capabilities(const struct rte_cryptodev_capabilities
> *capabilities,
>  		struct rte_crypto_sym_xform *crypto_xform)  {
> -	if (crypto_xform->type == RTE_CRYPTO_SYM_XFORM_AEAD)
> -		return verify_crypto_xform(capabilities, crypto_xform);
> -	else if (crypto_xform->next != NULL)
> +	if (crypto_xform->next != NULL)
>  		return (verify_crypto_xform(capabilities, crypto_xform) ||
>  		    verify_crypto_xform(capabilities, crypto_xform->next));
>  	else
> -		return -ENOTSUP;
> +		return verify_crypto_xform(capabilities, crypto_xform);
>  }
> 
>  static inline int
> --
> 2.25.1
  
Akhil Goyal March 16, 2023, 6:51 p.m. UTC | #2
> Subject: [EXT] [PATCH 1/2] examples/ipsec-secgw: allow single xform SA
> 
> Update check capabilities before session create to allow single xform SA
> i.e. auth or cipher only
> 
> Fixes: a8781df86c14 ("examples/ipsec-secgw: check capabilities before session
> create")
> Cc: gakhil@marvell.com,kai.ji@intel.com
> 
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index a5c2b524a7..a5706bed24 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -101,13 +101,11 @@  static inline int
 verify_crypto_capabilities(const struct rte_cryptodev_capabilities *capabilities,
 		struct rte_crypto_sym_xform *crypto_xform)
 {
-	if (crypto_xform->type == RTE_CRYPTO_SYM_XFORM_AEAD)
-		return verify_crypto_xform(capabilities, crypto_xform);
-	else if (crypto_xform->next != NULL)
+	if (crypto_xform->next != NULL)
 		return (verify_crypto_xform(capabilities, crypto_xform) ||
 		    verify_crypto_xform(capabilities, crypto_xform->next));
 	else
-		return -ENOTSUP;
+		return verify_crypto_xform(capabilities, crypto_xform);
 }
 
 static inline int