fix level configuration in compress
cover fix level configuration in compress
The mlx5 compress PMD uses HW acceleration for the compress operations. The mlx5 HW device has no level style mode, which does a tradeoff between throughput and compression ratio, unlike SW drivers where the CPU is doing the compress, and more CPU effort can cause a better compression ratio. The mlx5 driver wrongly defined the Huffman block size configuration according to the level that doesn't fill the level API requirement for the tradeoff.
Remove the effect of the level configuration in compress operation. Add "log-block-size" devarg to select compression block size manually.
Raja Zidane (2):
compress/mlx5: fix level configuration in compress compress/mlx5: add block size devarg
doc/guides/compressdevs/mlx5.rst | 10 ++++ doc/guides/rel_notes/release_21_11.rst | 2 + drivers/compress/mlx5/mlx5_compress.c | 79 +++++++++++++++++++++----- 3 files changed, 76 insertions(+), 15 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 compress/mlx5: fix level configuration in compress
The mlx5 compress PMD uses HW acceleration for the compress operations. The mlx5 HW device has no level style mode, which does a tradeoff between throughput and compression ratio, unlike SW drivers where the CPU is doing the compress, and more CPU effort can cause a better compression ratio. The mlx5 driver wrongly defined the Huffman block size configuration according to the level that doesn't fill the level API requirement for the tradeoff.
Remove the effect of the level configuration in compress operation.
--- drivers/compress/mlx5/mlx5_compress.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
drivers/compress/mlx5/mlx5_compress.c +3 -15
@@ -343,21 +343,9 @@ mlx5_compress_xform_create(struct rte_compressdev *dev, xfrm->gga_ctrl1 +=RTE_MIN (rte_log2_u32 (size),MLX5_COMP_MAX_WIN_SIZE_CONF ) <<WQE_GGA_COMP_WIN_SIZE_OFFSET ; -switch (xform->compress.level) { -case RTE_COMP_LEVEL_PMD_DEFAULT : - size =MLX5_GGA_COMP_LOG_BLOCK_SIZE_MAX ; -break ; -case RTE_COMP_LEVEL_MAX : - size = priv->min_block_size; -break ; -default : - size =RTE_MAX (MLX5_GGA_COMP_LOG_BLOCK_SIZE_MAX - +1 - xform->compress.level, - priv->min_block_size); - } - xfrm->gga_ctrl1 +=RTE_MIN (size, -MLX5_GGA_COMP_LOG_BLOCK_SIZE_MAX ) << -WQE_GGA_COMP_BLOCK_SIZE_OFFSET ; + size =MLX5_GGA_COMP_LOG_BLOCK_SIZE_MAX ; + xfrm->gga_ctrl1 += size << +WQE_GGA_COMP_BLOCK_SIZE_OFFSET ; xfrm->opcode +=MLX5_OPC_MOD_MMO_COMP <<WQE_CSEG_OPC_MOD_OFFSET ; size = xform->compress.deflate.huffman ==
Signature · 1 line
2.17.1
PATCH 2/2 compress/mlx5: add block size devarg
In reply to Raja ZidaneCurrently, the compression block size is 15 by default, which is the maximum.
Add "log-block-size" devarg to select compression block size manually. The value provided should be between 4 to 15.
Any out-of-range value will be defaulted to 15.
--- doc/guides/compressdevs/mlx5.rst | 10 ++++ doc/guides/rel_notes/release_21_11.rst | 2 + drivers/compress/mlx5/mlx5_compress.c | 63 +++++++++++++++++++++++++- 3 files changed, 74 insertions(+), 1 deletion(-)
doc/guides/compressdevs/mlx5.rst +10 -0
@@ -82,6 +82,16 @@ Limitations * Scatter-Gather, SHA and Stateful are not supported. * Non-compressed block is not supported in compress (supported in decompress). +Driver options +-------------- + +- ``log-block-size`` parameter [int] + + Log of the Huffman block size in the Deflate algorithm. + Values from [4-15]; value x means block size is 2^x. + The default value is 15. + + Supported NICs --------------
doc/guides/rel_notes/release_21_11.rst +2 -0
@@ -305,6 +305,8 @@ New Features * Pcapng format with timestamps and meta-data. * Fixes packet capture with stripped VLAN tags. +* **Updated mlx5 compress PMD.** + * Added devarg to allow manual setting of Huffman block size. Removed Items -------------
drivers/compress/mlx5/mlx5_compress.c +62 -1
105 lines not on this page · raw message
Signature · 1 line
2.17.1
Akhil Goyal
AppliedQuoted 11 lines
The mlx5 compress PMD uses HW acceleration for the compress operations. The mlx5 HW device has no level style mode, which does a tradeoff between throughput and compression ratio, unlike SW drivers where the CPU is doing the compress, and more CPU effort can cause a better compression ratio. The mlx5 driver wrongly defined the Huffman block size configuration according to the level that doesn't fill the level API requirement for the tradeoff.
Remove the effect of the level configuration in compress operation. Add "log-block-size" devarg to select compression block size manually.
Applied to dpdk-next-crypto
Thanks.