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 67458A04A4; Wed, 27 May 2020 10:39:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E25A71D8F6; Wed, 27 May 2020 10:39:08 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id AE3C01D8FC for ; Wed, 27 May 2020 10:39:07 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from matan@mellanox.com) with ESMTPS (AES256-SHA encrypted); 27 May 2020 11:39:02 +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 04R8cgsx005678; Wed, 27 May 2020 11:39:02 +0300 From: Michael Baum To: dev@dpdk.org Cc: matan@mellanox.com, viacheslavo@mellanox.com, stable@dpdk.org Date: Wed, 27 May 2020 08:37:57 +0000 Message-Id: <1590568677-11662-6-git-send-email-michaelba@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1590568677-11662-1-git-send-email-michaelba@mellanox.com> References: <1590568677-11662-1-git-send-email-michaelba@mellanox.com> Subject: [dpdk-dev] [PATCH 6/6] net/mlx5: fix compiler code arrangement in MPLS support 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" The mlx5_flow_validate_item_mpls function checks MPLS item validation. It first checks if the device supports MPLS, it is done using the ifdef condition that if it fails to skip to endif and return the appropriate error. When MPLS is supported, the preprocessor will copy the body of the function ending with return 0 followed by the lines that report MPLS support. In fact, these lines are unreachable because before them the function returns 0 and in any case they are unnecessary. Replace the endif by else and move endif to the end of the function. Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index ae478a5..f2c3cf9 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2269,11 +2269,12 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority, if (ret < 0) return ret; return 0; -#endif +#else return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, "MPLS is not supported by Verbs, please" " update."); +#endif } /** -- 1.8.3.1