rte_flow_item(3)
π rte_flow_item π
okay bestie, so this is a page from the Library Functions Manual β it's rte_flow_item(3), and it's literally the whole vibe of how a matching pattern item gets defined in DPDK. it's giving "the blueprint of pattern matching" and honestly? iconic. let's get into it π¦
β¨ SYNOPSIS β¨
#include <rte_flow.h>
π Data Fields
enum rte_flow_item_type typeconst void * specconst void * lastconst void * mask
πΈ DETAILED DESCRIPTION πΈ
Matching pattern item definition. periodt.
so a pattern gets built by stacking items, and you start from the lowest protocol layer you wanna match, then go up from there. no cap.
but bestie, hear me β this stacking restriction does not apply to meta items. those can be dropped anywhere in the stack without changing the meaning of the resulting pattern. main character energy fr fr. π
and how do patterns know when to stop? Patterns are terminated by END items. that's the closer, that's the mic drop. π
the spec field, explained with love
spec should be a valid pointer to a structure of the related item type. it may remain unspecified (NULL) in many cases, and that's totally fine β it just means you're requesting broad (nonspecific) matching. lowkey chill of you.
β οΈ but listen: in those cases,lastandmaskmust also be set toNULL. all three or nothing, bestie. no half-commitments. π
the last field, aka range queen
optionally, last can point to a structure of the same type to define an inclusive range. it's mostly supported by integer and address fields β for anything else it may cause errors, so don't be reckless π«Ά
and the fields that don't support ranges? they must be set to 0 or to the same value as the corresponding fields in spec. match the energy or set it to zero, no in-between. β¨
the mask field, the bit-manipulator of the group
by default, only the fields defined to nonzero values in the default masks (see the rte_flow_item_{name}_mask constants) are considered relevant. that's the default, that's just how she operates.
you can override this by providing a mask structure of the same type with the applicable bits set to one. π you can also use it to partially filter out specific fields β for example, as an alternate mean to match ranges of IP addresses. sneaky and valid, we love her.
mask is a simple bit-mask applied before interpreting the contents of spec and last, which may yield unexpected results if not used carefully. this is your reminder that bit math does not care about your feelings. π
for example, if for an IPv4 address field:
specprovides10.1.2.3lastprovides10.3.4.5maskprovides255.255.0.0
then the effective range becomes 10.1.0.0 to 10.3.255.255. see how the mask rewrote the whole story? ate. π
Definition at line 2127 of file rte_flow.h.
π FIELD DOCUMENTATION π
enum rte_flow_item_type type
Item type. that's it, that's the label on the box, bestie.
Definition at line 2128 of file rte_flow.h.
const void* spec
Pointer to item specification structure. this is the "what are we even looking for" pointer. π
Definition at line 2129 of file rte_flow.h.
const void* last
Defines an inclusive range (spec to last). from here to here, inclusive, no takebacks. π
Definition at line 2130 of file rte_flow.h.
const void* mask
Bit-mask applied to spec and last. the vibe filter, essentially. π
Definition at line 2131 of file rte_flow.h.
π§ AUTHOR π§
Generated automatically by Doxygen for DPDK from the source code. (yes she was born from a doc generator and she's still slaying, cry about it π)
okay so that was the whole page, mwah π«Ά and just so you know who's responsible for this masterpiece β it's DPDK, Version 25.11.3, and this whole lil doc came straight from the source code via Doxygen. byeeee, go match some patterns πβ¨πΈ
π¦ 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