Skip to contentSkip to conversation

Add Marvell OCTEON TX2 regex driver

PATCH Superseded [email protected] 3 participants 33 messages Sep 1, 2020 – Oct 14, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover Add Marvell OCTEON TX2 regex driver

From: Guy Kaneti <[email protected]>

This patchset adds support for OCTEON TX2 regex driver as DPDK regexdev. The driver implements the API defined in the regexdev lib.

Guy Kaneti (4):
common/octeontx2: add REE definitions and logging support regex/octeontx2: add build infra and device support
usertools: add octeontx2 REE device binding
doc: add Marvell OCTEON TX2 regex guide

 MAINTAINERS                                   |    3 +
 config/common_base                            |    6 +
 doc/guides/platform/octeontx2.rst             |    5 +
 doc/guides/regexdevs/features/octeontx2.ini   |   10 +
 doc/guides/regexdevs/index.rst                |    1 +
 doc/guides/regexdevs/octeontx2.rst            |   49 +
 doc/guides/rel_notes/release_20_11.rst        |    5 +
 drivers/common/octeontx2/hw/otx2_ree.h        |   27 +
 drivers/common/octeontx2/hw/otx2_rvu.h        |    5 +
 drivers/common/octeontx2/otx2_common.c        |    1 +
 drivers/common/octeontx2/otx2_common.h        |    5 +
 drivers/common/octeontx2/otx2_mbox.h          |  103 ++
 .../rte_common_octeontx2_version.map          |    1 +
 drivers/regex/meson.build                     |    2 +-
 drivers/regex/octeontx2/meson.build           |   53 +
 drivers/regex/octeontx2/otx2_regexdev.c       | 1001 +++++++++++++++++
 drivers/regex/octeontx2/otx2_regexdev.h       |  109 ++
 .../regex/octeontx2/otx2_regexdev_compiler.c  |  229 ++++
 .../regex/octeontx2/otx2_regexdev_compiler.h  |   11 +
 .../regex/octeontx2/otx2_regexdev_hw_access.c |  167 +++
 .../regex/octeontx2/otx2_regexdev_hw_access.h |  202 ++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.c  |  401 +++++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.h  |   38 +
 .../rte_pmd_octeontx2_regex_version.map       |    3 +
 meson_options.txt                             |    2 +
 usertools/dpdk-devbind.py                     |    8 +
 26 files changed, 2446 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/regexdevs/features/octeontx2.ini
 create mode 100644 doc/guides/regexdevs/octeontx2.rst
 create mode 100644 drivers/common/octeontx2/hw/otx2_ree.h
 create mode 100644 drivers/regex/octeontx2/meson.build
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.h
 create mode 100644 drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map
Signature · 1 line
2.28.0
#1 lore raw

PATCH 1/4 common/octeontx2: add REE definitions and logging support

From: Guy Kaneti <[email protected]>

Add REE mbox msg definitions, RVU and REE HW definitions

---
 drivers/common/octeontx2/hw/otx2_ree.h        |  27 +++++
 drivers/common/octeontx2/hw/otx2_rvu.h        |   5 +
 drivers/common/octeontx2/otx2_common.c        |   1 +
 drivers/common/octeontx2/otx2_common.h        |   5 +
 drivers/common/octeontx2/otx2_mbox.h          | 103 ++++++++++++++++++
 .../rte_common_octeontx2_version.map          |   1 +
 6 files changed, 142 insertions(+)
 create mode 100644 drivers/common/octeontx2/hw/otx2_ree.h
drivers/common/octeontx2/hw/otx2_ree.h new file +27 -0
new file mode 100644
index 000000000..b7481f125
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef __OTX2_REE_HW_H__
+#define __OTX2_REE_HW_H__
+
+/* REE BAR0*/
+#define REE_AF_REEXM_MAX_MATCH		(0x80c8)
+
+/* REE BAR02 */
+#define REE_LF_MISC_INT                 (0x300)
+#define REE_LF_DONE_INT                 (0x120)
+
+#define REE_AF_QUEX_GMCTL(a)            (0x800 | (a) << 3)
+
+#define REE_AF_INT_VEC_RAS          (0x0ull)
+#define REE_AF_INT_VEC_RVU          (0x1ull)
+#define REE_AF_INT_VEC_QUE_DONE     (0x2ull)
+#define REE_AF_INT_VEC_AQ           (0x3ull)
+
+/* ENUMS */
+
+#define REE_LF_INT_VEC_QUE_DONE	(0x0ull)
+#define REE_LF_INT_VEC_MISC		(0x1ull)
+
+#endif /* __OTX2_REE_HW_H__*/
drivers/common/octeontx2/hw/otx2_rvu.h +5 -0
index 330bfb37f..072515207 100644
@@ -130,6 +130,7 @@
 #define RVU_BLOCK_TYPE_RAD                  (0xdull)
 #define RVU_BLOCK_TYPE_DFA                  (0xeull)
 #define RVU_BLOCK_TYPE_HNA                  (0xfull)
+#define RVU_BLOCK_TYPE_REE                  (0xeull)
 
 #define RVU_BLOCK_ADDR_RVUM                 (0x0ull)
 #define RVU_BLOCK_ADDR_LMT                  (0x1ull)
@@ -146,6 +147,8 @@
 #define RVU_BLOCK_ADDR_NDC2                 (0xeull)
 #define RVU_BLOCK_ADDR_R_END                (0x1full)
 #define RVU_BLOCK_ADDR_R_START              (0x14ull)
+#define RVU_BLOCK_ADDR_REE0                 (0x14ull)
+#define RVU_BLOCK_ADDR_REE1                 (0x15ull)
 
 #define RVU_VF_INT_VEC_MBOX                 (0x0ull)
 
@@ -167,6 +170,7 @@
 #define NPA_AF_BAR2_SEL			(0x9000000ull)
 #define CPT_AF_BAR2_SEL			(0x9000000ull)
 #define RVU_AF_BAR2_SEL			(0x9000000ull)
+#define REE_AF_BAR2_SEL			(0x9000000ull)
 
 #define AF_BAR2_ALIASX(a, b) \
 	(0x9100000ull | (uint64_t)(a) << 12 | (uint64_t)(b))
@@ -177,6 +181,7 @@
 #define NPA_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(0, b)
 #define CPT_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(a, b)
 #define RVU_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(a, b)
+#define REE_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(a, b)
 
 /* Structures definitions */
 
drivers/common/octeontx2/otx2_common.c +1 -0
index b292e999a..d23c50242 100644
@@ -213,3 +213,4 @@ RTE_LOG_REGISTER(otx2_logtype_sso, pmd.event.octeontx2, NOTICE);
 RTE_LOG_REGISTER(otx2_logtype_tim, pmd.event.octeontx2.timer, NOTICE);
 RTE_LOG_REGISTER(otx2_logtype_dpi, pmd.raw.octeontx2.dpi, NOTICE);
 RTE_LOG_REGISTER(otx2_logtype_ep, pmd.raw.octeontx2.ep, NOTICE);
+RTE_LOG_REGISTER(otx2_logtype_ree, pmd.regex.octeontx2, NOTICE);
drivers/common/octeontx2/otx2_common.h +5 -0
index 2168cde4d..b6779f710 100644
@@ -21,6 +21,7 @@
 #include "hw/otx2_sso.h"
 #include "hw/otx2_ssow.h"
 #include "hw/otx2_tim.h"
+#include "hw/otx2_ree.h"
 
 /* Alignment */
 #define OTX2_ALIGN  128
@@ -96,6 +97,7 @@ extern int otx2_logtype_tm;
 extern int otx2_logtype_tim;
 extern int otx2_logtype_dpi;
 extern int otx2_logtype_ep;
