DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ori Kam <orika@mellanox.com>
To: jerinj@marvell.com, xiang.w.wang@intel.com
Cc: dev@dpdk.org, pbhagavatula@marvell.com, shahafs@mellanox.com,
	hemant.agrawal@nxp.com, opher@mellanox.com, alexr@mellanox.com,
	dovrat@marvell.com, pkapoor@marvell.com, nipun.gupta@nxp.com,
	bruce.richardson@intel.com, yang.a.hong@intel.com,
	harry.chang@intel.com, gu.jian1@zte.com.cn,
	shanjiangh@chinatelecom.cn, zhangy.yun@chinatelecom.cn,
	lixingfu@huachentel.com, wushuai@inspur.com,
	yuyingxia@yxlink.com, fanchenggang@sunyainfo.com,
	davidfgao@tencent.com, liuzhong1@chinaunicom.cn,
	zhaoyong11@huawei.com, oc@yunify.com, jim@netgate.com,
	hongjun.ni@intel.com, j.bromhead@titan-ic.com, deri@ntop.org,
	fc@napatech.com, arthur.su@lionic.com, thomas@monjalon.net,
	orika@mellanox.com
Subject: [dpdk-dev] [PATCH v2 2/4] regexdev: add regex core h file
Date: Fri, 17 Apr 2020 12:43:35 +0000
Message-ID: <1587127417-82492-3-git-send-email-orika@mellanox.com> (raw)
In-Reply-To: <1587127417-82492-1-git-send-email-orika@mellanox.com>

This commit introduce the rte_regexdev_core.h file.
This file holds internal structures and API that are used by
the regexdev.

Signed-off-by: Ori Kam <orika@mellanox.com>
---
v2:
* Move private data to rte_regexdev struct.
---
 lib/librte_regexdev/Makefile            |   1 +
 lib/librte_regexdev/meson.build         |   2 +-
 lib/librte_regexdev/rte_regexdev.h      |   2 +
 lib/librte_regexdev/rte_regexdev_core.h | 160 ++++++++++++++++++++++++++++++++
 4 files changed, 164 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_regexdev/rte_regexdev_core.h

diff --git a/lib/librte_regexdev/Makefile b/lib/librte_regexdev/Makefile
index 6f4cc63..9012d29 100644
--- a/lib/librte_regexdev/Makefile
+++ b/lib/librte_regexdev/Makefile
@@ -24,6 +24,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_REGEXDEV) := rte_regexdev.c
 
 # export include files
 SYMLINK-$(CONFIG_RTE_LIBRTE_REGEXDEV)-include += rte_regexdev.h
+SYMLINK-$(CONFIG_RTE_LIBRTE_REGEXDEV)-include += rte_regexdev_core.h
 
 # versioning export map
 EXPORT_MAP := rte_regexdev_version.map
diff --git a/lib/librte_regexdev/meson.build b/lib/librte_regexdev/meson.build
index f4db748..1816754 100644
--- a/lib/librte_regexdev/meson.build
+++ b/lib/librte_regexdev/meson.build
@@ -3,5 +3,5 @@
 
 allow_experimental_apis = true
 sources = files('rte_regexdev.c')
-headers = files('rte_regexdev.h')
+headers = files('rte_regexdev.h', 'rte_regexdev_core.h')
 deps += ['mbuf']
diff --git a/lib/librte_regexdev/rte_regexdev.h b/lib/librte_regexdev/rte_regexdev.h
index 7e688d9..bbc56f9 100644
--- a/lib/librte_regexdev/rte_regexdev.h
+++ b/lib/librte_regexdev/rte_regexdev.h
@@ -1466,6 +1466,8 @@ struct rte_regex_ops {
 rte_regexdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
 			   struct rte_regex_ops **ops, uint16_t nb_ops);
 
