---
name: "RTE_PIPELINE_ACTION_DROP"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_pipeline.h"
---

# RTE\_PIPELINE\_ACTION\_DROP(3)

Part of [rte\_pipeline.h(3)](/rte_pipeline.h/3.md).

## NAME

rte\_pipeline.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_port.h>`\
 `#include <rte_table.h>`\
 `#include <rte_common.h>`\

### Data Structures

struct **rte\_pipeline\_params**\
 struct **rte\_pipeline\_port\_in\_stats**\
 struct **rte\_pipeline\_port\_out\_stats**\
 struct **rte\_pipeline\_table\_stats**\
 struct **rte\_pipeline\_table\_entry**\
 struct **rte\_pipeline\_table\_params**\
 struct **rte\_pipeline\_port\_in\_params**\
 struct **rte\_pipeline\_port\_out\_params**\

### Macros

\#define **RTE\_PIPELINE\_TABLE\_MAX**   64\
 \#define **RTE\_PIPELINE\_PORT\_IN\_MAX**   64\
 \#define **RTE\_PIPELINE\_PORT\_OUT\_MAX**   64\

### Typedefs

**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

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

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

This tool is part of the DPDK Packet Framework tool suite and provides a standard methodology (logically similar to OpenFlow) for rapid development of complex packet processing pipelines out of ports, tables and actions.

**Basic operation.** A pipeline is constructed by connecting its input ports to its output ports through a chain of lookup tables. As result of lookup operation into the current table, one of the table entries (or the default table entry, in case of lookup miss) is identified to provide the actions to be executed on the current packet and the associated action meta-data. The behavior of user actions is defined through the configurable table action handler, while the reserved actions define the next hop for the current packet (either another table, an output port or packet drop) and are handled transparently by the framework.

**Initialization and run-time flows.** Once all the pipeline elements (input ports, tables, output ports) have been created, input ports connected to tables, table action handlers configured, tables populated with the initial set of entries (actions and action meta-data) and input ports enabled, the pipeline runs automatically, pushing packets from input ports to tables and output ports. At each table, the identified user actions are being executed, resulting in action meta-data (stored in the table entry) and packet meta-data (stored with the packet descriptor) being updated. The pipeline tables can have further updates and input ports can be disabled or enabled later on as required.

**Multi-core scaling.** Typically, each CPU core will run its own pipeline instance. Complex application-level pipelines can be implemented by interconnecting multiple CPU core-level pipelines in tree-like topologies, as the same port devices (e.g. SW rings) can serve as output ports for the pipeline running on CPU core A, as well as input ports for the pipeline running on CPU core B. This approach enables the 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.** It is possible to 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.

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.

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**.

## Typedef Documentation

### 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

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 instance \
 *pkts* Burst of input packets specified as array of up to 64 pointers to struct **rte\_mbuf** \
 *pkts\_mask* 64-bit bitmask specifying which packets in the input burst are valid. When pkts\_mask bit n is set, then element n of pkts array is pointing to a valid packet and element n of entries array is pointing to a valid table entry associated with the packet, with the association typically done by the table lookup operation. Otherwise, element n of pkts array and element n of entries array will not be accessed. \
 *entries* Set of table entries specified as array of up to 64 pointers to struct **rte\_pipeline\_table\_entry** \
 *arg* 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**.

### 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 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 instance \
 *pkts* Burst of input packets specified as array of up to 64 pointers to struct **rte\_mbuf** \
 *pkts\_mask* 64-bit bitmask specifying which packets in the input burst are valid. When pkts\_mask bit n is set, then element n of pkts array is pointing to a valid packet. Otherwise, element n of pkts array will not be accessed. \
 *entry* Single table entry associated with all the valid packets from the input burst, specified as pointer to struct **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**.

### 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

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 instance \
 *pkts* Burst of input packets specified as array of up to 64 pointers to struct **rte\_mbuf** \
 *n* Number of packets in the input burst. This parameter specifies that elements 0 to (n-1) of pkts array 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**.

### 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

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 instance \
 *pkts* Burst of input packets specified as array of up to 64 pointers to struct **rte\_mbuf** \
 *pkts\_mask* 64-bit bitmask specifying which packets in the input burst are valid. When pkts\_mask bit n is set, then element n of pkts array is pointing to a valid packet. Otherwise, element n of pkts array 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

**Enumerator**

