[PATCH] ipsec: use sym_session_opaque_data for RTE_SECURITY_TYPE_CPU_CRYPTO

Konstantin Ananyev konstantin.v.ananyev at yandex.ru
Tue Oct 31 02:08:57 CET 2023


>
> 
> ipsec related processing in dpdk makes use of the crypto.ses opaque
> data pointer.  This patch updates rte_ipsec_session_prepare to set
> ss->crypto.ses in the RTE_SECURITY_TYPE_CPU_CRYPTO case.


Hmm.. not sure why we need to do that for CPU_CRYPTO?
As I remember CPU_CRYPTO is synchronous operation and before calling
rte_ipsec_pkt_cpu_prepare() should already know ipsec session these
packets belong to.
Can you probably explain the logic behind this patch a bit more?
Konstantin

> 
> Signed-off-by: Garry Marshall <gazmarsh at meaningfulname.net>
> ---
>  lib/ipsec/ses.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/ipsec/ses.c b/lib/ipsec/ses.c
> index d9ab1e6d2b..29eb5ff6ca 100644
> --- a/lib/ipsec/ses.c
> +++ b/lib/ipsec/ses.c
> @@ -44,7 +44,8 @@ rte_ipsec_session_prepare(struct rte_ipsec_session *ss)
>  
>  	ss->pkt_func = fp;
>  
> -	if (ss->type == RTE_SECURITY_ACTION_TYPE_NONE)
> +	if (ss->type == RTE_SECURITY_ACTION_TYPE_NONE ||
> +		ss->type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
>  		rte_cryptodev_sym_session_opaque_data_set(ss->crypto.ses,
>  			(uintptr_t)ss);
>  	else
> -- 
> 2.39.2


More information about the dev mailing list