Added support for compression algorithms#26
Open
plauth wants to merge 59 commits intocryptodev-linux:masterfrom
Open
Added support for compression algorithms#26plauth wants to merge 59 commits intocryptodev-linux:masterfrom
plauth wants to merge 59 commits intocryptodev-linux:masterfrom
Conversation
Author
|
I forgot to mention: the changes require the acompress.h compression API, which has been introduced with Kernel 4.10. |
|
@plauth so to use this someone needs to actually implement it in source code or it's used by default? |
Author
|
@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. |
…ession/decompression operation back to userspace (for now, recycling the struct crypt_op.iv member, to avoid any big changes or compatibility breaks with other cryptodev structures).
…or some yet unknown reason, are surprisingly slow (major bottleneck) when HW-acceleration is available.
…ng crypto_op.iv, simply return it back in crypto_op.dlen.
…(e.g. uncompressing an empty compression stream).
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.
…r-module instance.
…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.
…kernel very fast.
…re copying it there.
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.