mbox series

[0/5] crypto: hisilicon - add some new algorithms

Message ID 1606357086-9785-1-git-send-email-liulongfang@huawei.com
Headers show
Series crypto: hisilicon - add some new algorithms | expand

Message

liulongfang Nov. 26, 2020, 2:18 a.m. UTC
As the new Kunpeng930 supports some new algorithms,
the driver needs to be updated

Longfang Liu (4):
  crypto: hisilicon/sec - add new type of sqe for Kunpeng930
  crypto: hisilicon/sec - add new skcipher mode for SEC
  crypto: hisilicon/sec - add new AEAD mode for SEC
  crypto: hisilicon/sec - fixes some coding style

Meng Yu (1):
  crypto: hisilicon/hpre - add version adapt to new algorithms

 drivers/crypto/hisilicon/hpre/hpre.h        |   5 +-
 drivers/crypto/hisilicon/hpre/hpre_crypto.c |   4 +-
 drivers/crypto/hisilicon/qm.c               |   4 +-
 drivers/crypto/hisilicon/qm.h               |   4 +-
 drivers/crypto/hisilicon/sec2/sec.h         |  19 +-
 drivers/crypto/hisilicon/sec2/sec_crypto.c  | 822 ++++++++++++++++++++++------
 drivers/crypto/hisilicon/sec2/sec_crypto.h  | 182 +++++-
 drivers/crypto/hisilicon/zip/zip.h          |   4 +-
 drivers/crypto/hisilicon/zip/zip_crypto.c   |   4 +-
 9 files changed, 860 insertions(+), 188 deletions(-)

Comments

Herbert Xu Dec. 4, 2020, 7:03 a.m. UTC | #1
On Thu, Nov 26, 2020 at 10:18:03AM +0800, Longfang Liu wrote:
>

> diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.h b/drivers/crypto/hisilicon/sec2/sec_crypto.h

> index 0e933e7..712176b 100644

> --- a/drivers/crypto/hisilicon/sec2/sec_crypto.h

> +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.h

> @@ -211,6 +219,167 @@ struct sec_sqe {

>  	struct sec_sqe_type2 type2;

>  };

>  

> +#pragma pack(4)


Please don't use pragma pack.  Instead add the attributes as
needed to each struct or member.

Cheers,
-- 
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
Herbert Xu Dec. 4, 2020, 7:05 a.m. UTC | #2
On Thu, Nov 26, 2020 at 10:18:01AM +0800, Longfang Liu wrote:
> As the new Kunpeng930 supports some new algorithms,

> the driver needs to be updated

> 

> Longfang Liu (4):

>   crypto: hisilicon/sec - add new type of sqe for Kunpeng930

>   crypto: hisilicon/sec - add new skcipher mode for SEC

>   crypto: hisilicon/sec - add new AEAD mode for SEC

>   crypto: hisilicon/sec - fixes some coding style

> 

> Meng Yu (1):

>   crypto: hisilicon/hpre - add version adapt to new algorithms


Please include details on whether this has been tested with the
self-tests, including the extra fuzz tests.

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
liulongfang Dec. 7, 2020, 1:10 a.m. UTC | #3
On 2020/12/4 15:03, Herbert Xu Wrote:
> On Thu, Nov 26, 2020 at 10:18:03AM +0800, Longfang Liu wrote:

>>

>> diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.h b/drivers/crypto/hisilicon/sec2/sec_crypto.h

>> index 0e933e7..712176b 100644

>> --- a/drivers/crypto/hisilicon/sec2/sec_crypto.h

>> +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.h

>> @@ -211,6 +219,167 @@ struct sec_sqe {

>>  	struct sec_sqe_type2 type2;

>>  };

>>  

>> +#pragma pack(4)

> 

> Please don't use pragma pack.  Instead add the attributes as

> needed to each struct or member.

> 

> Cheers,

> 

OK, I will modify it in next patchset
thanks.
Longfang
liulongfang Dec. 7, 2020, 1:20 a.m. UTC | #4
On 2020/12/4 15:05, Herbert Xu wrote:
> On Thu, Nov 26, 2020 at 10:18:01AM +0800, Longfang Liu wrote:

>> As the new Kunpeng930 supports some new algorithms,

>> the driver needs to be updated

>>