- *RTE\_PIPELINE\_ACTION\_DROP*

  *Drop the packet*

- *RTE\_PIPELINE\_ACTION\_PORT*

  *Send packet to output port*

- *RTE\_PIPELINE\_ACTION\_PORT\_META*

  *Send packet to output port read from packet meta-data*

- *RTE\_PIPELINE\_ACTION\_TABLE*

  *Send packet to table*

- *RTE\_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*

**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*

**Parameters**

*p Handle to pipeline instance*

**Returns**

*0 on success, error code otherwise*

### int rte\_pipeline\_check (struct rte\_pipeline \* p)

*Pipeline consistency check*

**Parameters**

*p Handle to pipeline instance*

**Returns**

*0 on success, error code otherwise*

### int rte\_pipeline\_run (struct rte\_pipeline \* p)

*Pipeline run*

**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*

**Parameters**

*p Handle to pipeline instance* \
 *params Parameters for pipeline table creation* \
 *table\_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 instance* \
 *table\_id Table ID (returned by previous invocation of pipeline table create)* \
 *default\_entry New contents for the table default entry* \
 *default\_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 'Drop* *the packet' with meta-data cleared (i.e. set to all-zeros).*

**Parameters**

*p Handle to pipeline instance* \
 *table\_id Table ID (returned by previous invocation of pipeline table create)* \
 *entry On successful invocation, when entry points 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 instance* \
 *table\_id Table ID (returned by previous invocation of pipeline table create)* \
 *key Table entry key* \
 *entry New contents for the table entry identified by key* \
 *key\_found On successful invocation, set to TRUE (value different than 0) if key was already present in the table before the add operation and to FALSE (value 0) if not* \
 *entry\_ptr On successful invocation, pointer to the table entry associated with key. 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*

**Parameters**

*p Handle to pipeline instance* \
 *table\_id Table ID (returned by previous invocation of pipeline table create)* \
 *key Table entry key* \
 *key\_found On successful invocation, set to TRUE (value different than 0) if key was found in the table before the delete operation and to FALSE (value 0) if not* \
 *entry On successful invocation, when key is found in the table and entry points 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*

**Parameters**

*p Handle to pipeline instance* \
 *table\_id Table ID (returned by previous invocation of pipeline table create)* \
 *keys Array containing table entry keys* \
 *entries Array containing new contents for every table entry identified by key* \
 *n\_keys Number of keys to add* \
 *key\_found On successful invocation, key\_found for every item in the array is set to TRUE (value different than 0) if key was already present in the table before the add operation and to FALSE (value 0) if not* \
 *entries\_ptr On successful invocation, array \*entries\_ptr stores pointer to every table entry associated with key. 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\_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*

**Parameters**

*p Handle to pipeline instance* \
 *table\_id Table ID (returned by previous invocation of pipeline table create)* \
 *keys Array containing table entry keys* \
 *n\_keys Number of keys to delete* \
 *key\_found On successful invocation, key\_found for every item in the array is set to TRUE (value different than 0) if key was found in the table before the delete operation and to FALSE (value 0) if not* \
 *entries If entries pointer is NULL, this pointer is ignored for every entry found. Else, after successful invocation, if specific key is found in the table and entry points 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\_stats\_read (struct rte\_pipeline \* p, uint32\_t table\_id, struct rte\_pipeline\_table\_stats \* stats, int clear)

*Read pipeline table stats.*

*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 instance* \
 *params Parameters for pipeline input port creation* \
 *port\_id Input port ID. Valid only within the scope of input port IDs of the current pipeline. Only returned after a successful invocation.*

**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*

**Parameters**

*p Handle to pipeline instance* \
 *port\_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*

**Parameters**

*p Handle to pipeline instance* \
 *port\_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*

**Parameters**

*p Handle to pipeline instance* \
 *port\_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 instance* \
 *params Parameters for pipeline output port creation* \
 *port\_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 instance* \
 *port\_id Output port ID (returned by previous invocation of pipeline output port create) to send the packet specified by pkt* \
 *pkt 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*

*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.*

*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 instance* \
 *pkts\_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. When pkts\_mask bit n is set, then element n of the pkts array (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 instance* \
 *pkts\_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. When pkts\_mask bit n is set, then element n of the pkts array (input argument to the action handler) is dropped.*

**Returns**

*0 on success, error code otherwise*

## Author

*Generated automatically by Doxygen for DPDK from the source code.*
