Multi-Pattern HWS Table Actions
Multi-Pattern HWS Table Actions optimize PMD resource usage for the following flow actions in non-shared configuration:
REFORMAT (ENCAP / DECAP)
MODIFY_ACTION
The optimization is fully utilized when several action templates with supported flow actions are grouped into a single template table. In this case, the PMD allocates a single action object instead of a dedicated action object for each template.
Example:
action_template id 1
raw_encap size X1 / jump / end
action_template id 2
raw_encap size X2 / jump / end
…
action_template id N raw_encap size Xn / jump / end
Not optimized:

Optimized:

This optimization can be applied to non-shared actions only. Shared reformat action has masked data parameter.
Modify action has shared configuration in the following cases:
MODIFY_ACTION source field ID is RTE_FLOW_FIELD_VALUE and all elements of source immediate value are masked.
MODIFY_ACTION source field ID is RTE_FLOW_FIELD_POINTER and source memory address is masked.
All other source field types are always masked.
The code below demonstrates how PMD determines if the modify action is shared:
static
__rte_always_inline bool
flow_hw_action_modify_field_is_shared(const
struct rte_flow_action *action, const
struct rte_flow_action *mask)
{
const
struct rte_flow_action_modify_field *v = action->conf;
const
struct rte_flow_action_modify_field *m = mask->conf;
if
(v->src.field == RTE_FLOW_FIELD_VALUE) {
uint32_t j;
for
(j = 0
; j < RTE_DIM(m->src.value); ++j) {
/*
* Immediate value is considered to be masked (and thus shared by all flow rules),
* if mask is non-zero. Partial mask over immediate value is not allowed.
*/
if
(m->src.value[j])
return
true
;
}
return
false
;
}
if
(v->src.field == RTE_FLOW_FIELD_POINTER)
return
m->src.pvalue != NULL;
/* Source field types other than VALUE and POINTER are always shared. */
return
true
;
}
This feature enhances ENCAP action validation for the size parameter. Application must supply a masked ENCAP size parameter. ENCAP size parameter is considered masked if its mask value is not 0.