patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@mellanox.com>
To: Suanming Mou <suanmingm@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Dekel Peled <dekelp@mellanox.com>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] net/mlx5: fix incorrect L3/L4 layer chosen	with tunnel
Date: Sun, 24 Nov 2019 09:15:17 +0000	[thread overview]
Message-ID: <DB3PR0502MB396434FB0DC2B280925A1EFEC24B0@DB3PR0502MB3964.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <1574338170-167657-1-git-send-email-suanmingm@mellanox.com>

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Suanming Mou
> Sent: Thursday, November 21, 2019 2:10 PM
> To: dev@dpdk.org
> Cc: Dekel Peled <dekelp@mellanox.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix incorrect L3/L4 layer chosen
> with tunnel
> 
> For tunnel mode, there maybe two L3/L4 layer match pattern items,
> the inner layer follows the outer layer as the latter layer item,
> the TTL and port modify actions should handle the outermost layer.
> 
> Current the outer and inner L3/L4 layers are both regared as the
> outer layer in flow_dv_attr_init(), it caueses actions may use the
> incorrect latter inner protocal for header modifier.
> 
> Check former L3/L4 outer layer existence avoid set the incorrect inner
> layer to the flow attr.
> 
> Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")
> Cc: dekelp@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
> ---
> 
> v2:
> * Add L4 layer check.
> 
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index c402a8d..688291f 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -73,6 +73,9 @@
>  /**
>   * Initialize flow attributes structure according to flow items' types.
>   *
> + * flow_dv_validate() avoids multiple L3/L4 layers cases other than tunnel
> + * mode. For tunnel mode, the items to be modified are the outermost
> ones.
> + *
>   * @param[in] item
>   *   Pointer to item specification.
>   * @param[out] attr
> @@ -84,16 +87,20 @@
>  	for (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
>  		switch (item->type) {
>  		case RTE_FLOW_ITEM_TYPE_IPV4:
> -			attr->ipv4 = 1;
> +			if (!attr->ipv6)
> +				attr->ipv4 = 1;
>  			break;
>  		case RTE_FLOW_ITEM_TYPE_IPV6:
> -			attr->ipv6 = 1;
> +			if (!attr->ipv4)
> +				attr->ipv6 = 1;
>  			break;
>  		case RTE_FLOW_ITEM_TYPE_UDP:
> -			attr->udp = 1;
> +			if (!attr->tcp)
> +				attr->udp = 1;
>  			break;
>  		case RTE_FLOW_ITEM_TYPE_TCP:
> -			attr->tcp = 1;
> +			if (!attr->udp)
> +				attr->tcp = 1;
>  			break;
>  		default:
>  			break;
> --
> 1.8.3.1


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

      parent reply	other threads:[~2019-11-24  9:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21  3:31 [dpdk-stable] [PATCH] net/mlx5: fix incorrect L3 layer chosen in TTL action Suanming Mou
2019-11-21  7:39 ` Matan Azrad
2019-11-21  9:41   ` Suanming Mou
2019-11-21 12:09 ` [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect L3/L4 layer chosen with tunnel Suanming Mou
2019-11-22  1:29   ` [dpdk-stable] [dpdk-dev] " Suanming Mou
2019-11-24  7:05     ` Matan Azrad
2019-11-24  9:15   ` Raslan Darawsheh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB3PR0502MB396434FB0DC2B280925A1EFEC24B0@DB3PR0502MB3964.eurprd05.prod.outlook.com \
    --to=rasland@mellanox.com \
    --cc=dekelp@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=suanmingm@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).