Hint to the Driver on the Number of Flow Rules
This capability is available using the new field "hint_num_of_rules_log" that was added to the "struct rte_flow_attr". Once the application sets it to a non-zero logarithm, it hints to the drivers about the expected number of flow rules in a group with the similar patterns. The field should be set only for the first flow rule, and it will help increasing the insertion rate for the following rules. Notice, this will also introduce some latency for the flow rule insertion with this attribute set.
The following is an example of the 1st flow rule to pass the hint to the driver about the expected rules number.
// expecting 2**22 = 4M rules in this group
const struct rte_flow_attr attr = {
.ingress = 1,
.group = 3,
.priority =3,
.hint_num_of_rules_log = 22,,
};
The following is an example of the following rules with the similar patterns in the same group.
// By default, hint_num_of_rules_log is 0.
const struct rte_flow_attr attr = {
.ingress = 1,
.group = 3,
.priority =3,
};