[dpdk-dev] [PATCH 06/16] crypto/cpt/base: add sym crypto request prepare for CPT

Jerin Jacob jerin.jacob at caviumnetworks.com
Thu Jun 14 05:24:10 CEST 2018


-----Original Message-----
> Date: Fri,  8 Jun 2018 22:15:15 +0530
> From: Anoob Joseph <anoob.joseph at caviumnetworks.com>
> To: Akhil Goyal <akhil.goyal at nxp.com>, Pablo de Lara
>  <pablo.de.lara.guarch at intel.com>, Thomas Monjalon <thomas at monjalon.net>
> Cc: Ankur Dwivedi <ankur.dwivedi at cavium.com>, Jerin Jacob
>  <jerin.jacob at caviumnetworks.com>, Murthy NSSR
>  <Nidadavolu.Murthy at cavium.com>, Narayana Prasad
>  <narayanaprasad.athreya at caviumnetworks.com>, Nithin Dabilpuram
>  <nithin.dabilpuram at cavium.com>, Ragothaman Jayaraman
>  <Ragothaman.Jayaraman at cavium.com>, Srisivasubramanian Srinivasan
>  <Srisivasubramanian.Srinivasan at cavium.com>, dev at dpdk.org
> Subject: [PATCH 06/16] crypto/cpt/base: add sym crypto request prepare for
>  CPT
> X-Mailer: git-send-email 2.7.4
> 
> From: Ankur Dwivedi <ankur.dwivedi at cavium.com>
> 
> These functions help in preparing symmetric crypto requests
> for the supported cipher/auth/aead. This includes all supported
> algos except Kasumi, Snow3G, Zuc, HMAC_ONLY and HASH_ONLY cases.
> 
> Signed-off-by: Ankur Dwivedi <ankur.dwivedi at cavium.com>
> Signed-off-by: Murthy NSSR <Nidadavolu.Murthy at cavium.com>
> Signed-off-by: Nithin Dabilpuram <nithin.dabilpuram at cavium.com>
> Signed-off-by: Ragothaman Jayaraman <Ragothaman.Jayaraman at cavium.com>
> Signed-off-by: Srisivasubramanian Srinivasan <Srisivasubramanian.Srinivasan at cavium.com>
> ---
>  drivers/crypto/cpt/base/cpt.h     |  129 +++++
>  drivers/crypto/cpt/base/cpt_ops.c | 1021 +++++++++++++++++++++++++++++++++++++
>  2 files changed, 1150 insertions(+)
> 
> diff --git a/drivers/crypto/cpt/base/cpt.h b/drivers/crypto/cpt/base/cpt.h
> index 11407ae..54b1cb6 100644
> --- a/drivers/crypto/cpt/base/cpt.h
> +++ b/drivers/crypto/cpt/base/cpt.h
> @@ -54,6 +54,135 @@
>  	void *marker;
>  } app_data_t;
>  
> +/*
> + * Parameters for Flexi Crypto
> + * requests
> + */
> +#define VALID_AAD_BUF 0x01
> +#define VALID_MAC_BUF 0x02
> +#define VALID_IV_BUF 0x04
> +#define SINGLE_BUF_INPLACE 0x08
> +#define SINGLE_BUF_HEADTAILROOM 0x10
> +
> +#define ENCR_IV_OFFSET(__d_offs) ((__d_offs >> 32) & 0xffff)
> +#define ENCR_OFFSET(__d_offs) ((__d_offs >> 16) & 0xffff)
> +#define AUTH_OFFSET(__d_offs) (__d_offs & 0xffff)
> +#define ENCR_DLEN(__d_lens) (__d_lens >> 32)
> +#define AUTH_DLEN(__d_lens) (__d_lens & 0xffffffff)
> +
> +typedef struct fc_params {
> +	/* 0th cache line */

Does it used in fastpath, if so, make it cache aligned

> +	union {
> +		buf_ptr_t bufs[1];
> +		struct {
> +			iov_ptr_t *src_iov;
> +			iov_ptr_t *dst_iov;
> +		};
> +	};
> +	void *iv_buf;
> +	void *auth_iv_buf;
> +	buf_ptr_t meta_buf;
> +	buf_ptr_t ctx_buf;
> +	uint64_t rsvd2;
> +
> +	/* 1st cache line */
> +	buf_ptr_t aad_buf;
> +	buf_ptr_t mac_buf;
> +
> +} fc_params_t;
> +
> +/*
> + * Parameters for digest
> + * generate requests
> + * Only src_iov, op, ctx_buf, mac_buf, prep_req


More information about the dev mailing list