+extern int otx2_logtype_ree;
 
 #define otx2_err(fmt, args...)			\
 	RTE_LOG(ERR, PMD, "%s():%u " fmt "\n",	\
@@ -119,6 +121,7 @@ extern int otx2_logtype_ep;
 #define otx2_tim_dbg(fmt, ...) otx2_dbg(tim, fmt, ##__VA_ARGS__)
 #define otx2_dpi_dbg(fmt, ...) otx2_dbg(dpi, fmt, ##__VA_ARGS__)
 #define otx2_sdp_dbg(fmt, ...) otx2_dbg(ep, fmt, ##__VA_ARGS__)
+#define otx2_ree_dbg(fmt, ...) otx2_dbg(ree, fmt, ##__VA_ARGS__)
 
 /* PCI IDs */
 #define PCI_VENDOR_ID_CAVIUM			0x177D
@@ -136,6 +139,8 @@ extern int otx2_logtype_ep;
 #define PCI_DEVID_OCTEONTX2_EP_VF		0xB203 /* OCTEON TX2 EP mode */
 #define PCI_DEVID_OCTEONTX2_RVU_SDP_PF		0xA0f6
 #define PCI_DEVID_OCTEONTX2_RVU_SDP_VF		0xA0f7
+#define PCI_DEVID_OCTEONTX2_RVU_REE_PF		0xA0f4
+#define PCI_DEVID_OCTEONTX2_RVU_REE_VF		0xA0f5
 
 /*
  * REVID for RVU PCIe devices.
drivers/common/octeontx2/otx2_mbox.h +103 -0

115 lines not on this page · raw message

drivers/common/octeontx2/rte_common_octeontx2_version.map +1 -0
index 9a9969613..d269d70d8 100644
@@ -38,6 +38,7 @@ INTERNAL {
 	otx2_sso_pf_func_get;
 	otx2_sso_pf_func_set;
 	otx2_unregister_irq;
+	otx2_logtype_ree;
 
 	local: *;
 };
Signature · 1 line
2.28.0
Reviewed-by on v1 1/4
#2 lore raw

Re: [dpdk-dev] [PATCH 1/4] common/octeontx2: add REE definitions and logging support

-----Original Message-----
From: dev <[email protected]> On Behalf Of [email protected]
Sent: Tuesday, 1 September 2020 15:25
To: Jerin Jacob Kollanukkaran <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Smadar Fuks <[email protected]>; Dovrat Zifroni <[email protected]>; Guy Kaneti <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH 1/4] common/octeontx2: add REE definitions and logging support

From: Guy Kaneti <[email protected]>

Add REE mbox msg definitions, RVU and REE HW definitions

---
 drivers/common/octeontx2/hw/otx2_ree.h        |  27 +++++
 drivers/common/octeontx2/hw/otx2_rvu.h        |   5 +
 drivers/common/octeontx2/otx2_common.c        |   1 +
 drivers/common/octeontx2/otx2_common.h        |   5 +
 drivers/common/octeontx2/otx2_mbox.h          | 103 ++++++++++++++++++
 .../rte_common_octeontx2_version.map          |   1 +
 6 files changed, 142 insertions(+)
 create mode 100644 drivers/common/octeontx2/hw/otx2_ree.h
drivers/common/octeontx2/hw/otx2_ree.h new file +27 -0
new file mode 100644
index 000000000..b7481f125
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef __OTX2_REE_HW_H__
+#define __OTX2_REE_HW_H__
+
+/* REE BAR0*/
+#define REE_AF_REEXM_MAX_MATCH		(0x80c8)
+
+/* REE BAR02 */
+#define REE_LF_MISC_INT                 (0x300)
+#define REE_LF_DONE_INT                 (0x120)
+
+#define REE_AF_QUEX_GMCTL(a)            (0x800 | (a) << 3)
+
+#define REE_AF_INT_VEC_RAS          (0x0ull)
+#define REE_AF_INT_VEC_RVU          (0x1ull)
+#define REE_AF_INT_VEC_QUE_DONE     (0x2ull)
+#define REE_AF_INT_VEC_AQ           (0x3ull)
+
+/* ENUMS */
+
+#define REE_LF_INT_VEC_QUE_DONE	(0x0ull)
+#define REE_LF_INT_VEC_MISC		(0x1ull)
+
+#endif /* __OTX2_REE_HW_H__*/
drivers/common/octeontx2/hw/otx2_rvu.h +4 -0
index 330bfb37f..072515207 100644
@@ -130,6 +130,7 @@
 #define RVU_BLOCK_TYPE_RAD                  (0xdull)
 #define RVU_BLOCK_TYPE_DFA                  (0xeull)
 #define RVU_BLOCK_TYPE_HNA                  (0xfull)
+#define RVU_BLOCK_TYPE_REE                  (0xeull)
 
 #define RVU_BLOCK_ADDR_RVUM                 (0x0ull)
 #define RVU_BLOCK_ADDR_LMT                  (0x1ull)
@@ -146,6 +147,8 @@
 #define RVU_BLOCK_ADDR_NDC2                 (0xeull)
 #define RVU_BLOCK_ADDR_R_END                (0x1full)
 #define RVU_BLOCK_ADDR_R_START              (0x14ull)
+#define RVU_BLOCK_ADDR_REE0                 (0x14ull)
+#define RVU_BLOCK_ADDR_REE1                 (0x15ull)
 
 #define RVU_VF_INT_VEC_MBOX                 (0x0ull)
 
@@ -167,6 +170,7 @@
 #define NPA_AF_BAR2_SEL			(0x9000000ull)
 #define CPT_AF_BAR2_SEL			(0x9000000ull)
 #define RVU_AF_BAR2_SEL			(0x9000000ull)
+#define REE_AF_BAR2_SEL			(0x9000000ull)
 
 #define AF_BAR2_ALIASX(a, b) \
 	(0x9100000ull | (uint64_t)(a) << 12 | (uint64_t)(b)) @@ -177,6 +181,7 @@

#define NPA_AF_BAR2_ALIASX(a, b) AF_BAR2_ALIASX(0, b)
#define CPT_AF_BAR2_ALIASX(a, b) AF_BAR2_ALIASX(a, b)
#define RVU_AF_BAR2_ALIASX(a, b) AF_BAR2_ALIASX(a, b)
+#define REE_AF_BAR2_ALIASX(a, b) AF_BAR2_ALIASX(a, b)

/* Structures definitions */

drivers/common/octeontx2/otx2_common.c +1 -0
index b292e999a..d23c50242 100644
@@ -213,3 +213,4 @@ RTE_LOG_REGISTER(otx2_logtype_sso, pmd.event.octeontx2, NOTICE);  RTE_LOG_REGISTER(otx2_logtype_tim, pmd.event.octeontx2.timer, NOTICE);  RTE_LOG_REGISTER(otx2_logtype_dpi, pmd.raw.octeontx2.dpi, NOTICE);  RTE_LOG_REGISTER(otx2_logtype_ep, pmd.raw.octeontx2.ep, NOTICE);
+RTE_LOG_REGISTER(otx2_logtype_ree, pmd.regex.octeontx2, NOTICE);
drivers/common/octeontx2/otx2_common.h +5 -0
index 2168cde4d..b6779f710 100644
@@ -21,6 +21,7 @@
 #include "hw/otx2_sso.h"
 #include "hw/otx2_ssow.h"
 #include "hw/otx2_tim.h"
+#include "hw/otx2_ree.h"
 
 /* Alignment */
 #define OTX2_ALIGN  128
@@ -96,6 +97,7 @@ extern int otx2_logtype_tm;  extern int otx2_logtype_tim;  extern int otx2_logtype_dpi;  extern int otx2_logtype_ep;
+extern int otx2_logtype_ree;
 
 #define otx2_err(fmt, args...)			\
 	RTE_LOG(ERR, PMD, "%s():%u " fmt "\n",	\
@@ -119,6 +121,7 @@ extern int otx2_logtype_ep;  #define otx2_tim_dbg(fmt, ...) otx2_dbg(tim, fmt, ##__VA_ARGS__)  #define otx2_dpi_dbg(fmt, ...) otx2_dbg(dpi, fmt, ##__VA_ARGS__)  #define otx2_sdp_dbg(fmt, ...) otx2_dbg(ep, fmt, ##__VA_ARGS__)
+#define otx2_ree_dbg(fmt, ...) otx2_dbg(ree, fmt, ##__VA_ARGS__)
 
 /* PCI IDs */
 #define PCI_VENDOR_ID_CAVIUM			0x177D
@@ -136,6 +139,8 @@ extern int otx2_logtype_ep;
 #define PCI_DEVID_OCTEONTX2_EP_VF		0xB203 /* OCTEON TX2 EP mode */
 #define PCI_DEVID_OCTEONTX2_RVU_SDP_PF		0xA0f6
 #define PCI_DEVID_OCTEONTX2_RVU_SDP_VF		0xA0f7
+#define PCI_DEVID_OCTEONTX2_RVU_REE_PF		0xA0f4
+#define PCI_DEVID_OCTEONTX2_RVU_REE_VF		0xA0f5
 
 /*
  * REVID for RVU PCIe devices.
drivers/common/octeontx2/otx2_mbox.h +100 -0

111 lines not on this page · raw message

index 9a9969613..d269d70d8 100644

drivers/common/octeontx2/rte_common_octeontx2_version.map +1 -0
@@ -38,6 +38,7 @@ INTERNAL {
 	otx2_sso_pf_func_get;
 	otx2_sso_pf_func_set;
 	otx2_unregister_irq;
+	otx2_logtype_ree;
 
 	local: *;
 };

--
2.28.0

#3 lore raw

PATCH 2/4 regex/octeontx2: add build infra and device support

In reply to [email protected]

From: Guy Kaneti <[email protected]>

Add meson based build infrastructure along with the OTX2 regexdev (REE) device functions.

For regex rule compiler support build:
meson configure -Dree_compiler_sdk=<path-to-compiler-sdk>

---
 MAINTAINERS                                   |    3 +
 config/common_base                            |    6 +
 drivers/regex/meson.build                     |    2 +-
 drivers/regex/octeontx2/meson.build           |   53 +
 drivers/regex/octeontx2/otx2_regexdev.c       | 1001 +++++++++++++++++
 drivers/regex/octeontx2/otx2_regexdev.h       |  109 ++
 .../regex/octeontx2/otx2_regexdev_compiler.c  |  229 ++++
 .../regex/octeontx2/otx2_regexdev_compiler.h  |   11 +
 .../regex/octeontx2/otx2_regexdev_hw_access.c |  167 +++
 .../regex/octeontx2/otx2_regexdev_hw_access.h |  202 ++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.c  |  401 +++++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.h  |   38 +
 .../rte_pmd_octeontx2_regex_version.map       |    3 +
 meson_options.txt                             |    2 +
 14 files changed, 2226 insertions(+), 1 deletion(-)
 create mode 100644 drivers/regex/octeontx2/meson.build
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.h
 create mode 100644 drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map
MAINTAINERS +3 -0
index ed163f5d5..ab8a9313c 100644
@@ -1137,6 +1137,9 @@ F: drivers/regex/mlx5/
 F: doc/guides/regexdevs/mlx5.rst
 F: doc/guides/regexdevs/features/mlx5.ini
 
+Marvell OCTEON TX2 regex
+M: Guy Kaneti <[email protected]>
+F: drivers/regex/octeontx2/
 
 vDPA Drivers
 ------------
config/common_base +6 -0
index fbf0ee70c..2cd687bf6 100644
@@ -842,6 +842,12 @@ CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EP_RAWDEV=y
 #
 CONFIG_RTE_LIBRTE_PMD_NTB_RAWDEV=y
 
+#
+# Compile PMD for Octeontx2 REE regex device
+#
+CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_REGEX=y
+CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_REGEX_COMPILER=n
+
 #
 # Compile librte_ring
 #
drivers/regex/meson.build +1 -1
index 8edeba3a0..79bb5d5df 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2020 Mellanox Technologies, Ltd
 
-drivers = ['mlx5']
+drivers = ['mlx5', 'octeontx2']
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
drivers/regex/octeontx2/meson.build new file +53 -0

53 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev.c new file +1001 -0

1,001 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev.h new file +109 -0

109 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_compiler.c new file +229 -0

229 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_compiler.h new file +11 -0
new file mode 100644
index 000000000..8d2625bf7
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _OTX2_REGEXDEV_COMPILER_H_
+#define _OTX2_REGEXDEV_COMPILER_H_
+
+int
+otx2_ree_rule_db_compile_prog(struct rte_regexdev *dev);
+
+#endif /* _OTX2_REGEXDEV_COMPILER_H_ */
drivers/regex/octeontx2/otx2_regexdev_hw_access.c new file +167 -0

167 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_hw_access.h new file +202 -0

202 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_mbox.c new file +401 -0

401 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_mbox.h new file +38 -0
new file mode 100644
index 000000000..953efa672
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _OTX2_REGEXDEV_MBOX_H_
+#define _OTX2_REGEXDEV_MBOX_H_
+
+#include <rte_regexdev.h>
+
+int otx2_ree_available_queues_get(const struct rte_regexdev *dev,
+				  uint16_t *nb_queues);
+
+int otx2_ree_queues_attach(const struct rte_regexdev *dev, uint8_t nb_queues);
+
+int otx2_ree_queues_detach(const struct rte_regexdev *dev);
+
+int otx2_ree_msix_offsets_get(const struct rte_regexdev *dev);
+
+int otx2_ree_config_lf(const struct rte_regexdev *dev, uint8_t lf, uint8_t pri,
+		       uint32_t size);
+
+int otx2_ree_af_reg_read(const struct rte_regexdev *dev, uint64_t reg,
+			 uint64_t *val);
+
+int otx2_ree_af_reg_write(const struct rte_regexdev *dev, uint64_t reg,
+			  uint64_t val);
+
+int otx2_ree_rule_db_get(const struct rte_regexdev *dev, char *rule_db,
+		 uint32_t rule_db_len, char *rule_dbi, uint32_t rule_dbi_len);
+
+int otx2_ree_rule_db_len_get(const struct rte_regexdev *dev,
+			     uint32_t *rule_db_len, uint32_t *rule_dbi_len);
+
+int otx2_ree_rule_db_prog(const struct rte_regexdev *dev, const char *rule_db,
+		uint32_t rule_db_len, const char *rule_dbi,
+		uint32_t rule_dbi_len);
+
+#endif /* _OTX2_REGEXDEV_MBOX_H_ */
drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map new file +3 -0
new file mode 100644
index 000000000..34eb991c7
@@ -0,0 +1,3 @@
+DPDK_20.08 {
+	local: *;
+};
meson_options.txt +2 -0
index 9bf18ab6b..214b5f7f5 100644
@@ -36,3 +36,5 @@ option('tests', type: 'boolean', value: true,
 	description: 'build unit tests')
 option('use_hpet', type: 'boolean', value: false,
 	description: 'use HPET timer in EAL')
+option('ree_compiler_sdk', type: 'string', value: '',
+	description: 'path to REE compiler SDK optional library for regex device')
\ No newline at end of file
Signature · 1 line
2.28.0
Reviewed-by on v1 2/4
#4 lore raw

Re: [dpdk-dev] [PATCH 2/4] regex/octeontx2: add build infra and device support

-----Original Message-----
From: dev <[email protected]> On Behalf Of [email protected]
Sent: Tuesday, 1 September 2020 15:25
To: Jerin Jacob Kollanukkaran <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Smadar Fuks <[email protected]>; Dovrat Zifroni <[email protected]>; Guy Kaneti <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH 2/4] regex/octeontx2: add build infra and device support

From: Guy Kaneti <[email protected]>

Add meson based build infrastructure along with the OTX2 regexdev (REE) device functions.

For regex rule compiler support build:
meson configure -Dree_compiler_sdk=<path-to-compiler-sdk>

---
 MAINTAINERS                                   |    3 +
 config/common_base                            |    6 +
 drivers/regex/meson.build                     |    2 +-
 drivers/regex/octeontx2/meson.build           |   53 +
 drivers/regex/octeontx2/otx2_regexdev.c       | 1001 +++++++++++++++++
 drivers/regex/octeontx2/otx2_regexdev.h       |  109 ++
 .../regex/octeontx2/otx2_regexdev_compiler.c  |  229 ++++
 .../regex/octeontx2/otx2_regexdev_compiler.h  |   11 +
 .../regex/octeontx2/otx2_regexdev_hw_access.c |  167 +++
 .../regex/octeontx2/otx2_regexdev_hw_access.h |  202 ++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.c  |  401 +++++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.h  |   38 +
 .../rte_pmd_octeontx2_regex_version.map       |    3 +
 meson_options.txt                             |    2 +
 14 files changed, 2226 insertions(+), 1 deletion(-)
 create mode 100644 drivers/regex/octeontx2/meson.build
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.h
 create mode 100644 drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map
MAINTAINERS +3 -0
index ed163f5d5..ab8a9313c 100644
@@ -1137,6 +1137,9 @@ F: drivers/regex/mlx5/
 F: doc/guides/regexdevs/mlx5.rst
 F: doc/guides/regexdevs/features/mlx5.ini
 
+Marvell OCTEON TX2 regex
+M: Guy Kaneti <[email protected]>
+F: drivers/regex/octeontx2/
 
 vDPA Drivers
 ------------
config/common_base +6 -0
index fbf0ee70c..2cd687bf6 100644
@@ -842,6 +842,12 @@ CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EP_RAWDEV=y
 #
 CONFIG_RTE_LIBRTE_PMD_NTB_RAWDEV=y
 
+#
+# Compile PMD for Octeontx2 REE regex device
+#
+CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_REGEX=y
+CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_REGEX_COMPILER=n
+
 #
 # Compile librte_ring
 #
drivers/regex/meson.build +1 -1
index 8edeba3a0..79bb5d5df 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2020 Mellanox Technologies, Ltd
 
-drivers = ['mlx5']
+drivers = ['mlx5', 'octeontx2']
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
drivers/regex/octeontx2/meson.build new file +53 -0

53 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev.c new file +1001 -0

1,001 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev.h new file +109 -0

109 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_compiler.c new file +229 -0

229 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_compiler.h new file +11 -0
new file mode 100644
index 000000000..8d2625bf7
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _OTX2_REGEXDEV_COMPILER_H_
+#define _OTX2_REGEXDEV_COMPILER_H_
+
+int
+otx2_ree_rule_db_compile_prog(struct rte_regexdev *dev);
+
+#endif /* _OTX2_REGEXDEV_COMPILER_H_ */
drivers/regex/octeontx2/otx2_regexdev_hw_access.c new file +167 -0

167 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_hw_access.h new file +202 -0

202 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_mbox.c new file +401 -0

401 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_mbox.h new file +38 -0
new file mode 100644
index 000000000..953efa672
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _OTX2_REGEXDEV_MBOX_H_
+#define _OTX2_REGEXDEV_MBOX_H_
+
+#include <rte_regexdev.h>
+
+int otx2_ree_available_queues_get(const struct rte_regexdev *dev,
+				  uint16_t *nb_queues);
+
+int otx2_ree_queues_attach(const struct rte_regexdev *dev, uint8_t nb_queues);
+
+int otx2_ree_queues_detach(const struct rte_regexdev *dev);
+
+int otx2_ree_msix_offsets_get(const struct rte_regexdev *dev);
+
+int otx2_ree_config_lf(const struct rte_regexdev *dev, uint8_t lf, uint8_t pri,
+		       uint32_t size);
+
+int otx2_ree_af_reg_read(const struct rte_regexdev *dev, uint64_t reg,
+			 uint64_t *val);
+
+int otx2_ree_af_reg_write(const struct rte_regexdev *dev, uint64_t reg,
+			  uint64_t val);
+
+int otx2_ree_rule_db_get(const struct rte_regexdev *dev, char *rule_db,
+		 uint32_t rule_db_len, char *rule_dbi, uint32_t rule_dbi_len);
+
+int otx2_ree_rule_db_len_get(const struct rte_regexdev *dev,
+			     uint32_t *rule_db_len, uint32_t *rule_dbi_len);
+
+int otx2_ree_rule_db_prog(const struct rte_regexdev *dev, const char *rule_db,
+		uint32_t rule_db_len, const char *rule_dbi,
+		uint32_t rule_dbi_len);
+
+#endif /* _OTX2_REGEXDEV_MBOX_H_ */
drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map new file +3 -0
new file mode 100644
index 000000000..34eb991c7
@@ -0,0 +1,3 @@
+DPDK_20.08 {
+	local: *;
+};
meson_options.txt +2 -0
index 9bf18ab6b..214b5f7f5 100644
@@ -36,3 +36,5 @@ option('tests', type: 'boolean', value: true,
 	description: 'build unit tests')
 option('use_hpet', type: 'boolean', value: false,
 	description: 'use HPET timer in EAL')
+option('ree_compiler_sdk', type: 'string', value: '',
+	description: 'path to REE compiler SDK optional library for regex device')
\ No newline at end of file
Signature · 1 line
2.28.0
#5 lore raw

PATCH 3/4 usertools: add octeontx2 REE device binding

In reply to [email protected]

From: Guy Kaneti <[email protected]>

Update the devbind script with new section of regex devices, also added OCTEONTX2 REE device ID to regex device list

---
 usertools/dpdk-devbind.py | 8 ++++++++
 1 file changed, 8 insertions(+)
usertools/dpdk-devbind.py +8 -0
index 86b6b53c4..51ee990db 100755
@@ -44,6 +44,8 @@
               'SVendor': None, 'SDevice': None}
 octeontx2_dma = {'Class': '08', 'Vendor': '177d', 'Device': 'a081',
               'SVendor': None, 'SDevice': None}
