DPDK  22.07.0
Data Fields
rte_flow_attr Struct Reference

#include <rte_flow.h>

Data Fields

uint32_t group
 
uint32_t priority
 
uint32_t ingress:1
 
uint32_t egress:1
 
uint32_t transfer:1
 
uint32_t reserved:29
 

Detailed Description

Flow rule attributes.

Priorities are set on a per rule based within groups.

Lower values denote higher priority, the highest priority for a flow rule is 0, so that a flow that matches for than one rule, the rule with the lowest priority value will always be matched.

Although optional, applications are encouraged to group similar rules as much as possible to fully take advantage of hardware capabilities (e.g. optimized matching) and work around limitations (e.g. a single pattern type possibly allowed in a given group). Applications should be aware that groups are not linked by default, and that they must be explicitly linked by the application using the JUMP action.

Priority levels are arbitrary and up to the application, they do not need to be contiguous nor start from 0, however the maximum number varies between devices and may be affected by existing flow rules.

If a packet is matched by several rules of a given group for a given priority level, the outcome is undefined. It can take any path, may be duplicated or even cause unrecoverable errors.

Note that support for more than a single group and priority level is not guaranteed.

At vNIC / ethdev level, flow rules can apply to inbound and / or outbound traffic (ingress / egress), with respect to the vNIC / ethdev in question. At embedded switch level, flow rules apply to all traffic seen by it unless fitting meta items are used to set concrete traffic source(s).

Several pattern items and actions are valid and can be used in both directions. Those valid for only one direction are described as such.

At least one direction must be specified.

Specifying both directions at once for a given rule is not recommended but may be valid in a few cases.

Examples:
examples/flow_classify/flow_classify.c, examples/flow_filtering/flow_blocks.c, examples/ipsec-secgw/flow.c, and examples/ipsec-secgw/ipsec-secgw.c.

Definition at line 86 of file rte_flow.h.

Field Documentation

◆ group

uint32_t group

Priority group.

Definition at line 87 of file rte_flow.h.

◆ priority

uint32_t priority

Rule priority level within group.

Examples:
examples/flow_classify/flow_classify.c.

Definition at line 88 of file rte_flow.h.

◆ ingress

uint32_t ingress

The rule in question applies to ingress traffic (non-"transfer").

Deprecated:
It has been possible to combine this attribute with "transfer". Doing so has been assumed to restrict the scope of matching to traffic going from within the embedded switch toward the ethdev the flow rule being created through. This behaviour is deprecated. During the transition period, one may still rely on it, but PMDs and applications are encouraged to gradually move away from this approach.
Examples:
examples/flow_classify/flow_classify.c, examples/ipsec-secgw/flow.c, and examples/ipsec-secgw/ipsec-secgw.c.

Definition at line 101 of file rte_flow.h.

◆ egress

uint32_t egress

The rule in question applies to egress traffic (non-"transfer").

Deprecated:
It has been possible to combine this attribute with "transfer". Doing so has been assumed to restrict the scope of matching to traffic sent by the application by virtue of the ethdev the flow rule being created through. This behaviour is now deprecated. During the transition period, one may still rely on it, but PMDs and applications are encouraged to gradually move away from this approach.
Examples:
examples/ipsec-secgw/flow.c.

Definition at line 114 of file rte_flow.h.

◆ transfer

uint32_t transfer

Instead of simply matching the properties of traffic as it would appear on a given DPDK port ID, enabling this attribute transfers a flow rule to the lowest possible level of any device endpoints found in the pattern.

When supported, this effectively enables an application to re-route traffic not necessarily intended for it (e.g. coming from or addressed to different physical ports, VFs or applications) at the device level.

The application should match traffic originating from precise locations. See items PORT_REPRESENTOR and REPRESENTED_PORT.

Managing "transfer" flows requires that the user communicate them through a suitable port.

See also
rte_flow_pick_transfer_proxy().

Definition at line 132 of file rte_flow.h.

◆ reserved

uint32_t reserved

Reserved, must be zero.

Definition at line 133 of file rte_flow.h.


The documentation for this struct was generated from the following file: