On 9/4/2018 9:28 AM, Anoob Joseph wrote:
From: Murthy NSSR <nidadavolu.mur...@caviumnetworks.com>

Adding pmd ops helper functions. Control path accessed APIs would be
added as helper functions. Adding microcode defined macros etc as
dependencies to the helper functions.

Signed-off-by: Ankur Dwivedi <ankur.dwiv...@caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.jos...@caviumnetworks.com>
Signed-off-by: Murthy NSSR <nidadavolu.mur...@caviumnetworks.com>
Signed-off-by: Nithin Dabilpuram <nithin.dabilpu...@caviumnetworks.com>
Signed-off-by: Ragothaman Jayaraman <rjayara...@caviumnetworks.com>
Signed-off-by: Srisivasubramanian S <ssriniva...@caviumnetworks.com>
Signed-off-by: Tejasree Kondoj <kondoj.tejas...@caviumnetworks.com>
---
  drivers/common/Makefile                       |  4 +++
  drivers/common/cpt/Makefile                   | 25 ++++++++++++++++
  drivers/common/cpt/cpt_common.h               | 41 +++++++++++++++++++++++++++
  drivers/common/cpt/cpt_mcode_defines.h        | 38 +++++++++++++++++++++++++
  drivers/common/cpt/cpt_pmd_ops_helper.c       | 41 +++++++++++++++++++++++++++
  drivers/common/cpt/cpt_pmd_ops_helper.h       | 34 ++++++++++++++++++++++
  drivers/common/cpt/meson.build                |  8 ++++++
  drivers/common/cpt/rte_common_cpt_version.map |  6 ++++
  drivers/common/meson.build                    |  2 +-
  mk/rte.app.mk                                 |  4 +++
  10 files changed, 202 insertions(+), 1 deletion(-)
  create mode 100644 drivers/common/cpt/Makefile
  create mode 100644 drivers/common/cpt/cpt_mcode_defines.h
  create mode 100644 drivers/common/cpt/cpt_pmd_ops_helper.c
  create mode 100644 drivers/common/cpt/cpt_pmd_ops_helper.h
  create mode 100644 drivers/common/cpt/meson.build
  create mode 100644 drivers/common/cpt/rte_common_cpt_version.map

diff --git a/drivers/common/Makefile b/drivers/common/Makefile
index 0fd2237..ca4e854 100644
--- a/drivers/common/Makefile
+++ b/drivers/common/Makefile
@@ -8,4 +8,8 @@ ifeq 
($(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF)$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOO
  DIRS-y += octeontx
  endif
+ifeq ($(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO),y)
+DIRS-y += cpt
+endif
+
  include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/drivers/common/cpt/Makefile b/drivers/common/cpt/Makefile
new file mode 100644
index 0000000..2340aa9
--- /dev/null
+++ b/drivers/common/cpt/Makefile
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Cavium, Inc
+#
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+#
+# library name
+#
+LIB = librte_common_cpt.a
+
+CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -I$(RTE_SDK)/drivers/bus/pci
+EXPORT_MAP := rte_common_cpt_version.map
+
+LIBABIVER := 1
+
+#
+# all source are stored in SRCS-y
+#
+SRCS-y += cpt_pmd_ops_helper.c
+
+LDLIBS += -lrte_eal
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/common/cpt/cpt_common.h b/drivers/common/cpt/cpt_common.h
index feca5fe..1f78d42 100644
--- a/drivers/common/cpt/cpt_common.h
+++ b/drivers/common/cpt/cpt_common.h
@@ -18,6 +18,24 @@
  #define AE_TYPE 1
  #define SE_TYPE 2
+#ifndef ROUNDUP4
+#define ROUNDUP4(val)  (((val) + 3) & 0xfffffffc)
+#endif
+
+#ifndef ROUNDUP8
+#define ROUNDUP8(val)  (((val) + 7) & 0xfffffff8)
+#endif
+
+#ifndef ROUNDUP16
+#define ROUNDUP16(val) (((val) + 15) & 0xfffffff0)
+#endif
+
+#ifndef __hot
+#define __hot __attribute__((hot))
+#endif
+
+#define MOD_INC(i, l)   ((i) == (l - 1) ? (i) = 0 : (i)++)
+
  /* cpt instance */
  struct cpt_instance {
        uint32_t queue_id;
@@ -51,4 +69,27 @@ struct pending_queue {
                /**< Pending requests count */
  };
+struct cpt_request_info {
+       /* fast path fields */
+       uint64_t dma_mode       : 2;
+               /**< DMA mode */
+       uint64_t se_req         : 1;
+               /**< To SE core */
+       uint64_t comp_baddr     : 61;
+       volatile uint64_t *completion_addr;
+       volatile uint64_t *alternate_caddr;
+       void *op;
+               /**< Reference to operation */
better to have comments in the same line wherever possible and if not, please check indentation.
Please check other patches as well.

Reply via email to