[PATCH v3 2/7] crypto/cnxk: add event metadata set operation

Akhil Goyal gakhil at marvell.com
Sun May 1 20:29:12 CEST 2022


> > -uint16_t
> > -cn10k_cpt_crypto_adapter_enqueue(uintptr_t tag_op, struct rte_crypto_op
> > *op)
> > +static int
> > +cn10k_cpt_crypto_adapter_ev_mdata_set(struct rte_cryptodev *dev
> > __rte_unused,
> > +				      void *sess,
> > +				      enum rte_crypto_op_type op_type,
> > +				      enum rte_crypto_op_sess_type sess_type,
> > +				      void *mdata)
> >  {
> > -	union rte_event_crypto_metadata *ec_mdata;
> > -	struct cpt_inflight_req *infl_req;
> > +	union rte_event_crypto_metadata *ec_mdata = mdata;
> >  	struct rte_event *rsp_info;
> > -	uint64_t lmt_base, lmt_arg;
> > -	struct cpt_inst_s *inst;
> >  	struct cnxk_cpt_qp *qp;
> >  	uint8_t cdev_id;
> > -	uint16_t lmt_id;
> > -	uint16_t qp_id;
> > -	int ret;
> > -
> > -	ec_mdata = cnxk_event_crypto_mdata_get(op);
> > -	if (!ec_mdata) {
> > -		rte_errno = EINVAL;
> > -		return 0;
> > -	}
> > +	int16_t qp_id;
> > +	uint64_t w2;
> >
> > +	/* Get queue pair */
> >  	cdev_id = ec_mdata->request_info.cdev_id;
> >  	qp_id = ec_mdata->request_info.queue_pair_id;
> >  	qp = rte_cryptodevs[cdev_id].data->queue_pairs[qp_id];
> > +
> > +	/* Prepare w2 */
> >  	rsp_info = &ec_mdata->response_info;
> > +	w2 = CNXK_CPT_INST_W2(
> > +		(RTE_EVENT_TYPE_CRYPTODEV << 28) | rsp_info->flow_id,
> > +		rsp_info->sched_type, rsp_info->queue_id, 0);
> > +
> > +	/* Set meta according to session type */
> > +	if (op_type == RTE_CRYPTO_OP_TYPE_SYMMETRIC) {
> > +		if (sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) {
> > +			struct cn10k_sec_session *priv;
> > +			struct cn10k_ipsec_sa *sa;
> > +
> > +			priv = get_sec_session_private_data(sess);
> > +			sa = &priv->sa;
> > +			sa->qp = qp;
> > +			sa->inst.w2 = w2;
> > +		} else if (sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
> > +			struct cnxk_se_sess *priv;
> > +
> > +			priv = get_sym_session_private_data(
> > +				sess, cn10k_cryptodev_driver_id);
> > +			priv->qp = qp;
> > +			priv->cpt_inst_w2 = w2;
> > +		} else
> cnXX_ca_meta_info_extract() supports SESSIONLESS case. But no support here.
> Is this expected?

This function is for setting the event metadata in session, but in case of sessionless
there are no sessions, so event metadata is extracted in a different way.
Hence this is correct.




More information about the dev mailing list