From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akhil Goyal Subject: Re: [PATCH 05/10] crypto/caam_jr: add queue config functions Date: Tue, 18 Sep 2018 19:34:53 +0530 Message-ID: References: <20180913060846.29930-1-g.singh@nxp.com> <20180913060846.29930-6-g.singh@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Hemant Agrawal To: Gagandeep Singh , dev@dpdk.org Return-path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30057.outbound.protection.outlook.com [40.107.3.57]) by dpdk.org (Postfix) with ESMTP id CB3204F90 for ; Tue, 18 Sep 2018 16:05:07 +0200 (CEST) In-Reply-To: <20180913060846.29930-6-g.singh@nxp.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Gagan, On 9/13/2018 11:38 AM, Gagandeep Singh wrote: > From: Hemant Agrawal > > Signed-off-by: Gagandeep Singh > Signed-off-by: Hemant Agrawal > --- > drivers/crypto/caam_jr/caam_jr.c | 64 ++++++++++++++++++++++++++++++++ > 1 file changed, 64 insertions(+) > > diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c > index 43fe5233b..f05e966b0 100644 > --- a/drivers/crypto/caam_jr/caam_jr.c > +++ b/drivers/crypto/caam_jr/caam_jr.c > @@ -104,6 +104,67 @@ static void hw_flush_job_ring(struct sec_job_ring_t *job_ring, > } > } > > +/* Release queue pair */ > +static int > +caam_jr_queue_pair_release(struct rte_cryptodev *dev, > + uint16_t qp_id) > +{ > + struct sec_job_ring_t *internals; > + struct caam_jr_qp *qp = NULL; > + > + PMD_INIT_FUNC_TRACE(); > + > + CAAM_JR_DEBUG("dev =%p, queue =%d", dev, qp_id); > + > + internals = dev->data->dev_private; > + if (qp_id >= internals->max_nb_queue_pairs) { > + CAAM_JR_ERR("Max supported qpid %d", > + internals->max_nb_queue_pairs); > + return -EINVAL; > + } > + > + qp = &internals->qps[qp_id]; > + qp->ring = NULL; > + dev->data->queue_pairs[qp_id] = NULL; > + > + return 0; > +} > + > +/* Setup a queue pair */ > +static int > +caam_jr_queue_pair_setup( > + struct rte_cryptodev *dev, uint16_t qp_id, > + __rte_unused const struct rte_cryptodev_qp_conf *qp_conf, > + __rte_unused int socket_id, > + __rte_unused struct rte_mempool *session_pool) > +{ > + struct sec_job_ring_t *internals; > + struct caam_jr_qp *qp = NULL; > + PMD_INIT_FUNC_TRACE(); missing here and please check other ops as well > + CAAM_JR_DEBUG("dev =%p, queue =%d, conf =%p", dev, qp_id, qp_conf); > + > + internals = dev->data->dev_private; > + if (qp_id >= internals->max_nb_queue_pairs) { > + CAAM_JR_ERR("Max supported qpid %d", > + internals->max_nb_queue_pairs); > + return -EINVAL; > + } > + > + qp = &internals->qps[qp_id]; > + qp->ring = internals; > + dev->data->queue_pairs[qp_id] = qp; > + > + return 0; > +} > + > +/* Return the number of allocated queue pairs */ > +static uint32_t > +caam_jr_queue_pair_count(struct rte_cryptodev *dev) > +{ > + PMD_INIT_FUNC_TRACE(); > + > + return dev->data->nb_queue_pairs; > +} > > static int > caam_jr_dev_configure(struct rte_cryptodev *dev, > @@ -186,6 +247,9 @@ static struct rte_cryptodev_ops caam_jr_ops = { > .dev_stop = caam_jr_dev_stop, > .dev_close = caam_jr_dev_close, > .dev_infos_get = caam_jr_dev_infos_get, > + .queue_pair_setup = caam_jr_queue_pair_setup, > + .queue_pair_release = caam_jr_queue_pair_release, > + .queue_pair_count = caam_jr_queue_pair_count, > }; > >