DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jack Min <jackmin@mellanox.com>
To: Dekel Peled <dekelp@mellanox.com>
Cc: Yongseok Koh <yskoh@mellanox.com>,
	Slava Ovsiienko <viacheslavo@mellanox.com>,
	Shahaf Shuler <shahafs@mellanox.com>,
	Ori Kam <orika@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix setting of item flags bitmap
Date: Fri, 19 Jul 2019 05:35:09 +0000	[thread overview]
Message-ID: <20190719053501.bypa4agfllmhpbeu@mellanox.com> (raw)
In-Reply-To: <17e97355b175364266eef4eb3ca959c4688f9a36.1563478206.git.dekelp@mellanox.com>

On Thu, 19-07-18, 22:42, Dekel Peled wrote:
> In functions flow_dv_translate() and  flow_dv_validate(), the flow
> items are scanned and each item is marked in item_flags bitmap.
> The code handling some of the items was ported from another project,
> where items are marked in a slightley different manner.
> 
> This patch fixes the setting of items in bitmap, adapting it to the
> required manner.
> 
> Fixes: d53aa89aea91 ("net/mlx5: support matching on ICMP/ICMP6")
> Fixes: 1242041c5601 ("net/mlx5: match GRE key and present bits")
> Fixes: 2e4c987aad91 ("net/mlx5: validate Direct Rule E-Switch")
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Xiaoyu Min <jackmin@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
> index 45cd140..7240d3b 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -2883,7 +2883,7 @@ struct field_modify_info modify_tcp[] = {
>  					(dev, items, attr, item_flags, error);
>  			if (ret < 0)
>  				return ret;
> -			last_item |= MLX5_FLOW_ITEM_PORT_ID;
> +			last_item = MLX5_FLOW_ITEM_PORT_ID;
>  			break;
>  		case RTE_FLOW_ITEM_TYPE_ETH:
>  			ret = mlx5_flow_validate_item_eth(items, item_flags,
> @@ -2979,7 +2979,7 @@ struct field_modify_info modify_tcp[] = {
>  				(items, item_flags, gre_item, error);
>  			if (ret < 0)
>  				return ret;
> -			item_flags |= MLX5_FLOW_LAYER_GRE_KEY;
> +			last_item = MLX5_FLOW_LAYER_GRE_KEY;
>  			break;
>  		case RTE_FLOW_ITEM_TYPE_VXLAN:
>  			ret = mlx5_flow_validate_item_vxlan(items, item_flags,
> @@ -3017,7 +3017,7 @@ struct field_modify_info modify_tcp[] = {
>  							   error);
>  			if (ret < 0)
>  				return ret;
> -			item_flags |= MLX5_FLOW_LAYER_ICMP;
> +			last_item = MLX5_FLOW_LAYER_ICMP;
>  			break;
>  		case RTE_FLOW_ITEM_TYPE_ICMP6:
>  			ret = mlx5_flow_validate_item_icmp6(items, item_flags,
> @@ -3025,7 +3025,7 @@ struct field_modify_info modify_tcp[] = {
>  							    error);
>  			if (ret < 0)
>  				return ret;
> -			item_flags |= MLX5_FLOW_LAYER_ICMP6;
> +			last_item = MLX5_FLOW_LAYER_ICMP6;
>  			break;
>  		default:
>  			return rte_flow_error_set(error, ENOTSUP,
> @@ -5043,7 +5043,7 @@ struct field_modify_info modify_tcp[] = {
>  		case RTE_FLOW_ITEM_TYPE_GRE_KEY:
>  			flow_dv_translate_item_gre_key(match_mask,
>  						       match_value, items);
> -			item_flags |= MLX5_FLOW_LAYER_GRE_KEY;
> +			last_item = MLX5_FLOW_LAYER_GRE_KEY;
>  			break;
>  		case RTE_FLOW_ITEM_TYPE_NVGRE:
>  			flow_dv_translate_item_nvgre(match_mask, match_value,
> @@ -5073,12 +5073,12 @@ struct field_modify_info modify_tcp[] = {
>  		case RTE_FLOW_ITEM_TYPE_ICMP:
>  			flow_dv_translate_item_icmp(match_mask, match_value,
>  						    items, tunnel);
> -			item_flags |= MLX5_FLOW_LAYER_ICMP;
> +			last_item = MLX5_FLOW_LAYER_ICMP;
>  			break;
>  		case RTE_FLOW_ITEM_TYPE_ICMP6:
>  			flow_dv_translate_item_icmp6(match_mask, match_value,
>  						      items, tunnel);
> -			item_flags |= MLX5_FLOW_LAYER_ICMP6;
> +			last_item = MLX5_FLOW_LAYER_ICMP6;
>  			break;
>  		default:
>  			break;
> -- 
> 1.8.3.1
> 

  parent reply	other threads:[~2019-07-19  5:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 19:42 Dekel Peled
2019-07-19  4:29 ` Slava Ovsiienko
2019-07-19  5:35 ` Jack Min [this message]
2019-07-21  7:53 ` Raslan Darawsheh

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=20190719053501.bypa4agfllmhpbeu@mellanox.com \
    --to=jackmin@mellanox.com \
    --cc=dekelp@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=orika@mellanox.com \
    --cc=shahafs@mellanox.com \
    --cc=viacheslavo@mellanox.com \
    --cc=yskoh@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).