[PATCH 22.11] crypto/cnxk: fix order of ECFPM parameters

Xueming(Steven) Li xuemingl at nvidia.com
Tue Apr 18 14:38:55 CEST 2023


Ack, thanks for update.

> -----Original Message-----
> From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
> Sent: 4/18/2023 20:19
> To: Xueming(Steven) Li <xuemingl at nvidia.com>; stable at dpdk.org
> Cc: Anoob Joseph <anoobj at marvell.com>
> Subject: RE: [PATCH 22.11] crypto/cnxk: fix order of ECFPM parameters
> 
> Hi,
> Please drop this patch as we would not need this fix for 22.11.2.
> 
> Thanks,
> Gowrishankar
> 
> > -----Original Message-----
> > From: Xueming(Steven) Li <xuemingl at nvidia.com>
> > Sent: Tuesday, April 18, 2023 4:52 PM
> > To: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>;
> > stable at dpdk.org
> > Cc: Anoob Joseph <anoobj at marvell.com>
> > Subject: [EXT] RE: [PATCH 22.11] crypto/cnxk: fix order of ECFPM
> > parameters
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> > There is a compilation error:
> >
> > In file included from
> > ../../../auto/mtbcswgwork/xuemingl/workspace/dpdk/drivers/crypto/cnxk/
> > cn9k
> > _cryptodev_ops.c:15:
> > ../../../auto/mtbcswgwork/xuemingl/workspace/dpdk/drivers/crypto/cnxk/
> > cnxk
> > _ae.h:958:13: error: no member named 'lf' in 'struct cnxk_ae_sess'
> >                                          sess->lf->roc_cpt->cpt_revision);
> >                                          ~~~~  ^
> >
> > Please provide a new version if we do need it for 22.11 LTS.
> >
> > > -----Original Message-----
> > > From: Xueming(Steven) Li <xuemingl at nvidia.com>
> > > Sent: 4/18/2023 14:23
> > > To: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>;
> > > stable at dpdk.org
> > > Cc: anoobj at marvell.com
> > > Subject: RE: [PATCH 22.11] crypto/cnxk: fix order of ECFPM
> > > parameters
> > >
> > > Thanks, patch applied.
> > >
> > > > -----Original Message-----
> > > > From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
> > > > Sent: 4/11/2023 15:41
> > > > To: stable at dpdk.org
> > > > Cc: anoobj at marvell.com; Xueming(Steven) Li <xuemingl at nvidia.com>;
> > > > Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
> > > > Subject: [PATCH 22.11] crypto/cnxk: fix order of ECFPM parameters
> > > >
> > > > [ upstream commit 76618fc4bef616f16b6c92f15681ea080eabb486 ]
> > > >
> > > > Fix the order of ECFPM parameters according to target board.
> > > >
> > > > Fixes: 8e39b133235 ("crypto/cnxk: support fixed point
> > > > multiplication")
> > > > Cc: stable at dpdk.org
> > > >
> > > > Signed-off-by: Gowrishankar Muthukrishnan
> > > > <gmuthukrishn at marvell.com>
> > > > ---
> > > >  drivers/crypto/cnxk/cnxk_ae.h | 48
> > > > ++++++++++++++++++++---------------
> > > >  1 file changed, 28 insertions(+), 20 deletions(-)
> > > >
> > > > diff --git a/drivers/crypto/cnxk/cnxk_ae.h
> > > > b/drivers/crypto/cnxk/cnxk_ae.h index adf719da73..f1183376d0
> > > > 100644
> > > > --- a/drivers/crypto/cnxk/cnxk_ae.h
> > > > +++ b/drivers/crypto/cnxk/cnxk_ae.h
> > > > @@ -678,7 +678,7 @@ static __rte_always_inline int
> > > > cnxk_ae_ecfpm_prep(struct rte_crypto_ecpm_op_param *ecpm,
> > > >  		   struct roc_ae_buf_ptr *meta_buf, uint64_t *fpm_iova,
> > > >  		   struct roc_ae_ec_group *ec_grp, uint8_t curveid,
> > > > -		   struct cpt_inst_s *inst)
> > > > +		   struct cpt_inst_s *inst, int cpt_ver)
> > > >  {
> > > >  	uint16_t scalar_align, p_align;
> > > >  	uint16_t dlen, prime_len;
> > > > @@ -697,26 +697,33 @@ cnxk_ae_ecfpm_prep(struct
> > > > rte_crypto_ecpm_op_param *ecpm,
> > > >  	scalar_align = RTE_ALIGN_CEIL(ecpm->scalar.length, 8);
> > > >
> > > >  	/*
> > > > -	 * Set dlen = sum(ROUNDUP8(input point(x and y coordinates), prime,
> > > > -	 * scalar length),
> > > > +	 * Set dlen = sum(prime, scalar length, table address and
> > > > +	 * optionally ROUNDUP8(input point(x and y coordinates)).
> > > >  	 * Please note point length is equivalent to prime of the curve
> > > >  	 */
> > > > -	dlen = sizeof(fpm_table_iova) + 3 * p_align + scalar_align;
> > > > -
> > > > -	memset(dptr, 0, dlen);
> > > > -
> > > > -	*(uint64_t *)dptr = fpm_table_iova;
> > > > -	dptr += sizeof(fpm_table_iova);
> > > > -
> > > > -	/* Copy scalar, prime */
> > > > -	memcpy(dptr, ecpm->scalar.data, ecpm->scalar.length);
> > > > -	dptr += scalar_align;
> > > > -	memcpy(dptr, ec_grp->prime.data, ec_grp->prime.length);
> > > > -	dptr += p_align;
> > > > -	memcpy(dptr, ec_grp->consta.data, ec_grp->consta.length);
> > > > -	dptr += p_align;
> > > > -	memcpy(dptr, ec_grp->constb.data, ec_grp->constb.length);
> > > > -	dptr += p_align;
> > > > +	if (cpt_ver == ROC_CPT_REVISION_ID_96XX_C0) {
> > > > +		dlen = sizeof(fpm_table_iova) + 3 * p_align + scalar_align;
> > > > +		memset(dptr, 0, dlen);
> > > > +		*(uint64_t *)dptr = fpm_table_iova;
> > > > +		dptr += sizeof(fpm_table_iova);
> > > > +		memcpy(dptr, ecpm->scalar.data, ecpm->scalar.length);
> > > > +		dptr += scalar_align;
> > > > +		memcpy(dptr, ec_grp->prime.data, ec_grp->prime.length);
> > > > +		dptr += p_align;
> > > > +		memcpy(dptr, ec_grp->consta.data, ec_grp->consta.length);
> > > > +		dptr += p_align;
> > > > +		memcpy(dptr, ec_grp->constb.data, ec_grp->constb.length);
> > > > +		dptr += p_align;
> > > > +	} else {
> > > > +		dlen = sizeof(fpm_table_iova) + p_align + scalar_align;
> > > > +		memset(dptr, 0, dlen);
> > > > +		memcpy(dptr, ecpm->scalar.data, ecpm->scalar.length);
> > > > +		dptr += scalar_align;
> > > > +		memcpy(dptr, ec_grp->prime.data, ec_grp->prime.length);
> > > > +		dptr += p_align;
> > > > +		*(uint64_t *)dptr = fpm_table_iova;
> > > > +		dptr += sizeof(fpm_table_iova);
> > > > +	}
> > > >
> > > >  	/* Setup opcodes */
> > > >  	w4.s.opcode_major = ROC_AE_MAJOR_OP_ECC; @@ -947,7 +954,8
> > > @@
> > > > cnxk_ae_enqueue(struct cnxk_cpt_qp *qp, struct rte_crypto_op *op,
> > > >  		ret = cnxk_ae_ecfpm_prep(&asym_op->ecpm, &meta_buf,
> > > >  					 sess->cnxk_fpm_iova,
> > > >  					 sess->ec_grp[sess->ec_ctx.curveid],
> > > > -					 sess->ec_ctx.curveid, inst);
> > > > +					 sess->ec_ctx.curveid, inst,
> > > > +					 sess->lf->roc_cpt->cpt_revision);
> > > >  		if (unlikely(ret))
> > > >  			goto req_fail;
> > > >  		break;
> > > > --
> > > > 2.25.1



More information about the stable mailing list