crypto/nx: Add sysfs interface to export NX capabilities
authorHaren Myneni <haren@linux.ibm.com>
Thu, 17 Jun 2021 20:39:08 +0000 (13:39 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 20 Jun 2021 11:58:58 +0000 (21:58 +1000)
commit8c099490fd2bd3b012b3b6d0babbba3b90e69b55
tree6ea6840a449123bb6b9335176e5f6b07ca2355de
parentb4ba22114c78de48fda3818f569f75e97d58c719
crypto/nx: Add sysfs interface to export NX capabilities

Export NX-GZIP capabilities to usrespace in sysfs
/sys/devices/vio/ibm,compression-v1/nx_gzip_caps directory.
These are queried by userspace accelerator libraries to set
minimum length heuristics and maximum limits on request sizes.

NX-GZIP capabilities:
min_compress_len  /*Recommended minimum compress length in bytes*/
min_decompress_len /*Recommended minimum decompress length in bytes*/
req_max_processed_len /* Maximum number of bytes processed in one
request */

NX will return RMA_Reject if the request buffer size is greater
than req_max_processed_len.

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/510da86abbd904878d5f13d74aba72603c37d783.camel@linux.ibm.com
drivers/crypto/nx/nx-common-pseries.c