API: Destroying a Flow Rule

Link-Inline™ Software User Guide

Platform
Napatech SmartNIC
Content Type
User Guide
Capture Software Version
Link-Inline™ Software 3.2

It is important to always destroy any flow rules that are no longer needed, in order to free up resources in the SmartNIC and avoid any potential issues with future flow rule creations or deletions. Use this DPDK API example to destroy a flow rule.

Destroying a flow rule

The following DPDK API example shows how to destroy a flow rule that was previously created using the rte_flow_create function.
/* Destroy flow */
struct rte_flow_error error;
if (rte_flow_destroy(PORT_ID, flow, struct rte_flow_error *error)) {
  /* Error handling */
}

The rte_flow_destroy function takes the same arguments as rte_flow_create: the port ID, a pointer to the flow rule to be destroyed, and a pointer to a structure that will hold error information in case of failure. If the flow rule is successfully destroyed, the function returns 0. If an error occurs, it returns a negative value, and the error information is stored in the rte_flow_error structure that was passed as a pointer to the function.