mbox series

[0/4] crypto: hisilicon: Add HiSilicon QM and ZIP controller driver

Message ID 1545465105-133138-1-git-send-email-wangzhou1@hisilicon.com
Headers show
Series crypto: hisilicon: Add HiSilicon QM and ZIP controller driver | expand

Message

Zhou Wang Dec. 22, 2018, 7:51 a.m. UTC
This series adds HiSilicon QM and ZIP controller driver in crypto subsystem.

A simple QM/ZIP driver which helps to provide an example for a general
accelerator framework is under review in community[1]. Based on this simple
driver, this series adds HW v2 support, PCI passthrough, reset, PCI/misc error
handler, debug support. But unlike [1], driver in this patchset only registers
to crypto subsystem.

There will be a long discussion about above accelerator framework in the
process of upstreaming. So let's firstly review and upstream QM/ZIP crypto
driver.

References:
[1] https://lkml.org/lkml/2018/11/12/1951

Zhou Wang (4):
  Documentation: Add debugfs doc for hisi_zip
  crypto: hisilicon: Add queue management driver for HiSilicon QM module
  crypto: hisilicon: Add HiSilicon ZIP accelerator support
  MAINTAINERS: add maintainer for HiSilicon QM and ZIP controller driver

 Documentation/ABI/testing/debugfs-hisi-zip |   50 +
 MAINTAINERS                                |    8 +
 drivers/crypto/hisilicon/Kconfig           |   11 +
 drivers/crypto/hisilicon/Makefile          |    2 +
 drivers/crypto/hisilicon/qm.c              | 1823 ++++++++++++++++++++++++++++
 drivers/crypto/hisilicon/qm.h              |  177 +++
 drivers/crypto/hisilicon/zip/Makefile      |    2 +
 drivers/crypto/hisilicon/zip/zip.h         |   60 +
 drivers/crypto/hisilicon/zip/zip_crypto.c  |  410 +++++++
 drivers/crypto/hisilicon/zip/zip_main.c    | 1161 ++++++++++++++++++
 10 files changed, 3704 insertions(+)
 create mode 100644 Documentation/ABI/testing/debugfs-hisi-zip
 create mode 100644 drivers/crypto/hisilicon/qm.c
 create mode 100644 drivers/crypto/hisilicon/qm.h
 create mode 100644 drivers/crypto/hisilicon/zip/Makefile
 create mode 100644 drivers/crypto/hisilicon/zip/zip.h
 create mode 100644 drivers/crypto/hisilicon/zip/zip_crypto.c
 create mode 100644 drivers/crypto/hisilicon/zip/zip_main.c

-- 
2.8.1

Comments

Zhou Wang Jan. 11, 2019, 6:34 a.m. UTC | #1
On 2019/1/11 14:08, Herbert Xu wrote:
> On Sat, Dec 22, 2018 at 03:51:44PM +0800, Zhou Wang wrote:

>>

>> +static struct crypto_alg hisi_zip_zlib = {

>> +	.cra_name		= "zlib-deflate",

>> +	.cra_flags		= CRYPTO_ALG_TYPE_COMPRESS,

>> +	.cra_ctxsize		= sizeof(struct hisi_zip_ctx),

>> +	.cra_priority           = 300,

>> +	.cra_module		= THIS_MODULE,

>> +	.cra_init		= hisi_zip_alloc_comp_ctx,

>> +	.cra_exit		= hisi_zip_free_comp_ctx,

>> +	.cra_u			= {

>> +		.compress = {

>> +			.coa_compress	= hisi_zip_compress,

>> +			.coa_decompress	= hisi_zip_decompress

>> +		}

>> +	}

>> +};

> 

> Please do not add any new implementations using the compress

> interface.  You should either use scomp or acomp depending on

> whether your driver is synchronous or async.


OK, current this driver only supports synchronous interface.
Will fix it in v2.

Thanks,
Zhou

> 

> Thanks,

>
Herbert Xu Jan. 18, 2019, 10:09 a.m. UTC | #2
On Fri, Jan 18, 2019 at 03:55:05PM +0800, Zhou Wang wrote:
>

> However, another question is that seems other subsystems in kernel,

> e.g. zswap still use crypto_alloc_comp. So we'd better register this

> ZIP engine using both cryto_alloc_comp and scomp/acomp interface to

> make it compatible with other subsystems?


Existing users should switch over to acomp.  We're not adding any
more new algorithms to the legacy compress interface.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt