diff mbox series

[RFC,21/21] net/mlx5: use HCA attributes from context device

Message ID 20210817134441.1966618-22-michaelba@nvidia.com (mailing list archive)
State RFC, archived
Delegated to: Raslan Darawsheh
Headers show
Series mlx5: sharing global MR cache between drivers | expand

Checks

Context Check Description
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Michael Baum Aug. 17, 2021, 1:44 p.m. UTC
Use HCA attributes from context device structure, instead of query it
for itself.

Signed-off-by: Michael Baum <michaelba@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 mbox series

Patch

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;