DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix RSS expansion compilation
@ 2022-01-14 15:16 Gregory Etelson
  2022-01-14 19:16 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory Etelson @ 2022-01-14 15:16 UTC (permalink / raw)
  To: dev; +Cc: getelson, rasland, Viacheslav Ovsiienko, Matan Azrad

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@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/mlx5: fix RSS expansion compilation
  2022-01-14 15:16 [PATCH] net/mlx5: fix RSS expansion compilation Gregory Etelson
@ 2022-01-14 19:16 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2022-01-14 19:16 UTC (permalink / raw)
  To: Gregory Etelson, dev; +Cc: rasland, Viacheslav Ovsiienko, Matan Azrad

On 1/14/2022 3:16 PM, Gregory Etelson wrote:
> 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")
> 

Squashed into relevant commit in next-net, thanks.

Please double check the code in next-net.

> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

<...>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-14 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-14 15:16 [PATCH] net/mlx5: fix RSS expansion compilation Gregory Etelson
2022-01-14 19:16 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).