DPDK 25.03.0-rc0
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
19struct rte_regexdev;
20
21typedef int (*regexdev_info_get_t)(struct rte_regexdev *dev,
22 struct rte_regexdev_info *info);
25typedef int (*regexdev_configure_t)(struct rte_regexdev *dev,
26 const struct rte_regexdev_config *cfg);
29typedef int (*regexdev_qp_setup_t)(struct rte_regexdev *dev, uint16_t id,
30 const struct rte_regexdev_qp_conf *qp_conf);
33typedef int (*regexdev_start_t)(struct rte_regexdev *dev);
36typedef int (*regexdev_stop_t)(struct rte_regexdev *dev);
39typedef int (*regexdev_close_t)(struct rte_regexdev *dev);
42typedef int (*regexdev_attr_get_t)(struct rte_regexdev *dev,
44 void *value);
47typedef int (*regexdev_attr_set_t)(struct rte_regexdev *dev,
49 const void *value);
52typedef int (*regexdev_rule_db_update_t)(struct rte_regexdev *dev,
53 const struct rte_regexdev_rule *rules,
54 uint16_t nb_rules);
57typedef int (*regexdev_rule_db_compile_activate_t)(struct rte_regexdev *dev);
60typedef int (*regexdev_rule_db_import_t)(struct rte_regexdev *dev,
61 const char *rule_db,
62 uint32_t rule_db_len);
65typedef int (*regexdev_rule_db_export_t)(struct rte_regexdev *dev,
66 char *rule_db);
69typedef int (*regexdev_xstats_names_get_t)(struct rte_regexdev *dev,
71 *xstats_map);
74typedef int (*regexdev_xstats_get_t)(struct rte_regexdev *dev,
75 const uint16_t *ids, uint64_t *values,
76 uint16_t nb_values);
79typedef int (*regexdev_xstats_by_name_get_t)(struct rte_regexdev *dev,
80 const char *name, uint16_t *id,
81 uint64_t *value);
84typedef int (*regexdev_xstats_reset_t)(struct rte_regexdev *dev,
85 const uint16_t *ids,
86 uint16_t nb_ids);
89typedef int (*regexdev_selftest_t)(struct rte_regexdev *dev);
92typedef int (*regexdev_dump_t)(struct rte_regexdev *dev, FILE *f);
95typedef uint16_t (*regexdev_enqueue_t)(struct rte_regexdev *dev, uint16_t qp_id,
96 struct rte_regex_ops **ops,
97 uint16_t nb_ops);
100typedef 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
147struct __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
165struct __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
180extern struct rte_regexdev rte_regex_devices[];
181
182#endif /* _RTE_REGEX_CORE_H_ */
#define __rte_cache_aligned
Definition: rte_common.h:627
rte_regexdev_attr_id
Definition: rte_regexdev.h:868
rte_regexdev_state
@ RTE_REGEXDEV_READY
@ RTE_REGEXDEV_REGISTERED
@ RTE_REGEXDEV_UNUSED