From patchwork Wed Jun 24 13:20:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 72136 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D76A8A0350; Wed, 24 Jun 2020 15:20:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 128A91D929; Wed, 24 Jun 2020 15:20:59 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 505A01D925 for ; Wed, 24 Jun 2020 15:20:57 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from matan@mellanox.com) with SMTP; 24 Jun 2020 16:20:56 +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 05ODKZgR023935; Wed, 24 Jun 2020 16:20:35 +0300 From: Michael Baum To: dev@dpdk.org Cc: matan@mellanox.com, viacheslavo@mellanox.com, stable@dpdk.org Date: Wed, 24 Jun 2020 13:20:31 +0000 Message-Id: <1593004831-4073-1-git-send-email-michaelba@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] common/mlx5: fix code arrangement in tag allocation 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" 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 *