Enlarging the Maximal Flow Priority Value
Currently, the maximal flow priority in non-root table to the user is 4. This value is insufficient for the user to perform certain flow match by priority such as LPM. To overcome such limitation, we enlarged the maximal flow priority value. Now the internal priority is 16 bits, where the user can use priorities from 0 - 21843.
These priorities are only used for ingress or egress flow groups greater than 0 and for any transfer flow group.
Users can use priorities from 0 – 21843, if exceed this range, an error will output, for example:
testpmd> flow create 0
ingress pattern eth / end actions jump group 1
/ count / end
Flow rule #0
created
testpmd> flow create 0
group 1
ingress priority 21843
ingress pattern eth / ipv4 dst is 11.11
.11.11
dst mask 255.255
.255.255
/ end actions mark id 5
/ queue index 0
/ end
Flow rule #1
created
testpmd> flow create 0
group 1
ingress priority 21842
ingress pattern dst mask 255.255
.255.0
/ end actions mark id 4
/ queue index 0
/ end
Flow rule #2
created
testpmd>
struct rte_flow_attr attr;
struct rte_flow_error error;
struct rte_flow_item pattern[MAX_PATTERN_NUM];
struct rte_flow_action action[MAX_ACTION_NUM];
struct rte_flow_action_queue queue = { .index = 4
};
memset(&attr, 0
, sizeof(struct rte_flow_attr));
attr.ingress = 1
;
attr.group = 1
;
attr.priority = 21843
;
pattern[0
].type = RTE_FLOW_ITEM_TYPE_ETH;
pattern[1
].type = RTE_FLOW_ITEM_TYPE_END;
action[0
].type = RTE_FLOW_ACTION_TYPE_QUEUE;
action[0
].conf = &queue;
action[1
].type = RTE_FLOW_ACTION_TYPE_END;
res = rte_flow_validate(port_id, &attr, pattern, action, &error);
if
(!res)
flow = rte_flow_create(port_id, &attr, pattern, action, &error);
return
flow;