DPDK  24.07.0
rte_regexdev_core.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2020 Mellanox Technologies, Ltd
3  */
4 
5 #ifndef _RTE_REGEX_CORE_H_
6 #define _RTE_REGEX_CORE_H_
7 
19 struct rte_regexdev;
20 
21 typedef int (*regexdev_info_get_t)(struct rte_regexdev *dev,
22  struct rte_regexdev_info *info);
25 typedef int (*regexdev_configure_t)(struct rte_regexdev *dev,
26  const struct rte_regexdev_config *cfg);
29 typedef int (*regexdev_qp_setup_t)(struct rte_regexdev *dev, uint16_t id,
30  const struct rte_regexdev_qp_conf *qp_conf);
33 typedef int (*regexdev_start_t)(struct rte_regexdev *dev);
36 typedef int (*regexdev_stop_t)(struct rte_regexdev *dev);
39 typedef int (*regexdev_close_t)(struct rte_regexdev *dev);
42 typedef int (*regexdev_attr_get_t)(struct rte_regexdev *dev,
43  enum rte_regexdev_attr_id id,
44  void *value);
47 typedef int (*regexdev_attr_set_t)(struct rte_regexdev *dev,
48  enum rte_regexdev_attr_id id,
49  const void *value);
52 typedef int (*regexdev_rule_db_update_t)(struct rte_regexdev *dev,
53  const struct rte_regexdev_rule *rules,
54  uint16_t nb_rules);
57 typedef int (*regexdev_rule_db_compile_activate_t)(struct rte_regexdev *dev);
60 typedef int (*regexdev_rule_db_import_t)(struct rte_regexdev *dev,
61  const char *rule_db,
62  uint32_t rule_db_len);
65 typedef int (*regexdev_rule_db_export_t)(struct rte_regexdev *dev,
66  char *rule_db);
69 typedef int (*regexdev_xstats_names_get_t)(struct rte_regexdev *dev,
71  *xstats_map);
74 typedef int (*regexdev_xstats_get_t)(struct rte_regexdev *dev,
75  const uint16_t *ids, uint64_t *values,
76  uint16_t nb_values);
79 typedef int (*regexdev_xstats_by_name_get_t)(struct rte_regexdev *dev,
80  const char *name, uint16_t *id,
81  uint64_t *value);
84 typedef int (*regexdev_xstats_reset_t)(struct rte_regexdev *dev,
85  const uint16_t *ids,
86  uint16_t nb_ids);
89 typedef int (*regexdev_selftest_t)(struct rte_regexdev *dev);
92 typedef int (*regexdev_dump_t)(struct rte_regexdev *dev, FILE *f);
95 typedef uint16_t (*regexdev_enqueue_t)(struct rte_regexdev *dev, uint16_t qp_id,
96  struct rte_regex_ops **ops,
97  uint16_t nb_ops);
100 typedef uint16_t (*regexdev_dequeue_t)(struct rte_regexdev *dev, uint16_t qp_id,
101  struct rte_regex_ops **ops,
102  uint16_t nb_ops);
109  regexdev_info_get_t dev_info_get;
110  regexdev_configure_t dev_configure;
111  regexdev_qp_setup_t dev_qp_setup;
112  regexdev_start_t dev_start;
113  regexdev_stop_t dev_stop;
114  regexdev_close_t dev_close;
115  regexdev_attr_get_t dev_attr_get;
116  regexdev_attr_set_t dev_attr_set;
117  regexdev_rule_db_update_t dev_rule_db_update;
118  regexdev_rule_db_compile_activate_t dev_rule_db_compile_activate;
119  regexdev_rule_db_import_t dev_db_import;
120  regexdev_rule_db_export_t dev_db_export;
121  regexdev_xstats_names_get_t dev_xstats_names_get;
122  regexdev_xstats_get_t dev_xstats_get;
123  regexdev_xstats_by_name_get_t dev_xstats_by_name_get;
124  regexdev_xstats_reset_t dev_xstats_reset;
125  regexdev_selftest_t dev_selftest;
126  regexdev_dump_t dev_dump;
127 };
128 
138 };
139 
147 struct __rte_cache_aligned rte_regexdev_data {
148  void *dev_private;
149  char dev_name[RTE_REGEXDEV_NAME_MAX_LEN];
150  uint16_t dev_id;
151  struct rte_regexdev_config dev_conf;
152  uint8_t dev_started : 1;
153 };
154 
165 struct __rte_cache_aligned rte_regexdev {
166  regexdev_enqueue_t enqueue;
167  regexdev_dequeue_t dequeue;
168  const struct rte_regexdev_ops *dev_ops;
170  struct rte_device *device;
171  enum rte_regexdev_state state;
172  struct rte_regexdev_data *data;
173 };
174 
180 extern struct rte_regexdev rte_regex_devices[];
181 
182 #endif /* _RTE_REGEX_CORE_H_ */
rte_regexdev_state
#define __rte_cache_aligned
Definition: rte_common.h:568
rte_regexdev_attr_id
Definition: rte_regexdev.h:872