compress/mlx5: fix compression level translation
authorRaja Zidane <rzidane@nvidia.com>
Thu, 29 Jul 2021 14:11:08 +0000 (17:11 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 3 Aug 2021 12:09:00 +0000 (14:09 +0200)
commit237aad88245b554071e124f7a4eedadf6c430f9c
treef99788db9759e2dad249399cb5a70a78b6f17824
parentcd9e2578d94e9ce0eb50f572f6e28ef2cb4fcc60
compress/mlx5: fix compression level translation

Compression Level is interpreted by each PMD differently.
However, lower numbers give faster compression
at the expense of compression ratio, while higher numbers
may give better compression ratios but are likely slower.
The level affects the block size, which affects performance,
the bigger the block, the faster the compression is.

The problem was that higher levels caused bigger blocks:
  size = min_block_size - 1 + level.

the solution is to reverse the above:
  size = max_block_size + 1 - level.

Fixes: 39a2c8715f8f ("compress/mlx5: add transformation operations")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/compress/mlx5/mlx5_compress.c