diff mbox series

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

Message ID 20210817134441.1966618-20-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/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/compress/mlx5/mlx5_compress.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c
index 93b0cc8ea6..e5d900568d 100644
--- a/drivers/compress/mlx5/mlx5_compress.c
+++ b/drivers/compress/mlx5/mlx5_compress.c
@@ -753,7 +753,6 @@  mlx5_compress_dev_probe(struct mlx5_common_device *dev)
 	struct rte_compressdev *cdev;
 	struct mlx5_dev_ctx *dev_ctx = &dev->ctx;
 	struct mlx5_compress_priv *priv;
-	struct mlx5_hca_attr att = { 0 };
 	struct rte_compressdev_pmd_init_params init_params = {
 		.name = "",
 		.socket_id = dev->dev->numa_node,
@@ -765,14 +764,6 @@  mlx5_compress_dev_probe(struct mlx5_common_device *dev)
 		rte_errno = ENOTSUP;
 		return -rte_errno;
 	}
-	if (mlx5_devx_cmd_query_hca_attr(dev_ctx->ctx, &att) != 0 ||
-	    att.mmo_compress_en == 0 || att.mmo_decompress_en == 0 ||
-	    att.mmo_dma_en == 0) {
-		DRV_LOG(ERR, "Not enough capabilities to support compress "
-			"operations, maybe old FW/OFED version?");
-		rte_errno = ENOTSUP;
-		return -ENOTSUP;
-	}
 	cdev = rte_compressdev_pmd_create(ibdev_name, dev->dev,
 					  sizeof(*priv), &init_params);
 	if (cdev == NULL) {
@@ -788,8 +779,8 @@  mlx5_compress_dev_probe(struct mlx5_common_device *dev)
 	priv = cdev->data->dev_private;
 	priv->dev_ctx = dev_ctx;
 	priv->cdev = cdev;
-	priv->min_block_size = att.compress_min_block_size;
-	priv->sq_ts_format = att.sq_ts_format;
+	priv->min_block_size = dev_ctx->hca_attr.compress_min_block_size;
+	priv->sq_ts_format = dev_ctx->hca_attr.sq_ts_format;
 	if (mlx5_compress_hw_global_prepare(priv) != 0) {
 		rte_compressdev_pmd_destroy(priv->cdev);
 		return -1;