rte_acl.h(3)
π rte_acl.h(3) π
okay so bestie, gather round, because this is the manual page for rte_acl.h β it lives in the Library Functions Manual section (that's the (3) btw, that's the vibe) and it's all about the RTE Classifier. no cap, it's a lot, but we're gonna get through it together π«Ά
β¨ NAME β¨
rte_acl.h β the header, the whole header, nothing but the header π
β¨ SYNOPSIS β¨
#include <rte_common.h>
#include <rte_acl_osdep.h>
πΈ Data Structures πΈ
lowkey the whole cast of characters:
struct rte_acl_field_defstruct rte_acl_configstruct rte_acl_fieldstruct rte_acl_rule_datastruct rte_acl_param
π Macros π
#define RTE_ACL_RULE_DEF(name, fld_num)
#define RTE_ACL_NAMESIZE 32
π¦ Enumerations π¦
enum rte_acl_classify_alg { }
π Functions π
every single one, verbatim, no skipping, we don't do that here:
void rte_acl_free (struct rte_acl_ctx *ctx)
struct rte_acl_ctx * rte_acl_create (const struct rte_acl_param *param)
__rte_malloc __rte_dealloc(rte_acl_free
struct rte_acl_ctx struct rte_acl_ctx * rte_acl_find_existing (const
char *name)
int rte_acl_add_rules (struct rte_acl_ctx *ctx, const struct
rte_acl_rule *rules, uint32_t num)
void rte_acl_reset_rules (struct rte_acl_ctx *ctx)
int rte_acl_build (struct rte_acl_ctx *ctx, const struct rte_acl_config
*cfg)
void rte_acl_reset (struct rte_acl_ctx *ctx)
int rte_acl_classify (const struct rte_acl_ctx *ctx, const uint8_t
**data, uint32_t *results, uint32_t num, uint32_t categories)
int rte_acl_classify_alg (const struct rte_acl_ctx *ctx, const uint8_t
**data, uint32_t *results, uint32_t num, uint32_t categories, enum
rte_acl_classify_alg alg)
void rte_acl_dump (const struct rte_acl_ctx *ctx)
void rte_acl_list_dump (void)
π Detailed Description π
π RTE Classifier.
and that's it. that's the description. short king behavior honestly π
Definition in file rte_acl.h.
π Macro Definition Documentation π
β¨ #define RTE_ACL_RULE_DEF( name, fld_num)
Value:
struct name {\
struct rte_acl_rule_data data; \
struct rte_acl_field field[fld_num]; \
}
ok so this macro defines a single ACL rule. data is the miscellaneous data for the rule, and field[] holds the value and mask or range for each field. it's giving "build me a struct" energy fr fr.
Definition at line 112 of file rte_acl.h.
β¨ #define RTE_ACL_NAMESIZE 32
Max number of characters in name. that's 32, bestie, not 31, not 33. iconic.
Definition at line 124 of file rte_acl.h.
π₯ Enumeration Type Documentation π₯
π
enum rte_acl_classify_alg
Available implementations of ACL classify. pick your fighter:
Enumerator
RTE_ACL_CLASSIFY_SCALARβ generic implementation. the reliable one, the one that shows up for everyone πRTE_ACL_CLASSIFY_SSEβ requires SSE4.1 support.RTE_ACL_CLASSIFY_AVX2β requires AVX2 support.RTE_ACL_CLASSIFY_NEONβ requires NEON support.RTE_ACL_CLASSIFY_ALTIVECβ requires ALTIVEC support.RTE_ACL_CLASSIFY_AVX512X16β requires AVX512 support.RTE_ACL_CLASSIFY_AVX512X32β requires AVX512 support.
Definition at line 242 of file rte_acl.h.
π§ Function Documentation π§
πΈ void rte_acl_free (struct rte_acl_ctx * ctx)
De-allocate all memory used by ACL context. bye bestie, it was real π«Ά
Parameters
ctxβ ACL context to free. IfctxisNULL, no operation is performed. (yes, it's polite like that.)
πΈ struct rte_acl_ctx * rte_acl_create (const struct rte_acl_param * param)
Create a new ACL context. brand new, fresh out the box, main character energy β¨
Parameters
paramβ Parameters used to create and initialise the ACL context.
Returns
Pointer to ACL context structure that is used in future ACL operations, or NULL on error, with error code set in rte_errno. Possible rte_errno errors include:
EINVAL- invalid parameter passed to function
πΈ struct rte_acl_ctx struct rte_acl_ctx * rte_acl_find_existing (const char * name)
Find an existing ACL context object and return a pointer to it. like, you already made one, now go find it ππ
Parameters
nameβ Name of the ACL context as passed torte_acl_create()
Returns
Pointer to ACL context or NULL if object not found with rte_errno set appropriately. Possible rte_errno values include:
ENOENT- value not available for return
πΈ int rte_acl_add_rules (struct rte_acl_ctx * ctx, const struct rte_acl_rule * rules, uint32_t num)
Add rules to an existing ACL context. This function is not multi-thread safe. β οΈ (say it with me: not multi-thread safe, do not let your threads fight over it.)
Parameters
ctxβ ACL context to add patterns to.rulesβ Array of rules to add to the ACL context. Note that all fields inrte_acl_rulestructures are expected to be in host byte order. Each rule expected to be in the same format and not exceed size specified at ACL context creation time.numβ Number of elements in the input array of rules.
Returns
-ENOMEMif there is no space in the ACL context for these rules.-EINVALif the parameters are invalid.- Zero if operation completed successfully.
πΈ void rte_acl_reset_rules (struct rte_acl_ctx * ctx)
Delete all rules from the ACL context. This function is not multi-thread safe. Note that internal run-time structures are not affected. so the rules dip out but the structures stay, love that for them π
Parameters
ctxβ ACL context to delete rules from.
πΈ int rte_acl_build (struct rte_acl_ctx * ctx, const struct rte_acl_config * cfg)
Analyze set of rules and build required internal run-time structures. This function is not multi-thread safe.
Parameters
ctxβ ACL context to build.cfgβ Pointer tostruct rte_acl_config- defines build parameters.
Returns
-ENOMEMif couldn't allocate enough memory.-EINVALif the parameters are invalid.- Negative error code if operation failed.
- Zero if operation completed successfully.
πΈ void rte_acl_reset (struct rte_acl_ctx * ctx)
Delete all rules from the ACL context and destroy all internal run-time structures. This function is not multi-thread safe. it's the full reset, the glow-down, the everything-must-go π
Parameters
ctxβ ACL context to reset.
πΈ int rte_acl_classify (const struct rte_acl_ctx * ctx, const uint8_t ** data, uint32_t * results, uint32_t num, uint32_t categories) [extern]
Perform search for a matching ACL rule for each input data buffer. Each input data buffer can have up to categories matches. That implies that results array should be big enough to hold (categories * num) elements. Also categories parameter should be either one or multiple of RTE_ACL_RESULTS_MULTIPLIER and can't be bigger than RTE_ACL_MAX_CATEGORIES. If more than one rule is applicable for given input buffer and given category, then rule with highest priority will be returned as a match. Note, that it is a caller's responsibility to ensure that input parameters are valid and point to correct memory locations. that last bit is on YOU bestie, not on us π
Parameters
ctxβ ACL context to search with.dataβ Array of pointers to input data buffers to perform search. Note that all fields in input data buffers supposed to be in network byte order (MSB).resultsβ Array of search results,categoriesresults per each input data buffer.numβ Number of elements in the input data buffers array.categoriesβ Number of maximum possible matches for each input buffer, one possible match per category.
Returns
zero on successful completion. -EINVAL for incorrect arguments.
πΈ int rte_acl_classify_alg (const struct rte_acl_ctx * ctx, const uint8_t ** data, uint32_t * results, uint32_t num, uint32_t categories, enum rte_acl_classify_alg alg) [extern]
Perform search using specified algorithm for a matching ACL rule for each input data buffer. Each input data buffer can have up to categories matches. That implies that results array should be big enough to hold (categories * num) elements. Also categories parameter should be either one or multiple of RTE_ACL_RESULTS_MULTIPLIER and can't be bigger than RTE_ACL_MAX_CATEGORIES. If more than one rule is applicable for given input buffer and given category, then rule with highest priority will be returned as a match. Note, that it is a caller's responsibility to ensure that input parameters are valid and point to correct memory locations.
Parameters
ctxβ ACL context to search with.dataβ Array of pointers to input data buffers to perform search. Note that all fields in input data buffers supposed to be in network byte order (MSB).resultsβ Array of search results,categoriesresults per each input data buffer.numβ Number of elements in the input data buffers array.categoriesβ Number of maximum possible matches for each input buffer, one possible match per category.algβ Algorithm to be used for the search. It is the caller responsibility to ensure that the value refers to the existing algorithm, and that it could be run on the given CPU. so like, double-check your CPU actually eats that algorithm, ok? π
Returns
zero on successful completion. -EINVAL for incorrect arguments.
πΈ void rte_acl_dump (const struct rte_acl_ctx * ctx)
Dump an ACL context structure to the console. spill the tea, ctx β
Parameters
ctxβ ACL context to dump.
πΈ void rte_acl_list_dump (void )
Dump all ACL context structures to the console. all of them. every last one. no survivors π₯
π Author π
Generated automatically by Doxygen for DPDK from the source code. so technically the author is a robot and it ate, we love a generated king π€π
and that's the whole page bestie!! you made it, I'm so proud, go touch some grass and then go build something iconic with your ACL contexts β¨
DPDK, Version 25.11.3, rte_acl.h(3) β mwah, bye, stay slay, read your man pages, hydrate π
ππ
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms