patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/2] net/mlx5: fix next protocol RSS expansion
@ 2022-03-01 15:18 Gregory Etelson
  2022-03-01 15:18 ` [PATCH 2/2] net/mlx5: fix INET IPIP protocol type Gregory Etelson
  2022-03-02 16:41 ` [PATCH 1/2] net/mlx5: fix next protocol RSS expansion Raslan Darawsheh
  0 siblings, 2 replies; 5+ messages in thread
From: Gregory Etelson @ 2022-03-01 15:18 UTC (permalink / raw)
  To: dev; +Cc: getelson, matan, rasland, stable, Viacheslav Ovsiienko

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.

Cc: stable@dpdk.org
Fixes: f3f1f576f438 ("net/mlx5: fix RSS expansion with explicit next protocol")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 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 a690e2d337..0d774cfd19 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -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;
-- 
2.34.1


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

* [PATCH 2/2] net/mlx5: fix INET IPIP protocol type
  2022-03-01 15:18 [PATCH 1/2] net/mlx5: fix next protocol RSS expansion Gregory Etelson
@ 2022-03-01 15:18 ` Gregory Etelson
  2022-03-03 16:07   ` Ferruh Yigit
  2022-03-02 16:41 ` [PATCH 1/2] net/mlx5: fix next protocol RSS expansion Raslan Darawsheh
  1 sibling, 1 reply; 5+ messages in thread
From: Gregory Etelson @ 2022-03-01 15:18 UTC (permalink / raw)
  To: dev; +Cc: getelson, matan, rasland, stable, Viacheslav Ovsiienko

Fix typo in INET IPIP protocol macro.

Cc: stable@dpdk.org

Fixes: f3f1f576f438 ("net/mlx5: fix RSS expansion with explicit next protocol")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 0d774cfd19..efb988a9bb 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -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:
-- 
2.34.1


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

* RE: [PATCH 1/2] net/mlx5: fix next protocol RSS expansion
  2022-03-01 15:18 [PATCH 1/2] net/mlx5: fix next protocol RSS expansion Gregory Etelson
  2022-03-01 15:18 ` [PATCH 2/2] net/mlx5: fix INET IPIP protocol type Gregory Etelson
@ 2022-03-02 16:41 ` Raslan Darawsheh
  1 sibling, 0 replies; 5+ messages in thread
From: Raslan Darawsheh @ 2022-03-02 16:41 UTC (permalink / raw)
  To: Gregory Etelson, dev; +Cc: Matan Azrad, stable, Slava Ovsiienko

Hi,

> -----Original Message-----
> From: Gregory Etelson <getelson@nvidia.com>
> Sent: Tuesday, March 1, 2022 5:19 PM
> To: dev@dpdk.org
> Cc: Gregory Etelson <getelson@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org; Slava Ovsiienko <viacheslavo@nvidia.com>
> Subject: [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.
> 
> Cc: stable@dpdk.org
> Fixes: f3f1f576f438 ("net/mlx5: fix RSS expansion with explicit next protocol")
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Changed the order of the patches, 
Series applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

* Re: [PATCH 2/2] net/mlx5: fix INET IPIP protocol type
  2022-03-01 15:18 ` [PATCH 2/2] net/mlx5: fix INET IPIP protocol type Gregory Etelson
@ 2022-03-03 16:07   ` Ferruh Yigit
  2022-03-07  6:04     ` Gregory Etelson
  0 siblings, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2022-03-03 16:07 UTC (permalink / raw)
  To: Gregory Etelson, dev
  Cc: matan, rasland, stable, Viacheslav Ovsiienko, Stephen Hemminger

On 3/1/2022 3:18 PM, Gregory Etelson wrote:
> Fix typo in INET IPIP protocol macro.
> 
> Cc: stable@dpdk.org
> 
> Fixes: f3f1f576f438 ("net/mlx5: fix RSS expansion with explicit next protocol")
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>   drivers/net/mlx5/mlx5_flow.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index 0d774cfd19..efb988a9bb 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -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.



[1]
https://developers.redhat.com/blog/2019/05/17/an-introduction-to-linux-virtual-interfaces-tunnels#ipip_tunnel

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

* RE: [PATCH 2/2] net/mlx5: fix INET IPIP protocol type
  2022-03-03 16:07   ` Ferruh Yigit
@ 2022-03-07  6:04     ` Gregory Etelson
  0 siblings, 0 replies; 5+ messages in thread
From: Gregory Etelson @ 2022-03-07  6:04 UTC (permalink / raw)
  To: Ferruh Yigit, dev
  Cc: Matan Azrad, Raslan Darawsheh, stable, Slava Ovsiienko,
	Stephen Hemminger

Hello Ferruh,

::snip::

> > Fixes: f3f1f576f438 ("net/mlx5: fix RSS
> expansion with explicit next protocol")
> > Signed-off-by: Gregory Etelson
> <getelson@nvidia.com>
> > Acked-by: Matan Azrad <matan@nvidia.com>
> > ---
> >   drivers/net/mlx5/mlx5_flow.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_flow.c
> b/drivers/net/mlx5/mlx5_flow.c
> > index 0d774cfd19..efb988a9bb 100644
> > --- a/drivers/net/mlx5/mlx5_flow.c
> > +++ b/drivers/net/mlx5/mlx5_flow.c
> > @@ -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.
> 

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



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

end of thread, other threads:[~2022-03-07  6:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 15:18 [PATCH 1/2] net/mlx5: fix next protocol RSS expansion Gregory Etelson
2022-03-01 15:18 ` [PATCH 2/2] net/mlx5: fix INET IPIP protocol type Gregory Etelson
2022-03-03 16:07   ` Ferruh Yigit
2022-03-07  6:04     ` Gregory Etelson
2022-03-02 16:41 ` [PATCH 1/2] net/mlx5: fix next protocol RSS expansion Raslan Darawsheh

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).