From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47E2CC10F11 for ; Mon, 22 Apr 2019 12:38:23 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 04DEE20693 for ; Mon, 22 Apr 2019 12:38:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04DEE20693 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DD02F1B447; Mon, 22 Apr 2019 14:38:21 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 242185F25 for ; Mon, 22 Apr 2019 14:38:21 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 22 Apr 2019 15:38:19 +0300 Received: from pegasus12.mtr.labs.mlnx. (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x3MCcJYr025765; Mon, 22 Apr 2019 15:38:19 +0300 From: Viacheslav Ovsiienko To: shahafs@mellanox.com Cc: dev@dpdk.org, Ori Kam Date: Mon, 22 Apr 2019 12:38:17 +0000 Message-Id: <1555936697-1096-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix query host adapter if no DevX enabled 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" If there is the support of DevX is exposed by rdma-core but DevX is not supported by or disabled for the specific interface the mlx5_devx_cmd_query_hca_attr() routine returns an error preventing the device from successful probing. The routine should be invoked only in case of enabled DevX. Fixes: e2b4925ef7c1 ("net/mlx5: support Direct Rules E-Switch") Cc: Ori Kam Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 46ca08a..3f43022 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1517,10 +1517,12 @@ struct mlx5_dev_spawn_data { */ mlx5_link_update(eth_dev, 0); #ifdef HAVE_IBV_DEVX_OBJ - err = mlx5_devx_cmd_query_hca_attr(sh->ctx, &config.hca_attr); - if (err) { - err = -err; - goto error; + if (config.devx) { + err = mlx5_devx_cmd_query_hca_attr(sh->ctx, &config.hca_attr); + if (err) { + err = -err; + goto error; + } } #endif #ifdef HAVE_MLX5DV_DR_ESWITCH -- 1.8.3.1