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 9F6F8A0526 for ; Tue, 21 Jul 2020 13:57:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 460C11BFE7; Tue, 21 Jul 2020 13:57:31 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id D89181BFE7 for ; Tue, 21 Jul 2020 13:57:29 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from matan@mellanox.com) with SMTP; 21 Jul 2020 14:57:28 +0300 Received: from pegasus07.mtr.labs.mlnx (pegasus07.mtr.labs.mlnx [10.210.16.112]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 06LBvSr7007282; Tue, 21 Jul 2020 14:57:28 +0300 From: Michael Baum To: dev@dpdk.org Cc: matan@mellanox.com, viacheslavo@mellanox.com, stable@dpdk.org Date: Tue, 21 Jul 2020 11:57:21 +0000 Message-Id: <1595332641-6144-1-git-send-email-michaelba@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [PATCH] net/mlx5: fix enum misusing for steering registers X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" The mlx5_flow_action_copy_mreg structure contains a field called src type enum modify_reg, similarly the mlx5_rte_flow_item_tag field contains a field called id type enum modify_reg. The enum modify_reg variable represents different registers in the system and it also has a field called REG_NONE whose value is 0 which means that the register does not exist. The flow_mreg_add_copy_action function sets a variable of struct mlx5_flow_action_copy_mreg type, and initializes the src field to be 0. similarly the flow_create_split_metadata function sets a variable of struct mlx5_rte_flow_item_tag type and initializes the id field to be 0. In both functions, they initialize a enum modify_reg type variable with an int type value while modify_reg has an appropriate field for that value (REG_NONE). Replace assigning 0 with REG_NONE in both functions. Fixes: dd3c774f6ffb ("net/mlx5: add metadata register copy table") Fixes: 71e254bc0294 ("net/mlx5: split Rx flows to provide metadata copy") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index b56bee4..aba8f41 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3011,7 +3011,7 @@ struct mlx5_flow_tunnel_info { }; struct mlx5_flow_action_copy_mreg cp_mreg = { .dst = REG_B, - .src = 0, + .src = REG_NONE, }; struct rte_flow_action_jump jump = { .group = MLX5_FLOW_MREG_ACT_TABLE_GROUP, @@ -4067,7 +4067,7 @@ struct mlx5_flow_tunnel_info { /* Internal PMD action to set register. */ struct mlx5_rte_flow_item_tag q_tag_spec = { .data = qrss_id, - .id = 0, + .id = REG_NONE, }; struct rte_flow_item q_items[] = { { -- 1.8.3.1