[dpdk-dev] [RFC 19/21] compress/mlx5: use HCA attributes from context device

Michael Baum michaelba at nvidia.com
Tue Aug 17 15:44:39 CEST 2021


Use HCA attributes from context device structure, instead of query it
for itself.

Signed-off-by: Michael Baum <michaelba at nvidia.com>
---
 drivers/compress/mlx5/mlx5_compress.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

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;
-- 
2.25.1



More information about the dev mailing list