rte_acl.h(3)
β¨ NAME β¨
This is the rte_acl.h(3) page from the Library Functions Manual, bestie β and the NAME entry is literally just rte_acl.h. Iconic minimalism, no cap π
.
πΈ SYNOPSIS πΈ
#include <rte_common.h>
#include <rte_acl_osdep.h>
Data Structures
struct rte_acl_field_def
struct rte_acl_config
struct rte_acl_field
struct rte_acl_rule_data
struct rte_acl_param
struct rte_acl_mem_hook
Macros
#define RTE_ACL_RULE_DEF(name, fld_num)
#define RTE_ACL_NAMESIZE 32
Enumerations
enum rte_acl_classify_alg { }
Functions
__rte_experimental int rte_acl_set_mem_hook (struct rte_acl_ctx *acl,
const struct rte_acl_mem_hook *mhook)
__rte_experimental int rte_acl_get_mem_hook (const struct rte_acl_ctx
*acl, struct rte_acl_mem_hook *mhook)
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. Yes bestie, thatβs the whole vibe check.
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]; \
}
Defines single ACL rule. data β miscellaneous data for the rule. field[] β value and mask or range for each field.
Definition at line 112 of file rte_acl.h.
#define RTE_ACL_NAMESIZE 32
Max number of characters in name.
Definition at line 124 of file rte_acl.h.
π¦ Enumeration Type Documentation π¦
enum rte_acl_classify_alg
Available implementations of ACL classify.
Enumerator
RTE_ACL_CLASSIFY_SCALARβ generic implementation.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 297 of file rte_acl.h.
π Function Documentation π
rte_acl_set_mem_hook
__rte_experimental int rte_acl_set_mem_hook (struct rte_acl_ctx * acl, const
struct rte_acl_mem_hook * mhook)
Set memory allocation hooks for a given ACL context.
Applications may use these hooks to allocate memory from custom pools or pre-allocated buffers. If no memory hook is provided, the ACL library uses rte_zmalloc_socket() internally.
This function must be called before rte_acl_build(). If the hook needs to be changed after a build, the ACL context must be reset first by invoking rte_acl_reset(), and only then can the memory hook be updated followed by another call to rte_acl_build().
Parameters
aclβ The ACL context.mhookβ Pointer to the memory hook structure.
Returns
0 on success. -EINVAL if parameters are invalid.
rte_acl_get_mem_hook
__rte_experimental int rte_acl_get_mem_hook (const struct rte_acl_ctx * acl,
struct rte_acl_mem_hook * mhook)
Retrieve the memory allocation hooks assigned to the ACL context.
Parameters
aclβ The ACL context.mhookβ Output location for the current memory hook structure.
Returns
0 on success. -EINVAL if parameters are invalid.
rte_acl_free
void rte_acl_free (struct rte_acl_ctx * ctx)
De-allocate all memory used by ACL context.
Parameters
ctxβ ACL context to free. IfctxisNULL, no operation is performed.
rte_acl_create
struct rte_acl_ctx * rte_acl_create (const struct rte_acl_param * param)
Create a new ACL context.
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.
rte_acl_find_existing
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.
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.
rte_acl_add_rules
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, bestie. Do not send your whole group chat at it at once.
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.
rte_acl_reset_rules
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.
Parameters
ctxβ ACL context to delete rules from.
rte_acl_build
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.
rte_acl_reset
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.
Parameters
ctxβ ACL context to reset.
rte_acl_classify
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.
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.
rte_acl_classify_alg
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.
Returns
Zero on successful completion. -EINVAL for incorrect arguments.
rte_acl_dump
void rte_acl_dump (const struct rte_acl_ctx * ctx)
Dump an ACL context structure to the console.
Parameters
ctxβ ACL context to dump.
rte_acl_list_dump
void rte_acl_list_dump (void )
Dump all ACL context structures to the console.
π Author π
Generated automatically by Doxygen for DPDK from the source code.
Byeeeee bestie, this page was brought to you by DPDK Version 26.03.0 and the rte_acl.h(3) manual page β mwah πβ¨
π¦ 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