+octeontx2_ree = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f4',
+              'SVendor': None, 'SDevice': None}
 
 intel_ioat_bdw = {'Class': '08', 'Vendor': '8086', 'Device': '6f20,6f21,6f22,6f23,6f24,6f25,6f26,6f27,6f2e,6f2f',
               'SVendor': None, 'SDevice': None}
@@ -61,6 +63,7 @@
 mempool_devices = [cavium_fpa, octeontx2_npa]
 compress_devices = [cavium_zip]
 misc_devices = [intel_ioat_bdw, intel_ioat_skx, intel_ioat_icx, intel_ntb_skx, octeontx2_dma]
+regex_devices = [octeontx2_ree]
 
 # global dict ethernet devices present. Dictionary indexed by PCI address.
 # Each device within this is itself a dictionary of device properties
@@ -648,6 +651,9 @@ def show_status():
     if status_dev == "misc" or status_dev == "all":
         show_device_status(misc_devices, "Misc (rawdev)")
 
+    if status_dev == "regex" or status_dev == "all":
+        show_device_status(regex_devices, "Regex")
+
 def parse_args():
     '''Parses the command-line arguments given by the user and takes the
     appropriate action for each'''
@@ -723,6 +729,7 @@ def do_arg_actions():
             get_device_details(mempool_devices)
             get_device_details(compress_devices)
             get_device_details(misc_devices)
+            get_device_details(regex_devices)
         show_status()
 
 
@@ -744,6 +751,7 @@ def main():
     get_device_details(mempool_devices)
     get_device_details(compress_devices)
     get_device_details(misc_devices)
+    get_device_details(regex_devices)
     do_arg_actions()
 
 if __name__ == "__main__":
Signature · 1 line
2.28.0
Reviewed-by on v1 3/4
#6 lore raw

Re: [dpdk-dev] [PATCH 3/4] usertools: add octeontx2 REE device binding

-----Original Message-----
From: dev <[email protected]> On Behalf Of [email protected]
Sent: Tuesday, 1 September 2020 15:25
To: Jerin Jacob Kollanukkaran <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Smadar Fuks <[email protected]>; Dovrat Zifroni <[email protected]>; Guy Kaneti <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH 3/4] usertools: add octeontx2 REE device binding

From: Guy Kaneti <[email protected]>

Update the devbind script with new section of regex devices, also added OCTEONTX2 REE device ID to regex device list

---
 usertools/dpdk-devbind.py | 8 ++++++++
 1 file changed, 8 insertions(+)
usertools/dpdk-devbind.py +3 -0
@@ -44,6 +44,8 @@
               'SVendor': None, 'SDevice': None}  octeontx2_dma = {'Class': '08', 'Vendor': '177d', 'Device': 'a081',
               'SVendor': None, 'SDevice': None}
+octeontx2_ree = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f4',
+              'SVendor': None, 'SDevice': None}
 
 intel_ioat_bdw = {'Class': '08', 'Vendor': '8086', 'Device': '6f20,6f21,6f22,6f23,6f24,6f25,6f26,6f27,6f2e,6f2f',
               'SVendor': None, 'SDevice': None} @@ -61,6 +63,7 @@  mempool_devices = [cavium_fpa, octeontx2_npa]  compress_devices = [cavium_zip]  misc_devices = [intel_ioat_bdw, intel_ioat_skx, intel_ioat_icx, intel_ntb_skx, octeontx2_dma]
+regex_devices = [octeontx2_ree]
 # global dict ethernet devices present. Dictionary indexed by PCI address.
 # Each device within this is itself a dictionary of device properties @@ -648,6 +651,9 @@ def show_status():
     if status_dev == "misc" or status_dev == "all":
         show_device_status(misc_devices, "Misc (rawdev)")

+ if status_dev == "regex" or status_dev == "all":
+ show_device_status(regex_devices, "Regex")
+
def parse_args():
'''Parses the command-line arguments given by the user and takes the appropriate action for each'''
@@ -723,6 +729,7 @@ def do_arg_actions():
get_device_details(mempool_devices) get_device_details(compress_devices) get_device_details(misc_devices)
+ get_device_details(regex_devices)
show_status()

@@ -744,6 +751,7 @@ def main():
get_device_details(mempool_devices)
get_device_details(compress_devices)
get_device_details(misc_devices)
+ get_device_details(regex_devices)
do_arg_actions()

if __name__ == "__main__":
--
2.28.0

#7 lore raw

PATCH 4/4 doc: add Marvell OCTEON TX2 regex guide

In reply to [email protected]

From: Guy Kaneti <[email protected]>

---
 doc/guides/platform/octeontx2.rst           |  5 +++
 doc/guides/regexdevs/features/octeontx2.ini | 10 +++++
 doc/guides/regexdevs/index.rst              |  1 +
 doc/guides/regexdevs/octeontx2.rst          | 49 +++++++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst      |  5 +++
 5 files changed, 70 insertions(+)
 create mode 100644 doc/guides/regexdevs/features/octeontx2.ini
 create mode 100644 doc/guides/regexdevs/octeontx2.rst
doc/guides/platform/octeontx2.rst +5 -0
index 13255eec5..c4d64ab4b 100644
@@ -67,6 +67,8 @@ DPDK subsystem.
    +---+-----+--------------------------------------------------------------+
    | 9 | SDP | rte_ethdev                                                   |
    +---+-----+--------------------------------------------------------------+
+   | 10| REE | rte_regexdev                                                 |
+   +---+-----+--------------------------------------------------------------+
 
 PF0 is called the administrative / admin function (AF) and has exclusive
 privileges to provision RVU functional block's LFs to each of the PF/VF.
@@ -156,6 +158,9 @@ This section lists dataplane H/W block(s) available in OCTEON TX2 SoC.
 #. **Crypto Device Driver**
    See :doc:`../cryptodevs/octeontx2` for CPT crypto device driver information.
 
+#. **Regex Device Driver**
+   See :doc:`../regexdevs/octeontx2` for REE regex device driver information.
+
 Procedure to Setup Platform
 ---------------------------
 
doc/guides/regexdevs/features/octeontx2.ini new file +10 -0
new file mode 100644
index 000000000..c9b421a16
@@ -0,0 +1,10 @@
+;
+; Supported features of the 'octeontx2' regex driver.
+;
+; Refer to default.ini for the full list of available driver features.
+;
+[Features]
+PCRE back reference         = Y
+PCRE word boundary          = Y
+Run time compilation        = Y
+Armv8                       = Y
doc/guides/regexdevs/index.rst +1 -0
index 49216a932..b1abc826b 100644
@@ -13,3 +13,4 @@ which can be used from an application through RegEx API.
 
    features_overview
    mlx5
+   octeontx2
doc/guides/regexdevs/octeontx2.rst new file +49 -0

49 lines not on this page · raw message

doc/guides/rel_notes/release_20_11.rst +5 -0
index df227a177..05c0a8ba7 100644
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Added Marvell OCTEON TX2 regex PMD.**
+
+  Added a new PMD driver for hardware regex offload block for OCTEON TX2 SoC.
+
+  See the :doc:`../regexdevs/octeontx2` for more details.
 
 Removed Items
 -------------
Signature · 1 line
2.28.0
Reviewed-by on v1 4/4
#8 lore raw

Re: [dpdk-dev] [PATCH 4/4] doc: add Marvell OCTEON TX2 regex guide

-----Original Message-----
From: dev <[email protected]> On Behalf Of [email protected]
Sent: Tuesday, 1 September 2020 15:25
To: Jerin Jacob Kollanukkaran <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Smadar Fuks <[email protected]>; Dovrat Zifroni <[email protected]>; Guy Kaneti <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH 4/4] doc: add Marvell OCTEON TX2 regex guide

From: Guy Kaneti <[email protected]>

---
 doc/guides/platform/octeontx2.rst           |  5 +++
 doc/guides/regexdevs/features/octeontx2.ini | 10 +++++
 doc/guides/regexdevs/index.rst              |  1 +
 doc/guides/regexdevs/octeontx2.rst          | 49 +++++++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst      |  5 +++
 5 files changed, 70 insertions(+)
 create mode 100644 doc/guides/regexdevs/features/octeontx2.ini
 create mode 100644 doc/guides/regexdevs/octeontx2.rst
doc/guides/platform/octeontx2.rst +4 -0
index 13255eec5..c4d64ab4b 100644
@@ -67,6 +67,8 @@ DPDK subsystem.
    +---+-----+--------------------------------------------------------------+
    | 9 | SDP | rte_ethdev                                                   |
    +---+-----+--------------------------------------------------------------+
+   | 10| REE | rte_regexdev                                                 |
+   
+ +---+-----+-----------------------------------------------------------
+ ---+
 

PF0 is called the administrative / admin function (AF) and has exclusive privileges to provision RVU functional block's LFs to each of the PF/VF.
@@ -156,6 +158,9 @@ This section lists dataplane H/W block(s) available in OCTEON TX2 SoC.
#. **Crypto Device Driver**
See :doc:../cryptodevs/octeontx2 for CPT crypto device driver information.

+#. **Regex Device Driver**
+ See :doc:../regexdevs/octeontx2 for REE regex device driver information.
+
Procedure to Setup Platform
---------------------------

doc/guides/regexdevs/features/octeontx2.ini new file +10 -0
new file mode 100644
index 000000000..c9b421a16
@@ -0,0 +1,10 @@
+;
+; Supported features of the 'octeontx2' regex driver.
+;
+; Refer to default.ini for the full list of available driver features.
+;
+[Features]
+PCRE back reference         = Y
+PCRE word boundary          = Y
+Run time compilation        = Y
+Armv8                       = Y
doc/guides/regexdevs/index.rst +1 -0
@@ -13,3 +13,4 @@ which can be used from an application through RegEx API.
 
    features_overview
    mlx5
+   octeontx2
doc/guides/regexdevs/octeontx2.rst new file +49 -0

49 lines not on this page · raw message

+ +---+------------+----------------------------------------------------
+ ---+

doc/guides/rel_notes/release_20_11.rst +5 -0
index df227a177..05c0a8ba7 100644
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Added Marvell OCTEON TX2 regex PMD.**
+
+  Added a new PMD driver for hardware regex offload block for OCTEON TX2 SoC.
+
+  See the :doc:`../regexdevs/octeontx2` for more details.
 
 Removed Items
 -------------

--
2.28.0

author
#9 lore raw
In reply to [email protected]

Kind reminder to all maintainers, please review and ack/comment.

Quoted 68 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Tuesday, September 1, 2020 3:25 PM
To: Jerin Jacob Kollanukkaran <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Smadar Fuks <[email protected]>; Dovrat Zifroni <[email protected]>; Guy Kaneti <[email protected]>; [email protected]
Subject: [PATCH 0/4] Add Marvell OCTEON TX2 regex driver

From: Guy Kaneti <[email protected]>

This patchset adds support for OCTEON TX2 regex driver as DPDK regexdev. The driver implements the API defined in the regexdev lib.

Guy Kaneti (4):
common/octeontx2: add REE definitions and logging support regex/octeontx2: add build infra and device support
usertools: add octeontx2 REE device binding
doc: add Marvell OCTEON TX2 regex guide

 MAINTAINERS                                   |    3 +
 config/common_base                            |    6 +
 doc/guides/platform/octeontx2.rst             |    5 +
 doc/guides/regexdevs/features/octeontx2.ini   |   10 +
 doc/guides/regexdevs/index.rst                |    1 +
 doc/guides/regexdevs/octeontx2.rst            |   49 +
 doc/guides/rel_notes/release_20_11.rst        |    5 +
 drivers/common/octeontx2/hw/otx2_ree.h        |   27 +
 drivers/common/octeontx2/hw/otx2_rvu.h        |    5 +
 drivers/common/octeontx2/otx2_common.c        |    1 +
 drivers/common/octeontx2/otx2_common.h        |    5 +
 drivers/common/octeontx2/otx2_mbox.h          |  103 ++
 .../rte_common_octeontx2_version.map          |    1 +
 drivers/regex/meson.build                     |    2 +-
 drivers/regex/octeontx2/meson.build           |   53 +
 drivers/regex/octeontx2/otx2_regexdev.c       | 1001 +++++++++++++++++
 drivers/regex/octeontx2/otx2_regexdev.h       |  109 ++
 .../regex/octeontx2/otx2_regexdev_compiler.c  |  229 ++++
 .../regex/octeontx2/otx2_regexdev_compiler.h  |   11 +
 .../regex/octeontx2/otx2_regexdev_hw_access.c |  167 +++
.../regex/octeontx2/otx2_regexdev_hw_access.h |  202 ++++
drivers/regex/octeontx2/otx2_regexdev_mbox.c  |  401 +++++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.h  |   38 +
 .../rte_pmd_octeontx2_regex_version.map       |    3 +
 meson_options.txt                             |    2 +
 usertools/dpdk-devbind.py                     |    8 +
 26 files changed, 2446 insertions(+), 1 deletion(-)  create mode 100644
doc/guides/regexdevs/features/octeontx2.ini
 create mode 100644 doc/guides/regexdevs/octeontx2.rst
 create mode 100644 drivers/common/octeontx2/hw/otx2_ree.h
 create mode 100644 drivers/regex/octeontx2/meson.build
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.h
 create mode 100644

drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map

--
2.28.0

#10 lore raw

08/10/2020 08:31, Guy Kaneti:

Quoted 1 line

Kind reminder to all maintainers, please review and ack/comment.

Please could you rebase?

The 2 rebase issues I see are:
- make is removed
- rte_cio_wmb is removed

author
#11 lore raw

Sure, I sent patch v2

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, October 12, 2020 12:23 AM
To: Guy Kaneti <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Smadar Fuks <[email protected]>; Dovrat Zifroni <[email protected]>
Subject: [EXT] Re: [dpdk-dev] [PATCH 0/4] Add Marvell OCTEON TX2 regex driver

External Email

----------------------------------------------------------------------
08/10/2020 08:31, Guy Kaneti:

Quoted 1 line

Kind reminder to all maintainers, please review and ack/comment.

Please could you rebase?

The 2 rebase issues I see are:
- make is removed
- rte_cio_wmb is removed

#12 lore raw

v2 cover Add Marvell OCTEON TX2 regex driver

In reply to [email protected]

From: Guy Kaneti <[email protected]>

This patchset adds support for OCTEON TX2 regex driver as DPDK regexdev. The driver implements the API defined in the regexdev lib.

v2:
* Rebase.
* Remove config/common_base from patch
* change rte_cio_wmb to rte_io_wmb

Guy Kaneti (4):
common/octeontx2: add REE definitions and logging support regex/octeontx2: add build infra and device support
usertools: add octeontx2 REE device binding
doc: add Marvell OCTEON TX2 regex guide

 MAINTAINERS                                   |    3 +
 doc/guides/platform/octeontx2.rst             |    5 +
 doc/guides/regexdevs/features/octeontx2.ini   |   10 +
 doc/guides/regexdevs/index.rst                |    1 +
 doc/guides/regexdevs/octeontx2.rst            |   49 +
 doc/guides/rel_notes/release_20_11.rst        |    5 +
 drivers/common/octeontx2/hw/otx2_ree.h        |   27 +
 drivers/common/octeontx2/hw/otx2_rvu.h        |    5 +
 drivers/common/octeontx2/otx2_common.c        |    1 +
 drivers/common/octeontx2/otx2_common.h        |    5 +
 drivers/common/octeontx2/otx2_mbox.h          |  103 ++
 .../rte_common_octeontx2_version.map          |    1 +
 drivers/regex/meson.build                     |    2 +-
 drivers/regex/octeontx2/meson.build           |   53 +
 drivers/regex/octeontx2/otx2_regexdev.c       | 1002 +++++++++++++++++
 drivers/regex/octeontx2/otx2_regexdev.h       |  109 ++
 .../regex/octeontx2/otx2_regexdev_compiler.c  |  229 ++++
 .../regex/octeontx2/otx2_regexdev_compiler.h  |   11 +
 .../regex/octeontx2/otx2_regexdev_hw_access.c |  167 +++
 .../regex/octeontx2/otx2_regexdev_hw_access.h |  202 ++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.c  |  401 +++++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.h  |   38 +
 .../rte_pmd_octeontx2_regex_version.map       |    3 +
 meson_options.txt                             |    2 +
 usertools/dpdk-devbind.py                     |    8 +
 25 files changed, 2441 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/regexdevs/features/octeontx2.ini
 create mode 100644 doc/guides/regexdevs/octeontx2.rst
 create mode 100644 drivers/common/octeontx2/hw/otx2_ree.h
 create mode 100644 drivers/regex/octeontx2/meson.build
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.h
 create mode 100644 drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map
Signature · 1 line
2.28.0
#13 lore raw

PATCH v2 1/4 common/octeontx2: add REE definitions and logging support

From: Guy Kaneti <[email protected]>

Add REE mbox msg definitions, RVU and REE HW definitions

---
 drivers/common/octeontx2/hw/otx2_ree.h        |  27 +++++
 drivers/common/octeontx2/hw/otx2_rvu.h        |   5 +
 drivers/common/octeontx2/otx2_common.c        |   1 +
 drivers/common/octeontx2/otx2_common.h        |   5 +
 drivers/common/octeontx2/otx2_mbox.h          | 103 ++++++++++++++++++
 .../rte_common_octeontx2_version.map          |   1 +
 6 files changed, 142 insertions(+)
 create mode 100644 drivers/common/octeontx2/hw/otx2_ree.h
drivers/common/octeontx2/hw/otx2_ree.h new file +27 -0
new file mode 100644
index 000000000..b7481f125
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef __OTX2_REE_HW_H__
+#define __OTX2_REE_HW_H__
+
+/* REE BAR0*/
+#define REE_AF_REEXM_MAX_MATCH		(0x80c8)
+
+/* REE BAR02 */
+#define REE_LF_MISC_INT                 (0x300)
+#define REE_LF_DONE_INT                 (0x120)
+
+#define REE_AF_QUEX_GMCTL(a)            (0x800 | (a) << 3)
+
+#define REE_AF_INT_VEC_RAS          (0x0ull)
+#define REE_AF_INT_VEC_RVU          (0x1ull)
+#define REE_AF_INT_VEC_QUE_DONE     (0x2ull)
+#define REE_AF_INT_VEC_AQ           (0x3ull)
+
+/* ENUMS */
+
+#define REE_LF_INT_VEC_QUE_DONE	(0x0ull)
+#define REE_LF_INT_VEC_MISC		(0x1ull)
+
+#endif /* __OTX2_REE_HW_H__*/
drivers/common/octeontx2/hw/otx2_rvu.h +5 -0
index 330bfb37f..072515207 100644
@@ -130,6 +130,7 @@
 #define RVU_BLOCK_TYPE_RAD                  (0xdull)
 #define RVU_BLOCK_TYPE_DFA                  (0xeull)
 #define RVU_BLOCK_TYPE_HNA                  (0xfull)
+#define RVU_BLOCK_TYPE_REE                  (0xeull)
 
 #define RVU_BLOCK_ADDR_RVUM                 (0x0ull)
 #define RVU_BLOCK_ADDR_LMT                  (0x1ull)
@@ -146,6 +147,8 @@
 #define RVU_BLOCK_ADDR_NDC2                 (0xeull)
 #define RVU_BLOCK_ADDR_R_END                (0x1full)
 #define RVU_BLOCK_ADDR_R_START              (0x14ull)
+#define RVU_BLOCK_ADDR_REE0                 (0x14ull)
+#define RVU_BLOCK_ADDR_REE1                 (0x15ull)
 
 #define RVU_VF_INT_VEC_MBOX                 (0x0ull)
 
@@ -167,6 +170,7 @@
 #define NPA_AF_BAR2_SEL			(0x9000000ull)
 #define CPT_AF_BAR2_SEL			(0x9000000ull)
 #define RVU_AF_BAR2_SEL			(0x9000000ull)
+#define REE_AF_BAR2_SEL			(0x9000000ull)
 
 #define AF_BAR2_ALIASX(a, b) \
 	(0x9100000ull | (uint64_t)(a) << 12 | (uint64_t)(b))
@@ -177,6 +181,7 @@
 #define NPA_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(0, b)
 #define CPT_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(a, b)
 #define RVU_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(a, b)
+#define REE_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(a, b)
 
 /* Structures definitions */
 
drivers/common/octeontx2/otx2_common.c +1 -0
index b292e999a..d23c50242 100644
@@ -213,3 +213,4 @@ RTE_LOG_REGISTER(otx2_logtype_sso, pmd.event.octeontx2, NOTICE);
 RTE_LOG_REGISTER(otx2_logtype_tim, pmd.event.octeontx2.timer, NOTICE);
 RTE_LOG_REGISTER(otx2_logtype_dpi, pmd.raw.octeontx2.dpi, NOTICE);
 RTE_LOG_REGISTER(otx2_logtype_ep, pmd.raw.octeontx2.ep, NOTICE);
+RTE_LOG_REGISTER(otx2_logtype_ree, pmd.regex.octeontx2, NOTICE);
drivers/common/octeontx2/otx2_common.h +5 -0
index 2168cde4d..b6779f710 100644
@@ -21,6 +21,7 @@
 #include "hw/otx2_sso.h"
 #include "hw/otx2_ssow.h"
 #include "hw/otx2_tim.h"
+#include "hw/otx2_ree.h"
 
 /* Alignment */
 #define OTX2_ALIGN  128
@@ -96,6 +97,7 @@ extern int otx2_logtype_tm;
 extern int otx2_logtype_tim;
 extern int otx2_logtype_dpi;
 extern int otx2_logtype_ep;
