7f6a3168ed
Function rte_flow_expand_rss() is used to expand a flow rule with partial pattern into several rules, to ensure all relevant packets are matched. It uses utility function rte_flow_expand_rss_item_complete(), to check if the last valid item in the flow rule pattern needs to be completed. For example the pattern "eth / ipv4 proto is 17 / end" will be completed with a "udp" item. This function returns "void" item in two cases: 1) The last item has empty spec, for example "eth / ipv4 / end". 2) The last itme has spec that can't be expanded for RSS. For example the pattern "eth / ipv4 proto is 47 / end" ends with IPv4 item that has next protocol GRE. In both cases the flow rule may be expanded, but in the second case such expansion may create rules with invalid pattern. For example "eth / ipv4 proto is 47 / udp / end". In such a case the flow rule should not be expanded. This patch updates function rte_flow_expand_rss_item_complete(). Return value RTE_FLOW_ITEM_TYPE_END is used to indicate the flow rule should not be expanded. In such a case, rte_flow_expand_rss() will return with the original flow rule only, without any expansion. Fixes: fc2dd8dd492f ("ethdev: fix expand RSS flows") Cc: stable@dpdk.org Signed-off-by: Dekel Peled <dekelp@nvidia.com> Acked-by: Xiaoyu Min <jackmin@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com>