>> Longfang Liu (4):

>>   crypto: hisilicon/sec - add new type of sqe for Kunpeng930

>>   crypto: hisilicon/sec - add new skcipher mode for SEC

>>   crypto: hisilicon/sec - add new AEAD mode for SEC

>>   crypto: hisilicon/sec - fixes some coding style

>>

>> Meng Yu (1):

>>   crypto: hisilicon/hpre - add version adapt to new algorithms

> 

> Please include details on whether this has been tested with the

> self-tests, including the extra fuzz tests.

> 

> Thanks,

> 

All of these new algorithms have been fully tested by the project team,
Did any test case tests fail?
Thanks.
Longfang
Herbert Xu Dec. 7, 2020, 1:33 a.m. UTC | #5
On Mon, Dec 07, 2020 at 09:20:05AM +0800, liulongfang wrote:
>

> Did any test case tests fail?


You tell me :)

If it passed all of the tests in your testing, please state that
in the cover letter or in one of the patches.

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
liulongfang Dec. 7, 2020, 3:17 a.m. UTC | #6
On 2020/12/7 9:33, Herbert Xu wrote:
> On Mon, Dec 07, 2020 at 09:20:05AM +0800, liulongfang wrote:

>>

>> Did any test case tests fail?

> 

> You tell me :)

> 

> If it passed all of the tests in your testing, please state that

> in the cover letter or in one of the patches.

> 

> Thanks,

> 

OK, I will add new algorithms test results in the next patchset
Thanks,
Longfang.
liulongfang Dec. 7, 2020, 3:43 a.m. UTC | #7
On 2020/12/4 15:03, Herbert Xu Wrote:
> On Thu, Nov 26, 2020 at 10:18:03AM +0800, Longfang Liu wrote:

>>

>> diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.h b/drivers/crypto/hisilicon/sec2/sec_crypto.h

>> index 0e933e7..712176b 100644

>> --- a/drivers/crypto/hisilicon/sec2/sec_crypto.h

>> +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.h

>> @@ -211,6 +219,167 @@ struct sec_sqe {

>>  	struct sec_sqe_type2 type2;

>>  };

>>  

>> +#pragma pack(4)

> 

> Please don't use pragma pack.  Instead add the attributes as

> needed to each struct or member.

> 

> Cheers,

> 

Can I use __attribute__((aligned(n))) instead of #pragma pack(n)?
Thanks,
Longfang.
Herbert Xu Dec. 7, 2020, 3:45 a.m. UTC | #8
On Mon, Dec 07, 2020 at 11:43:38AM +0800, liulongfang wrote:
>

> Can I use __attribute__((aligned(n))) instead of #pragma pack(n)?


We normally just use __aligned(n) in the kernel.

Cheers,
-- 
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
liulongfang Dec. 7, 2020, 7:46 a.m. UTC | #9
On 2020/12/7 11:45, Herbert Xu Wrote:
> On Mon, Dec 07, 2020 at 11:43:38AM +0800, liulongfang wrote:

>>

>> Can I use __attribute__((aligned(n))) instead of #pragma pack(n)?

> 

> We normally just use __aligned(n) in the kernel.

> 

> Cheers,

> 

I need to use "__packed __aligned(n)" to make sure the structure length is normal.
Is it possible to use "__packed __aligned(n)" in the kernel?
Thanks.
Longfang.
Herbert Xu Dec. 7, 2020, 7:47 a.m. UTC | #10
On Mon, Dec 07, 2020 at 03:46:28PM +0800, liulongfang wrote:
>

> I need to use "__packed __aligned(n)" to make sure the structure length is normal.

> Is it possible to use "__packed __aligned(n)" in the kernel?


I don't see why not.

Cheers,
-- 
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
liulongfang Dec. 7, 2020, 8:48 a.m. UTC | #11
On 2020/12/7 15:47, Herbert Xu Wrote:
> On Mon, Dec 07, 2020 at 03:46:28PM +0800, liulongfang wrote:

>>

>> I need to use "__packed __aligned(n)" to make sure the structure length is normal.

>> Is it possible to use "__packed __aligned(n)" in the kernel?

> 

> I don't see why not.

> 

> Cheers,

> 

Well, I will modify it in this way in the next patchset.
Thanks,
Longfang.