ethdev: fix expand RSS flows
rte_flow_expand_rss expands rte_flow item list based on the RSS
types. In another word, some additional rules are added if the user
specified items are not complete enough according to the RSS type,
for example:
... pattern eth / end actions rss type tcp end ...
User only provides item eth but want to do RSS on tcp traffic.
The pattern is not complete enough to filter TCP traffic only.
This will be a problem for some HWs.
So some PMDs use rte_flow_expand_rss to expand above user provided
flow to:
... pattern eth / end actions rss types tcp
... pattern eth / ipv4 / tcp / end actions rss types tcp ...
... pattern eth / ipv6 / tcp / end actions rss types tcp ...
in order to filter TCP traffic only and do RSS correctly.
However the current expansion cannot handle pattern as below, which
provides ethertype or ip next proto instead of providing an item:
... pattern eth type is 0x86DD / end actions rss types tcp ...
rte_flow_expand_rss will expand above flow to:
... pattern eth type is 0x86DD / ipv4 / tcp end ...
which has conflicting values: 0x86DD vs. ipv4 and some HWs will refuse
to create flow.
This patch will fix above by checking the last item's spec and to
expand RSS flows correctly.
Currently only support to complete item list based on ether type or ip
next proto.
Fixes:
4ed05fcd441b ("ethdev: add flow API to expand RSS flows")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>