[v2] compress/mlx5: fix double close for context device

Message ID 20211125081829.3149790-1-michaelba@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v2] compress/mlx5: fix double close for context device |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

Michael Baum Nov. 25, 2021, 8:18 a.m. UTC
  From: Michael Baum <michaelba@nvidia.com>

The context of the device opens once in the common probe and closes with
its removal.

If the probe of one of the drivers fails, it releases its resources and
then the common closes the context.
But mistakenly in the compress probe, if there isn't enough capabilities
to support compress operations, it closes the device and then common
probe closes it again.

Remove the redundant closing from compress probe.

Fixes: 2efd26544554 ("compress/mlx5: support partial transformation")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
v2: Improve commit log according to checkpatch warning.
    Add "Acked-by" inside.

 drivers/compress/mlx5/mlx5_compress.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Akhil Goyal Nov. 25, 2021, 10:21 a.m. UTC | #1
> From: Michael Baum <michaelba@nvidia.com>
> 
> The context of the device opens once in the common probe and closes with
> its removal.
> 
> If the probe of one of the drivers fails, it releases its resources and
> then the common closes the context.
> But mistakenly in the compress probe, if there isn't enough capabilities
> to support compress operations, it closes the device and then common
> probe closes it again.
> 
> Remove the redundant closing from compress probe.
> 
> Fixes: 2efd26544554 ("compress/mlx5: support partial transformation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
Applied to dpdk-next-crypto

Please cc all crypto/compression related patches to me in future.
  

Patch

diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c
index bb0dc3a5d2..82b871bd86 100644
--- a/drivers/compress/mlx5/mlx5_compress.c
+++ b/drivers/compress/mlx5/mlx5_compress.c
@@ -723,7 +723,6 @@  mlx5_compress_dev_probe(struct mlx5_common_device *cdev)
 		&& !attr->mmo_compress_qp_en && !attr->mmo_compress_sq_en
 		&& !attr->mmo_dma_qp_en && !attr->mmo_dma_sq_en) {
 		DRV_LOG(ERR, "Not enough capabilities to support compress operations, maybe old FW/OFED version?");
-		claim_zero(mlx5_glue->close_device(cdev->ctx));
 		rte_errno = ENOTSUP;
 		return -ENOTSUP;
 	}