rte_pipeline.h(3)
π rte_pipeline.h β bestie edition π
okay so this is rte_pipeline.h(3), from the Library Functions Manual, and literally it's the header that runs the whole DPDK Packet Framework pipeline situation. think of it as the group chat where ports, tables and actions all finally get along. no cap. π
β¨ NAME β¨
rte_pipeline.h β the header that defines the RTE Pipeline, aka the tool that lets you smash a bunch of input ports, lookup tables and output ports together into one gloriously chaotic packet processing pipeline. π¦
πΈ SYNOPSIS πΈ
#include <stdint.h>
#include <rte_port.h>
#include <rte_table.h>
#include <rte_common.h>
π Data Structures
like, all the structs you're gonna be passing around, queen:
struct rte_pipeline_paramsstruct rte_pipeline_port_in_statsstruct rte_pipeline_port_out_statsstruct rte_pipeline_table_statsstruct rte_pipeline_table_entrystruct rte_pipeline_table_paramsstruct rte_pipeline_port_in_paramsstruct rte_pipeline_port_out_params
π Macros
the hard limits, and babe, they are firm:
#define RTE_PIPELINE_TABLE_MAX 64
#define RTE_PIPELINE_PORT_IN_MAX 64
#define RTE_PIPELINE_PORT_OUT_MAX 64
π Typedefs
the function-pointer girlies β these are your handlers and they all return int:
typedef int(* rte_pipeline_table_action_handler_hit) (struct
rte_pipeline *p, struct rte_mbuf **pkts, uint64_t pkts_mask, struct
rte_pipeline_table_entry **entries, void *arg)
typedef int(* rte_pipeline_table_action_handler_miss) (struct
rte_pipeline *p, struct rte_mbuf **pkts, uint64_t pkts_mask, struct
rte_pipeline_table_entry *entry, void *arg)
typedef int(* rte_pipeline_port_in_action_handler) (struct rte_pipeline
*p, struct rte_mbuf **pkts, uint32_t n, void *arg)
typedef int(* rte_pipeline_port_out_action_handler) (struct rte_pipeline
*p, struct rte_mbuf **pkts, uint64_t pkts_mask, void *arg)
π Enumerations
one enum, five moods:
enum rte_pipeline_action { RTE_PIPELINE_ACTION_DROP = 0,
RTE_PIPELINE_ACTION_PORT, RTE_PIPELINE_ACTION_PORT_META,
RTE_PIPELINE_ACTION_TABLE, RTE_PIPELINE_ACTIONS }
π Functions
okay this is the whole roster, no one's getting left out π
struct rte_pipeline * rte_pipeline_create (struct rte_pipeline_params
*params)
int rte_pipeline_free (struct rte_pipeline *p)
int rte_pipeline_check (struct rte_pipeline *p)
int rte_pipeline_run (struct rte_pipeline *p)
int rte_pipeline_flush (struct rte_pipeline *p)
int rte_pipeline_table_create (struct rte_pipeline *p, struct
rte_pipeline_table_params *params, uint32_t *table_id)
int rte_pipeline_table_default_entry_add (struct rte_pipeline *p,
uint32_t table_id, struct rte_pipeline_table_entry *default_entry,
struct rte_pipeline_table_entry **default_entry_ptr)
int rte_pipeline_table_default_entry_delete (struct rte_pipeline *p,
uint32_t table_id, struct rte_pipeline_table_entry *entry)
int rte_pipeline_table_entry_add (struct rte_pipeline *p, uint32_t
table_id, void *key, struct rte_pipeline_table_entry *entry, int
*key_found, struct rte_pipeline_table_entry **entry_ptr)
int rte_pipeline_table_entry_delete (struct rte_pipeline *p, uint32_t
table_id, void *key, int *key_found, struct rte_pipeline_table_entry
*entry)
int rte_pipeline_table_entry_add_bulk (struct rte_pipeline *p, uint32_t
table_id, void **keys, struct rte_pipeline_table_entry **entries,
uint32_t n_keys, int *key_found, struct rte_pipeline_table_entry
**entries_ptr)
int rte_pipeline_table_entry_delete_bulk (struct rte_pipeline *p,
uint32_t table_id, void **keys, uint32_t n_keys, int *key_found,
struct rte_pipeline_table_entry **entries)
int rte_pipeline_table_stats_read (struct rte_pipeline *p, uint32_t
table_id, struct rte_pipeline_table_stats *stats, int clear)
int rte_pipeline_port_in_create (struct rte_pipeline *p, struct
rte_pipeline_port_in_params *params, uint32_t *port_id)
int rte_pipeline_port_in_connect_to_table (struct rte_pipeline *p,
uint32_t port_id, uint32_t table_id)
int rte_pipeline_port_in_enable (struct rte_pipeline *p, uint32_t
port_id)
int rte_pipeline_port_in_disable (struct rte_pipeline *p, uint32_t
port_id)
int rte_pipeline_port_in_stats_read (struct rte_pipeline *p, uint32_t
port_id, struct rte_pipeline_port_in_stats *stats, int clear)
int rte_pipeline_port_out_create (struct rte_pipeline *p, struct
rte_pipeline_port_out_params *params, uint32_t *port_id)
int rte_pipeline_port_out_stats_read (struct rte_pipeline *p, uint32_t
port_id, struct rte_pipeline_port_out_stats *stats, int clear)
int rte_pipeline_port_out_packet_insert (struct rte_pipeline *p,
uint32_t port_id, struct rte_mbuf *pkt)
int rte_pipeline_ah_packet_hijack (struct rte_pipeline *p, uint64_t
pkts_mask)
int rte_pipeline_ah_packet_drop (struct rte_pipeline *p, uint64_t
pkts_mask)
π Detailed Description π
π«Ά RTE Pipeline π«Ά
bestie. this tool is part of the DPDK Packet Framework tool suite, and what it does is give you a standard methodology β logically similar to OpenFlow, iykyk β so you can rapidly develop complex packet processing pipelines out of ports, tables and actions. it's giving lego but for networking. π§
Basic operation. so a pipeline gets constructed by connecting its input ports to its output ports through a chain of lookup tables. when you do a lookup into the current table, one of the table entries gets identified (or the default table entry, if the lookup misses) and that entry provides the actions to execute on the current packet plus the associated action meta-data. the behavior of user actions is defined through the configurable table action handler β and the reserved actions define the next hop for the current packet (either another table, an output port, or packet drop) and those are handled transparently by the framework. it just does it. periodt. β¨
Initialization and run-time flows. once all the pipeline elements have been created (input ports, tables, output ports), input ports are connected to tables, table action handlers are configured, tables are populated with the initial set of entries (actions and action meta-data) and input ports are enabled β the pipeline runs automatically, pushing packets from input ports to tables and output ports. at each table, the identified user actions get executed, which results in action meta-data (stored in the table entry) and packet meta-data (stored with the packet descriptor) being updated. and listen β the pipeline tables can have further updates, and input ports can be disabled or enabled later on as required. very flexible of her. π
Multi-core scaling. typically, each CPU core runs its own pipeline instance. complex application-level pipelines can be implemented by interconnecting multiple CPU core-level pipelines in tree-like topologies, because the same port devices (e.g. SW rings) can serve as output ports for the pipeline running on CPU core A and as input ports for the pipeline running on CPU core B. main character energy on both cores fr fr. this approach enables application development using the pipeline (CPU cores connected serially), cluster/run-to-completion (CPU cores connected in parallel) or mixed (pipeline of CPU core clusters) programming models.
Thread safety. you can have multiple pipelines running on the same CPU core, but it is not allowed (for thread safety reasons) to have multiple CPU cores running the same pipeline instance.
β οΈ okay so read that again because it matters: multiple pipelines on one core = fine. multiple cores on one pipeline instance = not allowed. thread safety reasons. don't do it, bestie. π«
Definition in file rte_pipeline.h.
π Macro Definition Documentation π
β¨ #define RTE_PIPELINE_TABLE_MAX 64 β¨
Maximum number of tables allowed for any given pipeline instance. the value of this parameter cannot be changed. like, at all. it's 64 and that's the vibe.
Definition at line 200 of file rte_pipeline.h.
β¨ #define RTE_PIPELINE_PORT_IN_MAX 64 β¨
Maximum number of input ports allowed for any given pipeline instance. the value of this parameter cannot be changed.
Definition at line 531 of file rte_pipeline.h.
β¨ #define RTE_PIPELINE_PORT_OUT_MAX 64 β¨
Maximum number of output ports allowed for any given pipeline instance. the value of this parameter cannot be changed.
Definition at line 662 of file rte_pipeline.h.
and that's just part one, bestie β the structs and the function-by-function breakdown are still coming up, so don't go anywhere π
π Typedef Documentation π
okay bestie, these are the callback types β the little function shapes you get to fill in with your own main-character code π every single one of them returns 0 on success or an error code otherwise, no cap.
rte_pipeline_table_action_handler_hit
typedef int(* rte_pipeline_table_action_handler_hit) (struct rte_pipeline
*p, struct rte_mbuf **pkts, uint64_t pkts_mask, struct
rte_pipeline_table_entry **entries, void *arg)
Pipeline table action handler on lookup hit β this is the function you bring to the party when a table lookup actually hits something π―
The action handler can decide to drop packets by resetting the associated packet bit in the pkts_mask parameter. In this case, the action handler is required not to free the packet buffer, which will be freed eventually by the pipeline. (so likeβ¦ hands off the mbuf, the pipeline handles cleanup, periodt π
)
Parameters
p</> β Handle to pipeline instancepkts</> β Burst of input packets specified as array of up to 64 pointers tostruct rte_mbufpkts_mask</> β 64-bit bitmask specifying which packets in the input burst are valid. Whenpkts_maskbitnis set, then elementnofpktsarray is pointing to a valid packet and elementnofentriesarray is pointing to a valid table entry associated with the packet, with the association typically done by the table lookup operation. Otherwise, elementnofpktsarray and elementnofentriesarray will not be accessed.entries</> β Set of table entries specified as array of up to 64 pointers tostruct rte_pipeline_table_entryarg</> β Opaque parameter registered by the user at the pipeline table creation time
Returns
0 on success, error code otherwise
Definition at line 255 of file rte_pipeline.h.
rte_pipeline_table_action_handler_miss
typedef int(* rte_pipeline_table_action_handler_miss) (struct rte_pipeline
*p, struct rte_mbuf **pkts, uint64_t pkts_mask, struct
rte_pipeline_table_entry *entry, void *arg)
Pipeline table action handler on lookup miss β the opposite vibe, when the lookup comes up empty and you gotta deal with it π«
The action handler can decide to drop packets by resetting the associated packet bit in the pkts_mask parameter. In this case, the action handler is required not to free the packet buffer, which will be freed eventually by the pipeline.
Parameters
p</> β Handle to pipeline instancepkts</> β Burst of input packets specified as array of up to 64 pointers tostruct rte_mbufpkts_mask</> β 64-bit bitmask specifying which packets in the input burst are valid. Whenpkts_maskbitnis set, then elementnofpktsarray is pointing to a valid packet. Otherwise, elementnofpktsarray will not be accessed.entry</> β Single table entry associated with all the valid packets from the input burst, specified as pointer tostruct rte_pipeline_table_entry. This entry is the pipeline table default entry that is associated by the table lookup operation with the input packets that have resulted in lookup miss.arg</> β Opaque parameter registered by the user at the pipeline table creation time
Returns
0 on success, error code otherwise
Definition at line 291 of file rte_pipeline.h.
rte_pipeline_port_in_action_handler
typedef int(* rte_pipeline_port_in_action_handler) (struct rte_pipeline *p,
struct rte_mbuf **pkts, uint32_t n, void *arg)
Pipeline input port action handler β this one runs at the input port, bestie πΈ
The action handler can decide to drop packets by resetting the associated packet bit in the pkts_mask parameter. In this case, the action handler is required not to free the packet buffer, which will be freed eventually by the pipeline.
Parameters
p</> β Handle to pipeline instancepkts</> β Burst of input packets specified as array of up to 64 pointers tostruct rte_mbufn</> β Number of packets in the input burst. This parameter specifies that elements0to(n-1)ofpktsarray are valid.arg</> β Opaque parameter registered by the user at the pipeline table creation time
Returns
0 on success, error code otherwise
Definition at line 555 of file rte_pipeline.h.
rte_pipeline_port_out_action_handler
typedef int(* rte_pipeline_port_out_action_handler) (struct rte_pipeline *p,
struct rte_mbuf **pkts, uint64_t pkts_mask, void *arg)
Pipeline output port action handler β and the output-port twin, iconic duo fr fr π
The action handler can decide to drop packets by resetting the associated packet bit in the pkts_mask parameter. In this case, the action handler is required not to free the packet buffer, which will be freed eventually by the pipeline.
Parameters
p</> β Handle to pipeline instancepkts</> β Burst of input packets specified as array of up to 64 pointers tostruct rte_mbufpkts_mask</> β 64-bit bitmask specifying which packets in the input burst are valid. Whenpkts_maskbitnis set, then elementnofpktsarray is pointing to a valid packet. Otherwise, elementnofpktsarray will not be accessed.arg</> β Opaque parameter registered by the user at the pipeline table creation time
Returns
0 on success, error code otherwise
Definition at line 687 of file rte_pipeline.h.
π Enumeration Type Documentation π
enum rte_pipeline_action
Reserved actions β the built-in moves the pipeline already knows how to do, lowkey the whole plot π¬
Enumerator
RTE_PIPELINE_ACTION_DROP</> β Drop the packet πRTE_PIPELINE_ACTION_PORT</> β Send packet to output portRTE_PIPELINE_ACTION_PORT_META</> β Send packet to output port read from packet meta-dataRTE_PIPELINE_ACTION_TABLE</> β Send packet to tableRTE_PIPELINE_ACTIONS</> β Number of reserved actions
Definition at line 178 of file rte_pipeline.h.
β Function Documentation β
struct rte_pipeline * rte_pipeline_create (struct rte_pipeline_params * params)
Pipeline create β birth of a pipeline, main character origin story β¨
Parameters
params</> β Parameters for pipeline creation
Returns
Handle to pipeline instance on success or NULL otherwise
int rte_pipeline_free (struct rte_pipeline * p)
Pipeline free β say bye bye π
Parameters
p</> β Handle to pipeline instance
Returns
0 on success, error code otherwise
int rte_pipeline_check (struct rte_pipeline * p)
Pipeline consistency check β the vibe check, literally π§
Parameters
p</> β Handle to pipeline instance
Returns
0 on success, error code otherwise
int rte_pipeline_run (struct rte_pipeline * p)
Pipeline run β make it go πββοΈ
Parameters
p</> β Handle to pipeline instance
Returns
Number of packets read and processed
int rte_pipeline_flush (struct rte_pipeline * p)
Pipeline flush π
Parameters
p</> β Handle to pipeline instance
Returns
0 on success, error code otherwise
int rte_pipeline_table_create (struct rte_pipeline * p, struct rte_pipeline_table_params * params, uint32_t * table_id)
Pipeline table create β new table just dropped π
Parameters
p</> β Handle to pipeline instanceparams</> β Parameters for pipeline table creationtable_id</> β Table ID. Valid only within the scope of table IDs of the current pipeline. Only returned after a successful invocation.
Returns
0 on success, error code otherwise
int rte_pipeline_table_default_entry_add (struct rte_pipeline * p, uint32_t table_id, struct rte_pipeline_table_entry * default_entry, struct rte_pipeline_table_entry ** default_entry_ptr)
Pipeline table default entry add
The contents of the table default entry is updated with the provided actions and meta-data. When the default entry is not configured (by using this function), the built-in default entry has the action "Drop" and meta-data set to all-zeros. π
Parameters
p</> β Handle to pipeline instancetable_id</> β Table ID (returned by previous invocation of pipeline table create)default_entry</> β New contents for the table default entrydefault_entry_ptr</> β On successful invocation, pointer to the default table entry which can be used for further read-write accesses to this table entry. This pointer is valid until the default entry is deleted or re-added.
Returns
0 on success, error code otherwise
int rte_pipeline_table_default_entry_delete (struct rte_pipeline * p, uint32_t table_id, struct rte_pipeline_table_entry * entry)
Pipeline table default entry delete
The new contents of the table default entry is set to reserved action "Dropthe packet" with meta-data cleared (i.e. set to all-zeros). π
Parameters
p</> β Handle to pipeline instancetable_id</> β Table ID (returned by previous invocation of pipeline table create)entry</> β On successful invocation, whenentrypoints to a valid buffer, the previous contents of the table default entry (as it was just before the delete operation) is copied to this buffer
Returns
0 on success, error code otherwise
int rte_pipeline_table_entry_add (struct rte_pipeline * p, uint32_t table_id, void * key, struct rte_pipeline_table_entry * entry, int * key_found, struct rte_pipeline_table_entry ** entry_ptr)
Pipeline table entry add
Parameters
p</> β Handle to pipeline instancetable_id</> β Table ID (returned by previous invocation of pipeline table create)key</> β Table entry keyentry</> β New contents for the table entry identified bykeykey_found</> β On successful invocation, set toTRUE(value different than0) ifkeywas already present in the table before the add operation and toFALSE(value0) if notentry_ptr</> β On successful invocation, pointer to the table entry associated withkey. This can be used for further read-write accesses to this table entry and is valid until the key is deleted from the table or re-added (usually for associating different actions and/or action meta-data to the current key)
Returns
0 on success, error code otherwise
int rte_pipeline_table_entry_delete (struct rte_pipeline * p, uint32_t table_id, void * key, int * key_found, struct rte_pipeline_table_entry * entry)
Pipeline table entry delete β bye key π¦
Parameters
p</> β Handle to pipeline instancetable_id</> β Table ID (returned by previous invocation of pipeline table create)key</> β Table entry keykey_found</> β On successful invocation, set toTRUE(value different than0) ifkeywas found in the table before the delete operation and toFALSE(value0) if notentry</> β On successful invocation, whenkeyis found in the table andentrypoints to a valid buffer, the table entry contents (as it was before the delete was performed) is copied to this buffer
Returns
0 on success, error code otherwise
int rte_pipeline_table_entry_add_bulk (struct rte_pipeline * p, uint32_t table_id, void ** keys, struct rte_pipeline_table_entry ** entries, uint32_t n_keys, int * key_found, struct rte_pipeline_table_entry ** entries_ptr)
Pipeline table entry add bulk β
pβ the handle to your pipeline instance π«Άtable_idβ the table ID, and yes it's the one you got back from that earlierpipeline table createcallkeysβ an array holding all the table entry keysentriesβ an array holding the new contents for every table entry that gets identified by a keyn_keysβ how many keys you're addingkey_foundβ if the call goes well, then for every single item in the array,key_foundgets set toTRUE(any value that isn't 0) when that key was already in the table before the add happened, and toFALSE(value 0) when it wasn'tentries_ptrβ if the call goes well, the array*entries_ptrstores a pointer to every table entry tied to a key. Lowkey this is your golden ticket: use it for further read-write access to that table entry, and it stays valid until the key gets deleted from the table or re-added (which is usually what you'd do to slap different actions and/or action meta-data onto the current key) β¨
Returns
0 on success, error code otherwise π
int rte_pipeline_table_entry_delete_bulk (struct rte_pipeline * p, uint32_t table_id, void ** keys, uint32_t n_keys, int * key_found, struct rte_pipeline_table_entry ** entries)
Pipeline table entry delete bulk β the group-chat equivalent of yeeting a whole batch of table entries at once, bestie π
Parameters
pβ handle to pipeline instancetable_idβ table ID (returned by previous invocation of pipeline table create)keysβ array containing table entry keysn_keysβ number of keys to deletekey_foundβ on successful invocation,key_foundfor every item in the array is set toTRUE(value different than 0) if the key was found in the table before the delete operation, and toFALSE(value 0) if notentriesβ ifentriespointer isNULL, this pointer is ignored for every entry found. Else, after successful invocation, if a specific key is found in the table and the entry points to a valid buffer, the table entry contents (as it was before the delete was performed) get copied into this buffer.
Returns
0 on success, error code otherwise πΈ
int rte_pipeline_table_stats_read (struct rte_pipeline * p, uint32_t table_id, struct rte_pipeline_table_stats * stats, int clear)
Read pipeline table stats. Obsessed with a good stat read fr fr β¨
This function reads table statistics identified by table_id of given pipeline p.
Parameters
pβ handle to pipeline instance.table_idβ port ID what stats will be returned.statsβ statistics buffer.clearβ if not 0, clear stats after reading.
Returns
0 on success, error code otherwise π
int rte_pipeline_port_in_create (struct rte_pipeline * p, struct rte_pipeline_port_in_params * params, uint32_t * port_id)
Pipeline input port create π
Parameters
pβ handle to pipeline instanceparamsβ parameters for pipeline input port creationport_idβ input port ID. Valid only within the scope of input port IDs of the current pipeline. Only returned after a successful invocation (so don't go reading it before that, bestie).
Returns
0 on success, error code otherwise π
int rte_pipeline_port_in_connect_to_table (struct rte_pipeline * p, uint32_t port_id, uint32_t table_id)
Pipeline input port connect to table β matchmaker behaviour, but for ports and tables π¦
Parameters
pβ handle to pipeline instanceport_idβ port ID (returned by previous invocation of pipeline input port create)table_idβ table ID (returned by previous invocation of pipeline table create)
Returns
0 on success, error code otherwise π
int rte_pipeline_port_in_enable (struct rte_pipeline * p, uint32_t port_id)
Pipeline input port enable β turn the tap on π
Parameters
pβ handle to pipeline instanceport_idβ port ID (returned by previous invocation of pipeline input port create)
Returns
0 on success, error code otherwise β
int rte_pipeline_port_in_disable (struct rte_pipeline * p, uint32_t port_id)
Pipeline input port disable β turn the tap off π
Parameters
pβ handle to pipeline instanceport_idβ port ID (returned by previous invocation of pipeline input port create)
Returns
0 on success, error code otherwise π
int rte_pipeline_port_in_stats_read (struct rte_pipeline * p, uint32_t port_id, struct rte_pipeline_port_in_stats * stats, int clear)
Read pipeline port in stats.
This function reads port in statistics identified by port_id of given pipeline p.
Parameters
pβ handle to pipeline instance.port_idβ port ID what stats will be returned.statsβ statistics buffer.clearβ if not 0, clear stats after reading.
Returns
0 on success, error code otherwise π§
int rte_pipeline_port_out_create (struct rte_pipeline * p, struct rte_pipeline_port_out_params * params, uint32_t * port_id)
Pipeline output port create π
Parameters
pβ handle to pipeline instanceparamsβ parameters for pipeline output port creationport_idβ output port ID. Valid only within the scope of output port IDs of the current pipeline. Only returned after a successful invocation.
Returns
0 on success, error code otherwise π
int rte_pipeline_port_out_stats_read (struct rte_pipeline * p, uint32_t port_id, struct rte_pipeline_port_out_stats * stats, int clear)
Read pipeline port out stats.
This function reads port out statistics identified by port_id of given pipeline p.
Parameters
pβ handle to pipeline instance.port_idβ port ID what stats will be returned.statsβ statistics buffer.clearβ if not 0, clear stats after reading.
Returns
0 on success, error code otherwise π
int rte_pipeline_port_out_packet_insert (struct rte_pipeline * p, uint32_t port_id, struct rte_mbuf * pkt)
Action handler packet insert to output port π€
This function can be called by any input/output port or table action handler to send a packet out through one of the pipeline output ports. This packet is generated by the action handler, i.e. this packet is not part of the burst of packets read from one of the pipeline input ports and currently processed by the pipeline (this packet is not an element of the pkts array input parameter of the action handler).
Parameters
pβ handle to pipeline instanceport_idβ output port ID (returned by previous invocation of pipeline output port create) to send the packet specified bypktpktβ new packet generated by the action handler
Returns
0 on success, error code otherwise π
int rte_pipeline_ah_packet_hijack (struct rte_pipeline * p, uint64_t pkts_mask)
Action handler packet hijack β not me stealing packets out of the pipeline's hands π
This function can be called by any input/output port or table action handler to hijack selected packets from the burst of packets read from one of the pipeline input ports and currently processed by the pipeline. The hijacked packets are removed from any further pipeline processing, with the action handler now having the full ownership for these packets. (Yes, full. All yours.)
The action handler can further send the hijacked packets out through any pipeline output port by calling the rte_pipeline_ah_port_out_packet_insert() function. The action handler can also drop these packets by calling the rte_pktmbuf_free() function, although a better alternative is provided by the action handler using the rte_pipeline_ah_packet_drop() function.
Parameters
pβ handle to pipeline instancepkts_maskβ 64-bit bitmask specifying which of the packets handed over for processing to the action handler is to be hijacked by the action handler. Whenpkts_maskbitnis set, then elementnof thepktsarray (input argument to the action handler) is hijacked.
Returns
0 on success, error code otherwise π₯
int rte_pipeline_ah_packet_drop (struct rte_pipeline * p, uint64_t pkts_mask)
Action handler packet drop ποΈ
This function is called by the pipeline action handlers (port in/out, table) to drop the packets selected using packet mask.
This function can be called by any input/output port or table action handler to drop selected packets from the burst of packets read from one of the pipeline input ports and currently processed by the pipeline. The dropped packets are removed from any further pipeline processing and the packet buffers are eventually freed to their buffer pool.
This function updates the drop statistics counters correctly, therefore the recommended approach for dropping packets by the action handlers is to call this function, as opposed to the action handler hijacking the packets first and then dropping them invisibly to the pipeline (by using the rte_pktmbuf_free() function).
Parameters
pβ handle to pipeline instancepkts_maskβ 64-bit bitmask specifying which of the packets handed over for processing to the action handler is to be dropped by the action handler. Whenpkts_maskbitnis set, then elementnof thepktsarray (input argument to the action handler) is dropped.
Returns
0 on success, error code otherwise π
Pro tip from your girl: if you're dropping, use rte_pipeline_ah_packet_drop() so the stats stay honest. Sneaky drops are giving stale counters, and we don't do that here. Periodt. π
π Author
Generated automatically by Doxygen for DPDK from the source code. (Not a human, not a bestie, just Doxygen doing its little thing β¨)
And that's a wrap on rte_pipeline.h, bestie!! π You just cleared the whole page, main character energy fr fr π This one was DPDK version 25.11.3, and if you ever need to check the date, it's stamped right there on the page next to rte_pipeline.h(3) β go off, you ate that π«Άπ
π¦ 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