DPDK patches and discussions
 help / color / mirror / Atom feed
From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
To: shahafs@mellanox.com
Cc: dev@dpdk.org, Ori Kam <orika@mellanox.com>
Subject: [dpdk-dev] [PATCH] net/mlx5: fix query host adapter if no DevX enabled
Date: Mon, 22 Apr 2019 12:38:17 +0000	[thread overview]
Message-ID: <1555936697-1096-1-git-send-email-viacheslavo@mellanox.com> (raw)
Message-ID: <20190422123817.nrrgyfhEAm1XToLb1KQdMtfNJiF05fgEC57EEiG10vY@z> (raw)

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 <orika@mellanox.com>

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 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


             reply	other threads:[~2019-04-22 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-22 12:38 Viacheslav Ovsiienko [this message]
2019-04-22 12:38 ` Viacheslav Ovsiienko
2019-04-22 17:46 ` Shahaf Shuler
2019-04-22 17:46   ` Shahaf Shuler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1555936697-1096-1-git-send-email-viacheslavo@mellanox.com \
    --to=viacheslavo@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=orika@mellanox.com \
    --cc=shahafs@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).