[EXT] [PATCH 1/4] compressdev: add LZ4 algorithm support

Akhil Goyal gakhil at marvell.com
Mon Jan 30 19:35:13 CET 2023


> +/**
> + * Block checksum flag.
> + * If this flag is set, each data block will be followed by a 4-bytes checksum,
> + * calculated by using the xxHash-32 algorithm on the raw (compressed) data
> + * block. The intention is to detect data corruption (storage or transmission
> + * errors) immediately, before decoding. Block checksum usage is optional.
> + */
> +#define RTE_COMP_LZ4_FLAG_BLOCK_CHECKSUM (1 << 4)
> +
> +/**
> + * Block Independence flag.
> + * If this flag is set to 1, blocks are independent.
> + * If this flag is set to 0, each block depends on previous ones (up to LZ4
> + * window size, which is 64 KB). In such case, it is necessary to decode all
> + * blocks in sequence.
> + * Block dependency improves compression ratio, especially for small blocks.
> On
> + * the other hand, it makes random access or multi-threaded decoding
> impossible.
> + */
> +#define RTE_COMP_LZ4_FLAG_BLOCK_INDEPENDENCE (1 << 5)

Why did you start with 4th and 5th bit of the flags? Why not first two bits?

++ more people for review.


More information about the dev mailing list