7 #ifndef _RTE_REGEXDEV_H_
8 #define _RTE_REGEXDEV_H_
202 #include <rte_config.h>
208 #define RTE_REGEXDEV_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
210 extern int rte_regexdev_logtype;
212 #define RTE_REGEXDEV_LOG(level, ...) \
213 rte_log(RTE_LOG_ ## level, rte_regexdev_logtype, "" __VA_ARGS__)
216 #define RTE_REGEXDEV_VALID_DEV_ID_OR_ERR_RET(dev_id, retval) do { \
217 if (!rte_regexdev_is_valid_dev(dev_id)) { \
218 RTE_REGEXDEV_LOG(ERR, "Invalid dev_id=%u\n", dev_id); \
223 #define RTE_REGEXDEV_VALID_DEV_ID_OR_RET(dev_id) do { \
224 if (!rte_regexdev_is_valid_dev(dev_id)) { \
225 RTE_REGEXDEV_LOG(ERR, "Invalid dev_id=%u\n", dev_id); \
274 #define RTE_REGEXDEV_CAPA_RUNTIME_COMPILATION_F (1ULL << 0)
283 #define RTE_REGEXDEV_CAPA_SUPP_PCRE_START_ANCHOR_F (1ULL << 1)
294 #define RTE_REGEXDEV_CAPA_SUPP_PCRE_ATOMIC_GROUPING_F (1ULL << 2)
306 #define RTE_REGEXDEV_SUPP_PCRE_BACKTRACKING_CTRL_F (1ULL << 3)
314 #define RTE_REGEXDEV_SUPP_PCRE_CALLOUTS_F (1ULL << 4)
324 #define RTE_REGEXDEV_SUPP_PCRE_BACKREFERENCE_F (1ULL << 5)
332 #define RTE_REGEXDEV_SUPP_PCRE_GREEDY_F (1ULL << 6)
341 #define RTE_REGEXDEV_SUPP_PCRE_MATCH_ALL_F (1ULL << 7)
350 #define RTE_REGEXDEV_SUPP_PCRE_LOOKAROUND_ASRT_F (1ULL << 8)
360 #define RTE_REGEXDEV_SUPP_PCRE_MATCH_POINT_RST_F (1ULL << 9)
369 #define RTE_REGEXDEV_SUPP_NEWLINE_CONVENTIONS_F (1ULL << 10)
381 #define RTE_REGEXDEV_SUPP_PCRE_NEWLINE_SEQ_F (1ULL << 11)
389 #define RTE_REGEXDEV_SUPP_PCRE_POSSESSIVE_QUALIFIERS_F (1ULL << 12)
399 #define RTE_REGEXDEV_SUPP_PCRE_SUBROUTINE_REFERENCES_F (1ULL << 13)
408 #define RTE_REGEXDEV_SUPP_PCRE_UTF_8_F (1ULL << 14)
414 #define RTE_REGEXDEV_SUPP_PCRE_UTF_16_F (1ULL << 15)
420 #define RTE_REGEXDEV_SUPP_PCRE_UTF_32_F (1ULL << 16)
426 #define RTE_REGEXDEV_SUPP_PCRE_WORD_BOUNDARY_F (1ULL << 17)
433 #define RTE_REGEXDEV_SUPP_PCRE_FORWARD_REFERENCES_F (1ULL << 18)
442 #define RTE_REGEXDEV_SUPP_MATCH_AS_END_F (1ULL << 19)
452 #define RTE_REGEXDEV_SUPP_CROSS_BUFFER_F (1ULL << 20)
468 #define RTE_REGEXDEV_SUPP_MATCH_ALL_F (1ULL << 21)
477 #define RTE_REGEXDEV_CAPA_QUEUE_PAIR_OOS_F (1ULL << 22)
487 #define RTE_REGEX_PCRE_RULE_ALLOW_EMPTY_F (1ULL << 0)
495 #define RTE_REGEX_PCRE_RULE_ANCHORED_F (1ULL << 1)
504 #define RTE_REGEX_PCRE_RULE_CASELESS_F (1ULL << 2)
512 #define RTE_REGEX_PCRE_RULE_DOTALL_F (1ULL << 3)
520 #define RTE_REGEX_PCRE_RULE_DUPNAMES_F (1ULL << 4)
528 #define RTE_REGEX_PCRE_RULE_EXTENDED_F (1ULL << 5)
536 #define RTE_REGEX_PCRE_RULE_MATCH_UNSET_BACKREF_F (1ULL << 6)
544 #define RTE_REGEX_PCRE_RULE_MULTILINE_F (1ULL << 7)
553 #define RTE_REGEX_PCRE_RULE_NO_AUTO_CAPTURE_F (1ULL << 8)
563 #define RTE_REGEX_PCRE_RULE_UCP_F (1ULL << 9)
571 #define RTE_REGEX_PCRE_RULE_UNGREEDY_F (1ULL << 10)
580 #define RTE_REGEX_PCRE_RULE_UTF_F (1ULL << 11)
589 #define RTE_REGEX_PCRE_RULE_NEVER_BACKSLASH_C_F (1ULL << 12)
648 #define RTE_REGEXDEV_CFG_CROSS_BUFFER_SCAN_F (1ULL << 0)
661 #define RTE_REGEXDEV_CFG_MATCH_AS_END_F (1ULL << 1)
671 #define RTE_REGEXDEV_CFG_MATCH_ALL_F (1ULL << 2)
747 #define RTE_REGEX_QUEUE_PAIR_CFG_OOS_F (1ULL << 0)
941 const void *attr_value);
1057 uint32_t rule_db_len);
1085 #define RTE_REGEXDEV_XSTATS_NAME_SIZE 64
1149 uint64_t *values, uint16_t nb_values);
1176 uint16_t *
id, uint64_t *value);
1274 #define RTE_REGEX_OPS_REQ_GROUP_ID0_VALID_F (1 << 0)
1277 #define RTE_REGEX_OPS_REQ_GROUP_ID1_VALID_F (1 << 1)
1280 #define RTE_REGEX_OPS_REQ_GROUP_ID2_VALID_F (1 << 2)
1283 #define RTE_REGEX_OPS_REQ_GROUP_ID3_VALID_F (1 << 3)
1286 #define RTE_REGEX_OPS_REQ_STOP_ON_MATCH_F (1 << 4)
1289 #define RTE_REGEX_OPS_REQ_MATCH_HIGH_PRIORITY_F (1 << 5)
1301 #define RTE_REGEX_OPS_RSP_PMI_SOJ_F (1 << 0)
1308 #define RTE_REGEX_OPS_RSP_PMI_EOJ_F (1 << 1)
1315 #define RTE_REGEX_OPS_RSP_MAX_SCAN_TIMEOUT_F (1 << 2)
1322 #define RTE_REGEX_OPS_RSP_MAX_MATCH_F (1 << 3)
1329 #define RTE_REGEX_OPS_RSP_MAX_PREFIX_F (1 << 4)
1336 #define RTE_REGEX_OPS_RSP_RESOURCE_LIMIT_REACHED_F (1 << 4)
1468 static inline uint16_t
1472 struct rte_regexdev *dev = &rte_regex_devices[dev_id];
1473 #ifdef RTE_LIBRTE_REGEXDEV_DEBUG
1474 RTE_REGEXDEV_VALID_DEV_ID_OR_ERR_RET(dev_id, -EINVAL);
1475 RTE_FUNC_PTR_OR_ERR_RET(*dev->enqueue, -ENOTSUP);
1476 if (qp_id >= dev->data->dev_conf.nb_queue_pairs) {
1477 RTE_REGEXDEV_LOG(ERR,
"Invalid queue %d\n", qp_id);
1481 return (*dev->enqueue)(dev, qp_id, ops, nb_ops);
1527 static inline uint16_t
1531 struct rte_regexdev *dev = &rte_regex_devices[dev_id];
1532 #ifdef RTE_LIBRTE_REGEXDEV_DEBUG
1533 RTE_REGEXDEV_VALID_DEV_ID_OR_ERR_RET(dev_id, -EINVAL);
1534 RTE_FUNC_PTR_OR_ERR_RET(*dev->dequeue, -ENOTSUP);
1535 if (qp_id >= dev->data->dev_conf.nb_queue_pairs) {
1536 RTE_REGEXDEV_LOG(ERR,
"Invalid queue %d\n", qp_id);
1540 return (*dev->dequeue)(dev, qp_id, ops, nb_ops);
__rte_experimental uint8_t rte_regexdev_count(void)
__rte_experimental int rte_regexdev_xstats_by_name_get(uint8_t dev_id, const char *name, uint16_t *id, uint64_t *value)
__rte_experimental int rte_regexdev_info_get(uint8_t dev_id, struct rte_regexdev_info *dev_info)
uint32_t nb_rules_per_group
#define RTE_REGEXDEV_XSTATS_NAME_SIZE
static __rte_experimental uint16_t rte_regexdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_regex_ops **ops, uint16_t nb_ops)
__rte_experimental int rte_regexdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, const struct rte_regexdev_qp_conf *qp_conf)
enum rte_regexdev_rule_op op
__rte_experimental int rte_regexdev_dump(uint8_t dev_id, FILE *f)
__rte_experimental int rte_regexdev_attr_set(uint8_t dev_id, enum rte_regexdev_attr_id attr_id, const void *attr_value)
__rte_experimental int rte_regexdev_xstats_names_get(uint8_t dev_id, struct rte_regexdev_xstats_map *xstats_map)
__rte_experimental int rte_regexdev_xstats_reset(uint8_t dev_id, const uint16_t *ids, uint16_t nb_ids)
int rte_regexdev_is_valid_dev(uint16_t dev_id)
uint16_t nb_actual_matches
__rte_experimental int rte_regexdev_get_dev_id(const char *name)
char name[RTE_REGEXDEV_XSTATS_NAME_SIZE]
__rte_experimental int rte_regexdev_close(uint8_t dev_id)
void(* regexdev_stop_flush_t)(uint8_t dev_id, uint16_t qp_id, struct rte_regex_ops *op)
static __rte_experimental uint16_t rte_regexdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_regex_ops **ops, uint16_t nb_ops)
__rte_experimental int rte_regexdev_xstats_get(uint8_t dev_id, const uint16_t *ids, uint64_t *values, uint16_t nb_values)
uint32_t max_rules_per_group
__rte_experimental int rte_regexdev_stop(uint8_t dev_id)
__rte_experimental int rte_regexdev_rule_db_update(uint8_t dev_id, const struct rte_regexdev_rule *rules, uint32_t nb_rules)
__rte_experimental int rte_regexdev_start(uint8_t dev_id)
__rte_experimental int rte_regexdev_selftest(uint8_t dev_id)
uint16_t max_payload_size
__rte_experimental int rte_regexdev_rule_db_export(uint8_t dev_id, char *rule_db)
__rte_experimental int rte_regexdev_rule_db_compile_activate(uint8_t dev_id)
__rte_experimental int rte_regexdev_attr_get(uint8_t dev_id, enum rte_regexdev_attr_id attr_id, void *attr_value)
struct rte_regexdev_match matches[]
__rte_experimental int rte_regexdev_rule_db_import(uint8_t dev_id, const char *rule_db, uint32_t rule_db_len)
__rte_experimental int rte_regexdev_configure(uint8_t dev_id, const struct rte_regexdev_config *cfg)