> -----Original Message-----
> From: Anoob Joseph [mailto:anoob.jos...@caviumnetworks.com]
> Sent: Friday, June 8, 2018 5:45 PM
> To: Akhil Goyal <akhil.go...@nxp.com>; De Lara Guarch, Pablo
> <pablo.de.lara.gua...@intel.com>; Thomas Monjalon <tho...@monjalon.net>
> Cc: Ankur Dwivedi <ankur.dwiv...@cavium.com>; Jerin Jacob
> <jerin.ja...@caviumnetworks.com>; Murthy NSSR
> <nidadavolu.mur...@cavium.com>; Narayana Prasad
> <narayanaprasad.athr...@caviumnetworks.com>; Nithin Dabilpuram
> <nithin.dabilpu...@cavium.com>; Ragothaman Jayaraman
> <ragothaman.jayara...@cavium.com>; Srisivasubramanian Srinivasan
> <srisivasubramanian.sriniva...@cavium.com>; dev@dpdk.org
> Subject: [PATCH 04/16] crypto/cpt/base: add hardware enq/deq API for CPT

No need to use "for CPT" here, as the "crypto/cpt/base" already states that.
Same applies in other patches.

> 
> From: Ankur Dwivedi <ankur.dwiv...@cavium.com>
> 
> Adds hardware enqueue/dequeue API of instructions to a queue pair for Cavium
> CPT device.
> 
> Signed-off-by: Ankur Dwivedi <ankur.dwiv...@cavium.com>
> Signed-off-by: Murthy NSSR <nidadavolu.mur...@cavium.com>
> Signed-off-by: Nithin Dabilpuram <nithin.dabilpu...@cavium.com>
> Signed-off-by: Ragothaman Jayaraman
> <ragothaman.jayara...@cavium.com>
> Signed-off-by: Srisivasubramanian Srinivasan
> <srisivasubramanian.sriniva...@cavium.com>
> ---
>  drivers/crypto/cpt/base/cpt.h             | 102 +++++++
>  drivers/crypto/cpt/base/cpt_device.c      |   4 +-
>  drivers/crypto/cpt/base/cpt_request_mgr.c | 424
> ++++++++++++++++++++++++++++++
> drivers/crypto/cpt/base/cpt_request_mgr.h |  75 ++++++
>  4 files changed, 603 insertions(+), 2 deletions(-)  create mode 100644
> drivers/crypto/cpt/base/cpt.h  create mode 100644
> drivers/crypto/cpt/base/cpt_request_mgr.c
>  create mode 100644 drivers/crypto/cpt/base/cpt_request_mgr.h
> 
> diff --git a/drivers/crypto/cpt/base/cpt.h b/drivers/crypto/cpt/base/cpt.h new
> file mode 100644 index 0000000..11407ae
> --- /dev/null
> +++ b/drivers/crypto/cpt/base/cpt.h

...
> +/* cpt instance */
> +struct cpt_instance {
> +     /* 0th cache line */

Is this comment useful for only 12 bytes of data?


...

> diff --git a/drivers/crypto/cpt/base/cpt_device.c
> b/drivers/crypto/cpt/base/cpt_device.c
> index b7cd5b5..a50e5b8 100644
> --- a/drivers/crypto/cpt/base/cpt_device.c
> +++ b/drivers/crypto/cpt/base/cpt_device.c
> @@ -193,7 +193,7 @@ int cptvf_get_resource(struct cpt_vf *dev,
>       uint64_t *next_ptr;
>       uint64_t pg_sz = sysconf(_SC_PAGESIZE);
> 
> -     PMD_DRV_LOG(DEBUG, "Initializing csp resource %s\n", cptvf-
> >dev_name);
> +     PMD_DRV_LOG(DEBUG, "Initializing cpt resource %s\n", cptvf-
> >dev_name);

This should be "cpt resource" since the beginning, in the patch that introduced 
this line.
Same below.

> 
>       cpt_instance = &cptvf->instance;
> 
> @@ -323,7 +323,7 @@ int cptvf_put_resource(cpt_instance_t *instance)
>               return -EINVAL;
>       }
> 
> -     PMD_DRV_LOG(DEBUG, "Releasing csp device %s\n", cptvf-
> >dev_name);
> +     PMD_DRV_LOG(DEBUG, "Releasing cpt device %s\n", cptvf-
> >dev_name);
> 
>       rz = (struct rte_memzone *)instance->rsvd;
>       rte_memzone_free(rz);
> diff --git a/drivers/crypto/cpt/base/cpt_request_mgr.c
> b/drivers/crypto/cpt/base/cpt_request_mgr.c
> new file mode 100644
> index 0000000..8b9b1ff
> --- /dev/null
> +++ b/drivers/crypto/cpt/base/cpt_request_mgr.c
> @@ -0,0 +1,424 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2017 Cavium, Inc
> + */
> +
> +#include "cpt_request_mgr.h"
> +#include "cpt_debug.h"
> +#include <rte_atomic.h>

Same comment about the includes applies here.
Separate them with blank lines, between external and internal to DPDK includes.

> +
> +#define MOD_INC(i, l)   ((i) == (l - 1) ? (i) = 0 : (i)++)
> +
> +#define __hot __attribute__((hot))
> +
> +static inline uint64_t cpu_cycles(void) {
> +     return rte_get_timer_cycles();
> +}
> +
> +static inline uint64_t cpu_cycles_freq(void) {
> +     return rte_get_timer_hz();
> +}
> +
> +static inline void *
> +get_cpt_inst(struct command_queue *cqueue, void *req) {
> +     (void)req;
> +     PMD_TX_LOG(DEBUG, "CPT queue idx %u, req %p\n", cqueue->idx, req);
> +     return &cqueue->qhead[cqueue->idx * CPT_INST_SIZE]; }
> +
> +static inline void
> +mark_cpt_inst(struct cpt_vf *cptvf,
> +           struct command_queue *queue,
> +           uint32_t ring_door_bell)
> +{
> +#ifdef CMD_DEBUG

Try to avoid this compile time checks, as Jerin suggested.

> +     /* DEBUG */
> +     {

Reply via email to