[EXT] [PATCH 1/4] compressdev: add LZ4 algorithm support
Michael Baum
michaelba at nvidia.com
Mon Jan 30 21:36:58 CET 2023
On Mon, Jan 30, 2023 at 20:35 PM Akhil Goyal <gakhil at marvell.com> wrote:
>
> > +/**
> > + * 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?
I didn't choose the values by myself, I took them from LZ4 standard:
https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md#frame-descriptor
>
> ++ more people for review.
More information about the dev
mailing list