From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DAE1FA0471 for ; Thu, 18 Jul 2019 21:42:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AF2483257; Thu, 18 Jul 2019 21:42:29 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 1E84F322C for ; Thu, 18 Jul 2019 21:42:28 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from dekelp@mellanox.com) with ESMTPS (AES256-SHA encrypted); 18 Jul 2019 22:42:27 +0300 Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx [10.128.130.87]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x6IJgRd1022027; Thu, 18 Jul 2019 22:42:27 +0300 From: Dekel Peled To: yskoh@mellanox.com, viacheslavo@mellanox.com, shahafs@mellanox.com Cc: jackmin@mellanox.com, orika@mellanox.com, dev@dpdk.org Date: Thu, 18 Jul 2019 22:42:23 +0300 Message-Id: <17e97355b175364266eef4eb3ca959c4688f9a36.1563478206.git.dekelp@mellanox.com> X-Mailer: git-send-email 1.7.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix setting of item flags bitmap X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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