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 A84331C0B for ; Wed, 23 May 2018 14:28:16 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shahafs@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 May 2018 15:01:43 +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 w4NBxjO3016389; Wed, 23 May 2018 14:59:45 +0300 From: Shahaf Shuler To: nelio.laranjeiro@6wind.com, adrien.mazarguil@6wind.com, yskoh@mellanox.com Cc: dev@dpdk.org, xuemingl@mellanox.com Date: Wed, 23 May 2018 14:59:37 +0300 Message-Id: <20180523115937.32201-1-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 Subject: [dpdk-dev] [PATCH] net/mlx5: fix generic tunnel offloading compatibility check 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: , X-List-Received-Date: Wed, 23 May 2018 12:28:17 -0000 On some distros, the inbox rdma-core tree can contain the Software Parser enum while the remaining structs still missing. Fixes: 5f8ba81c4228 ("net/mlx5: support generic tunnel offloading") Cc: xuemingl@mellanox.com Signed-off-by: Shahaf Shuler --- drivers/net/mlx5/Makefile | 7 ++++++- drivers/net/mlx5/mlx5.c | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index 293144e8a0..b09dd785ad 100644 --- a/drivers/net/mlx5/Makefile +++ b/drivers/net/mlx5/Makefile @@ -118,11 +118,16 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh enum IBV_WQ_FLAG_RX_END_PADDING \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ - HAVE_IBV_MLX5_MOD_SWP \ + HAVE_IBV_MLX5_MOD_SWP_MASK \ infiniband/mlx5dv.h \ enum MLX5DV_CONTEXT_MASK_SWP \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ + HAVE_IBV_MLX5_MOD_SWP_CAPS \ + infiniband/mlx5dv.h \ + type 'struct mlx5dv_sw_parsing_caps' \ + $(AUTOCONF_OUTPUT) + $Q sh -- '$<' '$@' \ HAVE_IBV_MLX5_MOD_MPW \ infiniband/mlx5dv.h \ enum MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED \ diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 006665600a..91dafe93ab 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -775,7 +775,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, } ibv_dev = list[i]; DRV_LOG(DEBUG, "device opened"); -#ifdef HAVE_IBV_MLX5_MOD_SWP +#ifdef HAVE_IBV_MLX5_MOD_SWP_MASK attrs_out.comp_mask |= MLX5DV_CONTEXT_MASK_SWP; #endif /* @@ -801,7 +801,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, DRV_LOG(DEBUG, "MPW isn't supported"); mps = MLX5_MPW_DISABLED; } -#ifdef HAVE_IBV_MLX5_MOD_SWP +#if defined(HAVE_IBV_MLX5_MOD_SWP_MASK) && defined(HAVE_IBV_MLX5_MOD_SWP_CAPS) if (attrs_out.comp_mask & MLX5DV_CONTEXT_MASK_SWP) swp = attrs_out.sw_parsing_caps.sw_parsing_offloads; DRV_LOG(DEBUG, "SWP support: %u", swp); -- 2.12.0