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 7ED45A0093 for ; Tue, 19 May 2020 15:14:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 771601D702; Tue, 19 May 2020 15:14:09 +0200 (CEST) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by dpdk.org (Postfix) with ESMTP id 76F421D702 for ; Tue, 19 May 2020 15:14:08 +0200 (CEST) Received: by mail-wr1-f45.google.com with SMTP id e1so15873952wrt.5 for ; Tue, 19 May 2020 06:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MYxwb9X+56dybeg48GSS+Qz/NpcErs9CL4eNg4QjdqU=; b=LIERbxb5g5+UeJ0pkSuWr+lY2O6gFA7bgQm649tJJXTcpH857dM1KB6JWdEIhFXHwe qgu9eiOeyAJSZWSw/ai05nF809C8Lu5P6HBXUODKByQsD55E/JsmZ0Aod7jEa/vroIzm 3tCxwJHJ7M0TJjecS0DoOIx5vDtRaSC0/UdRhNuQCAJLbv2TgvQ8G3fU6ZpwizFqmuVm 0dqPR76BIKrrpXm3DENNzJZ6lOOwkCaIjaVC5dI7S1Ro61KtoWSBR57ecNCc3qnw0qht 45Ymp2ORwfq6GblwsaBQGq446G19r4h4T4bQQpKVBlg8P0Wh0Rw+F6+5azCQHrBZLVkx dUag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MYxwb9X+56dybeg48GSS+Qz/NpcErs9CL4eNg4QjdqU=; b=Kq5d0132sggBjJ4oltE+a8lXs2lEp+8PITvuIA/wogdtkie0sTo2rDsLX9biDCZB69 pUtpHp72PMdy7VFNJRKfAgC0okqqwIUuNezKuXIUtTR+BsGUV6phnD7q116wzKstcwFE TeCih6RP+MkGnpR5YnwW0pFzCmWYVLthuB+UDD5eOG3LOt0Pwp2gPd6R0UlBsQglAEGp uquszfV8V7lO/xTea+PUcQ82K9+/ZKT1KfFJSGte6wJ0Y+G4F8FuA56W0Le0Vq5d9Ure UTUR/6qhqweSa6+VcuWBRIX2oDOE3AxRmBWc17mhKy9aKhbIQsEn3rHhUS8JVhYwtMSg TDiQ== X-Gm-Message-State: AOAM533Tr7i5vn3M01WhnIt6WFmOBb/dljgyVH44ZTFN+hRorvvFOP7o fOaRrneaQ4D0qVFc9RsQZ4c= X-Google-Smtp-Source: ABdhPJzl5RAvZd4aAURap0Kwa19AtmZ9pAZsbXUxxZ5b37hbwuaFx5o2tbdJsBYYKfX4EndRcW6wQA== X-Received: by 2002:a5d:4c4f:: with SMTP id n15mr20111325wrt.249.1589894048181; Tue, 19 May 2020 06:14:08 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id d1sm21496485wrc.26.2020.05.19.06.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:14:07 -0700 (PDT) From: luca.boccassi@gmail.com To: Kevin Traynor Cc: Viacheslav Ovsiienko , dpdk stable Date: Tue, 19 May 2020 14:04:51 +0100 Message-Id: <20200519130549.112823-156-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix gcc 10 enum-conversion warning' has been queued to stable release 19.11.3 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" Hi, FYI, your patch has been queued to stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 46b7943fda728784115ef6297a44f1a3030cea72 Mon Sep 17 00:00:00 2001 From: Kevin Traynor Date: Fri, 20 Mar 2020 16:47:42 +0000 Subject: [PATCH] net/mlx5: fix gcc 10 enum-conversion warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 869ea2e62de7f981c4b69fc0b63d32ca0c1213cd ] gcc 10.0.1 reports warnings when using mlx5_rte_flow enums with rte_flow type enums. For example: ../drivers/net/mlx5/mlx5_flow.c: In function ‘flow_hairpin_split’: ../drivers/net/mlx5/mlx5_flow.c:3406:19: warning: implicit conversion from ‘enum mlx5_rtedflow_action_type’ to ‘enum rte_flow_action_type’ [-Wenum-conversion] 3406 | tag_action->type = MLX5_RTE_FLOW_ACTION_TYPE_TAG; | ^ ../drivers/net/mlx5/mlx5_flow.c:3419:13: warning: implicit conversion from ‘enum mlx5_rte_flow_item_type’ to ‘enum rte_flow_item_type’ [-Wenum-conversion] 3419 | item->type = MLX5_RTE_FLOW_ITEM_TYPE_TAG; | ^ Fix by casting to the correct enum. Signed-off-by: Kevin Traynor Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 46 ++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 15d895c847..5fcff9a075 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2962,18 +2962,21 @@ flow_mreg_add_copy_action(struct rte_eth_dev *dev, uint32_t mark_id, /* Build a new flow. */ if (mark_id != MLX5_DEFAULT_COPY_ID) { items[0] = (struct rte_flow_item){ - .type = MLX5_RTE_FLOW_ITEM_TYPE_TAG, + .type = (enum rte_flow_item_type) + MLX5_RTE_FLOW_ITEM_TYPE_TAG, .spec = &tag_spec, }; items[1] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_END, }; actions[0] = (struct rte_flow_action){ - .type = MLX5_RTE_FLOW_ACTION_TYPE_MARK, + .type = (enum rte_flow_action_type) + MLX5_RTE_FLOW_ACTION_TYPE_MARK, .conf = &ftag, }; actions[1] = (struct rte_flow_action){ - .type = MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG, + .type = (enum rte_flow_action_type) + MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG, .conf = &cp_mreg, }; actions[2] = (struct rte_flow_action){ @@ -2990,7 +2993,8 @@ flow_mreg_add_copy_action(struct rte_eth_dev *dev, uint32_t mark_id, .type = RTE_FLOW_ITEM_TYPE_END, }; actions[0] = (struct rte_flow_action){ - .type = MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG, + .type = (enum rte_flow_action_type) + MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG, .conf = &cp_mreg, }; actions[1] = (struct rte_flow_action){ @@ -3364,7 +3368,8 @@ flow_hairpin_split(struct rte_eth_dev *dev, } /* Add set meta action and end action for the Rx flow. */ tag_action = actions_rx; - tag_action->type = MLX5_RTE_FLOW_ACTION_TYPE_TAG; + tag_action->type = (enum rte_flow_action_type) + MLX5_RTE_FLOW_ACTION_TYPE_TAG; actions_rx++; rte_memcpy(actions_rx, actions, sizeof(struct rte_flow_action)); actions_rx++; @@ -3377,7 +3382,8 @@ flow_hairpin_split(struct rte_eth_dev *dev, rte_memcpy(actions_tx, actions, sizeof(struct rte_flow_action)); addr = (void *)&pattern_tx[2]; item = pattern_tx; - item->type = MLX5_RTE_FLOW_ITEM_TYPE_TAG; + item->type = (enum rte_flow_item_type) + MLX5_RTE_FLOW_ITEM_TYPE_TAG; tag_item = (void *)addr; tag_item->data = *flow_id; tag_item->id = mlx5_flow_get_reg_id(dev, MLX5_HAIRPIN_TX, 0, NULL); @@ -3509,7 +3515,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, case RTE_FLOW_ACTION_TYPE_METER: /* Add the extra tag action first. */ tag_action = actions_pre; - tag_action->type = MLX5_RTE_FLOW_ACTION_TYPE_TAG; + tag_action->type = (enum rte_flow_action_type) + MLX5_RTE_FLOW_ACTION_TYPE_TAG; actions_pre++; action_cur = &actions_pre; break; @@ -3570,7 +3577,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, * Convert to internal match item, it is used * for vlan push and set vid. */ - sfx_items->type = MLX5_RTE_FLOW_ITEM_TYPE_VLAN; + sfx_items->type = (enum rte_flow_item_type) + MLX5_RTE_FLOW_ITEM_TYPE_VLAN; sfx_items++; } break; @@ -3585,7 +3593,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, tag_spec->id = mlx5_flow_get_reg_id(dev, MLX5_MTR_SFX, 0, &error); tag_mask = tag_spec + 1; tag_mask->data = 0xffffff00; - tag_item->type = MLX5_RTE_FLOW_ITEM_TYPE_TAG; + tag_item->type = (enum rte_flow_item_type) + MLX5_RTE_FLOW_ITEM_TYPE_TAG; tag_item->spec = tag_spec; tag_item->last = NULL; tag_item->mask = tag_mask; @@ -3688,7 +3697,8 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, /* Construct new actions array. */ /* Replace QUEUE/RSS action. */ split_actions[qrss_idx] = (struct rte_flow_action){ - .type = MLX5_RTE_FLOW_ACTION_TYPE_TAG, + .type = (enum rte_flow_action_type) + MLX5_RTE_FLOW_ACTION_TYPE_TAG, .conf = set_tag, }; } @@ -3751,7 +3761,8 @@ flow_mreg_tx_copy_prep(struct rte_eth_dev *dev, memcpy(ext_actions, actions, sizeof(*ext_actions) * encap_idx); if (encap_idx == actions_n - 1) { ext_actions[actions_n - 1] = (struct rte_flow_action){ - .type = MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG, + .type = (enum rte_flow_action_type) + MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG, .conf = cp_mreg, }; ext_actions[actions_n] = (struct rte_flow_action){ @@ -3759,7 +3770,8 @@ flow_mreg_tx_copy_prep(struct rte_eth_dev *dev, }; } else { ext_actions[encap_idx] = (struct rte_flow_action){ - .type = MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG, + .type = (enum rte_flow_action_type) + MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG, .conf = cp_mreg, }; memcpy(ext_actions + encap_idx + 1, actions + encap_idx, @@ -3873,6 +3885,7 @@ flow_create_split_metadata(struct rte_eth_dev *dev, RTE_FLOW_ACTION_TYPE_VOID; else ext_actions[qrss - actions].type = + (enum rte_flow_action_type) MLX5_RTE_FLOW_ACTION_TYPE_TAG; /* * Create the new actions list with removed Q/RSS action @@ -3924,7 +3937,8 @@ flow_create_split_metadata(struct rte_eth_dev *dev, }; struct rte_flow_item q_items[] = { { - .type = MLX5_RTE_FLOW_ITEM_TYPE_TAG, + .type = (enum rte_flow_item_type) + MLX5_RTE_FLOW_ITEM_TYPE_TAG, .spec = &q_tag_spec, .last = NULL, .mask = NULL, @@ -4586,7 +4600,8 @@ mlx5_ctrl_flow_source_queue(struct rte_eth_dev *dev, }; struct rte_flow_item items[] = { { - .type = MLX5_RTE_FLOW_ITEM_TYPE_TX_QUEUE, + .type = (enum rte_flow_item_type) + MLX5_RTE_FLOW_ITEM_TYPE_TX_QUEUE, .spec = &queue_spec, .last = NULL, .mask = &queue_mask, @@ -5705,7 +5720,8 @@ mlx5_flow_discover_mreg_c(struct rte_eth_dev *dev) }; struct rte_flow_action actions[] = { [0] = { - .type = MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG, + .type = (enum rte_flow_action_type) + MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG, .conf = &(struct mlx5_flow_action_copy_mreg){ .src = REG_C_1, .dst = idx, -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:50.834375911 +0100 +++ 0156-net-mlx5-fix-gcc-10-enum-conversion-warning.patch 2020-05-19 14:04:44.496653448 +0100 @@ -1,4 +1,4 @@ -From 869ea2e62de7f981c4b69fc0b63d32ca0c1213cd Mon Sep 17 00:00:00 2001 +From 46b7943fda728784115ef6297a44f1a3030cea72 Mon Sep 17 00:00:00 2001 From: Kevin Traynor Date: Fri, 20 Mar 2020 16:47:42 +0000 Subject: [PATCH] net/mlx5: fix gcc 10 enum-conversion warning @@ -6,6 +6,8 @@ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +[ upstream commit 869ea2e62de7f981c4b69fc0b63d32ca0c1213cd ] + gcc 10.0.1 reports warnings when using mlx5_rte_flow enums with rte_flow type enums. For example: @@ -30,10 +32,10 @@ 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c -index a373f33b6e..01376f3c51 100644 +index 15d895c847..5fcff9a075 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c -@@ -3021,18 +3021,21 @@ flow_mreg_add_copy_action(struct rte_eth_dev *dev, uint32_t mark_id, +@@ -2962,18 +2962,21 @@ flow_mreg_add_copy_action(struct rte_eth_dev *dev, uint32_t mark_id, /* Build a new flow. */ if (mark_id != MLX5_DEFAULT_COPY_ID) { items[0] = (struct rte_flow_item){ @@ -58,7 +60,7 @@ .conf = &cp_mreg, }; actions[2] = (struct rte_flow_action){ -@@ -3049,7 +3052,8 @@ flow_mreg_add_copy_action(struct rte_eth_dev *dev, uint32_t mark_id, +@@ -2990,7 +2993,8 @@ flow_mreg_add_copy_action(struct rte_eth_dev *dev, uint32_t mark_id, .type = RTE_FLOW_ITEM_TYPE_END, }; actions[0] = (struct rte_flow_action){ @@ -68,7 +70,7 @@ .conf = &cp_mreg, }; actions[1] = (struct rte_flow_action){ -@@ -3456,7 +3460,8 @@ flow_hairpin_split(struct rte_eth_dev *dev, +@@ -3364,7 +3368,8 @@ flow_hairpin_split(struct rte_eth_dev *dev, } /* Add set meta action and end action for the Rx flow. */ tag_action = actions_rx; @@ -78,7 +80,7 @@ actions_rx++; rte_memcpy(actions_rx, actions, sizeof(struct rte_flow_action)); actions_rx++; -@@ -3469,7 +3474,8 @@ flow_hairpin_split(struct rte_eth_dev *dev, +@@ -3377,7 +3382,8 @@ flow_hairpin_split(struct rte_eth_dev *dev, rte_memcpy(actions_tx, actions, sizeof(struct rte_flow_action)); addr = (void *)&pattern_tx[2]; item = pattern_tx; @@ -88,7 +90,7 @@ tag_item = (void *)addr; tag_item->data = *flow_id; tag_item->id = mlx5_flow_get_reg_id(dev, MLX5_HAIRPIN_TX, 0, NULL); -@@ -3606,7 +3612,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, +@@ -3509,7 +3515,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, case RTE_FLOW_ACTION_TYPE_METER: /* Add the extra tag action first. */ tag_action = actions_pre; @@ -98,7 +100,7 @@ actions_pre++; action_cur = &actions_pre; break; -@@ -3667,7 +3674,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, +@@ -3570,7 +3577,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, * Convert to internal match item, it is used * for vlan push and set vid. */ @@ -108,7 +110,7 @@ sfx_items++; } break; -@@ -3682,7 +3690,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, +@@ -3585,7 +3593,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, tag_spec->id = mlx5_flow_get_reg_id(dev, MLX5_MTR_SFX, 0, &error); tag_mask = tag_spec + 1; tag_mask->data = 0xffffff00; @@ -118,7 +120,7 @@ tag_item->spec = tag_spec; tag_item->last = NULL; tag_item->mask = tag_mask; -@@ -3785,7 +3794,8 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, +@@ -3688,7 +3697,8 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, /* Construct new actions array. */ /* Replace QUEUE/RSS action. */ split_actions[qrss_idx] = (struct rte_flow_action){ @@ -128,7 +130,7 @@ .conf = set_tag, }; } -@@ -3848,7 +3858,8 @@ flow_mreg_tx_copy_prep(struct rte_eth_dev *dev, +@@ -3751,7 +3761,8 @@ flow_mreg_tx_copy_prep(struct rte_eth_dev *dev, memcpy(ext_actions, actions, sizeof(*ext_actions) * encap_idx); if (encap_idx == actions_n - 1) { ext_actions[actions_n - 1] = (struct rte_flow_action){ @@ -138,7 +140,7 @@ .conf = cp_mreg, }; ext_actions[actions_n] = (struct rte_flow_action){ -@@ -3856,7 +3867,8 @@ flow_mreg_tx_copy_prep(struct rte_eth_dev *dev, +@@ -3759,7 +3770,8 @@ flow_mreg_tx_copy_prep(struct rte_eth_dev *dev, }; } else { ext_actions[encap_idx] = (struct rte_flow_action){ @@ -148,7 +150,7 @@ .conf = cp_mreg, }; memcpy(ext_actions + encap_idx + 1, actions + encap_idx, -@@ -3973,6 +3985,7 @@ flow_create_split_metadata(struct rte_eth_dev *dev, +@@ -3873,6 +3885,7 @@ flow_create_split_metadata(struct rte_eth_dev *dev, RTE_FLOW_ACTION_TYPE_VOID; else ext_actions[qrss - actions].type = @@ -156,7 +158,7 @@ MLX5_RTE_FLOW_ACTION_TYPE_TAG; /* * Create the new actions list with removed Q/RSS action -@@ -4024,7 +4037,8 @@ flow_create_split_metadata(struct rte_eth_dev *dev, +@@ -3924,7 +3937,8 @@ flow_create_split_metadata(struct rte_eth_dev *dev, }; struct rte_flow_item q_items[] = { { @@ -166,7 +168,7 @@ .spec = &q_tag_spec, .last = NULL, .mask = NULL, -@@ -4830,7 +4844,8 @@ mlx5_ctrl_flow_source_queue(struct rte_eth_dev *dev, +@@ -4586,7 +4600,8 @@ mlx5_ctrl_flow_source_queue(struct rte_eth_dev *dev, }; struct rte_flow_item items[] = { { @@ -176,7 +178,7 @@ .spec = &queue_spec, .last = NULL, .mask = &queue_mask, -@@ -6100,7 +6115,8 @@ mlx5_flow_discover_mreg_c(struct rte_eth_dev *dev) +@@ -5705,7 +5720,8 @@ mlx5_flow_discover_mreg_c(struct rte_eth_dev *dev) }; struct rte_flow_action actions[] = { [0] = {