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 95607A0350 for ; Wed, 24 Jun 2020 16:14:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 43AB41D99A; Wed, 24 Jun 2020 16:14:36 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C32CA1D578 for ; Wed, 24 Jun 2020 16:14:26 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from matan@mellanox.com) with SMTP; 24 Jun 2020 17:14:25 +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 05OBXhuH007248; Wed, 24 Jun 2020 14:33:43 +0300 From: Michael Baum To: dev@dpdk.org Cc: matan@mellanox.com, viacheslavo@mellanox.com, stable@dpdk.org Date: Wed, 24 Jun 2020 11:33:01 +0000 Message-Id: <1592998387-28181-1-git-send-email-michaelba@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [PATCH 1/7] common/mlx5: fix code arrangement in tag allocation 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" Flow tag action is supported only when the driver has DR or DV support. The tag allocation is adjusted to the modes DV or DR. In case both DR and DV are not supported in the system, the driver handles static code for error report. This error code, wrongly, was compiled when DV is supported while in this case it cannot be accessed at all. Ignore the aforementioned static error code in case of DV by preprocessor commands rearrangement. Fixes: cbb66daa3c85 ("net/mlx5: prepare Direct Verbs for Direct Rule") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/common/mlx5/linux/mlx5_glue.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/common/mlx5/linux/mlx5_glue.c b/drivers/common/mlx5/linux/mlx5_glue.c index c91ee33..a41650d 100644 --- a/drivers/common/mlx5/linux/mlx5_glue.c +++ b/drivers/common/mlx5/linux/mlx5_glue.c @@ -752,7 +752,7 @@ #ifdef HAVE_IBV_FLOW_DV_SUPPORT #ifdef HAVE_MLX5DV_DR return mlx5dv_dr_action_create_tag(tag); -#else +#else /* HAVE_MLX5DV_DR */ struct mlx5dv_flow_action_attr *action; action = malloc(sizeof(*action)); if (!action) @@ -760,11 +760,12 @@ action->type = MLX5DV_FLOW_ACTION_TAG; action->tag_value = tag; return action; -#endif -#endif +#endif /* HAVE_MLX5DV_DR */ +#else /* HAVE_IBV_FLOW_DV_SUPPORT */ (void)tag; errno = ENOTSUP; return NULL; +#endif /* HAVE_IBV_FLOW_DV_SUPPORT */ } static void * -- 1.8.3.1