Use HCA attributes from context device structure, instead of query it for itself.
Signed-off-by: Michael Baum <michae...@nvidia.com> --- drivers/net/mlx5/linux/mlx5_os.c | 7 +------ drivers/net/mlx5/windows/mlx5_os.c | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index c8134f064f..a8a1cbc729 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1380,12 +1380,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->mps == MLX5_MPW ? "legacy " : "", config->mps != MLX5_MPW_DISABLED ? "enabled" : "disabled"); if (config->devx) { - err = mlx5_devx_cmd_query_hca_attr(sh->dev_ctx->ctx, - &config->hca_attr); - if (err) { - err = -err; - goto error; - } + config->hca_attr = dev_ctx->hca_attr; /* Check relax ordering support. */ if (!haswell_broadwell_cpu) { sh->cmng.relaxed_ordering_write = diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index d269cf2f74..49b9c258fa 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -443,12 +443,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->cqe_comp = 0; } if (config->devx) { - err = mlx5_devx_cmd_query_hca_attr(sh->dev_ctx->ctx, - &config->hca_attr); - if (err) { - err = -err; - goto error; - } + config->hca_attr = dev_ctx->hca_attr; /* Check relax ordering support. */ sh->cmng.relaxed_ordering_read = 0; sh->cmng.relaxed_ordering_write = 0; -- 2.25.1