From 34d3fdceae89d42fd910f46eae2ccb94899797d6 Mon Sep 17 00:00:00 2001 From: Gregory Etelson Date: Tue, 1 Mar 2022 17:18:55 +0200 Subject: [PATCH] net/mlx5: fix next protocol RSS expansion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 6ae5c238371aeb86359c5a6c1eb1330e1cc25fca ] RSS expansion scheme has 2 operational modes: default and specific. The default mode expands into all valid options for a given network layer. For example, Ethernet expands by default into VLAN, IPv4 and IPv6, L3 expands into TCP and UDP, etc. The specific mode expands according to flow item next protocol configuration provided by the item spec and mask parameters. There are 3 outcomes for the specific expansion: 1. Back to default – that is the case when result of (spec & mask) allows all possibilities. For example: eth type mask 0 type spec 0 2. No results – in that case item configuration has no valid expansion. For example: eth type mask 0xffff type spec 101 3. Direct - In that case flow item mask and spec configuration return valid expansion option. Example: eth type mask 0x0fff type spec 0x0800. Current PMD expands flow items with explicit spec and mask configuration into the Direct(3) or No results (2). Default expansions were handled as No results. Fixes: f3f1f576f438 ("net/mlx5: fix RSS expansion with explicit next protocol") Signed-off-by: Gregory Etelson Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 24c2665c53..56db0217b9 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -174,6 +174,9 @@ mlx5_nsh_proto_to_item_type(uint8_t proto_spec, uint8_t proto_mask) enum rte_flow_item_type type; switch (proto_mask & proto_spec) { + case 0: + type = RTE_FLOW_ITEM_TYPE_VOID; + break; case RTE_VXLAN_GPE_TYPE_IPV4: type = RTE_FLOW_ITEM_TYPE_IPV4; break; @@ -195,6 +198,9 @@ mlx5_inet_proto_to_item_type(uint8_t proto_spec, uint8_t proto_mask) enum rte_flow_item_type type; switch (proto_mask & proto_spec) { + case 0: + type = RTE_FLOW_ITEM_TYPE_VOID; + break; case IPPROTO_UDP: type = RTE_FLOW_ITEM_TYPE_UDP; break; @@ -220,6 +226,9 @@ mlx5_ethertype_to_item_type(rte_be16_t type_spec, enum rte_flow_item_type type; switch (rte_be_to_cpu_16(type_spec & type_mask)) { + case 0: + type = RTE_FLOW_ITEM_TYPE_VOID; + break; case RTE_ETHER_TYPE_TEB: type = is_tunnel ? RTE_FLOW_ITEM_TYPE_ETH : RTE_FLOW_ITEM_TYPE_END;