[2/2] net/mlx5: fix INET IPIP protocol type

Message ID 20220301151856.17341-2-getelson@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series [1/2] net/mlx5: fix next protocol RSS expansion |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Gregory Etelson March 1, 2022, 3:18 p.m. UTC
  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(-)
  

Comments

Ferruh Yigit March 3, 2022, 4:07 p.m. UTC | #1
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
  
Gregory Etelson March 7, 2022, 6:04 a.m. UTC | #2
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
  

Patch

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: