Re: [PATCH 08/10] crypto/NX: Add NX GZIP user space API
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2019-12-17 09:33:43
Also in:
linux-crypto
On Sun, Dec 15, 2019 at 05:05:19AM -0800, Haren Myneni wrote:
On power9, userspace can send GZIP compression requests directly to NX once kernel establishes NX channel / window. This patch provides GZIP engine access to user space via /dev/crypto/nx-gzip device node with open, VAS_TX_WIN_OPEN ioctl, mmap and close operations. Each window corresponds to file descriptor and application can open multiple windows. After the window is opened, mmap() system call to map the hardware address of engine's request queue into the application's virtual address space. Then the application can then submit one or more requests to the the engine by using the copy/paste instructions and pasting the CRBs to the virtual address (aka paste_address) returned by mmap(). Signed-off-by: Sukadev Bhattiprolu <redacted> Signed-off-by: Haren Myneni <haren@us.ibm.com> --- drivers/crypto/nx/Makefile | 2 +- drivers/crypto/nx/nx-842-powernv.h | 2 + drivers/crypto/nx/nx-commom-powernv.c | 21 ++- drivers/crypto/nx/nx-gzip-powernv.c | 282 ++++++++++++++++++++++++++++++++++ 4 files changed, 304 insertions(+), 3 deletions(-) create mode 100644 drivers/crypto/nx/nx-gzip-powernv.c
We already have a kernel compress API which could be exposed to user-space through af_alg. If every driver created their own user-space API it would be unmanageable. Cheers, -- Email: Herbert Xu [off-list ref] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt