net/mlx5: fix next protocol RSS expansion
PATCH 1/2 net/mlx5: fix next protocol RSS expansion
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.
--- drivers/net/mlx5/mlx5_flow.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/mlx5/mlx5_flow.c +9 -0
@@ -175,6 +175,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 ;
@@ -196,6 +199,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 ;
@@ -221,6 +227,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 ;
Signature · 1 line
2.34.1
PATCH 2/2 net/mlx5: fix INET IPIP protocol type
Fix typo in INET IPIP protocol macro.
--- drivers/net/mlx5/mlx5_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow.c +1 -1
@@ -208,7 +208,7 @@ mlx5_inet_proto_to_item_type(uint8_t proto_spec, uint8_t proto_mask)case IPPROTO_TCP : type =RTE_FLOW_ITEM_TYPE_TCP ;break ; -case IPPROTO_IP : +case IPPROTO_IPIP : type =RTE_FLOW_ITEM_TYPE_IPV4 ;break ;case IPPROTO_IPV6 :
Signature · 1 line
2.34.1
Re: [PATCH 2/2] net/mlx5: fix INET IPIP protocol type
Quoted 16 lines · Gregory Etelson
Fix typo in INET IPIP protocol macro.
Fixes f3f1f576f438 ("net/mlx5: fix RSS expansion with explicit next protocol")Signed-off-by Gregory Etelson <[email protected]>Acked-by Matan Azrad <[email protected]>--- drivers/net/mlx5/mlx5_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/mlx5/mlx5_flow.c +0
-0
drivers/net/mlx5/mlx5_flow.c mlx5_inet_proto_to_item_type(uint8_t proto_spec, uint8_t proto_mask) · line 211
Quoted 5 lines
drivers/net/mlx5/mlx5_flow.c +1
-1@@ -208,7 +208,7 @@ mlx5_inet_proto_to_item_type(uint8_t proto_spec, uint8_t proto_mask)case IPPROTO_TCP : type =RTE_FLOW_ITEM_TYPE_TCP ;break ; -case IPPROTO_IP : +case IPPROTO_IPIP :
Hi Gregory, Matan,
Are you sure about this change?
In linux header (include/uapi/linux/in.h) it is defined as:IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
And IPIP tunnels as far as I can found [1]:
IPIP tunnel, just as the name suggests, is an IP over IP tunnel, defined in RFC 2003.
Since type set to 'RTE_FLOW_ITEM_TYPE_IPV4' in this case statement, I would like to double check if this is correct.
RE: [PATCH 2/2] net/mlx5: fix INET IPIP protocol type
Hello Ferruh,
::snip::
Quoted 37 lines
Quoted 1 line
Fixes f3f1f576f438 ("net/mlx5: fix RSSexpansion with explicit next protocol")
Quoted 1 line
Signed-off-by Gregory EtelsonReview
Quoted 6 lines
Acked-by Matan Azrad <[email protected]>--- drivers/net/mlx5/mlx5_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/net/mlx5/mlx5_flow.cdrivers/net/mlx5/mlx5_flow.c
Quoted 4 lines
index
0d774cfd19..efb988a9bb100644drivers/net/mlx5/mlx5_flow.c +0
-0@@ -208,7 +208,7 @@mlx5_inet_proto_to_item_type(uint8_t
proto_spec,uint8_tproto_mask)drivers/net/mlx5/mlx5_flow.c mlx5_inet_proto_to_item_type(uint8_t proto_spec, uint8_t proto_mask) · line 211
Quoted 5 lines
drivers/net/mlx5/mlx5_flow.c +1
-1case IPPROTO_TCP : type =RTE_FLOW_ITEM_TYPE_TCP ;break ; -case IPPROTO_IP : +case IPPROTO_IPIP :Hi Gregory, Matan,
Are you sure about this change?
In linux header (
include/uapi/linux/in.h) it is
defined as:IPPROTO_IPIP= 4, /* IPIP tunnels (older
KA9Q tunnels use 94) */And IPIP tunnels as far as I can found [1]:
IPIP tunnel, just as the name suggests, is an IP
over IP tunnel, defined in RFC 2003.
Quoted 5 lines
Since type set to '
RTE_FLOW_ITEM_TYPE_IPV4' in this case
statement, I would like to double check if this is correct.
That code is part of MLX5 PMD RSS expansion model.
The code returns RTE flow pattern type of the next network header. In case of IPv4 in IPv4 tunnel, next header for the outer IPv4 is also IPv4. Therefore, the code returns 'RTE_FLOW_ITEM_TYPE_IPV4'.
Regards,
Gregory
Hi,
Quoted 25 lines
-----Original Message-----
From: Gregory Etelson <[email protected]>
Sent: Tuesday, March 1, 2022 5:19 PM
To: [email protected]
Cc: Gregory Etelson <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; [email protected]; Slava Ovsiienko <[email protected]>
Subject: [PATCH 1/2] net/mlx5: fix next protocol RSS expansionRSS 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 mask0xfffftype spec 101
3. Direct - In that case flow item mask and spec configuration return
valid expansion option.
Example: eth type mask0x0ffftype spec0x0800.
Quoted 8 lines
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 <[email protected]>Acked-by Matan Azrad <[email protected]>
Changed the order of the patches,
Series applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh