From: Viacheslav Ovsiienko Date: Mon, 22 Apr 2019 12:38:17 +0000 (+0000) Subject: net/mlx5: fix probing if DevX disabled X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f4a9349da80f8076d060498c3a9f673032e8662c;p=dpdk.git net/mlx5: fix probing if DevX disabled 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") Signed-off-by: Viacheslav Ovsiienko Acked-by: Shahaf Shuler --- diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 4944310ced..1bb58b1908 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1519,10 +1519,12 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, */ 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