patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@mellanox.com>
To: Dekel Peled <dekelp@mellanox.com>,
	Matan Azrad <matan@mellanox.com>,
	Slava Ovsiienko <viacheslavo@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix CVLAN tag set in IP item translation
Date: Tue, 17 Mar 2020 12:42:04 +0000	[thread overview]
Message-ID: <AM0PR05MB6707A962603E42FCD63C7547C2F60@AM0PR05MB6707.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <259ecb84468740008ea1ecb5a407ad0bdb788d7d.1584348950.git.dekelp@mellanox.com>

Hi,

> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Monday, March 16, 2020 10:58 AM
> To: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Raslan Darawsheh <rasland@mellanox.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix CVLAN tag set in IP item translation
> 
> Previous fix added, at the end of functions flow_dv_translate_item_ipv4()
> and flow_dv_translate_item_ipv6(), the setting of cvlan_tag mask.
> In the case of unspecified item (item->spec == null) these functions
> return, and the new code section is not reached.
> 
> This patch moves the setting of cvlan_tag mask to be done before the
> check of item->spec, to make sure it is always executed.
> 
> Fixes: 797329d6c4a1 ("net/mlx5: fix match on ethertype and CVLAN tag")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 26 ++++++++++++++------------
>  1 file changed, 14 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index e2d6690..2090631 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -5464,6 +5464,13 @@ struct field_modify_info modify_tcp[] = {
>  	else
>  		MLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version,
> 0x4);
>  	MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_version, 4);
> +	/*
> +	 * On outer header (which must contains L2), or inner header with L2,
> +	 * set cvlan_tag mask bit to mark this packet as untagged.
> +	 * This should be done even if item->spec is empty.
> +	 */
> +	if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2)
> +		MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag,
> 1);
>  	if (!ipv4_v)
>  		return;
>  	if (!ipv4_m)
> @@ -5495,12 +5502,6 @@ struct field_modify_info modify_tcp[] = {
>  		 ipv4_m->hdr.time_to_live);
>  	MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_ttl_hoplimit,
>  		 ipv4_v->hdr.time_to_live & ipv4_m->hdr.time_to_live);
> -	/*
> -	 * On outer header (which must contains L2), or inner header with L2,
> -	 * set cvlan_tag mask bit to mark this packet as untagged.
> -	 */
> -	if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2)
> -		MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag,
> 1);
>  }
> 
>  /**
> @@ -5565,6 +5566,13 @@ struct field_modify_info modify_tcp[] = {
>  	else
>  		MLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version,
> 0x6);
>  	MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_version, 6);
> +	/*
> +	 * On outer header (which must contains L2), or inner header with L2,
> +	 * set cvlan_tag mask bit to mark this packet as untagged.
> +	 * This should be done even if item->spec is empty.
> +	 */
> +	if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2)
> +		MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag,
> 1);
>  	if (!ipv6_v)
>  		return;
>  	if (!ipv6_m)
> @@ -5613,12 +5621,6 @@ struct field_modify_info modify_tcp[] = {
>  		 ipv6_m->hdr.hop_limits);
>  	MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_ttl_hoplimit,
>  		 ipv6_v->hdr.hop_limits & ipv6_m->hdr.hop_limits);
> -	/*
> -	 * On outer header (which must contains L2), or inner header with L2,
> -	 * set cvlan_tag mask bit to mark this packet as untagged.
> -	 */
> -	if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2)
> -		MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag,
> 1);
>  }
> 
>  /**
> --
> 1.8.3.1


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

      reply	other threads:[~2020-03-17 12:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16  8:57 Dekel Peled
2020-03-17 12:42 ` 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=AM0PR05MB6707A962603E42FCD63C7547C2F60@AM0PR05MB6707.eurprd05.prod.outlook.com \
    --to=rasland@mellanox.com \
    --cc=dekelp@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@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).