+#include "rte_regexdev_core.h"
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_regexdev/rte_regexdev_core.h b/lib/librte_regexdev/rte_regexdev_core.h
new file mode 100644
index 0000000..fb7a27e
--- /dev/null
+++ b/lib/librte_regexdev/rte_regexdev_core.h
@@ -0,0 +1,160 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Mellanox Corporation
+ */
+
+#ifndef _RTE_REGEX_CORE_H_
+#define _RTE_REGEX_CORE_H_
+
+/**
+ * @file
+ *
+ * RTE RegEx Device internal header.
+ *
+ * This header contains internal data types, that are used by the RegEx devices
+ * in order to expose their ops to the class.
+ *
+ * Applications should not use these API directly.
+ *
+ */
+
+struct rte_regexdev;
+
+typedef int (*regexdev_info_get_t)(struct rte_regexdev *dev,
+				   struct rte_regexdev_info *info);
+/**< @internal Get the RegEx device info. */
+
+typedef int (*regexdev_configure_t)(struct rte_regexdev *dev,
+				    const struct rte_regexdev_config *cfg);
+/**< @internal Configure the RegEx device. */
+
+typedef int (*regexdev_qp_setup_t)(struct rte_regexdev *dev, uint8_t id,
+				   const struct rte_regexdev_qp_conf *qp_conf);
+/**< @internal Setup a queue pair.*/
+
+typedef int (*regexdev_start_t)(struct rte_regexdev *dev);
+/**< @internal Start the RegEx device. */
+
+typedef int (*regexdev_stop_t)(struct rte_regexdev *dev);
+/**< @internal Stop the RegEx device. */
+
+typedef int (*regexdev_close_t)(struct rte_regexdev *dev);
+/**< @internal Close the RegEx device. */
+
+typedef int (*regexdev_attr_get_t)(struct rte_regexdev *dev,
+				   enum rte_regexdev_attr_id id,
+				   void *value);
+/**< @internal Get selected attribute from RegEx device. */
+
+typedef int (*regexdev_attr_set_t)(struct rte_regexdev *dev,
+				   enum rte_regexdev_attr_id id,
+				   const void *value);
+/**< @internal Set selected attribute to RegEx device. */
+
+typedef int (*regexdev_rule_db_update_t)(struct rte_regexdev *dev,
+					 const struct rte_regexdev_rule *rules,
+					 uint16_t nb_rules);
+/**< @internal Update the rule database for the RegEx device. */
+
+typedef int (*regexdev_rule_db_compile_activate_t)(struct rte_regexdev *dev);
+/**< @internal Compile the rule database and activate it. */
+
+typedef int (*regexdev_rule_db_import_t)(struct rte_regexdev *dev,
+					 const char *rule_db,
+					 uint32_t rule_db_len);
+/**< @internal Upload a pre created rule database to the RegEx device. */
+
+typedef int (*regexdev_rule_db_export_t)(struct rte_regexdev *dev,
+					 const char *rule_db);
+/**< @internal Export the current rule database from the RegEx device. */
+
+typedef int (*regexdev_xstats_names_get_t)(struct rte_regexdev *dev,
+					   struct rte_regexdev_xstats_map
+					   *xstats_map);
+/**< @internal Get xstats name map for the RegEx device. */
+
+typedef int (*regexdev_xstats_get_t)(struct rte_regexdev *dev,
+				     const uint16_t *ids, uint64_t *values,
+				     uint16_t nb_values);
+/**< @internal Get xstats values for the RegEx device. */
+
+typedef int (*regexdev_xstats_by_name_get_t)(struct rte_regexdev *dev,
+					     const char *name, uint16_t *id,
+					     uint64_t *value);
+/**< @internal Get xstat value for the RegEx device based on the xstats name. */
+
+typedef int (*regexdev_xstats_reset_t)(struct rte_regexdev *dev,
+				       const uint16_t *ids,
+				       uint16_t nb_ids);
+/**< @internal Reset xstats values for the RegEx device. */
+
+typedef int (*regexdev_selftest_t)(struct rte_regexdev *dev);
+/**< @internal Trigger RegEx self test. */
+
+typedef int (*regexdev_dump_t)(struct rte_regexdev *dev, FILE *f);
+/**< @internal Dump internal information about the RegEx device. */
+
+typedef int (*regexdev_enqueue_t)(struct rte_regexdev *dev, uint16_t qp_id,
+				  struct rte_regex_ops **ops, uint16_t nb_ops);
+/**< @internal Enqueue a burst of scan requests to a queue on RegEx device. */
+
+typedef int (*regexdev_dequeue_t)(struct rte_regexdev *dev, uint16_t qp_id,
+				  struct rte_regex_ops **ops,
+				  uint16_t nb_ops);
+/**< @internal Dequeue a burst of scan response from a queue on RegEx device. */
+
+/**
+ * RegEx device operations
+ */
+struct rte_regexdev_ops {
+	regexdev_info_get_t dev_info_get;
+	regexdev_configure_t dev_configure;
+	regexdev_qp_setup_t dev_qp_setup;
+	regexdev_start_t dev_start;
+	regexdev_stop_t dev_stop;
+	regexdev_close_t dev_close;
+	regexdev_attr_get_t dev_attr_get;
+	regexdev_attr_set_t dev_attr_set;
+	regexdev_rule_db_update_t dev_rule_db_update;
+	regexdev_rule_db_compile_activate_t dev_rule_db_compile_activate;
+	regexdev_rule_db_import_t dev_db_import;
+	regexdev_rule_db_export_t dev_db_export;
+	regexdev_xstats_names_get_t dev_xstats_names_get;
+	regexdev_xstats_get_t dev_xstats_get;
+	regexdev_xstats_by_name_get_t dev_xstats_by_name_get;
+	regexdev_xstats_reset_t dev_xstats_reset;
+	regexdev_selftest_t dev_selftest;
+	regexdev_dump_t dev_dump;
+};
+
+#define RTE_REGEXDEV_NAME_MAX_LEN
+/**
+ * @internal
+ * The data part, with no function pointers, associated with each RegEx device.
+ *
+ * This structure is safe to place in shared memory to be common among different
+ * processes in a multi-process configuration.
+ */
+struct rte_regexdev_data {
+	void *dev_private; /**< PMD-specific private data. */
+} __rte_cache_aligned;
+
+/**
+ * @internal
+ * The generic data structure associated with each RegEx device.
+ *
+ * Pointers to burst-oriented packet receive and transmit functions are
+ * located at the beginning of the structure, along with the pointer to
+ * where all the data elements for the particular device are stored in shared
+ * memory. This split allows the function pointer and driver data to be per-
+ * process, while the actual configuration data for the device is shared.
+ */
+struct rte_regexdev {
+	regexdev_enqueue_t enqueue;
+	regexdev_dequeue_t dequeue;
+	const struct rte_regexdev_ops *dev_ops;
+	/**< Functions exported by PMD */
+	struct rte_device *device; /**< Backing device */
+	struct rte_regexdev_data *data;  /**< Pointer to device data. */
+} __rte_cache_aligned;
+
+#endif /* _RTE_REGEX_CORE_H_ */
-- 
1.8.3.1


  parent reply	other threads:[~2020-04-17 12:44 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29  6:47 [dpdk-dev] [PATCH v1 0/4] add RegEx class Ori Kam
2020-03-29  6:47 ` [dpdk-dev] [PATCH v1 1/4] regexdev: introduce regexdev subsystem Ori Kam
2020-04-04 15:04   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2020-04-05 15:03     ` Ori Kam
2020-03-29  6:47 ` [dpdk-dev] [PATCH v1 2/4] regexdev: add regex core h file Ori Kam
     [not found]   ` <DM5PR18MB221411AAEAFFA9D9F373292BC6C20@DM5PR18MB2214.namprd18.prod.outlook.com>
2020-04-07  8:53     ` Guy Kaneti
2020-04-07 16:16       ` Ori Kam
2020-04-07 16:27         ` Jerin Jacob
2020-04-08  7:37           ` Ori Kam
2020-04-08  7:48             ` Jerin Jacob
2020-04-08  8:31               ` Ori Kam
2020-04-08  8:38                 ` Jerin Jacob
2020-04-08  9:51                   ` Ori Kam
2020-03-29  6:47 ` [dpdk-dev] [PATCH v1 3/4] regexdev: add regexdev core functions Ori Kam
2020-04-04 15:01   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2020-04-05 15:05     ` Ori Kam
2020-04-05 17:10       ` Pavan Nikhilesh Bhagavatula
2020-04-05 20:02         ` Ori Kam
2020-04-06 12:48           ` Pavan Nikhilesh Bhagavatula
2020-04-06 13:29             ` Thomas Monjalon
2020-04-06 13:38               ` Jerin Jacob
2020-04-06 19:11                 ` Ori Kam
2020-04-07  5:49                   ` Jerin Jacob
2020-04-07  6:46                     ` Ori Kam
2020-04-07  7:22                       ` Jerin Jacob
2020-04-07 12:27                     ` Thomas Monjalon
2020-04-07 12:54                       ` Jerin Jacob
2020-04-07 14:21                   ` Guy Kaneti
2020-04-07 16:28                     ` Ori Kam
2020-04-07 16:37                       ` Guy Kaneti
2020-04-08  6:52                         ` Ori Kam
2020-04-08  8:39               ` Ori Kam
2020-04-19 10:38                 ` Guy Kaneti
2020-04-22 21:36                   ` Ori Kam
2020-04-08  9:41             ` Ori Kam
2020-03-29  6:47 ` [dpdk-dev] [PATCH v1 4/4] regexdev: implement regex rte level functions Ori Kam
2020-04-04 14:27   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2020-04-05 15:04     ` Ori Kam
2020-04-05 16:48       ` Pavan Nikhilesh Bhagavatula
2020-04-05 19:46         ` Ori Kam
2020-04-06 11:16       ` Thomas Monjalon
2020-04-06 12:33         ` Pavan Nikhilesh Bhagavatula
2020-04-06 13:14           ` Thomas Monjalon
2020-04-06 13:20             ` Jerin Jacob
2020-04-06 13:22             ` Pavan Nikhilesh Bhagavatula
2020-04-06 13:36               ` Thomas Monjalon
2020-04-06 13:50                 ` Pavan Nikhilesh Bhagavatula
2020-04-06 14:00                   ` Thomas Monjalon
2020-04-06 18:53                     ` Ori Kam
2020-04-04 13:06 ` [dpdk-dev] [EXT] [PATCH v1 0/4] add RegEx class Pavan Nikhilesh Bhagavatula
2020-04-05 15:03   ` Ori Kam
2020-04-17 12:43 ` [dpdk-dev] [PATCH v2 " Ori Kam
2020-04-17 12:43   ` [dpdk-dev] [PATCH v2 1/4] regexdev: introduce regexdev subsystem Ori Kam
2020-04-17 12:43   ` Ori Kam [this message]
2020-04-20 10:48     ` [dpdk-dev] [PATCH v2 2/4] regexdev: add regex core h file Guy Kaneti
2020-04-20 15:49       ` Ori Kam
2020-04-17 12:43   ` [dpdk-dev] [PATCH v2 3/4] regexdev: add regexdev core functions Ori Kam
2020-04-17 12:43   ` [dpdk-dev] [PATCH v2 4/4] regexdev: implement regex rte level functions Ori Kam
2020-04-21 11:12     ` Guy Kaneti
2020-04-21 11:20       ` Ori Kam
2020-04-21 11:36     ` Guy Kaneti
2020-04-22 20:33       ` Ori Kam
2020-05-07  9:45 ` [dpdk-dev] [PATCH v3 0/4] add RegEx class Ori Kam
2020-05-07  9:45   ` [dpdk-dev] [PATCH v3 1/4] regexdev: introduce regexdev subsystem Ori Kam
2020-06-21 11:18     ` Ori Kam
2020-06-30 19:57       ` Ori Kam
2020-05-07  9:45   ` [dpdk-dev] [PATCH v3 2/4] regexdev: add regex core h file Ori Kam
2020-06-03  6:47     ` [dpdk-dev] [EXT] " Guy Kaneti
2020-05-07  9:45   ` [dpdk-dev] [PATCH v3 3/4] regexdev: add regexdev core functions Ori Kam
2020-06-03  6:57     ` [dpdk-dev] [EXT] " Guy Kaneti
2020-05-07  9:45   ` [dpdk-dev] [PATCH v3 4/4] regexdev: implement regex rte level functions Ori Kam
2020-06-03  6:59     ` [dpdk-dev] [EXT] " Guy Kaneti
2020-06-28 13:45     ` Guy Kaneti
2020-06-28 14:10       ` Ori Kam
2020-05-24 20:24   ` [dpdk-dev] [PATCH v3 0/4] add RegEx class Ori Kam
2020-07-02  7:45 ` [dpdk-dev] [PATCH v4 " Ori Kam
2020-07-02  7:46   ` [dpdk-dev] [PATCH v4 1/4] regexdev: introduce regexdev subsystem Ori Kam
2020-07-05 21:18     ` Thomas Monjalon
2020-07-06  7:02       ` Ori Kam
2020-07-02  7:46   ` [dpdk-dev] [PATCH v4 2/4] regexdev: add regex core h file Ori Kam
2020-07-02  7:46   ` [dpdk-dev] [PATCH v4 3/4] regexdev: add regexdev core functions Ori Kam
2020-07-05 21:08     ` Thomas Monjalon
2020-07-06  6:07       ` Ori Kam
2020-07-06  7:03         ` Thomas Monjalon
2020-07-06  8:00           ` Bruce Richardson
2020-07-02  7:46   ` [dpdk-dev] [PATCH v4 4/4] regexdev: implement regex rte level functions Ori Kam
2020-07-05 21:21   ` [dpdk-dev] [PATCH v4 0/4] add RegEx class Thomas Monjalon
2020-07-06  7:03     ` Ori Kam
2020-07-06 17:36 ` [dpdk-dev] [PATCH v5 " Ori Kam
2020-07-06 17:36   ` [dpdk-dev] [PATCH v5 1/4] regexdev: introduce regexdev subsystem Ori Kam
2020-07-06 19:38     ` Thomas Monjalon
2020-09-11 12:46     ` David Marchand
2020-07-06 17:36   ` [dpdk-dev] [PATCH v5 2/4] regexdev: add regex core h file Ori Kam
2020-07-06 17:36   ` [dpdk-dev] [PATCH v5 3/4] regexdev: add regexdev core functions Ori Kam
2020-07-06 17:36   ` [dpdk-dev] [PATCH v5 4/4] regexdev: implement regex rte level functions Ori Kam
2020-07-06 22:30   ` [dpdk-dev] [PATCH v5 0/4] add RegEx class Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1587127417-82492-3-git-send-email-orika@mellanox.com \
    --to=orika@mellanox.com \
    --cc=alexr@mellanox.com \
    --cc=arthur.su@lionic.com \
    --cc=bruce.richardson@intel.com \
    --cc=davidfgao@tencent.com \
    --cc=deri@ntop.org \
    --cc=dev@dpdk.org \
    --cc=dovrat@marvell.com \
    --cc=fanchenggang@sunyainfo.com \
    --cc=fc@napatech.com \
    --cc=gu.jian1@zte.com.cn \
    --cc=harry.chang@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=hongjun.ni@intel.com \
    --cc=j.bromhead@titan-ic.com \
    --cc=jerinj@marvell.com \
    --cc=jim@netgate.com \
    --cc=liuzhong1@chinaunicom.cn \
    --cc=lixingfu@huachentel.com \
    --cc=nipun.gupta@nxp.com \
    --cc=oc@yunify.com \
    --cc=opher@mellanox.com \
    --cc=pbhagavatula@marvell.com \
    --cc=pkapoor@marvell.com \
    --cc=shahafs@mellanox.com \
    --cc=shanjiangh@chinatelecom.cn \
    --cc=thomas@monjalon.net \
    --cc=wushuai@inspur.com \
    --cc=xiang.w.wang@intel.com \
    --cc=yang.a.hong@intel.com \
    --cc=yuyingxia@yxlink.com \
    --cc=zhangy.yun@chinatelecom.cn \
    --cc=zhaoyong11@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git