28 #define CNE_ACL_MAX_CATEGORIES 16
30 #define CNE_ACL_RESULTS_MULTIPLIER (XMM_SIZE / sizeof(uint32_t))
32 #define CNE_ACL_MAX_LEVELS 64
33 #define CNE_ACL_MAX_FIELDS 64
35 union cne_acl_field_types {
42 enum { CNE_ACL_FIELD_TYPE_MASK = 0, CNE_ACL_FIELD_TYPE_RANGE, CNE_ACL_FIELD_TYPE_BITMASK };
80 union cne_acl_field_types
value;
92 CNE_ACL_TYPE_SHIFT = 29,
93 CNE_ACL_MAX_INDEX =
CNE_LEN2MASK(CNE_ACL_TYPE_SHIFT, uint32_t),
94 CNE_ACL_MAX_PRIORITY = CNE_ACL_MAX_INDEX,
95 CNE_ACL_MIN_PRIORITY = 1,
98 #define CNE_ACL_MASKLEN_TO_BITMASK(v, s) \
99 ((v) == 0 ? (v) : (typeof(v))((uint64_t)-1 << ((s)*CHAR_BIT - (v))))
115 #define CNE_ACL_RULE_DEF(name, fld_num) \
117 struct cne_acl_rule_data data; \
118 struct cne_acl_field field[fld_num]; \
123 #define CNE_ACL_RULE_SZ(fld_num) \
124 (sizeof(struct cne_acl_rule) + sizeof(struct cne_acl_field) * (fld_num))
127 #define CNE_ACL_NAMESIZE 32
141 CNE_ACL_CLASSIFY_DEFAULT = 0,
271 extern int cne_acl_classify(
const struct cne_acl_ctx *ctx,
const uint8_t **data, uint32_t *results,
272 uint32_t num, uint32_t categories);
309 uint32_t *results, uint32_t num, uint32_t categories,
@ CNE_ACL_CLASSIFY_AVX512X32
@ CNE_ACL_CLASSIFY_AVX512X16
@ CNE_ACL_CLASSIFY_SCALAR
@ CNE_ACL_CLASSIFY_ALTIVEC
#define CNE_ACL_RULE_DEF(name, fld_num)
int cne_acl_add_rules(struct cne_acl_ctx *ctx, const struct cne_acl_rule *rules, uint32_t num)
void cne_acl_free(struct cne_acl_ctx *ctx)
void cne_acl_reset(struct cne_acl_ctx *ctx)
void cne_acl_set_algo(struct cne_acl_ctx *ctx, enum cne_acl_classify_alg algo)
void cne_acl_dump(const struct cne_acl_ctx *ctx)
struct cne_acl_ctx * cne_acl_create(const struct cne_acl_param *param)
int cne_acl_build(struct cne_acl_ctx *ctx, const struct cne_acl_config *cfg)
int cne_acl_classify(const struct cne_acl_ctx *ctx, const uint8_t **data, uint32_t *results, uint32_t num, uint32_t categories)
void cne_acl_reset_rules(struct cne_acl_ctx *ctx)
#define CNE_LEN2MASK(ln, tp)
struct cne_acl_field_def defs[CNE_ACL_MAX_FIELDS]
union cne_acl_field_types value
union cne_acl_field_types mask_range