[dpdk-dev] [PATCH 05/20] crypto/cnxk: add queue pair ops

Anoob Joseph anoobj at marvell.com
Thu Jun 17 09:13:03 CEST 2021


Hi Akhil,

Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: Akhil Goyal <gakhil at marvell.com>
> Sent: Wednesday, June 16, 2021 4:36 PM
> To: Anoob Joseph <anoobj at marvell.com>; Thomas Monjalon
> <thomas at monjalon.net>
> Cc: Ankur Dwivedi <adwivedi at marvell.com>; Jerin Jacob Kollanukkaran
> <jerinj at marvell.com>; Tejasree Kondoj <ktejasree at marvell.com>;
> dev at dpdk.org; Anoob Joseph <anoobj at marvell.com>; Archana Muniganti
> <marchana at marvell.com>
> Subject: RE: [PATCH 05/20] crypto/cnxk: add queue pair ops
> 
> > diff --git a/drivers/crypto/cnxk/cnxk_cpt_ops_helper.c
> > b/drivers/crypto/cnxk/cnxk_cpt_ops_helper.c
> > new file mode 100644
> > index 0000000..103195e
> > --- /dev/null
> > +++ b/drivers/crypto/cnxk/cnxk_cpt_ops_helper.c
> > @@ -0,0 +1,28 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright(C) 2021 Marvell.
> > + */
> > +
> > +#include <rte_common.h>
> > +
> > +#include "hw/cpt.h"
> > +#include "roc_api.h"
> > +
> > +#include "cnxk_cpt_ops_helper.h"
> > +
> > +int
> > +cnxk_cpt_ops_helper_get_mlen(void)
> > +{
> > +	uint32_t len;
> > +
> > +	/* For MAC */
> > +	len = 2 * sizeof(uint64_t);
> > +	len += ROC_SE_MAX_MAC_LEN * sizeof(uint8_t);
> > +
> > +	len += CPT_OFFSET_CONTROL_BYTES + CPT_MAX_IV_LEN;
> > +	len += RTE_ALIGN_CEIL((ROC_SE_SG_LIST_HDR_SIZE +
> > +
> > (RTE_ALIGN_CEIL(ROC_SE_MAX_SG_IN_OUT_CNT, 4) >>
> > +				2) * SG_ENTRY_SIZE),
> > +			      8);
> > +
> > +	return len;
> > +}
> > diff --git a/drivers/crypto/cnxk/cnxk_cpt_ops_helper.h
> > b/drivers/crypto/cnxk/cnxk_cpt_ops_helper.h
> > new file mode 100644
> > index 0000000..23c6fed
> > --- /dev/null
> > +++ b/drivers/crypto/cnxk/cnxk_cpt_ops_helper.h
> > @@ -0,0 +1,20 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright(C) 2021 Marvell.
> > + */
> > +
> > +#ifndef _CNXK_CPT_OPS_HELPER_H_
> > +#define _CNXK_CPT_OPS_HELPER_H_
> > +
> > +#define CPT_MAX_IV_LEN		 16
> > +#define CPT_OFFSET_CONTROL_BYTES 8
> > +#define SG_ENTRY_SIZE		 sizeof(struct roc_se_sglist_comp)
> > +
> > +/*
> > + * Get size of contiguous meta buffer to be allocated
> > + *
> > + * @return
> > + *   - length
> > + */
> > +int cnxk_cpt_ops_helper_get_mlen(void);
> > +
> > +#endif /* _CNXK_CPT_OPS_HELPER_H_ */
> 
> Why do we need these separate helper files. It has only one function and few
> Macros which can be easily moved to
> drivers/crypto/cnxk/cnxk_cryptodev_ops.c/.h
> 

[Anoob] Yes. This can be removed. Will move to cnxk_cryptodev_ops.c as the macros are not used elsewhere. 


More information about the dev mailing list