[dpdk-dev] [PATCH v2 05/33] common/cpt: add common code for init routine

Anoob Joseph ajoseph at caviumnetworks.com
Tue Sep 4 05:58:52 CEST 2018


From: Anoob Joseph <anoob.joseph at caviumnetworks.com>

Adding code identified common for OcteonTX family crypto devices. This
patch is adding the code required by the structures and code path of
init routine.

Signed-off-by: Ankur Dwivedi <ankur.dwivedi at caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.joseph at caviumnetworks.com>
Signed-off-by: Murthy NSSR <nidadavolu.murthy at caviumnetworks.com>
Signed-off-by: Nithin Dabilpuram <nithin.dabilpuram at caviumnetworks.com>
Signed-off-by: Ragothaman Jayaraman <rjayaraman at caviumnetworks.com>
Signed-off-by: Srisivasubramanian S <ssrinivasan at caviumnetworks.com>
Signed-off-by: Tejasree Kondoj <kondoj.tejasree at caviumnetworks.com>
---
 drivers/common/cpt/cpt_common.h | 54 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 drivers/common/cpt/cpt_common.h

diff --git a/drivers/common/cpt/cpt_common.h b/drivers/common/cpt/cpt_common.h
new file mode 100644
index 0000000..feca5fe
--- /dev/null
+++ b/drivers/common/cpt/cpt_common.h
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Cavium, Inc
+ */
+
+#ifndef _CPT_COMMON_H_
+#define _CPT_COMMON_H_
+
+/*
+ * This file defines common macros and structs
+ */
+
+/*
+ * Macros to determine CPT model. Driver makefile will define CPT_MODEL
+ * accordingly
+ */
+#define CRYPTO_OCTEONTX		0x1
+
+#define AE_TYPE 1
+#define SE_TYPE 2
+
+/* cpt instance */
+struct cpt_instance {
+	uint32_t queue_id;
+	uintptr_t rsvd;
+};
+
+struct cptvf_meta_info {
+	void *cptvf_meta_pool;
+	int cptvf_op_mlen;
+	int cptvf_op_sb_mlen;
+};
+
+struct rid {
+	uintptr_t rid;
+		/**< Request id of a crypto operation */
+};
+
+/*
+ * Pending queue structure
+ *
+ */
+struct pending_queue {
+	uint16_t enq_tail;
+	uint16_t deq_head;
+	uint16_t soft_qlen;
+		/**< Software expected queue length */
+	uint16_t p_doorbell;
+	struct rid *rid_queue;
+		/**< Array of pending requests */
+	uint64_t pending_count;
+		/**< Pending requests count */
+};
+
+#endif /* _CPT_COMMON_H_ */
-- 
2.7.4



More information about the dev mailing list