[PATCH] net/mlx5: fix RSS expansion compilation
Gregory Etelson
getelson at nvidia.com
Fri Jan 14 16:16:06 CET 2022
For each item in flow rule pattern that can be expanded, RSS expansion
scheme returns ether specific next item flow item type or
RTE_FLOW_ITEM_TYPE_VOID or RTE_FLOW_ITEM_TYPE_END.
RTE_FLOW_ITEM_TYPE_END means that expansion has completed.
RTE_FLOW_ITEM_TYPE_VOID means that next flow item was not located yet
and the procedure will continue.
Current expansion scheme assigns RTE_FLOW_ITEM_TYPE_END for L2, L3 and
L4 rule items that set next protocol value to 0 in flow item mask.
The correct value in that case is RTE_FLOW_ITEM_TYPE_VOID.
Fixes: 342a22ef3928 ("net/mlx5: fix RSS expansion with explicit next protocol")
Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
drivers/net/mlx5/mlx5_flow.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 4e2ff16e30..e067087272 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -261,18 +261,26 @@ mlx5_flow_expand_rss_item_complete(const struct rte_flow_item *item)
switch (item->type) {
case RTE_FLOW_ITEM_TYPE_ETH:
MLX5_XSET_ITEM_MASK_SPEC(eth, type);
+ if (!mask)
+ return RTE_FLOW_ITEM_TYPE_VOID;
ret = mlx5_ethertype_to_item_type(spec, mask, false);
break;
case RTE_FLOW_ITEM_TYPE_VLAN:
MLX5_XSET_ITEM_MASK_SPEC(vlan, inner_type);
+ if (!mask)
+ return RTE_FLOW_ITEM_TYPE_VOID;
ret = mlx5_ethertype_to_item_type(spec, mask, false);
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
MLX5_XSET_ITEM_MASK_SPEC(ipv4, hdr.next_proto_id);
+ if (!mask)
+ return RTE_FLOW_ITEM_TYPE_VOID;
ret = mlx5_inet_proto_to_item_type(spec, mask);
break;
case RTE_FLOW_ITEM_TYPE_IPV6:
MLX5_XSET_ITEM_MASK_SPEC(ipv6, hdr.proto);
+ if (!mask)
+ return RTE_FLOW_ITEM_TYPE_VOID;
ret = mlx5_inet_proto_to_item_type(spec, mask);
break;
case RTE_FLOW_ITEM_TYPE_GENEVE:
--
2.34.1
More information about the dev
mailing list