Skip to content

Added support for compression algorithms#26

Open
plauth wants to merge 59 commits intocryptodev-linux:masterfrom
plauth:master
Open

Added support for compression algorithms#26
plauth wants to merge 59 commits intocryptodev-linux:masterfrom
plauth:master

Conversation

@plauth
Copy link
Copy Markdown

@plauth plauth commented Aug 15, 2017

The cryptodev-linux kernel module has been extended to support compression-type crypto functions. At the current state, both LZO and the IBM 842 algorithm are supported and example programs are provided as well.

@plauth
Copy link
Copy Markdown
Author

plauth commented Aug 15, 2017

I forgot to mention: the changes require the acompress.h compression API, which has been introduced with Kernel 4.10.

@Ansuel
Copy link
Copy Markdown

Ansuel commented Aug 24, 2017

@plauth so to use this someone needs to actually implement it in source code or it's used by default?

@plauth
Copy link
Copy Markdown
Author

plauth commented Nov 8, 2017

@Ansuel sorry for the radio silence. No, this changeset exposes the compression-API, which after a bigger overhaul is available starting with Linux Kernel 4.10. The main goal for exposing kernel-based compression algorithms aims at cases where hardware accelerated compression is available, and in order to use these accelerated compressors from user space.

joanbm and others added 30 commits April 24, 2020 18:07
cryptodev_compr_init could leak memory if an allocation error failed within the initialization routine.
This refactors the initialization routine to make sure this doesn't happen.
…to avoid undesired different behaviors depending on the system's page sizes.
This commit extends compression so that the user can compress or decompress data in multiple separate chunks (compressed bitstreams) with a single ioctl system call. This avoids reducing the overhead if the user wants to compress the input in many small chunks, which previously required a separate ioctl for each chunk, involving substantial overhead.
… destionation buffers are page-aligned and the chunk sizes are multiples of the page size.
…llback less costly, and even allow some zerocopy even if the user buffer isn't perfectly aligned. It also allows leaking uninitialized kernel memory through the inter-chunk gaps like it was doing before.
…tly in order to be able to distinguish between compressible (ret=0) and incompressible(ret=-ENOSPC) chunks on compression.
…specify that the chunk is not present (i.e. should be skipped). This is useful in the presence of uncompressible chunks, which can be transmitted uncompressed, which ends up creating 'gaps' between compressible chunks.
…tra header that makes it incompatible with the other implementations.
…ession (for decompression the NX842 driver has the same problem internally but it will fix it itself without our help).
Pull changes from joanbm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants