.TH "rte_acl.h" 3 "Version 25.11.0" "DPDK" \" -*- nroff -*-
.ad l
.nh
.SH NAME
rte_acl.h
.SH SYNOPSIS
.br
.PP
\fR#include <rte_common\&.h>\fP
.br
\fR#include <rte_acl_osdep\&.h>\fP
.br

.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBrte_acl_field_def\fP"
.br
.ti -1c
.RI "struct \fBrte_acl_config\fP"
.br
.ti -1c
.RI "struct \fBrte_acl_field\fP"
.br
.ti -1c
.RI "struct \fBrte_acl_rule_data\fP"
.br
.ti -1c
.RI "struct \fBrte_acl_param\fP"
.br
.in -1c
.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBRTE_ACL_RULE_DEF\fP(name,  fld_num)"
.br
.ti -1c
.RI "#define \fBRTE_ACL_NAMESIZE\fP   32"
.br
.in -1c
.SS "Enumerations"

.in +1c
.ti -1c
.RI "enum \fBrte_acl_classify_alg\fP {  }"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBrte_acl_free\fP (struct rte_acl_ctx *ctx)"
.br
.ti -1c
.RI "struct rte_acl_ctx * \fBrte_acl_create\fP (const struct \fBrte_acl_param\fP *param) \fB__rte_malloc\fP \fB__rte_dealloc\fP(\fBrte_acl_free\fP"
.br
.ti -1c
.RI "struct rte_acl_ctx struct rte_acl_ctx * \fBrte_acl_find_existing\fP (const char *name)"
.br
.ti -1c
.RI "int \fBrte_acl_add_rules\fP (struct rte_acl_ctx *ctx, const struct rte_acl_rule *rules, uint32_t num)"
.br
.ti -1c
.RI "void \fBrte_acl_reset_rules\fP (struct rte_acl_ctx *ctx)"
.br
.ti -1c
.RI "int \fBrte_acl_build\fP (struct rte_acl_ctx *ctx, const struct \fBrte_acl_config\fP *cfg)"
.br
.ti -1c
.RI "void \fBrte_acl_reset\fP (struct rte_acl_ctx *ctx)"
.br
.ti -1c
.RI "int \fBrte_acl_classify\fP (const struct rte_acl_ctx *ctx, const uint8_t **data, uint32_t *results, uint32_t num, uint32_t categories)"
.br
.ti -1c
.RI "int \fBrte_acl_classify_alg\fP (const struct rte_acl_ctx *ctx, const uint8_t **data, uint32_t *results, uint32_t num, uint32_t categories, enum \fBrte_acl_classify_alg\fP alg)"
.br
.ti -1c
.RI "void \fBrte_acl_dump\fP (const struct rte_acl_ctx *ctx)"
.br
.ti -1c
.RI "void \fBrte_acl_list_dump\fP (void)"
.br
.in -1c
.SH "Detailed Description"
.PP 
RTE Classifier\&. 
.PP
Definition in file \fBrte_acl\&.h\fP\&.
.SH "Macro Definition Documentation"
.PP 
.SS "#define RTE_ACL_RULE_DEF( name,  fld_num)"
\fBValue:\fP
.nf
    struct name {\\
    struct rte_acl_rule_data data;               \\
    struct rte_acl_field field[fld_num];         \\
}
.PP
.fi
Defines single ACL rule\&. data - miscellaneous data for the rule\&. field[] - value and mask or range for each field\&. 
.PP
Definition at line \fB112\fP of file \fBrte_acl\&.h\fP\&.
.SS "#define RTE_ACL_NAMESIZE   32"
Max number of characters in name\&. 
.PP
Definition at line \fB124\fP of file \fBrte_acl\&.h\fP\&.
.SH "Enumeration Type Documentation"
.PP 
.SS "enum \fBrte_acl_classify_alg\fP"
Available implementations of ACL classify\&. 
.PP
\fBEnumerator\fP
.in +1c
.TP
\f(BIRTE_ACL_CLASSIFY_SCALAR \fP
generic implementation\&. 
.TP
\f(BIRTE_ACL_CLASSIFY_SSE \fP
requires SSE4\&.1 support\&. 
.TP
\f(BIRTE_ACL_CLASSIFY_AVX2 \fP
requires AVX2 support\&. 
.TP
\f(BIRTE_ACL_CLASSIFY_NEON \fP
requires NEON support\&. 
.TP
\f(BIRTE_ACL_CLASSIFY_ALTIVEC \fP
requires ALTIVEC support\&. 
.TP
\f(BIRTE_ACL_CLASSIFY_AVX512X16 \fP
requires AVX512 support\&. 
.TP
\f(BIRTE_ACL_CLASSIFY_AVX512X32 \fP
requires AVX512 support\&. 
.PP
Definition at line \fB242\fP of file \fBrte_acl\&.h\fP\&.
.SH "Function Documentation"
.PP 
.SS "void rte_acl_free (struct rte_acl_ctx * ctx)"
De-allocate all memory used by ACL context\&.

.PP
\fBParameters\fP
.RS 4
\fIctx\fP ACL context to free If ctx is NULL, no operation is performed\&. 
.RE
.PP

.SS "struct rte_acl_ctx * rte_acl_create (const struct \fBrte_acl_param\fP * param)"
Create a new ACL context\&.

.PP
\fBParameters\fP
.RS 4
\fIparam\fP Parameters used to create and initialise the ACL context\&. 
.RE
.PP
\fBReturns\fP
.RS 4
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:
.IP "\(bu" 2
EINVAL - invalid parameter passed to function 
.PP
.RE
.PP

.SS "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\&.

.PP
\fBParameters\fP
.RS 4
\fIname\fP Name of the ACL context as passed to \fBrte_acl_create()\fP 
.RE
.PP
\fBReturns\fP
.RS 4
Pointer to ACL context or NULL if object not found with rte_errno set appropriately\&. Possible rte_errno values include:
.IP "\(bu" 2
ENOENT - value not available for return 
.PP
.RE
.PP

.SS "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\&.

.PP
\fBParameters\fP
.RS 4
\fIctx\fP ACL context to add patterns to\&. 
.br
\fIrules\fP Array of rules to add to the ACL context\&. Note that all fields in rte_acl_rule structures 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\&. 
.br
\fInum\fP Number of elements in the input array of rules\&. 
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
-ENOMEM if there is no space in the ACL context for these rules\&.
.IP "\(bu" 2
-EINVAL if the parameters are invalid\&.
.IP "\(bu" 2
Zero if operation completed successfully\&. 
.PP
.RE
.PP

.SS "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\&.

.PP
\fBParameters\fP
.RS 4
\fIctx\fP ACL context to delete rules from\&. 
.RE
.PP

.SS "int rte_acl_build (struct rte_acl_ctx * ctx, const struct \fBrte_acl_config\fP * cfg)"
Analyze set of rules and build required internal run-time structures\&. This function is not multi-thread safe\&.

.PP
\fBParameters\fP
.RS 4
\fIctx\fP ACL context to build\&. 
.br
\fIcfg\fP Pointer to struct \fBrte_acl_config\fP - defines build parameters\&. 
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
-ENOMEM if couldn't allocate enough memory\&.
.IP "\(bu" 2
-EINVAL if the parameters are invalid\&.
.IP "\(bu" 2
Negative error code if operation failed\&.
.IP "\(bu" 2
Zero if operation completed successfully\&. 
.PP
.RE
.PP

.SS "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\&.

.PP
\fBParameters\fP
.RS 4
\fIctx\fP ACL context to reset\&. 
.RE
.PP

.SS "int rte_acl_classify (const struct rte_acl_ctx * ctx, const uint8_t ** data, uint32_t * results, uint32_t num, uint32_t categories)\fR [extern]\fP"
Perform search for a matching ACL rule for each input data buffer\&. Each input data buffer can have up to \fIcategories\fP 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\&.

.PP
\fBParameters\fP
.RS 4
\fIctx\fP ACL context to search with\&. 
.br
\fIdata\fP 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)\&. 
.br
\fIresults\fP Array of search results, \fIcategories\fP results per each input data buffer\&. 
.br
\fInum\fP Number of elements in the input data buffers array\&. 
.br
\fIcategories\fP Number of maximum possible matches for each input buffer, one possible match per category\&. 
.RE
.PP
\fBReturns\fP
.RS 4
zero on successful completion\&. -EINVAL for incorrect arguments\&. 
.RE
.PP

.SS "int \fBrte_acl_classify_alg\fP (const struct rte_acl_ctx * ctx, const uint8_t ** data, uint32_t * results, uint32_t num, uint32_t categories, enum \fBrte_acl_classify_alg\fP alg)\fR [extern]\fP"
Perform search using specified algorithm for a matching ACL rule for each input data buffer\&. Each input data buffer can have up to \fIcategories\fP 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\&.

.PP
\fBParameters\fP
.RS 4
\fIctx\fP ACL context to search with\&. 
.br
\fIdata\fP 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)\&. 
.br
\fIresults\fP Array of search results, \fIcategories\fP results per each input data buffer\&. 
.br
\fInum\fP Number of elements in the input data buffers array\&. 
.br
\fIcategories\fP Number of maximum possible matches for each input buffer, one possible match per category\&. 
.br
\fIalg\fP 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\&. 
.RE
.PP
\fBReturns\fP
.RS 4
zero on successful completion\&. -EINVAL for incorrect arguments\&. 
.RE
.PP

.SS "void rte_acl_dump (const struct rte_acl_ctx * ctx)"
Dump an ACL context structure to the console\&.

.PP
\fBParameters\fP
.RS 4
\fIctx\fP ACL context to dump\&. 
.RE
.PP

.SS "void rte_acl_list_dump (void )"
Dump all ACL context structures to the console\&. 
.SH "Author"
.PP 
Generated automatically by Doxygen for DPDK from the source code\&.
