DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix query host adapter if no DevX enabled
@ 2019-04-22 12:38 Viacheslav Ovsiienko
  2019-04-22 12:38 ` Viacheslav Ovsiienko
  2019-04-22 17:46 ` Shahaf Shuler
  0 siblings, 2 replies; 4+ messages in thread
From: Viacheslav Ovsiienko @ 2019-04-22 12:38 UTC (permalink / raw)
  To: shahafs; +Cc: dev, Ori Kam

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-22 17:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-22 12:38 [dpdk-dev] [PATCH] net/mlx5: fix query host adapter if no DevX enabled Viacheslav Ovsiienko
2019-04-22 12:38 ` Viacheslav Ovsiienko
2019-04-22 17:46 ` Shahaf Shuler
2019-04-22 17:46   ` Shahaf Shuler

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).