rte_regexdev.h(3)
π rte_regexdev.h π
okay so bestie, buckle UP β this is the rte_regexdev.h(3) page from the Library Functions Manual, and it's basically the entire personality of the regex device API. it's giving "the whole header file got its own fan page" and honestly? deserved. π
β¨ NAME β¨
rte_regexdev.h β that's it, that's the name. the header herself. π
π¦ SYNOPSIS π¦
first things first, the girl pulls in her whole squad of includes:
#include <rte_compat.h>
#include <rte_common.h>
#include <rte_dev.h>
#include <rte_mbuf.h>
#include 'rte_regexdev_core.h'
(yes 'rte_regexdev_core.h' is in single quotes in the original, we don't question the icon's choices, we just copy them exactly π«Ά)
π Data Structures π
the cast of characters, in order, no skips:
struct rte_regexdev_infostruct rte_regexdev_configstruct rte_regexdev_qp_confstruct rte_regexdev_rulestruct rte_regexdev_xstats_mapstruct rte_regexdev_matchstruct rte_regex_ops
π Macros π
okay this is the long part, hydrate first π. every single one, exactly as written:
π capability flags β the CAPA / SUPP girlies
RTE_REGEXDEV_CAPA_RUNTIME_COMPILATION_Fβ(1ULL << 0)RTE_REGEXDEV_CAPA_SUPP_PCRE_START_ANCHOR_Fβ(1ULL << 1)RTE_REGEXDEV_CAPA_SUPP_PCRE_ATOMIC_GROUPING_Fβ(1ULL << 2)RTE_REGEXDEV_SUPP_PCRE_BACKTRACKING_CTRL_Fβ(1ULL << 3)RTE_REGEXDEV_SUPP_PCRE_CALLOUTS_Fβ(1ULL << 4)RTE_REGEXDEV_SUPP_PCRE_BACKREFERENCE_Fβ(1ULL << 5)RTE_REGEXDEV_SUPP_PCRE_GREEDY_Fβ(1ULL << 6)RTE_REGEXDEV_SUPP_PCRE_MATCH_ALL_Fβ(1ULL << 7)RTE_REGEXDEV_SUPP_PCRE_LOOKAROUND_ASRT_Fβ(1ULL << 8)RTE_REGEXDEV_SUPP_PCRE_MATCH_POINT_RST_Fβ(1ULL << 9)RTE_REGEXDEV_SUPP_NEWLINE_CONVENTIONS_Fβ(1ULL << 10)RTE_REGEXDEV_SUPP_PCRE_NEWLINE_SEQ_Fβ(1ULL << 11)RTE_REGEXDEV_SUPP_PCRE_POSSESSIVE_QUALIFIERS_Fβ(1ULL << 12)RTE_REGEXDEV_SUPP_PCRE_SUBROUTINE_REFERENCES_Fβ(1ULL << 13)RTE_REGEXDEV_SUPP_PCRE_UTF_8_Fβ(1ULL << 14)RTE_REGEXDEV_SUPP_PCRE_UTF_16_Fβ(1ULL << 15)RTE_REGEXDEV_SUPP_PCRE_UTF_32_Fβ(1ULL << 16)RTE_REGEXDEV_SUPP_PCRE_WORD_BOUNDARY_Fβ(1ULL << 17)RTE_REGEXDEV_SUPP_PCRE_FORWARD_REFERENCES_Fβ(1ULL << 18)RTE_REGEXDEV_SUPP_MATCH_AS_END_Fβ(1ULL << 19)RTE_REGEXDEV_SUPP_CROSS_BUFFER_Fβ(1ULL << 20)RTE_REGEXDEV_SUPP_MATCH_ALL_Fβ(1ULL << 21)RTE_REGEXDEV_CAPA_QUEUE_PAIR_OOS_Fβ(1ULL << 22)
πΈ PCRE rule flags β RTE_REGEX_PCRE_RULE_*
RTE_REGEX_PCRE_RULE_ALLOW_EMPTY_Fβ(1ULL << 0)RTE_REGEX_PCRE_RULE_ANCHORED_Fβ(1ULL << 1)RTE_REGEX_PCRE_RULE_CASELESS_Fβ(1ULL << 2)RTE_REGEX_PCRE_RULE_DOTALL_Fβ(1ULL << 3)RTE_REGEX_PCRE_RULE_DUPNAMES_Fβ(1ULL << 4)RTE_REGEX_PCRE_RULE_EXTENDED_Fβ(1ULL << 5)RTE_REGEX_PCRE_RULE_MATCH_UNSET_BACKREF_Fβ(1ULL << 6)RTE_REGEX_PCRE_RULE_MULTILINE_Fβ(1ULL << 7)RTE_REGEX_PCRE_RULE_NO_AUTO_CAPTURE_Fβ(1ULL << 8)RTE_REGEX_PCRE_RULE_UCP_Fβ(1ULL << 9)RTE_REGEX_PCRE_RULE_UNGREEDY_Fβ(1ULL << 10)RTE_REGEX_PCRE_RULE_UTF_Fβ(1ULL << 11)RTE_REGEX_PCRE_RULE_NEVER_BACKSLASH_C_Fβ(1ULL << 12)
π§ config + queue pair flags
RTE_REGEXDEV_CFG_CROSS_BUFFER_SCAN_Fβ(1ULL << 0)RTE_REGEXDEV_CFG_MATCH_AS_END_Fβ(1ULL << 1)RTE_REGEXDEV_CFG_MATCH_ALL_Fβ(1ULL << 2)RTE_REGEX_QUEUE_PAIR_CFG_OOS_Fβ(1ULL << 0)
β the xstats name size
RTE_REGEXDEV_XSTATS_NAME_SIZEβ64(just the number, no shift, she's simple like that)
π₯ regex ops request flags β REQ
RTE_REGEX_OPS_REQ_GROUP_ID0_VALID_Fβ(1 << 0)RTE_REGEX_OPS_REQ_GROUP_ID1_VALID_Fβ(1 << 1)RTE_REGEX_OPS_REQ_GROUP_ID2_VALID_Fβ(1 << 2)RTE_REGEX_OPS_REQ_GROUP_ID3_VALID_Fβ(1 << 3)RTE_REGEX_OPS_REQ_STOP_ON_MATCH_Fβ(1 << 4)RTE_REGEX_OPS_REQ_MATCH_HIGH_PRIORITY_Fβ(1 << 5)
π regex ops response flags β RSP
RTE_REGEX_OPS_RSP_PMI_SOJ_Fβ(1 << 0)RTE_REGEX_OPS_RSP_PMI_EOJ_Fβ(1 << 1)RTE_REGEX_OPS_RSP_MAX_SCAN_TIMEOUT_Fβ(1 << 2)RTE_REGEX_OPS_RSP_MAX_MATCH_Fβ(1 << 3)RTE_REGEX_OPS_RSP_MAX_PREFIX_Fβ(1 << 4)RTE_REGEX_OPS_RSP_RESOURCE_LIMIT_REACHED_Fβ(1 << 4)
not me noticingRTE_REGEX_OPS_RSP_MAX_PREFIX_FandRTE_REGEX_OPS_RSP_RESOURCE_LIMIT_REACHED_Fare both literally(1 << 4)π that's what the page says, so that's what we write. no editing the icon. π
π Typedefs π
regexdev_stop_flush_tβ a function pointer, and here's her exact shape:
typedef void(* regexdev_stop_flush_t) (uint8_t dev_id, uint16_t qp_id,
struct rte_regex_ops *op)
π Enumerations π
enum rte_regexdev_attr_idβ the members, in this exact order:RTE_REGEXDEV_ATTR_SOCKET_IDRTE_REGEXDEV_ATTR_MAX_MATCHESRTE_REGEXDEV_ATTR_MAX_SCAN_TIMEOUTRTE_REGEXDEV_ATTR_MAX_PREFIX
enum rte_regexdev_rule_opβ two moods only:RTE_REGEX_RULE_OP_ADDRTE_REGEX_RULE_OP_REMOVE
π Functions π
every one of these is __rte_experimental, so likeβ¦ she's experimental, she's growing, be nice to her π«Ά. full signatures, verbatim:
rte_regexdev_is_valid_devβ__rte_experimental int rte_regexdev_is_valid_dev (uint16_t dev_id)rte_regexdev_countβ__rte_experimental uint8_t rte_regexdev_count (void)rte_regexdev_get_dev_idβ__rte_experimental int rte_regexdev_get_dev_id (const char *name)rte_regexdev_info_getβ__rte_experimental int rte_regexdev_info_get (uint8_t dev_id, struct rte_regexdev_info *dev_info)rte_regexdev_configureβ__rte_experimental int rte_regexdev_configure (uint8_t dev_id, const struct rte_regexdev_config *cfg)rte_regexdev_queue_pair_setupβ__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)rte_regexdev_startβ__rte_experimental int rte_regexdev_start (uint8_t dev_id)rte_regexdev_stopβ__rte_experimental int rte_regexdev_stop (uint8_t dev_id)rte_regexdev_closeβ__rte_experimental int rte_regexdev_close (uint8_t dev_id)rte_regexdev_attr_getβ__rte_experimental int rte_regexdev_attr_get (uint8_t dev_id, enum rte_regexdev_attr_id attr_id, void *attr_value)rte_regexdev_attr_setβ__rte_experimental int rte_regexdev_attr_set (uint8_t dev_id, enum rte_regexdev_attr_id attr_id, const void *attr_value)rte_regexdev_rule_db_updateβ__rte_experimental int rte_regexdev_rule_db_update (uint8_t dev_id, const struct rte_regexdev_rule *rules, uint32_t nb_rules)rte_regexdev_rule_db_compile_activateβ__rte_experimental int rte_regexdev_rule_db_compile_activate (uint8_t dev_id)rte_regexdev_rule_db_importβ__rte_experimental int rte_regexdev_rule_db_import (uint8_t dev_id, const char *rule_db, uint32_t rule_db_len)rte_regexdev_rule_db_exportβ__rte_experimental int rte_regexdev_rule_db_export (uint8_t dev_id, char *rule_db)rte_regexdev_xstats_names_getβ__rte_experimental int rte_regexdev_xstats_names_get (uint8_t dev_id, struct rte_regexdev_xstats_map *xstats_map)rte_regexdev_xstats_getβ__rte_experimental int rte_regexdev_xstats_get (uint8_t dev_id, const uint16_t *ids, uint64_t *values, uint16_t nb_values)rte_regexdev_xstats_by_name_getβ__rte_experimental int rte_regexdev_xstats_by_name_get (uint8_t dev_id, const char *name, uint16_t *id, uint64_t *value)rte_regexdev_xstats_resetβ__rte_experimental int rte_regexdev_xstats_reset (uint8_t dev_id, const uint16_t *ids, uint16_t nb_ids)rte_regexdev_selftestβ__rte_experimental int rte_regexdev_selftest (uint8_t dev_id)rte_regexdev_dumpβ__rte_experimental int rte_regexdev_dump (uint8_t dev_id, FILE *f)rte_regexdev_enqueue_burstβ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_regexdev_dequeue_burstβ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)
bestie note: the last two arestaticand__rte_experimental, both of them. don't come for me, that's literally what the page says. β¨
and the enqueue_burst / dequeue_burst girlies both take struct rte_regex_ops **ops and a uint16_t nb_ops, so yeah, they're twins. iconic behavior. π
π DETAILED DESCRIPTION π
π RTE RegEx Device API π
okay so bestie, this is the RTE RegEx Device API β it defines the RTE RegEx Device APIs for RegEx operations and its provisioning. π
The RegEx Device API is literally made of two parts:
- The application-oriented RegEx API that includes functions to setup a RegEx device (configure it, setup its queue pairs and start it), update the rule database and so on.
- The driver-oriented RegEx API that exports a function allowing a RegEx poll Mode Driver (PMD) to simultaneously register itself as a RegEx device driver.
RegEx device components and definitions, bestie β behold the diagram:
+-----------------+
| |
| o---------+ rte_regexdev_[en|de]queue_burst()
| PCRE based o------+ | |
| RegEx pattern | | | +--------+ |
| matching engine o------+--+--o | | +------+
| | | | | queue |<==o===>|Core 0|
| o----+ | | | pair 0 | | |
| | | | | +--------+ +------+
+-----------------+ | | |
^ | | | +--------+
| | | | | | +------+
| | +--+--o queue |<======>|Core 1|
Rule|Database | | | pair 1 | | |
+------+----------+ | | +--------+ +------+
| Group 0 | | |
| +-------------+ | | | +--------+ +------+
| | Rules 0..n | | | | | | |Core 2|
| +-------------+ | | +--o queue |<======>| |
| Group 1 | | | pair 2 | +------+
| +-------------+ | | +--------+
| | Rules 0..n | | |
| +-------------+ | | +--------+
| Group 2 | | | | +------+
| +-------------+ | | | queue |<======>|Core n|
| | Rules 0..n | | +-------o pair n | | |
| +-------------+ | +--------+ +------+
| Group n |
| +-------------+ |<-------rte_regexdev_rule_db_update()
| | | |<-------rte_regexdev_rule_db_compile_activate()
| | Rules 0..n | |<-------rte_regexdev_rule_db_import()
| +-------------+ |------->rte_regexdev_rule_db_export()
+-----------------+
RegEx: a regular expression is a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters. A common abbreviation for this is βRegExβ. β¨
RegEx device: a hardware or software-based implementation of RegEx device API for PCRE based pattern matching syntax and semantics. π¦
PCRE RegEx syntax and semantics specification: http://regexkit.sourceforge.net/Documentation/pcre/pcrepattern.html
RegEx queue pair: each RegEx device should have one or more queue pair to transmit a burst of pattern matching request and receive a burst of the pattern matching response. The pattern matching request/response embedded in rte_regex_ops structure. π
Rule: a pattern matching rule expressed in PCRE RegEx syntax along with Match ID and Group ID to identify the rule upon the match. π
Rule database: the RegEx device accepts regular expressions and converts them into a compiled rule database that can then be used to scan data. Compilation allows the device to analyze the given pattern(s) and pre-determine how to scan for these patterns in an optimized fashion that would be far too expensive to compute at run-time. A rule database contains a set of rules that compiled in device specific binary form. π§
Match ID or Rule ID: a unique identifier provided at the time of rule creation for the application to identify the rule upon match. β
Group ID: group of rules can be grouped under one group ID to enable rule isolation and effective pattern matching. A unique group identifier provided at the time of rule creation for the application to identify the rule upon match. πΈ
Scan: a pattern matching request through enqueue API. π₯
It may be possible that a given RegEx device may not support all the features of PCRE. The application may probe unsupported features through struct rte_regexdev_info::pcre_unsup_flags. π
By default, all the functions of the RegEx Device API exported by a PMD are lock-free functions which assume to not be invoked in parallel on different logical cores to work on the same target object. For instance, the dequeue function of a PMD cannot be invoked in parallel on two logical cores to operate on the same RegEx queue pair. Of course, this function can be invoked in parallel by different logical core on different queue pair. It is the responsibility of the upper level application to enforce this rule. π
In all functions of the RegEx API, the RegEx device is designated by an integer >= 0 named the device identifier dev_id. π
At the RegEx driver level, RegEx devices are represented by a generic data structure of type rte_regexdev.
RegEx devices are dynamically registered during the PCI/SoC device probing phase performed at EAL initialization time. When a RegEx device is being probed, a rte_regexdev structure and a new device identifier are allocated for that device. Then, the regexdev_init() function supplied by the RegEx driver matching the probed device is invoked to properly initialize the device.
The role of the device init function consists of resetting the hardware or software RegEx driver implementations.
If the device init operation is successful, the correspondence between the device identifier assigned to the new device and its associated rte_regexdev structure is effectively registered. Otherwise, both the rte_regexdev structure and the device identifier are freed.
The functions exported by the application RegEx API to setup a device designated by its device identifier must be invoked in the following order: π«Ά
rte_regexdev_configure()rte_regexdev_queue_pair_setup()rte_regexdev_start()
Then, the application can invoke, in any order, the functions exported by the RegEx API to enqueue pattern matching job, dequeue pattern matching response, get the stats, update the rule database, get/set device attributes and so on. π
If the application wants to change the configuration (i.e. call rte_regexdev_configure() or rte_regexdev_queue_pair_setup()), it must call rte_regexdev_stop() first to stop the device and then do the reconfiguration before calling rte_regexdev_start() again. The enqueue and dequeue functions should not be invoked when the device is stopped.
Finally, an application can close a RegEx device by invoking the rte_regexdev_close() function. π
Each function of the application RegEx API invokes a specific function of the PMD that controls the target device designated by its device identifier.
For this purpose, all device-specific functions of a RegEx driver are supplied through a set of pointers contained in a generic structure of type regexdev_ops. The address of the regexdev_ops structure is stored in the rte_regexdev structure by the device init function of the RegEx driver, which is invoked during the PCI/SoC device probing phase, as explained earlier. β¨
In other words, each function of the RegEx API simply retrieves the rte_regexdev structure associated with the device identifier and performs an indirect invocation of the corresponding driver function supplied in the regexdev_ops structure of the rte_regexdev structure. π
For performance reasons, the address of the fast-path functions of the RegEx driver is not contained in the regexdev_ops structure. Instead, they are directly stored at the beginning of the rte_regexdev structure to avoid an extra indirect memory access during their invocation. π₯
RTE RegEx device drivers do not use interrupts for enqueue or dequeue operation. Instead, RegEx drivers export Poll-Mode enqueue and dequeue functions to applications.
The enqueue operation submits a burst of RegEx pattern matching request to the RegEx device and the dequeue operation gets a burst of pattern matching response for the ones submitted through enqueue operation. πΈ
Typical application utilisation of the RegEx device API will follow the following programming flow. π¦
rte_regexdev_configure()rte_regexdev_queue_pair_setup()rte_regexdev_rule_db_update()Needs to invoke if precompiled rule database not provided inrte_regexdev_config::rule_dbforrte_regexdev_configure()and/or application needs to update rule database.rte_regexdev_rule_db_compile_activate()Needs to invoke ifrte_regexdev_rule_db_updatefunction was used.- Create or reuse exiting mempool for
rte_regex_opsobjects. rte_regexdev_start()rte_regexdev_enqueue_burst()rte_regexdev_dequeue_burst()
Definition in file rte_regexdev.h.
π MACRO DEFINITION DOCUMENTATION π
π RTE_REGEXDEV_CAPA_RUNTIME_COMPILATION_F
#define RTE_REGEXDEV_CAPA_RUNTIME_COMPILATION_F (1ULL << 0)
RegEx device does support compiling the rules at runtime unlike loading only the pre-built rule database using struct rte_regexdev_config::rule_db in rte_regexdev_configure(). β¨
See also
struct rte_regexdev_config::rule_db,rte_regexdev_configure()struct rte_regexdev_info::regexdev_capa
Definition at line 273 of file rte_regexdev.h.
π RTE_REGEXDEV_CAPA_SUPP_PCRE_START_ANCHOR_F
#define RTE_REGEXDEV_CAPA_SUPP_PCRE_START_ANCHOR_F (1ULL << 1)
RegEx device support PCRE Anchor to start of match flag. Example RegEx is /\Gfoo\d/. Here \G asserts position at the end of the previous match or the start of the string for the first match. This position will change each time the RegEx is applied to the subject string. If the RegEx is applied to foo1foo2Zfoo3 the first two matches will be successful for foo1foo2 and fail for Zfoo3. π
See also
struct rte_regexdev_info::regexdev_capa
Definition at line 282 of file rte_regexdev.h.
π¦ RTE_REGEXDEV_CAPA_SUPP_PCRE_ATOMIC_GROUPING_F
#define RTE_REGEXDEV_CAPA_SUPP_PCRE_ATOMIC_GROUPING_F (1ULL << 2)
RegEx device support PCRE Atomic grouping. Atomic groups are represented by (?>). An atomic group is a group that, when the RegEx engine exits from it, automatically throws away all backtracking positions remembered by any tokens inside the group. Example RegEx is a(?>bc|b)c if the given patterns are abc and abcc then a(bc|b)c matches both where as a(?>bc|b)c matches only abcc because atomic groups don't allow backtracking back to b. π
See also
struct rte_regexdev_info::regexdev_capa
Definition at line 293 of file rte_regexdev.h.
β RTE_REGEXDEV_SUPP_PCRE_BACKTRACKING_CTRL_F
#define RTE_REGEXDEV_SUPP_PCRE_BACKTRACKING_CTRL_F (1ULL << 3)
RegEx device support PCRE backtracking control verbs. Some examples of backtracking verbs are (*COMMIT), (*ACCEPT), (*FAIL), (*SKIP), (*PRUNE). π₯
See also
struct rte_regexdev_info::regexdev_capa
Definition at line 305 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_PCRE_CALLOUTS_F
#define RTE_REGEXDEV_SUPP_PCRE_CALLOUTS_F (1ULL << 4)
RegEx device support PCRE callouts. PCRE supports calling an external function in between matches by using (?C). Example RegEx ABC(?C)D β if a given pattern is ABCD, then the RegEx engine will parse ABC, perform a userdefined callout, and return a successful match at D.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 313 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_PCRE_BACKREFERENCE_F
#define RTE_REGEXDEV_SUPP_PCRE_BACKREFERENCE_F (1ULL << 5)
RegEx device support PCRE backreference. Example RegEx is (\2ABC|(GHI))+\2 β \2 matches the same text as most recently matched by the 2nd capturing group, i.e. GHI.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 323 of file rte_regexdev.h.
π¦ RTE_REGEXDEV_SUPP_PCRE_GREEDY_F
#define RTE_REGEXDEV_SUPP_PCRE_GREEDY_F (1ULL << 6)
RegEx device support PCRE Greedy mode. For example, if the RegEx is AB\d*?, then *? represents zero or unlimited matches. In greedy mode the pattern AB12345 will be matched completely, whereas in ungreedy mode AB will be returned as the match.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 331 of file rte_regexdev.h.
πΈ RTE_REGEXDEV_SUPP_PCRE_MATCH_ALL_F
#define RTE_REGEXDEV_SUPP_PCRE_MATCH_ALL_F (1ULL << 7)
RegEx device support match all mode. For example, if the RegEx is AB\d*?, then *? represents zero or unlimited matches. In match all mode the pattern AB12345 will return 6 matches: AB, AB1, AB12, AB123, AB1234, AB12345.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 340 of file rte_regexdev.h.
π
RTE_REGEXDEV_SUPP_PCRE_LOOKAROUND_ASRT_F
#define RTE_REGEXDEV_SUPP_PCRE_LOOKAROUND_ASRT_F (1ULL << 8)
RegEx device support PCRE Lookaround assertions (Zero-width assertions). Example RegEx is [a-z]+\d+(?=!{3,}) β if the given pattern is dwad1234!, the RegEx engine doesn't report any matches because the assert (?=!{3,}) fails. The pattern dwad123!!! would return a successful match.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 349 of file rte_regexdev.h.
π«Ά RTE_REGEXDEV_SUPP_PCRE_MATCH_POINT_RST_F
#define RTE_REGEXDEV_SUPP_PCRE_MATCH_POINT_RST_F (1ULL << 9)
RegEx device doesn't support PCRE match point reset directive. Example RegEx is [a-z]+\K\d+ β if the pattern is dwad123, then even though the entire pattern matches, only 123 is reported as a match.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 359 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_NEWLINE_CONVENTIONS_F
#define RTE_REGEXDEV_SUPP_NEWLINE_CONVENTIONS_F (1ULL << 10)
RegEx support PCRE newline convention. Newline conventions are represented as follows:
(*CR)carriage return(*LF)linefeed(*CRLF)carriage return, followed by linefeed(*ANYCRLF)any of the three above(*ANY)all Unicode newline sequences
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 368 of file rte_regexdev.h.
π₯ RTE_REGEXDEV_SUPP_PCRE_NEWLINE_SEQ_F
#define RTE_REGEXDEV_SUPP_PCRE_NEWLINE_SEQ_F (1ULL << 11)
RegEx device support PCRE newline sequence. The escape sequence \R will match any newline sequence. It is equivalent to: (?>\r\n|\n|\x0b|\f|\r|\x85).
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 380 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_PCRE_POSSESSIVE_QUALIFIERS_F
#define RTE_REGEXDEV_SUPP_PCRE_POSSESSIVE_QUALIFIERS_F (1ULL << 12)
RegEx device support PCRE possessive qualifiers. Example RegEx possessive qualifiers *+, ++, ?+, {m,n}+. Possessive quantifier repeats the token as many times as possible and it does not give up matches as the engine backtracks. With a possessive quantifier, the deal is all or nothing.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 388 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_PCRE_SUBROUTINE_REFERENCES_F
#define RTE_REGEXDEV_SUPP_PCRE_SUBROUTINE_REFERENCES_F (1ULL << 13)
RegEx device support PCRE Subroutine references. PCRE Subroutine references allow for sub patterns to be assessed as part of the RegEx. Example RegEx is (foo|fuzz)\g<1>+bar β matches the pattern foofoofuzzfoofuzzbar.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 398 of file rte_regexdev.h.
β RTE_REGEXDEV_SUPP_PCRE_UTF_8_F
#define RTE_REGEXDEV_SUPP_PCRE_UTF_8_F (1ULL << 14)
RegEx device support UTF-8 character encoding.
See also: struct rte_regexdev_info::pcre_unsup_flags
Definition at line 407 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_PCRE_UTF_16_F
#define RTE_REGEXDEV_SUPP_PCRE_UTF_16_F (1ULL << 15)
RegEx device support UTF-16 character encoding.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 413 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_PCRE_UTF_32_F
#define RTE_REGEXDEV_SUPP_PCRE_UTF_32_F (1ULL << 16)
RegEx device support UTF-32 character encoding.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 419 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_PCRE_WORD_BOUNDARY_F
#define RTE_REGEXDEV_SUPP_PCRE_WORD_BOUNDARY_F (1ULL << 17)
RegEx device support word boundaries. The meta character \b represents word boundary anchor.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 425 of file rte_regexdev.h.
π§ RTE_REGEXDEV_SUPP_PCRE_FORWARD_REFERENCES_F
#define RTE_REGEXDEV_SUPP_PCRE_FORWARD_REFERENCES_F (1ULL << 18)
RegEx device support Forward references. Forward references allow you to use a back reference to a group that appears later in the RegEx. Example RegEx is (\3ABC|(DEF|(GHI)))+ β matches the following string GHIGHIABCDEF.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 432 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_MATCH_AS_END_F
#define RTE_REGEXDEV_SUPP_MATCH_AS_END_F (1ULL << 19)
RegEx device support match as end. Match as end means that the match result holds the end offset of the detected match. No len value is set. If the device doesn't support this feature, it means the match result holds the starting position of match and the length of the match.
See also: struct rte_regexdev_info::regexdev_capa
Definition at line 441 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_CROSS_BUFFER_F
#define RTE_REGEXDEV_SUPP_CROSS_BUFFER_F (1ULL << 20)
RegEx device support cross buffer match. Cross buffer matching means that the match can be detected even if the string was started in previous buffer. In case the device is configured as RTE_REGEXDEV_CFG_MATCH_AS_END, the end offset will be relative for the first packet. For example RegEx is ABC, the first buffer is xxxx, second buffer yyyA, and the last buffer BCzz. In case the match as end is configured, the end offset will be 10.
See also: -RTE_REGEXDEV_CFG_MATCH_AS_END_F-RTE_REGEXDEV_CFG_CROSS_BUFFER_SCAN_F-RTE_REGEX_OPS_RSP_PMI_SOJ_F-RTE_REGEX_OPS_RSP_PMI_EOJ_F
Definition at line 451 of file rte_regexdev.h.
π RTE_REGEXDEV_SUPP_MATCH_ALL_F
#define RTE_REGEXDEV_SUPP_MATCH_ALL_F (1ULL << 21)
RegEx device support match all. Match all means that the RegEx engine will return all possible matches. For example, assume the RegEx is A+b, given the input AAAb the returned matches will be: Ab, AAb and AAAb.
See also: RTE_REGEXDEV_CFG_MATCH_ALL_F
Definition at line 467 of file rte_regexdev.h.
π¦ RTE_REGEXDEV_CAPA_QUEUE_PAIR_OOS_F
#define RTE_REGEXDEV_CAPA_QUEUE_PAIR_OOS_F (1ULL << 22)
RegEx device supports out of order scan. Out of order scan means the response of a specific job can be returned as soon as it is ready even if previous jobs on the same queue didn't complete.
See also: -RTE_REGEX_QUEUE_PAIR_CFG_OOS_F-struct rte_regexdev_info::regexdev_capa
Definition at line 476 of file rte_regexdev.h.
π
RTE_REGEX_PCRE_RULE_ALLOW_EMPTY_F
#define RTE_REGEX_PCRE_RULE_ALLOW_EMPTY_F (1ULL << 0)
When this flag is set, the pattern that can match against an empty string, such as .*, are allowed.
See also: -struct rte_regexdev_info::rule_flags-struct rte_regexdev_rule::rule_flags
Definition at line 486 of file rte_regexdev.h.
πΈ RTE_REGEX_PCRE_RULE_ANCHORED_F
#define RTE_REGEX_PCRE_RULE_ANCHORED_F (1ULL << 1)
When this flag is set, the pattern is forced to be "anchored", that is, it is constrained to match only at the first matching point in the string that is being searched. Similar to ^ and represented by \A.
See also: -struct rte_regexdev_info::rule_flags-struct rte_regexdev_rule::rule_flags
Definition at line 494 of file rte_regexdev.h.
π«Ά RTE_REGEX_PCRE_RULE_CASELESS_F
#define RTE_REGEX_PCRE_RULE_CASELESS_F (1ULL << 2)
When this flag is set, letters in the pattern match both upper and lower case letters in the subject.
See also: -struct rte_regexdev_info::rule_flags-struct rte_regexdev_rule::rule_flags
Definition at line 503 of file rte_regexdev.h.
π RTE_REGEX_PCRE_RULE_DOTALL_F
#define RTE_REGEX_PCRE_RULE_DOTALL_F (1ULL << 3)
When this flag is set, a dot metacharacter in the pattern matches any character, including one that indicates a newline.
See also: -struct rte_regexdev_info::rule_flags-struct rte_regexdev_rule::rule_flags
Definition at line 511 of file rte_regexdev.h.
π₯ RTE_REGEX_PCRE_RULE_DUPNAMES_F
#define RTE_REGEX_PCRE_RULE_DUPNAMES_F (1ULL << 4)
When this flag is set, names used to identify capture groups need not be unique.
See also: -struct rte_regexdev_info::rule_flags-struct rte_regexdev_rule::rule_flags
Definition at line 519 of file rte_regexdev.h.
π RTE_REGEX_PCRE_RULE_EXTENDED_F
#define RTE_REGEX_PCRE_RULE_EXTENDED_F (1ULL << 5)
When this flag is set, most white space characters in the pattern are totally ignored except when escaped or inside a character class.
See also: -struct rte_regexdev_info::rule_flags-struct rte_regexdev_rule::rule_flags
Definition at line 527 of file rte_regexdev.h.
π RTE_REGEX_PCRE_RULE_MATCH_UNSET_BACKREF_F
#define RTE_REGEX_PCRE_RULE_MATCH_UNSET_BACKREF_F (1ULL << 6)
When this flag is set, a backreference to an unset capture group matches an empty string.
See also: -struct rte_regexdev_info::rule_flags-struct rte_regexdev_rule::rule_flags
Definition at line 535 of file rte_regexdev.h.
β RTE_REGEX_PCRE_RULE_MULTILINE_F
#define RTE_REGEX_PCRE_RULE_MULTILINE_F (1ULL << 7)
When this flag is set, the ^ and $ constructs match immediately following or immediately before internal newlines in the subject string, respectively, as well as at the very start and end.
See also: -struct rte_regexdev_info::rule_flags-struct rte_regexdev_rule::rule_flags
Definition at line 543 of file rte_regexdev.h.
π RTE_REGEX_PCRE_RULE_NO_AUTO_CAPTURE_F
#define RTE_REGEX_PCRE_RULE_NO_AUTO_CAPTURE_F (1ULL << 8)
When this flag is set, it disables the use of numbered capturing parentheses in the pattern. References to capture groups (backreferences or recursion/subroutine calls) may only refer to named groups, though the reference can be by name or by number.
See also: -struct rte_regexdev_info::rule_flags-struct rte_regexdev_rule::rule_flags
Definition at line 552 of file rte_regexdev.h.
π RTE_REGEX_PCRE_RULE_UCP_F
#define RTE_REGEX_PCRE_RULE_UCP_F (1ULL << 9)
By default, only ASCII characters are recognized. When this flag is set, Unicode properties are used instead to classify characters.
See also: -struct rte_regexdev_info::rule_flags-struct rte_regexdev_rule::rule_flags
Definition at line 562 of file rte_regexdev.h.
RTE_REGEX_PCRE_RULE_UNGREEDY_Fβ(1ULL << 10). When this flag is set, the βgreedinessβ of the quantifiers gets inverted, so they are not greedy by default, but they become greedy if followed by?. See alsostruct rte_regexdev_info::rule_flagsandstruct rte_regexdev_rule::rule_flags. Definition at line 570 of filerte_regexdev.h.RTE_REGEX_PCRE_RULE_UTF_Fβ(1ULL << 11). When this flag is set, the RegEx engine has to regard both the pattern and the subject strings that are subsequently processed as strings of UTF characters instead of single-code-unit strings. See alsostruct rte_regexdev_info::rule_flagsandstruct rte_regexdev_rule::rule_flags. Definition at line 579 of filerte_regexdev.h.RTE_REGEX_PCRE_RULE_NEVER_BACKSLASH_C_Fβ(1ULL << 12). This flag locks out the use of\Cin the pattern that is being compiled. This escape matches one data unit, even in UTF mode, which can cause unpredictable behavior in UTF-8 or UTF-16 modes, because it may leave the current matching point in themi:set hlsearchddleof a multi-code-unit character. See alsostruct rte_regexdev_info::rule_flagsandstruct rte_regexdev_rule::rule_flags. Definition at line 588 of filerte_regexdev.h.RTE_REGEXDEV_CFG_CROSS_BUFFER_SCAN_Fβ(1ULL << 0). Cross buffer scan is the ability to be able to detect matches that occur across buffer boundaries, where the buffers are related to each other in some way. Enable this flag when to scan payload size greater thanstruct rte_regexdev_info::max_payload_sizeand/or matches can present across scan buffer boundaries. See alsostruct rte_regexdev_info::max_payload_size,struct rte_regexdev_config::dev_cfg_flags,rte_regexdev_configure(),RTE_REGEX_OPS_RSP_PMI_SOJ_F, andRTE_REGEX_OPS_RSP_PMI_EOJ_F. Definition at line 649 of filerte_regexdev.h.RTE_REGEXDEV_CFG_MATCH_AS_END_Fβ(1ULL << 1). Match as end is the ability to return the result as ending offset. When this flag is set, the result for each match will hold the ending offset of the match inend_offset. If this flag is not set, then the match result will hold the starting offset instart_offset, and the length of the match inlen. See alsoRTE_REGEXDEV_SUPP_MATCH_AS_END_F. Definition at line 662 of filerte_regexdev.h.RTE_REGEXDEV_CFG_MATCH_ALL_Fβ(1ULL << 2). Match all is the ability to return all possible results. See alsoRTE_REGEXDEV_SUPP_MATCH_ALL_F. Definition at line 672 of filerte_regexdev.h.RTE_REGEX_QUEUE_PAIR_CFG_OOS_Fβ(1ULL << 0). Out of order scan. If not set, a scan must retire after previously issued in-order scans to this queue pair. If set, this scan can be retired as soon as device returns completion. Application should not set out of order scan flag if it needs to maintain the ingress order of scan request. See alsostruct rte_regexdev_qp_conf::qp_conf_flagsandrte_regexdev_queue_pair_setup(). Definition at line 748 of filerte_regexdev.h.RTE_REGEXDEV_XSTATS_NAME_SIZEβ64. Maximum name length for extended statistics counters. Definition at line 1086 of filerte_regexdev.h.RTE_REGEX_OPS_REQ_GROUP_ID0_VALID_Fβ(1 << 0). Set whenstruct rte_regexdev_rule::group_id0is valid. Definition at line 1273 of filerte_regexdev.h.RTE_REGEX_OPS_REQ_GROUP_ID1_VALID_Fβ(1 << 1). Set whenstruct rte_regexdev_rule::group_id1is valid. Definition at line 1276 of filerte_regexdev.h.RTE_REGEX_OPS_REQ_GROUP_ID2_VALID_Fβ(1 << 2). Set whenstruct rte_regexdev_rule::group_id2is valid. Definition at line 1279 of filerte_regexdev.h.RTE_REGEX_OPS_REQ_GROUP_ID3_VALID_Fβ(1 << 3). Set whenstruct rte_regexdev_rule::group_id3is valid. Definition at line 1282 of filerte_regexdev.h.RTE_REGEX_OPS_REQ_STOP_ON_MATCH_Fβ(1 << 4). The RegEx engine will stop scanning and return the first match. Definition at line 1285 of filerte_regexdev.h.RTE_REGEX_OPS_REQ_MATCH_HIGH_PRIORITY_Fβ(1 << 5). In High Priority mode a maximum of one match will be returned per scan to reduce the post-processing required by the application. The match with the lowest Rule id, lowest start pointer and lowest match length will be returned. See alsostruct rte_regex_ops::nb_actual_matchesandstruct rte_regex_ops::nb_matches. Definition at line 1288 of filerte_regexdev.h.RTE_REGEX_OPS_RSP_PMI_SOJ_Fβ(1 << 0). Indicates that the RegEx device has encountered a partial match at the start of scan in the given buffer. See alsoRTE_REGEXDEV_CFG_CROSS_BUFFER_SCAN_F. Definition at line 1300 of filerte_regexdev.h.RTE_REGEX_OPS_RSP_PMI_EOJ_Fβ(1 << 1). Indicates that the RegEx device has encountered a partial match at the end of scan in the given buffer. See alsoRTE_REGEXDEV_CFG_CROSS_BUFFER_SCAN_F. Definition at line 1307 of filerte_regexdev.h.RTE_REGEX_OPS_RSP_MAX_SCAN_TIMEOUT_Fβ(1 << 2). Indicates that the RegEx device has exceeded the max timeout while scanning the given buffer. See alsoRTE_REGEXDEV_ATTR_MAX_SCAN_TIMEOUT. Definition at line 1314 of filerte_regexdev.h.RTE_REGEX_OPS_RSP_MAX_MATCH_Fβ(1 << 3). Indicates that the RegEx device has exceeded the max matches while scanning the given buffer. See alsoRTE_REGEXDEV_ATTR_MAX_MATCHES. Definition at line 1321 of filerte_regexdev.h.RTE_REGEX_OPS_RSP_MAX_PREFIX_Fβ(1 << 4). Indicates that the RegEx device has reached the max allowed prefix length while scanning the given buffer. See alsoRTE_REGEXDEV_ATTR_MAX_PREFIX. Definition at line 1328 of filerte_regexdev.h.RTE_REGEX_OPS_RSP_RESOURCE_LIMIT_REACHED_Fβ(1 << 4). Indicates that the RegEx device has reached the max allowed resource allowed while scanning the given buffer. Definition at line 1335 of filerte_regexdev.h.
π Typedef Documentation π
regexdev_stop_flush_t
typedef void(* regexdev_stop_flush_t) (uint8_t dev_id, uint16_t qp_id, struct rte_regex_ops *op)
Callback function called during rte_regexdev_stop(), invoked once per flushed RegEx op.
Definition at line 759 of file rte_regexdev.h.
π¦ Enumeration Type Documentation π¦
enum rte_regexdev_attr_id
Enumerates RegEx device attribute identifier.
RTE_REGEXDEV_ATTR_SOCKET_IDβ The NUMA socket id to which the device is connected or a default of zero if the socket could not be determined. datatype:int; operation:get.RTE_REGEXDEV_ATTR_MAX_MATCHESβ Maximum number of matches per scan. datatype:uint8_t; operation:getandset. See alsoRTE_REGEX_OPS_RSP_MAX_MATCH_F.RTE_REGEXDEV_ATTR_MAX_SCAN_TIMEOUTβ Upper bound scan time in ns. datatype:uint16_t; operation:getandset. See alsoRTE_REGEX_OPS_RSP_MAX_SCAN_TIMEOUT_F.RTE_REGEXDEV_ATTR_MAX_PREFIXβ Maximum number of prefix detected per scan. This would be useful for denial of service detection. datatype:uint16_t; operation:getandset. See alsoRTE_REGEX_OPS_RSP_MAX_PREFIX_F.
Definition at line 868 of file rte_regexdev.h.
enum rte_regexdev_rule_op
Enumerates RegEx rule operation.
RTE_REGEX_RULE_OP_ADDβ Add RegEx rule to rule database.RTE_REGEX_RULE_OP_REMOVEβ Remove RegEx rule from rule database.
Definition at line 946 of file rte_regexdev.h.
π₯ Function Documentation π₯
rte_regexdev_is_valid_dev()
__rte_experimental int rte_regexdev_is_valid_dev (uint16_t dev_id)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Check if dev_id is ready.
Parameters
- dev_id β The dev identifier of the RegEx device.
Returns
0if device state is not in ready state.1if device state is ready state.
rte_regexdev_count()
__rte_experimental uint8_t rte_regexdev_count (void )
β οΈ EXPERIMENTAL: this API may change without prior notice.
Get the total number of RegEx devices that have been successfully initialised.
Returns
The total number of usable RegEx devices.
rte_regexdev_get_dev_id()
__rte_experimental int rte_regexdev_get_dev_id (const char * name)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Get the device identifier for the named RegEx device.
Parameters
- name β RegEx device name to select the RegEx device identifier.
Returns
Returns RegEx device identifier on success.
<0: Failure to find named RegEx device.
rte_regexdev_info_get()
__rte_experimental int rte_regexdev_info_get (uint8_t dev_id, struct rte_regexdev_info * dev_info)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Retrieve the contextual information of a RegEx device.
Parameters
- dev_id β The identifier of the device.
- dev_info β A pointer to a structure of type
rte_regexdev_infoto be filled with the contextual information of the device.
Returns
0: Success, driver updates the contextual information of the RegEx device.<0: Error code returned by the driver info get function.
rte_regexdev_configure()
__rte_experimental int rte_regexdev_configure (uint8_t dev_id, const struct rte_regexdev_config * cfg)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Configure a RegEx device.
This function must be invoked first before any other function in the API. This function can also be re-invoked when a device is in the stopped state.
The caller may use rte_regexdev_info_get() to get the capability of each resources available for this regex device.
Parameters
- dev_id β The identifier of the device to configure.
- cfg β The RegEx device configuration structure.
Returns
0: Success, device configured. Otherwise negative errno is returned.
rte_regexdev_queue_pair_setup()
__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)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Allocate and set up a RegEx queue pair for a RegEx device.
Parameters
- dev_id β The identifier of the device.
- queue_pair_id β The index of the RegEx queue pair to setup. The value must be in the range
[0, nb_queue_pairs - 1]previously supplied torte_regexdev_configure(). - qp_conf β The pointer to the configuration data to be used for the RegEx queue pair.
NULLvalue is allowed, in which case default configuration used.
Returns
0 on success. Otherwise negative errno is returned.
rte_regexdev_start()
__rte_experimental int rte_regexdev_start (uint8_t dev_id)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Start a RegEx device.
okay so the device start step is literally the final step, and itβs all about setting the RegEx queues to start accepting pattern-matching scan requests. Once it succeeds, every basic function the API exports (RegEx enqueue, RegEx dequeue, and so on) is fair game to invoke. slay π β¨
rte_regexdev_stop β stop the device, bestie π
__rte_experimental int rte_regexdev_stop (uint8_t dev_id)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Stops a RegEx device. You can restart it later with a call to rte_regexdev_start(). This function causes all queued response regex ops to be drained in the response queue. While draining ops out of the device, struct rte_regexdev_qp_conf::cb will be invoked for each ops.
Parameters:
dev_idβ RegEx device identifier.
Returns:
0 on success. Otherwise negative errno is returned.
rte_regexdev_close β close it and itβs done done π
__rte_experimental int rte_regexdev_close (uint8_t dev_id)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Closes a RegEx device. The device cannot be restarted! like, periodt, no take-backs π
Parameters:
dev_idβ RegEx device identifier
Returns:
0 on success. Otherwise negative errno is returned.
rte_regexdev_attr_get β get an attribute β¨
__rte_experimental int rte_regexdev_attr_get (uint8_t dev_id, enum rte_regexdev_attr_id attr_id, void * attr_value)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Get an attribute from a RegEx device.
Parameters:
dev_idβ RegEx device identifier.attr_idβ the attribute ID to retrieve.attr_valueβ a pointer that will be filled in with the attribute value if successful.
Returns:
0: Successfully retrieved attribute value.-EINVAL: Invalid device orattr_idprovided, orattr_valueisNULL.-ENOTSUP: if the device doesn't support specificattr_id.
rte_regexdev_attr_set β set an attribute π
__rte_experimental int rte_regexdev_attr_set (uint8_t dev_id, enum rte_regexdev_attr_id attr_id, const void * attr_value)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Set an attribute to a RegEx device.
Parameters:
dev_idβ RegEx device identifier.attr_idβ the attribute ID to retrieve.attr_valueβ pointer that will be filled in with the attribute value by the application.
Returns:
0: Successfully applied the attribute value.-EINVAL: Invalid device orattr_idprovided, orattr_valueisNULL.-ENOTSUP: if the device doesn't support specificattr_id.
rte_regexdev_rule_db_update β update the local rule set π§
__rte_experimental int rte_regexdev_rule_db_update (uint8_t dev_id, const struct rte_regexdev_rule * rules, uint32_t nb_rules)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Update the local rule set. This functions only modify the rule set in memory. In order for the changes to take effect, the function rte_regexdev_rule_db_compile_active must be called. iykyk, memory-only ainβt enough π
Parameters:
dev_idβ RegEx device identifier.rulesβ points to an array ofnb_rulesobjects of typerte_regexdev_rulestructure which contain the regex rules attributes to be updated in rule database.nb_rulesβ the number of PCRE rules to update the rule database.
Returns:
The number of regex rules actually updated on the regex device's rule database. The return value can be less than the value of the nb_rules parameter when the regex devices fails to update the rule database or if invalid parameters are specified in a rte_regexdev_rule. If the return value is less than nb_rules, the remaining PCRE rules at the end of rules are not consumed and the caller has to take care of them and rte_errno is set accordingly. Possible errno values include:
-EINVAL: Invalid device ID orrulesisNULL-ENOTSUP: The last processed rule is not supported on this device.-ENOSPC: No space available in rule database.
See also:
rte_regexdev_rule_db_import(), rte_regexdev_rule_db_export(), rte_regexdev_rule_db_compile_activate()
rte_regexdev_rule_db_compile_activate β compile and burn it π₯
__rte_experimental int rte_regexdev_rule_db_compile_activate (uint8_t dev_id)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Compile local rule set and burn the complied result to the RegEx device.
Parameters:
dev_idβ RegEx device identifier.
Returns:
0 on success, otherwise negative errno.
See also:
rte_regexdev_rule_db_import(), rte_regexdev_rule_db_export(), rte_regexdev_rule_db_update()
rte_regexdev_rule_db_import β import a prebuilt rule database π¦
__rte_experimental int rte_regexdev_rule_db_import (uint8_t dev_id, const char * rule_db, uint32_t rule_db_len)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Import a prebuilt rule database from a buffer to a RegEx device.
Parameters:
dev_idβ RegEx device identifier.rule_dbβ points to prebuilt rule database.rule_db_lenβ length of the rule database.
Returns:
0: Successfully updated the prebuilt rule database.-EINVAL: Invalid device ID orrule_dbisNULL-ENOTSUP: Rule database import is not supported on this device.-ENOSPC: No space available in rule database.
See also:
rte_regexdev_rule_db_update(), rte_regexdev_rule_db_export()
rte_regexdev_rule_db_export β export the prebuilt rule database πΈ
__rte_experimental int rte_regexdev_rule_db_export (uint8_t dev_id, char * rule_db)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Export the prebuilt rule database from a RegEx device to the buffer.
Parameters:
dev_idβ RegEx device identifier.rule_dbβ block of memory to insert the rule database. Must be at least size in capacity. If set toNULL, function returns required capacity.
Returns:
0: Successfully exported the prebuilt rule database.size: Ifrule_dbset toNULLthen required capacity forrule_db-EINVAL: Invalid device ID-ENOTSUP: Rule database export is not supported on this device.
See also:
rte_regexdev_rule_db_update(), rte_regexdev_rule_db_import()
rte_regexdev_xstats_names_get β get the xstats names π
__rte_experimental int rte_regexdev_xstats_names_get (uint8_t dev_id, struct rte_regexdev_xstats_map * xstats_map)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Retrieve names of extended statistics of a regex device.
Parameters:
dev_idβ the identifier of the regex device.xstats_mapβ block of memory to insert id and names into. Must be at least size in capacity. If set toNULL, function returns required capacity.
Returns:
- Positive value on success: -The return value is the number of entries filled in the stats map. -If
xstats_mapset toNULLthen required capacity forxstats_map. - Negative value on error:
-ENODEVfor invaliddev_id-ENOTSUPif the device doesn't support this function.
rte_regexdev_xstats_get β get the xstats values β
__rte_experimental int rte_regexdev_xstats_get (uint8_t dev_id, const uint16_t * ids, uint64_t * values, uint16_t nb_values)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Retrieve extended statistics of an regex device.
Parameters:
dev_idβ the identifier of the device.idsβ the id numbers of the stats to get. The ids can be got from the stat position in the stat list fromrte_regexdev_xstats_names_get(), or by usingrte_regexdev_xstats_by_name_get().valuesβ the values for each stats request by ID.nb_valuesβ the number of stats requested.
Returns:
- Positive value: number of stat entries filled into the
valuesarray - Negative value on error:
-ENODEVfor invaliddev_id-ENOTSUPif the device doesn't support this function.
rte_regexdev_xstats_by_name_get β get one stat by name π―
__rte_experimental int rte_regexdev_xstats_by_name_get (uint8_t dev_id, const char * name, uint16_t * id, uint64_t * value)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Retrieve the value of a single stat by requesting it by name.
Parameters:
dev_idβ the identifier of the device.nameβ the stat name to retrieve.idβ if non-NULL, the numerical id of the stat will be returned, so that further requests for the stat can be got usingrte_regexdev_xstats_get, which will be faster as it doesn't need to scan a list of names for the stat.valueβ must be non-NULL, retrieved xstat value will be stored in this address.
Returns:
0: Successfully retrieved xstat value.-EINVAL: invalid parameters-ENOTSUP: if not supported.
rte_regexdev_xstats_reset β reset the xstats π§Ό
__rte_experimental int rte_regexdev_xstats_reset (uint8_t dev_id, const uint16_t * ids, uint16_t nb_ids)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Reset the values of the xstats of the selected component in the device.
Parameters:
dev_idβ the identifier of the device.idsβ selects specific statistics to be reset. WhenNULL, all statistics will be reset. If non-NULL, must point to array of at leastnb_idssize.nb_idsβ the number of ids available from theidsarray. Ignored whenidsisNULL.
Returns:
0: Successfully reset the statistics to zero.-EINVAL: invalid parameters.-ENOTSUP: if not supported.
rte_regexdev_selftest β self test time π§ͺ
__rte_experimental int rte_regexdev_selftest (uint8_t dev_id)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Trigger the RegEx device self test.
Parameters:
dev_idβ the identifier of the device.
Returns:
0: Selftest successful.-ENOTSUPif the device doesn't support selftest.- other values
< 0on failure.
rte_regexdev_dump β dump the internal info π
__rte_experimental int rte_regexdev_dump (uint8_t dev_id, FILE * f)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Dump internal information about dev_id to the FILE* provided in f.
Parameters:
dev_idβ the identifier of the device.fβ a pointer to a file for output.
Returns:
0 on success, negative errno on failure.
rte_regexdev_enqueue_burst β enqueue a burst of scan requests π
__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) [inline], [static]
β οΈ EXPERIMENTAL: this API may change without prior notice.
Enqueue a burst of scan request on a RegEx device.
The rte_regexdev_enqueue_burst() function is invoked to place regex operations on the queue qp_id of the device designated by its dev_id.
The nb_ops parameter is the number of operations to process which are supplied in the ops array of rte_regexdev_op structures.
The rte_regexdev_enqueue_burst() function returns the number of operations it actually enqueued for processing. A return value equal to nb_ops means that all packets have been enqueued.
π§Ύ Parameters
dev_idβ the identifier of the device. like, which regex dev we're talking to πqp_idβ the index of the queue pair that packets are gonna be enqueued on for processing. must be in the range[0, nb_queue_pairs - 1]β and those numbers are the ones you already handed torte_regexdev_configure(), ok? no making up new ones πopsβ the address of an array ofnb_opspointers torte_regexdev_opstructures, which contain the regex operations to be processed. it's giving "here's my to-do list, pls handle it" β¨nb_opsβ the number of operations to process. literally just how many π
π¬ Returns
the number of operations actually enqueued on the regex device π and bestie, listen β this can totally be less than the value of the nb_ops parameter, either when the regex device's queue is full or if there were invalid parameters specified in a rte_regexdev_op. if the return value is less than nb_ops, then the remaining ops at the end of ops are not consumed, and the caller has to take care of them. no cap, that's on you π«Ά
definition at line 1470 of file rte_regexdev.h.
π₯ __rte_experimental uint16_t rte_regexdev_dequeue_burst π₯
__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) [inline],
[static]
β οΈ warning β EXPERIMENTAL: this API may change without prior notice. so like, don't get too attached π
dequeue a burst of scan response from a queue on the RegEx device π the dequeued operations are stored in rte_regexdev_op structures whose pointers you supply in the ops array.
the rte_regexdev_dequeue_burst() function returns the number of ops actually dequeued β which is literally the number of rte_regexdev_op data structures effectively supplied into the ops array πΈ
a return value equal to nb_ops means the queue contained at least nb_ops operations, and that's highkey a sign that other processed operations are still chilling in the device's output queue π apps that are out here implementing a "retrieve as many processed operations as possible" policy can check this specific case and just keep invoking rte_regexdev_dequeue_burst() until a value less than nb_ops comes back. slay, keep going πββοΈπ¨
the rte_regexdev_dequeue_burst() function does not provide any error notification β that's on purpose, to avoid the corresponding overhead. icon behaviour tbh, no notes π
π§Ύ Parameters
dev_idβ the RegEx device identifier πqp_idβ the index of the queue pair from which to retrieve processed packets. must be in the range[0, nb_queue_pairs - 1], previously supplied torte_regexdev_configure(). same deal as before β¨opsβ the address of an array of pointers torte_regexdev_opstructures, and that array has to be big enough to storenb_opspointers in it. big enough bestie, don't play yourself πnb_opsβ the maximum number of operations to dequeue π
π¬ Returns
the number of operations actually dequeued β which is the number of pointers to rte_regexdev_op structures effectively supplied to the ops array π¦ and if the return value is less than nb_ops, the remaining ops at the end of ops are not consumed and the caller has to take care of them. again. still your job. i don't make the rules fr fr π
definition at line 1530 of file rte_regexdev.h.
π Author
generated automatically by Doxygen for DPDK from the source code. not me writing it by hand, the robots did that one π€β¨
okay that's the whole page bestie, we made it to the end together π«Άπ this was DPDK Version 26.03.0, and you were reading rte_regexdev.h(3) β periodt, go write some regex code now, i believe in you πππ
π¦ where this page comes from
- nixos 26.05: dpdk 26.03
- nixpkgs unstable: dpdk 26.03
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms