From patchwork Fri Jun 5 23:15:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Mazarguil X-Patchwork-Id: 5223 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 09E9EC37E; Sat, 6 Jun 2015 01:15:52 +0200 (CEST) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by dpdk.org (Postfix) with ESMTP id 92A06C37E for ; Sat, 6 Jun 2015 01:15:50 +0200 (CEST) Received: by wifx6 with SMTP id x6so34372986wif.0 for ; Fri, 05 Jun 2015 16:15:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lqR5RqD1VoaoMYKomc+3g4KvhwsS8Ofzm8M0VpypxTM=; b=jvIAIH/rhYBwiK2NBmBeID7OgwLBsFWBuVz+Xtsjctvu7Y0GsJzfgC2ln9emdPmQit h7QJrR4sda3G2SLODH59ovYx26uLB0LOjK+VvJWC0gp77YjrzoVNiukmlddk9mJJn+jp e/LySQi6uKvDUhOka704mqAsAlWw965Hs/LuaRjk9QchCABunlZado712iRBIUb5zKv5 vFRJ/ISwZokKfm854qhAswpOOrtz06ODI5RmJY7iy3CbYj0yHV5DPvhHwJQ1dDU9Sptf pzzDTT5LRVAHPBuZ48G/qeu+v+tgat+gpNo0XNz+47W6Cp2QXggv84rPwCl9d7OlnqDp NJYw== X-Gm-Message-State: ALoCoQnTtJamDQz0NrC2BgIgSffGOeWo91Rra9tlSheUGRFM24KqY99IwE7ngg7NZJuVl2wfPTIl X-Received: by 10.194.122.168 with SMTP id lt8mr10168689wjb.77.1433546150487; Fri, 05 Jun 2015 16:15:50 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id c3sm12572288wja.3.2015.06.05.16.15.48 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 05 Jun 2015 16:15:49 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Sat, 6 Jun 2015 01:15:07 +0200 Message-Id: <1433546120-2254-4-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1433546120-2254-1-git-send-email-adrien.mazarguil@6wind.com> References: <1433546120-2254-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH 03/16] mlx4: make sure experimental device query function is implemented X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Olga Shern HAVE_EXP_QUERY_DEVICE is used to check whether ibv_exp_query_device() can be used. RSS and inline receive features depend on it. Signed-off-by: Olga Shern Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/Makefile | 4 ++++ drivers/net/mlx4/mlx4.c | 17 ++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile index 97b364a..ce1f2b0 100644 --- a/drivers/net/mlx4/Makefile +++ b/drivers/net/mlx4/Makefile @@ -112,6 +112,10 @@ mlx4_autoconf.h: $(RTE_SDK)/scripts/auto-config-h.sh SEND_RAW_WR_SUPPORT \ infiniband/verbs.h \ type 'struct ibv_send_wr_raw' $(AUTOCONF_OUTPUT) + $Q sh -- '$<' '$@' \ + HAVE_EXP_QUERY_DEVICE \ + infiniband/verbs.h \ + type 'struct ibv_exp_device_attr' $(AUTOCONF_OUTPUT) mlx4.o: mlx4_autoconf.h diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index b77fb22..e32e433 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -4452,17 +4452,18 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) struct ibv_pd *pd = NULL; struct priv *priv = NULL; struct rte_eth_dev *eth_dev; -#if defined(INLINE_RECV) || defined(RSS_SUPPORT) +#ifdef HAVE_EXP_QUERY_DEVICE struct ibv_exp_device_attr exp_device_attr; -#endif +#endif /* HAVE_EXP_QUERY_DEVICE */ struct ether_addr mac; union ibv_gid temp_gid; +#ifdef HAVE_EXP_QUERY_DEVICE + exp_device_attr.comp_mask = IBV_EXP_DEVICE_ATTR_EXP_CAP_FLAGS; #ifdef RSS_SUPPORT - exp_device_attr.comp_mask = - (IBV_EXP_DEVICE_ATTR_EXP_CAP_FLAGS | - IBV_EXP_DEVICE_ATTR_RSS_TBL_SZ); + exp_device_attr.comp_mask |= IBV_EXP_DEVICE_ATTR_RSS_TBL_SZ; #endif /* RSS_SUPPORT */ +#endif /* HAVE_EXP_QUERY_DEVICE */ DEBUG("using port %u (%08" PRIx32 ")", port, test); @@ -4507,11 +4508,12 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) priv->port = port; priv->pd = pd; priv->mtu = ETHER_MTU; -#ifdef RSS_SUPPORT +#ifdef HAVE_EXP_QUERY_DEVICE if (ibv_exp_query_device(ctx, &exp_device_attr)) { - INFO("experimental ibv_exp_query_device"); + ERROR("ibv_exp_query_device() failed"); goto port_error; } +#ifdef RSS_SUPPORT if ((exp_device_attr.exp_device_cap_flags & IBV_EXP_DEVICE_QPG) && (exp_device_attr.exp_device_cap_flags & @@ -4563,6 +4565,7 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) priv->inl_recv_size); } #endif /* INLINE_RECV */ +#endif /* HAVE_EXP_QUERY_DEVICE */ (void)mlx4_getenv_int; priv->vf = vf;