+extern int otx2_logtype_ree;
 
 #define otx2_err(fmt, args...)			\
 	RTE_LOG(ERR, PMD, "%s():%u " fmt "\n",	\
@@ -119,6 +121,7 @@ extern int otx2_logtype_ep;
 #define otx2_tim_dbg(fmt, ...) otx2_dbg(tim, fmt, ##__VA_ARGS__)
 #define otx2_dpi_dbg(fmt, ...) otx2_dbg(dpi, fmt, ##__VA_ARGS__)
 #define otx2_sdp_dbg(fmt, ...) otx2_dbg(ep, fmt, ##__VA_ARGS__)
+#define otx2_ree_dbg(fmt, ...) otx2_dbg(ree, fmt, ##__VA_ARGS__)
 
 /* PCI IDs */
 #define PCI_VENDOR_ID_CAVIUM			0x177D
@@ -136,6 +139,8 @@ extern int otx2_logtype_ep;
 #define PCI_DEVID_OCTEONTX2_EP_VF		0xB203 /* OCTEON TX2 EP mode */
 #define PCI_DEVID_OCTEONTX2_RVU_SDP_PF		0xA0f6
 #define PCI_DEVID_OCTEONTX2_RVU_SDP_VF		0xA0f7
+#define PCI_DEVID_OCTEONTX2_RVU_REE_PF		0xA0f4
+#define PCI_DEVID_OCTEONTX2_RVU_REE_VF		0xA0f5
 
 /*
  * REVID for RVU PCIe devices.
drivers/common/octeontx2/otx2_mbox.h +103 -0

115 lines not on this page · raw message

drivers/common/octeontx2/rte_common_octeontx2_version.map +1 -0
index 9a9969613..d269d70d8 100644
@@ -38,6 +38,7 @@ INTERNAL {
 	otx2_sso_pf_func_get;
 	otx2_sso_pf_func_set;
 	otx2_unregister_irq;
+	otx2_logtype_ree;
 
 	local: *;
 };
Signature · 1 line
2.28.0
#14 lore raw

PATCH v2 2/4 regex/octeontx2: add build infra and device support

In reply to [email protected]

From: Guy Kaneti <[email protected]>

Add meson based build infrastructure along with the OTX2 regexdev (REE) device functions.

For regex rule compiler support build:
meson configure -Dree_compiler_sdk=<path-to-compiler-sdk>

---
 MAINTAINERS                                   |    3 +
 drivers/regex/meson.build                     |    2 +-
 drivers/regex/octeontx2/meson.build           |   53 +
 drivers/regex/octeontx2/otx2_regexdev.c       | 1002 +++++++++++++++++
 drivers/regex/octeontx2/otx2_regexdev.h       |  109 ++
 .../regex/octeontx2/otx2_regexdev_compiler.c  |  229 ++++
 .../regex/octeontx2/otx2_regexdev_compiler.h  |   11 +
 .../regex/octeontx2/otx2_regexdev_hw_access.c |  167 +++
 .../regex/octeontx2/otx2_regexdev_hw_access.h |  202 ++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.c  |  401 +++++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.h  |   38 +
 .../rte_pmd_octeontx2_regex_version.map       |    3 +
 meson_options.txt                             |    2 +
 13 files changed, 2221 insertions(+), 1 deletion(-)
 create mode 100644 drivers/regex/octeontx2/meson.build
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.h
 create mode 100644 drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map
MAINTAINERS +3 -0
index 2a18262d6..631893bb2 100644
@@ -1118,6 +1118,9 @@ F: drivers/regex/mlx5/
 F: doc/guides/regexdevs/mlx5.rst
 F: doc/guides/regexdevs/features/mlx5.ini
 
+Marvell OCTEON TX2 regex
+M: Guy Kaneti <[email protected]>
+F: drivers/regex/octeontx2/
 
 vDPA Drivers
 ------------
drivers/regex/meson.build +1 -1
index 8edeba3a0..79bb5d5df 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2020 Mellanox Technologies, Ltd
 
-drivers = ['mlx5']
+drivers = ['mlx5', 'octeontx2']
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
drivers/regex/octeontx2/meson.build new file +53 -0

53 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev.c new file +1002 -0

1,002 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev.h new file +109 -0

109 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_compiler.c new file +229 -0

229 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_compiler.h new file +11 -0
new file mode 100644
index 000000000..8d2625bf7
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _OTX2_REGEXDEV_COMPILER_H_
+#define _OTX2_REGEXDEV_COMPILER_H_
+
+int
+otx2_ree_rule_db_compile_prog(struct rte_regexdev *dev);
+
+#endif /* _OTX2_REGEXDEV_COMPILER_H_ */
drivers/regex/octeontx2/otx2_regexdev_hw_access.c new file +167 -0

167 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_hw_access.h new file +202 -0

202 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_mbox.c new file +401 -0

401 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_mbox.h new file +38 -0
new file mode 100644
index 000000000..953efa672
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _OTX2_REGEXDEV_MBOX_H_
+#define _OTX2_REGEXDEV_MBOX_H_
+
+#include <rte_regexdev.h>
+
+int otx2_ree_available_queues_get(const struct rte_regexdev *dev,
+				  uint16_t *nb_queues);
+
+int otx2_ree_queues_attach(const struct rte_regexdev *dev, uint8_t nb_queues);
+
+int otx2_ree_queues_detach(const struct rte_regexdev *dev);
+
+int otx2_ree_msix_offsets_get(const struct rte_regexdev *dev);
+
+int otx2_ree_config_lf(const struct rte_regexdev *dev, uint8_t lf, uint8_t pri,
+		       uint32_t size);
+
+int otx2_ree_af_reg_read(const struct rte_regexdev *dev, uint64_t reg,
+			 uint64_t *val);
+
+int otx2_ree_af_reg_write(const struct rte_regexdev *dev, uint64_t reg,
+			  uint64_t val);
+
+int otx2_ree_rule_db_get(const struct rte_regexdev *dev, char *rule_db,
+		 uint32_t rule_db_len, char *rule_dbi, uint32_t rule_dbi_len);
+
+int otx2_ree_rule_db_len_get(const struct rte_regexdev *dev,
+			     uint32_t *rule_db_len, uint32_t *rule_dbi_len);
+
+int otx2_ree_rule_db_prog(const struct rte_regexdev *dev, const char *rule_db,
+		uint32_t rule_db_len, const char *rule_dbi,
+		uint32_t rule_dbi_len);
+
+#endif /* _OTX2_REGEXDEV_MBOX_H_ */
drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map new file +3 -0
new file mode 100644
index 000000000..34eb991c7
@@ -0,0 +1,3 @@
+DPDK_20.08 {
+	local: *;
+};
meson_options.txt +2 -0
index 9bf18ab6b..214b5f7f5 100644
@@ -36,3 +36,5 @@ option('tests', type: 'boolean', value: true,
 	description: 'build unit tests')
 option('use_hpet', type: 'boolean', value: false,
 	description: 'use HPET timer in EAL')
+option('ree_compiler_sdk', type: 'string', value: '',
+	description: 'path to REE compiler SDK optional library for regex device')
\ No newline at end of file
Signature · 1 line
2.28.0
#15 lore raw

Re: [dpdk-dev] [PATCH v2 2/4] regex/octeontx2: add build infra and device support

12/10/2020 13:31, [email protected]:

MAINTAINERS F: drivers/regex/mlx5/ · line 1124

Quoted 10 lines
MAINTAINERS +3 -0
@@ -1118,6 +1118,9 @@ F: drivers/regex/mlx5/
 F: doc/guides/regexdevs/mlx5.rst
 F: doc/guides/regexdevs/features/mlx5.ini
 
+Marvell OCTEON TX2 regex
+M: Guy Kaneti <[email protected]>
+F: drivers/regex/octeontx2/
 

A blank line is missing.
Please sort in alphabetical order.

drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map line 3

Quoted 6 lines
drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map new file +3 -0
@@ -0,0 +1,3 @@
+DPDK_20.08 {
+	local: *;
+};

Should be DPDK_21

meson_options.txt option('tests', type: 'boolean', value: true, · line 40

Quoted 4 lines
meson_options.txt +2 -0
+option('ree_compiler_sdk', type: 'string', value: '',
+	description: 'path to REE compiler SDK optional library for regex device')

Is this SDK specific to Marvell or octeontx2? If yes, it should appear here.

Why this SDK requires setting the path manually? Well designed libs should use pkg-config.

author
#16 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v2 2/4] regex/octeontx2: add build infra and device support

Hi

Quoted 24 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, October 12, 2020 5:33 PM
To: Guy Kaneti <[email protected]>
Cc: [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Smadar Fuks <[email protected]>; Dovrat Zifroni <[email protected]>; Liron Himi <[email protected]>
Subject: [EXT] Re: [dpdk-dev] [PATCH v2 2/4] regex/octeontx2: add build infra and device support

External Email

----------------------------------------------------------------------
12/10/2020 13:31, [email protected]:

Quoted 6 lines
MAINTAINERS +0 -0
@@ -1118,6 +1118,9 @@ F: drivers/regex/mlx5/
 F: doc/guides/regexdevs/mlx5.rst
 F: doc/guides/regexdevs/features/mlx5.ini
 
Quoted 7 lines

MAINTAINERS F: drivers/regex/mlx5/ · line 1124

Quoted 4 lines
MAINTAINERS +3 -0
+Marvell OCTEON TX2 regex
+M: Guy Kaneti <[email protected]>
+F: drivers/regex/octeontx2/
 

A blank line is missing.
Please sort in alphabetical order.

Will fix

Quoted 9 lines

drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map line 3

Quoted 7 lines
drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map new file +3 -0
@@ -0,0 +1,3 @@
+DPDK_20.08 {
+	local: *;
+};

Should be DPDK_21

Will fix

Quoted 9 lines

meson_options.txt

Quoted 5 lines
meson_options.txt +2 -0
+option('ree_compiler_sdk', type: 'string', value: '',
+	description: 'path to REE compiler SDK optional library for regex

device')

Is this SDK specific to Marvell or octeontx2?
If yes, it should appear here.

Yes, it is specific to Marvell.

Quoted 5 lines

Why this SDK requires setting the path manually?
Well designed libs should use pkg-config.

#17 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v2 2/4] regex/octeontx2: add build infra and device support

12/10/2020 19:06, Guy Kaneti:

Quoted 8 lines

From: Thomas Monjalon <[email protected]>

Quoted 7 lines

12/10/2020 13:31, [email protected]:

meson_options.txt

Quoted 4 lines
meson_options.txt +2 -0
+option('ree_compiler_sdk', type: 'string', value: '',
+	description: 'path to REE compiler SDK optional library for regex

device')

Quoted 8 lines
Quoted 2 lines

Is this SDK specific to Marvell or octeontx2?
If yes, it should appear here.

Yes, it is specific to Marvell.

Quoted 3 lines

Why this SDK requires setting the path manually?
Well designed libs should use pkg-config.

You didn't reply this question.
Really I would prefer avoiding this ugly meson option. Please rework the REE SDK to use pkg-config.

author
#18 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v2 2/4] regex/octeontx2: add build infra and device support

Quoted 31 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, October 12, 2020 8:11 PM
To: Guy Kaneti <[email protected]>
Cc: [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Smadar Fuks <[email protected]>; Dovrat Zifroni <[email protected]>; Liron Himi <[email protected]>
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH v2 2/4] regex/octeontx2: add build infra and device support

12/10/2020 19:06, Guy Kaneti:

Quoted 14 lines

From: Thomas Monjalon <[email protected]>

Quoted 9 lines

12/10/2020 13:31, [email protected]:

meson_options.txt

Quoted 4 lines
meson_options.txt +2 -0
+option('ree_compiler_sdk', type: 'string', value: '',
+	description: 'path to REE compiler SDK optional library for regex

device')

Is this SDK specific to Marvell or octeontx2?
If yes, it should appear here.

Yes, it is specific to Marvell.

Quoted 1 line
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

Why this SDK requires setting the path manually?
Well designed libs should use pkg-config.

You didn't reply this question.
Really I would prefer avoiding this ugly meson option. Please rework the REE SDK to use pkg-config.

It is required to be set manually mainly when cross compiling The target library will not be part of the host system.

#19 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v2 2/4] regex/octeontx2: add build infra and device support

12/10/2020 19:13, Guy Kaneti:

Quoted 19 lines

From: Thomas Monjalon <[email protected]>

Quoted 18 lines

12/10/2020 19:06, Guy Kaneti:

Quoted 16 lines

From: Thomas Monjalon <[email protected]>

Quoted 9 lines

12/10/2020 13:31, [email protected]:

meson_options.txt

Quoted 4 lines
meson_options.txt +2 -0
+option('ree_compiler_sdk', type: 'string', value: '',
+	description: 'path to REE compiler SDK optional library for regex

device')

Is this SDK specific to Marvell or octeontx2?
If yes, it should appear here.

Yes, it is specific to Marvell.

Quoted 3 lines

Why this SDK requires setting the path manually?
Well designed libs should use pkg-config.

Quoted 6 lines
Quoted 4 lines

You didn't reply this question.
Really I would prefer avoiding this ugly meson option. Please rework the REE SDK to use pkg-config.

It is required to be set manually mainly when cross compiling The target library will not be part of the host system.

It does not make sense. The cross-compiled lib is compiled on the host and pkg-config works also for cross-compiling.
How do you think other libraries are linked?
I don't see why REE should be an exception.
It's the same issue with another Marvell SDK: lib_musdk_dir. The other exceptions (which should be removed) are armv8_crypto_dir and flexran_sdk.

#20 lore raw

PATCH v2 3/4 usertools: add octeontx2 REE device binding

In reply to [email protected]

From: Guy Kaneti <[email protected]>

Update the devbind script with new section of regex devices, also added OCTEONTX2 REE device ID to regex device list

---
 usertools/dpdk-devbind.py | 8 ++++++++
 1 file changed, 8 insertions(+)
usertools/dpdk-devbind.py +8 -0
index 1d1113a08..cb2fc6009 100755
@@ -41,6 +41,8 @@
               'SVendor': None, 'SDevice': None}
 octeontx2_dma = {'Class': '08', 'Vendor': '177d', 'Device': 'a081',
               'SVendor': None, 'SDevice': None}
+octeontx2_ree = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f4',
+              'SVendor': None, 'SDevice': None}
 
 intel_ioat_bdw = {'Class': '08', 'Vendor': '8086', 'Device': '6f20,6f21,6f22,6f23,6f24,6f25,6f26,6f27,6f2e,6f2f',
               'SVendor': None, 'SDevice': None}
@@ -64,6 +66,7 @@
 misc_devices = [intel_ioat_bdw, intel_ioat_skx, intel_ioat_icx, intel_idxd_spr,
                 intel_ntb_skx, intel_ntb_icx,
                 octeontx2_dma]
+regex_devices = [octeontx2_ree]
 
 # global dict ethernet devices present. Dictionary indexed by PCI address.
 # Each device within this is itself a dictionary of device properties
@@ -650,6 +653,9 @@ def show_status():
     if status_dev == "misc" or status_dev == "all":
         show_device_status(misc_devices, "Misc (rawdev)")
 
+    if status_dev == "regex" or status_dev == "all":
+        show_device_status(regex_devices, "Regex")
+
 
 def pci_glob(arg):
     '''Returns a list containing either:
@@ -743,6 +749,7 @@ def do_arg_actions():
             get_device_details(mempool_devices)
             get_device_details(compress_devices)
             get_device_details(misc_devices)
+            get_device_details(regex_devices)
         show_status()
 
 
@@ -764,6 +771,7 @@ def main():
     get_device_details(mempool_devices)
     get_device_details(compress_devices)
     get_device_details(misc_devices)
+    get_device_details(regex_devices)
     do_arg_actions()
 
 if __name__ == "__main__":
Signature · 1 line
2.28.0
#21 lore raw

Re: [dpdk-dev] [PATCH v2 3/4] usertools: add octeontx2 REE device binding

12/10/2020 13:31, [email protected]:

Quoted 24 lines

From: Guy Kaneti <[email protected]>

Update the devbind script with new section of regex devices, also added OCTEONTX2 REE device ID to regex device list

---
 usertools/dpdk-devbind.py | 8 ++++++++
 1 file changed, 8 insertions(+)
usertools/dpdk-devbind.py +2 -0
index 1d1113a08..cb2fc6009 100755
@@ -41,6 +41,8 @@
               'SVendor': None, 'SDevice': None}
 octeontx2_dma = {'Class': '08', 'Vendor': '177d', 'Device': 'a081',
               'SVendor': None, 'SDevice': None}
+octeontx2_ree = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f4',
+              'SVendor': None, 'SDevice': None}
 
 intel_ioat_bdw = {'Class': '08', 'Vendor': '8086', 'Device': '6f20,6f21,6f22,6f23,6f24,6f25,6f26,6f27,6f2e,6f2f',
               'SVendor': None, 'SDevice': None}

usertools/dpdk-devbind.py line 69

Quoted 4 lines
usertools/dpdk-devbind.py +1 -0
@@ -64,6 +66,7 @@
 misc_devices = [intel_ioat_bdw, intel_ioat_skx, intel_ioat_icx, intel_idxd_spr,
                 intel_ntb_skx, intel_ntb_icx,
                 octeontx2_dma]
+regex_devices = [octeontx2_ree]

Please add regex befort misc devices.

[...]

usertools/dpdk-devbind.py def do_arg_actions(): · line 752

Quoted 4 lines
usertools/dpdk-devbind.py +1 -0
             get_device_details(mempool_devices)
             get_device_details(compress_devices)
             get_device_details(misc_devices)
+            get_device_details(regex_devices)

Here as well, before misc.

usertools/dpdk-devbind.py def main(): · line 774

Quoted 5 lines
usertools/dpdk-devbind.py +1 -0
@@ -764,6 +771,7 @@ def main():
     get_device_details(mempool_devices)
     get_device_details(compress_devices)
     get_device_details(misc_devices)
+    get_device_details(regex_devices)

Same

#22 lore raw

PATCH v2 4/4 doc: add Marvell OCTEON TX2 regex guide

In reply to [email protected]

From: Guy Kaneti <[email protected]>

Added Marvell OCTEON TX2 regex guide, features
and updated release notes.

---
 doc/guides/platform/octeontx2.rst           |  5 +++
 doc/guides/regexdevs/features/octeontx2.ini | 10 +++++
 doc/guides/regexdevs/index.rst              |  1 +
 doc/guides/regexdevs/octeontx2.rst          | 49 +++++++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst      |  5 +++
 5 files changed, 70 insertions(+)
 create mode 100644 doc/guides/regexdevs/features/octeontx2.ini
 create mode 100644 doc/guides/regexdevs/octeontx2.rst
doc/guides/platform/octeontx2.rst +5 -0
index 13255eec5..c4d64ab4b 100644
@@ -67,6 +67,8 @@ DPDK subsystem.
    +---+-----+--------------------------------------------------------------+
    | 9 | SDP | rte_ethdev                                                   |
    +---+-----+--------------------------------------------------------------+
+   | 10| REE | rte_regexdev                                                 |
+   +---+-----+--------------------------------------------------------------+
 
 PF0 is called the administrative / admin function (AF) and has exclusive
 privileges to provision RVU functional block's LFs to each of the PF/VF.
@@ -156,6 +158,9 @@ This section lists dataplane H/W block(s) available in OCTEON TX2 SoC.
 #. **Crypto Device Driver**
    See :doc:`../cryptodevs/octeontx2` for CPT crypto device driver information.
 
+#. **Regex Device Driver**
+   See :doc:`../regexdevs/octeontx2` for REE regex device driver information.
+
 Procedure to Setup Platform
 ---------------------------
 
doc/guides/regexdevs/features/octeontx2.ini new file +10 -0
new file mode 100644
index 000000000..c9b421a16
@@ -0,0 +1,10 @@
+;
+; Supported features of the 'octeontx2' regex driver.
+;
+; Refer to default.ini for the full list of available driver features.
+;
+[Features]
+PCRE back reference         = Y
+PCRE word boundary          = Y
+Run time compilation        = Y
+Armv8                       = Y
doc/guides/regexdevs/index.rst +1 -0
index 49216a932..b1abc826b 100644
@@ -13,3 +13,4 @@ which can be used from an application through RegEx API.
 
    features_overview
    mlx5
+   octeontx2
doc/guides/regexdevs/octeontx2.rst new file +49 -0

49 lines not on this page · raw message

doc/guides/rel_notes/release_20_11.rst +5 -0
index 57e3edcdd..90b32936f 100644
@@ -148,6 +148,11 @@ New Features
   * Extern objects and functions can be plugged into the pipeline.
   * Transaction-oriented table updates.
 
+* **Added Marvell OCTEON TX2 regex PMD.**
+
+  Added a new PMD driver for hardware regex offload block for OCTEON TX2 SoC.
+
+  See the :doc:`../regexdevs/octeontx2` for more details.
 
 Removed Items
 -------------
Signature · 1 line
2.28.0
#23 lore raw

Re: [dpdk-dev] [PATCH v2 4/4] doc: add Marvell OCTEON TX2 regex guide

12/10/2020 13:31, [email protected]:

Quoted 4 lines

From: Guy Kaneti <[email protected]>

Added Marvell OCTEON TX2 regex guide, features
and updated release notes.

I think this patch should be merged with doc changes:
- almost all in patch 2 with driver code
- the dpdk-devbind.py chapter in patch 3

Quoted 119 lines
---
 doc/guides/platform/octeontx2.rst           |  5 +++
 doc/guides/regexdevs/features/octeontx2.ini | 10 +++++
 doc/guides/regexdevs/index.rst              |  1 +
 doc/guides/regexdevs/octeontx2.rst          | 49 +++++++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst      |  5 +++
 5 files changed, 70 insertions(+)
 create mode 100644 doc/guides/regexdevs/features/octeontx2.ini
 create mode 100644 doc/guides/regexdevs/octeontx2.rst
doc/guides/platform/octeontx2.rst +5 -0
index 13255eec5..c4d64ab4b 100644
@@ -67,6 +67,8 @@ DPDK subsystem.
    +---+-----+--------------------------------------------------------------+
    | 9 | SDP | rte_ethdev                                                   |
    +---+-----+--------------------------------------------------------------+
+   | 10| REE | rte_regexdev                                                 |
+   +---+-----+--------------------------------------------------------------+
 
 PF0 is called the administrative / admin function (AF) and has exclusive
 privileges to provision RVU functional block's LFs to each of the PF/VF.
@@ -156,6 +158,9 @@ This section lists dataplane H/W block(s) available in OCTEON TX2 SoC.
 #. **Crypto Device Driver**
    See :doc:`../cryptodevs/octeontx2` for CPT crypto device driver information.
 
+#. **Regex Device Driver**
+   See :doc:`../regexdevs/octeontx2` for REE regex device driver information.
+
 Procedure to Setup Platform
 ---------------------------
 
doc/guides/regexdevs/features/octeontx2.ini new file +10 -0
new file mode 100644
index 000000000..c9b421a16
@@ -0,0 +1,10 @@
+;
+; Supported features of the 'octeontx2' regex driver.
+;
+; Refer to default.ini for the full list of available driver features.
+;
+[Features]
+PCRE back reference         = Y
+PCRE word boundary          = Y
+Run time compilation        = Y
+Armv8                       = Y
doc/guides/regexdevs/index.rst +1 -0
index 49216a932..b1abc826b 100644
@@ -13,3 +13,4 @@ which can be used from an application through RegEx API.
 
    features_overview
    mlx5
+   octeontx2
doc/guides/regexdevs/octeontx2.rst new file +49 -0
new file mode 100644
index 000000000..859780da1
@@ -0,0 +1,49 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Marvell International Ltd.
+
+OCTEON TX2 REE Regexdev Driver
+===============================
+
+The OCTEON TX2 REE PMD (**librte_pmd_octeontx2_regex**) provides poll mode
+regexdev driver support for the inbuilt regex device found in the **Marvell OCTEON TX2**
+SoC family.
+
+More information about OCTEON TX2 SoC can be found at `Marvell Official Website
+<https://www.marvell.com/embedded-processors/infrastructure-processors/>`_.
+
+Features
+--------
+
+Features of the OCTEON TX2 REE PMD are:
+
+- 36 queues
+- Up to 254 matches for each regex operation
+
+Prerequisites and Compilation procedure
+---------------------------------------
+
+   See :doc:`../platform/octeontx2` for setup information.
+
+Device Setup
+------------
+
+The OCTEON TX2 REE devices will need to be bound to a user-space IO driver
+for use. The script ``dpdk-devbind.py`` script included with DPDK can be
+used to view the state of the devices and to bind them to a suitable
+DPDK-supported kernel driver. When querying the status of the devices,
+they will appear under the category of "REGEX devices", i.e. the command
+``dpdk-devbind.py --status-dev regex`` can be used to see the state of
+those devices alone.
+
+Debugging Options
+-----------------
+
+.. _table_octeontx2_regex_debug_options:
+
+.. table:: OCTEON TX2 regex device debug options
+
+   +---+------------+-------------------------------------------------------+
+   | # | Component  | EAL log command                                       |
+   +===+============+=======================================================+
+   | 1 | REE        | --log-level='pmd\.regex\.octeontx2,8'                 |
+   +---+------------+-------------------------------------------------------+
doc/guides/rel_notes/release_20_11.rst +0 -0
index 57e3edcdd..90b32936f 100644

doc/guides/rel_notes/release_20_11.rst New Features · line 155

Quoted 8 lines
doc/guides/rel_notes/release_20_11.rst +5 -0
@@ -148,6 +148,11 @@ New Features
   * Extern objects and functions can be plugged into the pipeline.
   * Transaction-oriented table updates.
 
+* **Added Marvell OCTEON TX2 regex PMD.**
+
+  Added a new PMD driver for hardware regex offload block for OCTEON TX2 SoC.
+
+  See the :doc:`../regexdevs/octeontx2` for more details.

Missing blank line and should be sorted with other drivers (before rawdev).

author
#24 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v2 4/4] doc: add Marvell OCTEON TX2 regex guide

Hi,

Quoted 18 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, October 12, 2020 5:39 PM
To: Guy Kaneti <[email protected]>
Cc: [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Smadar Fuks <[email protected]>; Dovrat Zifroni <[email protected]>; Liron Himi <[email protected]>
Subject: [EXT] Re: [dpdk-dev] [PATCH v2 4/4] doc: add Marvell OCTEON TX2 regex guide

External Email

----------------------------------------------------------------------
12/10/2020 13:31, [email protected]:

Quoted 8 lines
Quoted 4 lines

From: Guy Kaneti <[email protected]>

Added Marvell OCTEON TX2 regex guide, features and updated release notes.

I think this patch should be merged with doc changes:
- almost all in patch 2 with driver code
- the dpdk-devbind.py chapter in patch 3

Do you mean do merge this patch with patch 2?

#25 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v2 4/4] doc: add Marvell OCTEON TX2 regex guide

12/10/2020 19:09, Guy Kaneti:

Quoted 8 lines

From: Thomas Monjalon <[email protected]>

Quoted 7 lines

12/10/2020 13:31, [email protected]:

Quoted 4 lines

From: Guy Kaneti <[email protected]>

Added Marvell OCTEON TX2 regex guide, features and updated release notes.

I think this patch should be merged with doc changes:

I meant with "code changes".

Quoted 4 lines
Quoted 2 lines

- almost all in patch 2 with driver code
- the dpdk-devbind.py chapter in patch 3

Do you mean do merge this patch with patch 2?

Almost yes.
The doc part about dpdk-devbind.py should be in patch 3.

#26 lore raw

v3 cover Add Marvell OCTEON TX2 regex driver

In reply to [email protected]

From: Guy Kaneti <[email protected]>

This patchset adds support for OCTEON TX2 regex driver as DPDK regexdev. The driver implements the API defined in the regexdev lib.

v3:
* Fix ML comments.

v2:
* Rebase.
* Remove config/common_base from patch
* change rte_cio_wmb to rte_io_wmb

Guy Kaneti (3):
common/octeontx2: add REE definitions and logging support regex/octeontx2: add build infra and device support
usertools: add octeontx2 REE device binding

 MAINTAINERS                                   |    4 +
 doc/guides/platform/octeontx2.rst             |    5 +
 doc/guides/regexdevs/features/octeontx2.ini   |   10 +
 doc/guides/regexdevs/index.rst                |    1 +
 doc/guides/regexdevs/octeontx2.rst            |   49 +
 doc/guides/rel_notes/release_20_11.rst        |    5 +
 drivers/common/octeontx2/hw/otx2_ree.h        |   27 +
 drivers/common/octeontx2/hw/otx2_rvu.h        |    5 +
 drivers/common/octeontx2/otx2_common.c        |    1 +
 drivers/common/octeontx2/otx2_common.h        |    5 +
 drivers/common/octeontx2/otx2_mbox.h          |  103 ++
 .../rte_common_octeontx2_version.map          |    1 +
 drivers/regex/meson.build                     |    2 +-
 drivers/regex/octeontx2/meson.build           |   44 +
 drivers/regex/octeontx2/otx2_regexdev.c       | 1002 +++++++++++++++++
 drivers/regex/octeontx2/otx2_regexdev.h       |  109 ++
 .../regex/octeontx2/otx2_regexdev_compiler.c  |  229 ++++
 .../regex/octeontx2/otx2_regexdev_compiler.h  |   11 +
 .../regex/octeontx2/otx2_regexdev_hw_access.c |  167 +++
 .../regex/octeontx2/otx2_regexdev_hw_access.h |  202 ++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.c  |  401 +++++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.h  |   38 +
 .../rte_pmd_octeontx2_regex_version.map       |    3 +
 usertools/dpdk-devbind.py                     |    8 +
 24 files changed, 2431 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/regexdevs/features/octeontx2.ini
 create mode 100644 doc/guides/regexdevs/octeontx2.rst
 create mode 100644 drivers/common/octeontx2/hw/otx2_ree.h
 create mode 100644 drivers/regex/octeontx2/meson.build
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.h
 create mode 100644 drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map
Signature · 1 line
2.28.0
#27 lore raw

PATCH v3 1/3 common/octeontx2: add REE definitions and logging support

From: Guy Kaneti <[email protected]>

Add REE mbox msg definitions, RVU and REE HW definitions

---
 drivers/common/octeontx2/hw/otx2_ree.h        |  27 +++++
 drivers/common/octeontx2/hw/otx2_rvu.h        |   5 +
 drivers/common/octeontx2/otx2_common.c        |   1 +
 drivers/common/octeontx2/otx2_common.h        |   5 +
 drivers/common/octeontx2/otx2_mbox.h          | 103 ++++++++++++++++++
 .../rte_common_octeontx2_version.map          |   1 +
 6 files changed, 142 insertions(+)
 create mode 100644 drivers/common/octeontx2/hw/otx2_ree.h
drivers/common/octeontx2/hw/otx2_ree.h new file +27 -0
new file mode 100644
index 000000000..b7481f125
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef __OTX2_REE_HW_H__
+#define __OTX2_REE_HW_H__
+
+/* REE BAR0*/
+#define REE_AF_REEXM_MAX_MATCH		(0x80c8)
+
+/* REE BAR02 */
+#define REE_LF_MISC_INT                 (0x300)
+#define REE_LF_DONE_INT                 (0x120)
+
+#define REE_AF_QUEX_GMCTL(a)            (0x800 | (a) << 3)
+
+#define REE_AF_INT_VEC_RAS          (0x0ull)
+#define REE_AF_INT_VEC_RVU          (0x1ull)
+#define REE_AF_INT_VEC_QUE_DONE     (0x2ull)
+#define REE_AF_INT_VEC_AQ           (0x3ull)
+
+/* ENUMS */
+
+#define REE_LF_INT_VEC_QUE_DONE	(0x0ull)
+#define REE_LF_INT_VEC_MISC		(0x1ull)
+
+#endif /* __OTX2_REE_HW_H__*/
drivers/common/octeontx2/hw/otx2_rvu.h +5 -0
index 330bfb37f..072515207 100644
@@ -130,6 +130,7 @@
 #define RVU_BLOCK_TYPE_RAD                  (0xdull)
 #define RVU_BLOCK_TYPE_DFA                  (0xeull)
 #define RVU_BLOCK_TYPE_HNA                  (0xfull)
+#define RVU_BLOCK_TYPE_REE                  (0xeull)
 
 #define RVU_BLOCK_ADDR_RVUM                 (0x0ull)
 #define RVU_BLOCK_ADDR_LMT                  (0x1ull)
@@ -146,6 +147,8 @@
 #define RVU_BLOCK_ADDR_NDC2                 (0xeull)
 #define RVU_BLOCK_ADDR_R_END                (0x1full)
 #define RVU_BLOCK_ADDR_R_START              (0x14ull)
+#define RVU_BLOCK_ADDR_REE0                 (0x14ull)
+#define RVU_BLOCK_ADDR_REE1                 (0x15ull)
 
 #define RVU_VF_INT_VEC_MBOX                 (0x0ull)
 
@@ -167,6 +170,7 @@
 #define NPA_AF_BAR2_SEL			(0x9000000ull)
 #define CPT_AF_BAR2_SEL			(0x9000000ull)
 #define RVU_AF_BAR2_SEL			(0x9000000ull)
+#define REE_AF_BAR2_SEL			(0x9000000ull)
 
 #define AF_BAR2_ALIASX(a, b) \
 	(0x9100000ull | (uint64_t)(a) << 12 | (uint64_t)(b))
@@ -177,6 +181,7 @@
 #define NPA_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(0, b)
 #define CPT_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(a, b)
 #define RVU_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(a, b)
+#define REE_AF_BAR2_ALIASX(a, b)		AF_BAR2_ALIASX(a, b)
 
 /* Structures definitions */
 
drivers/common/octeontx2/otx2_common.c +1 -0
index b292e999a..d23c50242 100644
@@ -213,3 +213,4 @@ RTE_LOG_REGISTER(otx2_logtype_sso, pmd.event.octeontx2, NOTICE);
 RTE_LOG_REGISTER(otx2_logtype_tim, pmd.event.octeontx2.timer, NOTICE);
 RTE_LOG_REGISTER(otx2_logtype_dpi, pmd.raw.octeontx2.dpi, NOTICE);
 RTE_LOG_REGISTER(otx2_logtype_ep, pmd.raw.octeontx2.ep, NOTICE);
+RTE_LOG_REGISTER(otx2_logtype_ree, pmd.regex.octeontx2, NOTICE);
drivers/common/octeontx2/otx2_common.h +5 -0
index 2168cde4d..b6779f710 100644
@@ -21,6 +21,7 @@
 #include "hw/otx2_sso.h"
 #include "hw/otx2_ssow.h"
 #include "hw/otx2_tim.h"
+#include "hw/otx2_ree.h"
 
 /* Alignment */
 #define OTX2_ALIGN  128
@@ -96,6 +97,7 @@ extern int otx2_logtype_tm;
 extern int otx2_logtype_tim;
 extern int otx2_logtype_dpi;
 extern int otx2_logtype_ep;
+extern int otx2_logtype_ree;
 
 #define otx2_err(fmt, args...)			\
 	RTE_LOG(ERR, PMD, "%s():%u " fmt "\n",	\
@@ -119,6 +121,7 @@ extern int otx2_logtype_ep;
 #define otx2_tim_dbg(fmt, ...) otx2_dbg(tim, fmt, ##__VA_ARGS__)
 #define otx2_dpi_dbg(fmt, ...) otx2_dbg(dpi, fmt, ##__VA_ARGS__)
 #define otx2_sdp_dbg(fmt, ...) otx2_dbg(ep, fmt, ##__VA_ARGS__)
+#define otx2_ree_dbg(fmt, ...) otx2_dbg(ree, fmt, ##__VA_ARGS__)
 
 /* PCI IDs */
 #define PCI_VENDOR_ID_CAVIUM			0x177D
@@ -136,6 +139,8 @@ extern int otx2_logtype_ep;
 #define PCI_DEVID_OCTEONTX2_EP_VF		0xB203 /* OCTEON TX2 EP mode */
 #define PCI_DEVID_OCTEONTX2_RVU_SDP_PF		0xA0f6
 #define PCI_DEVID_OCTEONTX2_RVU_SDP_VF		0xA0f7
+#define PCI_DEVID_OCTEONTX2_RVU_REE_PF		0xA0f4
+#define PCI_DEVID_OCTEONTX2_RVU_REE_VF		0xA0f5
 
 /*
  * REVID for RVU PCIe devices.
drivers/common/octeontx2/otx2_mbox.h +103 -0

115 lines not on this page · raw message

drivers/common/octeontx2/rte_common_octeontx2_version.map +1 -0
index 9a9969613..d269d70d8 100644
@@ -38,6 +38,7 @@ INTERNAL {
 	otx2_sso_pf_func_get;
 	otx2_sso_pf_func_set;
 	otx2_unregister_irq;
+	otx2_logtype_ree;
 
 	local: *;
 };
Signature · 1 line
2.28.0
#28 lore raw

Re: [dpdk-dev] [PATCH v3 1/3] common/octeontx2: add REE definitions and logging support

13/10/2020 12:10, [email protected]:

drivers/common/octeontx2/rte_common_octeontx2_version.map INTERNAL { · line 41

Quoted 13 lines

From: Guy Kaneti <[email protected]>

Add REE mbox msg definitions, RVU and REE HW definitions

---

drivers/common/octeontx2/rte_common_octeontx2_version.map +1 -0
@@ -38,6 +38,7 @@ INTERNAL {
 	otx2_sso_pf_func_get;
 	otx2_sso_pf_func_set;
 	otx2_unregister_irq;
+	otx2_logtype_ree;

I will sort this symbol in the list.

#29 lore raw

PATCH v3 2/3 regex/octeontx2: add build infra and device support

In reply to [email protected]

From: Guy Kaneti <[email protected]>

Add meson based build infrastructure along with the OTX2 regexdev (REE) device functions.
Add Marvell OCTEON TX2 regex guide.

---
 MAINTAINERS                                   |    4 +
 doc/guides/platform/octeontx2.rst             |    5 +
 doc/guides/regexdevs/features/octeontx2.ini   |   10 +
 doc/guides/regexdevs/index.rst                |    1 +
 doc/guides/regexdevs/octeontx2.rst            |   38 +
 doc/guides/rel_notes/release_20_11.rst        |    5 +
 drivers/regex/meson.build                     |    2 +-
 drivers/regex/octeontx2/meson.build           |   44 +
 drivers/regex/octeontx2/otx2_regexdev.c       | 1002 +++++++++++++++++
 drivers/regex/octeontx2/otx2_regexdev.h       |  109 ++
 .../regex/octeontx2/otx2_regexdev_compiler.c  |  229 ++++
 .../regex/octeontx2/otx2_regexdev_compiler.h  |   11 +
 .../regex/octeontx2/otx2_regexdev_hw_access.c |  167 +++
 .../regex/octeontx2/otx2_regexdev_hw_access.h |  202 ++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.c  |  401 +++++++
 drivers/regex/octeontx2/otx2_regexdev_mbox.h  |   38 +
 .../rte_pmd_octeontx2_regex_version.map       |    3 +
 17 files changed, 2270 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/regexdevs/features/octeontx2.ini
 create mode 100644 doc/guides/regexdevs/octeontx2.rst
 create mode 100644 drivers/regex/octeontx2/meson.build
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_compiler.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_hw_access.h
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.c
 create mode 100644 drivers/regex/octeontx2/otx2_regexdev_mbox.h
 create mode 100644 drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map
MAINTAINERS +4 -0
index 2a18262d6..44c7cc82a 100644
@@ -1112,6 +1112,10 @@ F: doc/guides/compressdevs/features/zlib.ini
 RegEx Drivers
 -------------
 
+Marvell OCTEON TX2 regex
+M: Guy Kaneti <[email protected]>
+F: drivers/regex/octeontx2/
+
 Mellanox mlx5
 M: Ori Kam <[email protected]>
 F: drivers/regex/mlx5/
doc/guides/platform/octeontx2.rst +5 -0
index 13255eec5..c4d64ab4b 100644
@@ -67,6 +67,8 @@ DPDK subsystem.
    +---+-----+--------------------------------------------------------------+
    | 9 | SDP | rte_ethdev                                                   |
    +---+-----+--------------------------------------------------------------+
+   | 10| REE | rte_regexdev                                                 |
+   +---+-----+--------------------------------------------------------------+
 
 PF0 is called the administrative / admin function (AF) and has exclusive
 privileges to provision RVU functional block's LFs to each of the PF/VF.
@@ -156,6 +158,9 @@ This section lists dataplane H/W block(s) available in OCTEON TX2 SoC.
 #. **Crypto Device Driver**
    See :doc:`../cryptodevs/octeontx2` for CPT crypto device driver information.
 
+#. **Regex Device Driver**
+   See :doc:`../regexdevs/octeontx2` for REE regex device driver information.
+
 Procedure to Setup Platform
 ---------------------------
 
doc/guides/regexdevs/features/octeontx2.ini new file +10 -0
new file mode 100644
index 000000000..c9b421a16
@@ -0,0 +1,10 @@
+;
+; Supported features of the 'octeontx2' regex driver.
+;
+; Refer to default.ini for the full list of available driver features.
+;
+[Features]
+PCRE back reference         = Y
+PCRE word boundary          = Y
+Run time compilation        = Y
+Armv8                       = Y
doc/guides/regexdevs/index.rst +1 -0
index 49216a932..b1abc826b 100644
@@ -13,3 +13,4 @@ which can be used from an application through RegEx API.
 
    features_overview
    mlx5
+   octeontx2
doc/guides/regexdevs/octeontx2.rst new file +38 -0
new file mode 100644
index 000000000..87659b661
@@ -0,0 +1,38 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Marvell International Ltd.
+
+OCTEON TX2 REE Regexdev Driver
+===============================
+
+The OCTEON TX2 REE PMD (**librte_pmd_octeontx2_regex**) provides poll mode
+regexdev driver support for the inbuilt regex device found in the **Marvell OCTEON TX2**
+SoC family.
+
+More information about OCTEON TX2 SoC can be found at `Marvell Official Website
+<https://www.marvell.com/embedded-processors/infrastructure-processors/>`_.
+
+Features
+--------
+
+Features of the OCTEON TX2 REE PMD are:
+
+- 36 queues
+- Up to 254 matches for each regex operation
+
+Prerequisites and Compilation procedure
+---------------------------------------
+
+   See :doc:`../platform/octeontx2` for setup information.
+
+Debugging Options
+-----------------
+
+.. _table_octeontx2_regex_debug_options:
+
+.. table:: OCTEON TX2 regex device debug options
+
+   +---+------------+-------------------------------------------------------+
+   | # | Component  | EAL log command                                       |
+   +===+============+=======================================================+
+   | 1 | REE        | --log-level='pmd\.regex\.octeontx2,8'                 |
+   +---+------------+-------------------------------------------------------+
doc/guides/rel_notes/release_20_11.rst +5 -0
index 57e3edcdd..90b32936f 100644
@@ -148,6 +148,11 @@ New Features
   * Extern objects and functions can be plugged into the pipeline.
   * Transaction-oriented table updates.
 
+* **Added Marvell OCTEON TX2 regex PMD.**
+
+  Added a new PMD driver for hardware regex offload block for OCTEON TX2 SoC.
+
+  See the :doc:`../regexdevs/octeontx2` for more details.
 
 Removed Items
 -------------
drivers/regex/meson.build +1 -1
index 8edeba3a0..79bb5d5df 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2020 Mellanox Technologies, Ltd
 
-drivers = ['mlx5']
+drivers = ['mlx5', 'octeontx2']
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
drivers/regex/octeontx2/meson.build new file +44 -0

44 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev.c new file +1002 -0

1,002 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev.h new file +109 -0

109 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_compiler.c new file +229 -0

229 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_compiler.h new file +11 -0
new file mode 100644
index 000000000..8d2625bf7
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _OTX2_REGEXDEV_COMPILER_H_
+#define _OTX2_REGEXDEV_COMPILER_H_
+
+int
+otx2_ree_rule_db_compile_prog(struct rte_regexdev *dev);
+
+#endif /* _OTX2_REGEXDEV_COMPILER_H_ */
drivers/regex/octeontx2/otx2_regexdev_hw_access.c new file +167 -0

167 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_hw_access.h new file +202 -0

202 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_mbox.c new file +401 -0

401 lines not on this page · raw message

drivers/regex/octeontx2/otx2_regexdev_mbox.h new file +38 -0
new file mode 100644
index 000000000..953efa672
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _OTX2_REGEXDEV_MBOX_H_
+#define _OTX2_REGEXDEV_MBOX_H_
+
+#include <rte_regexdev.h>
+
+int otx2_ree_available_queues_get(const struct rte_regexdev *dev,
+				  uint16_t *nb_queues);
+
+int otx2_ree_queues_attach(const struct rte_regexdev *dev, uint8_t nb_queues);
+
+int otx2_ree_queues_detach(const struct rte_regexdev *dev);
+
+int otx2_ree_msix_offsets_get(const struct rte_regexdev *dev);
+
+int otx2_ree_config_lf(const struct rte_regexdev *dev, uint8_t lf, uint8_t pri,
+		       uint32_t size);
+
+int otx2_ree_af_reg_read(const struct rte_regexdev *dev, uint64_t reg,
+			 uint64_t *val);
+
+int otx2_ree_af_reg_write(const struct rte_regexdev *dev, uint64_t reg,
+			  uint64_t val);
+
+int otx2_ree_rule_db_get(const struct rte_regexdev *dev, char *rule_db,
+		 uint32_t rule_db_len, char *rule_dbi, uint32_t rule_dbi_len);
+
+int otx2_ree_rule_db_len_get(const struct rte_regexdev *dev,
+			     uint32_t *rule_db_len, uint32_t *rule_dbi_len);
+
+int otx2_ree_rule_db_prog(const struct rte_regexdev *dev, const char *rule_db,
+		uint32_t rule_db_len, const char *rule_dbi,
+		uint32_t rule_dbi_len);
+
+#endif /* _OTX2_REGEXDEV_MBOX_H_ */
drivers/regex/octeontx2/rte_pmd_octeontx2_regex_version.map new file +3 -0
new file mode 100644
index 000000000..4a76d1d52
@@ -0,0 +1,3 @@
+DPDK_21 {
+	local: *;
+};
Signature · 1 line
2.28.0
#30 lore raw

Re: [dpdk-dev] [PATCH v3 2/3] regex/octeontx2: add build infra and device support

13/10/2020 12:10, [email protected]:

MAINTAINERS F: doc/guides/compressdevs/features/zlib.ini · line 1118

Quoted 10 lines
MAINTAINERS +4 -0
@@ -1112,6 +1112,10 @@ F: doc/guides/compressdevs/features/zlib.ini
 RegEx Drivers
 -------------
 
+Marvell OCTEON TX2 regex
+M: Guy Kaneti <[email protected]>
+F: drivers/regex/octeontx2/
+

Will add doc file here.

#31 lore raw

PATCH v3 3/3 usertools: add octeontx2 REE device binding

In reply to [email protected]

From: Guy Kaneti <[email protected]>

Update the devbind script with new section of regex devices, also added OCTEONTX2 REE device ID to regex device list

---
 doc/guides/regexdevs/octeontx2.rst | 11 +++++++++++
 usertools/dpdk-devbind.py          |  8 ++++++++
 2 files changed, 19 insertions(+)
doc/guides/regexdevs/octeontx2.rst +11 -0
index 87659b661..859780da1 100644
@@ -24,6 +24,17 @@ Prerequisites and Compilation procedure
 
    See :doc:`../platform/octeontx2` for setup information.
 
+Device Setup
+------------
+
+The OCTEON TX2 REE devices will need to be bound to a user-space IO driver
+for use. The script ``dpdk-devbind.py`` script included with DPDK can be
+used to view the state of the devices and to bind them to a suitable
+DPDK-supported kernel driver. When querying the status of the devices,
+they will appear under the category of "REGEX devices", i.e. the command
+``dpdk-devbind.py --status-dev regex`` can be used to see the state of
+those devices alone.
+
 Debugging Options
 -----------------
 
usertools/dpdk-devbind.py +8 -0
index 1d1113a08..99112b7ab 100755
@@ -41,6 +41,8 @@
               'SVendor': None, 'SDevice': None}
 octeontx2_dma = {'Class': '08', 'Vendor': '177d', 'Device': 'a081',
               'SVendor': None, 'SDevice': None}
+octeontx2_ree = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f4',
+              'SVendor': None, 'SDevice': None}
 
 intel_ioat_bdw = {'Class': '08', 'Vendor': '8086', 'Device': '6f20,6f21,6f22,6f23,6f24,6f25,6f26,6f27,6f2e,6f2f',
               'SVendor': None, 'SDevice': None}
@@ -61,6 +63,7 @@
 eventdev_devices = [cavium_sso, cavium_tim, octeontx2_sso]
 mempool_devices = [cavium_fpa, octeontx2_npa]
 compress_devices = [cavium_zip]
+regex_devices = [octeontx2_ree]
 misc_devices = [intel_ioat_bdw, intel_ioat_skx, intel_ioat_icx, intel_idxd_spr,
                 intel_ntb_skx, intel_ntb_icx,
                 octeontx2_dma]
@@ -650,6 +653,9 @@ def show_status():
     if status_dev == "misc" or status_dev == "all":
         show_device_status(misc_devices, "Misc (rawdev)")
 
+    if status_dev == "regex" or status_dev == "all":
+        show_device_status(regex_devices, "Regex")
+
 
 def pci_glob(arg):
     '''Returns a list containing either:
@@ -742,6 +748,7 @@ def do_arg_actions():
             get_device_details(eventdev_devices)
             get_device_details(mempool_devices)
             get_device_details(compress_devices)
+            get_device_details(regex_devices)
             get_device_details(misc_devices)
         show_status()
 
@@ -763,6 +770,7 @@ def main():
     get_device_details(eventdev_devices)
     get_device_details(mempool_devices)
     get_device_details(compress_devices)
+    get_device_details(regex_devices)
     get_device_details(misc_devices)
     do_arg_actions()
 
Signature · 1 line
2.28.0
#32 lore raw
In reply to [email protected]

13/10/2020 12:10, [email protected]:

Quoted 13 lines

From: Guy Kaneti <[email protected]>

This patchset adds support for OCTEON TX2 regex driver as DPDK regexdev. The driver implements the API defined in the regexdev lib.

v3:
* Fix ML comments.

v2:
* Rebase.
* Remove config/common_base from patch
* change rte_cio_wmb to rte_io_wmb

Quoted 4 lines

Guy Kaneti (3):
common/octeontx2: add REE definitions and logging support regex/octeontx2: add build infra and device support
usertools: add octeontx2 REE device binding

Applied with last minor changes described in this thread, thanks.