From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 2D8B52B95 for ; Thu, 26 Jul 2018 08:20:22 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shahafs@mellanox.com) with ESMTPS (AES256-SHA encrypted); 26 Jul 2018 09:03:28 +0300 Received: from unicorn01.mtl.labs.mlnx. (unicorn01.mtl.labs.mlnx [10.7.12.62]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w6Q60CLR007933; Thu, 26 Jul 2018 09:00:12 +0300 From: Shahaf Shuler To: yskoh@mellanox.com Cc: stable@dpdk.org Date: Thu, 26 Jul 2018 09:00:02 +0300 Message-Id: <20180726060002.11691-1-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 Subject: [dpdk-stable] [PATCH 17.11] net/mlx5: fix compilation for rdma-core v19 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: , X-List-Received-Date: Thu, 26 Jul 2018 06:20:22 -0000 [ backported from upstream commit 06b1fe3f6d2121009b3b879e92b8cca25d4c0c42 ] The flow counter support introduced by commit 9a761de8ea14 ("net/mlx5: flow counter support") was intend to work only with MLNX_OFED_4.2 as the upstream rdma-core libraries were lack such support. On rdma-core v19 the support for the flow counters was added but with different user APIs, hence causing compilation issues on the PMD. This patch fix the compilation errors by forcing the flow counters to be enabled only with MLNX_OFED APIs. Once MLNX_OFED and rdma-core APIs will be aligned, a proper patch to support the new API will be submitted. Fixes: 9a761de8ea14 ("net/mlx5: flow counter support") Cc: stable@dpdk.org Reported-by: Stephen Hemminger Reported-by: Ferruh Yigit Signed-off-by: Shahaf Shuler Acked-by: Ori Kam --- drivers/net/mlx5/Makefile | 2 +- drivers/net/mlx5/mlx5_flow.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index a3984eb9fe..6f0d51a293 100644 --- a/drivers/net/mlx5/Makefile +++ b/drivers/net/mlx5/Makefile @@ -145,7 +145,7 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh $Q sh -- '$<' '$@' \ HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT \ infiniband/verbs.h \ - enum IBV_FLOW_SPEC_ACTION_COUNT \ + type 'struct ibv_counter_set_init_attr' \ $(AUTOCONF_OUTPUT) # Create mlx5_autoconf.h or update it in case it differs from the new one. diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 57b654c35c..0f79cf6907 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -63,12 +63,6 @@ #define MLX5_IPV6 6 #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT -struct ibv_counter_set_init_attr { - int dummy; -}; -struct ibv_flow_spec_counter_action { - int dummy; -}; struct ibv_counter_set { int dummy; }; @@ -885,10 +879,17 @@ mlx5_flow_convert_items_validate(const struct rte_flow_item items[], sizeof(struct ibv_flow_spec_action_tag); } if (parser->count) { +#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT unsigned int size = sizeof(struct ibv_flow_spec_counter_action); for (i = 0; i != hash_rxq_init_n; ++i) parser->queue[i].offset += size; +#else + rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, + items, + "Count action supported only on " + "MLNX_OFED_4.2 and above"); +#endif } return 0; exit_item_not_supported: -- 2.12.0