DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash
@ 2018-12-12 19:59 Arek Kusztal
  2018-12-12 19:59 ` [dpdk-dev] [PATCH 1/3] crypto/qat: handle error msg of block size properly Arek Kusztal
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Arek Kusztal @ 2018-12-12 19:59 UTC (permalink / raw)
  To: akhil.goyal; +Cc: dev, fiona.trahe, Arek Kusztal

This patchset fixes invalid message which is caused by not
entirely correct way of checking for block size.

Arek Kusztal (3):
  crypto/qat: handle error msg of block size properly
  crypto/qat: fix message for CCM when setting unused counter
  crypto/qat: fix message for NULL algo setting unused counter

 drivers/crypto/qat/qat_sym_session.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] [PATCH 1/3] crypto/qat: handle error msg of block size properly
  2018-12-12 19:59 [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash Arek Kusztal
@ 2018-12-12 19:59 ` Arek Kusztal
  2018-12-17 12:12   ` Kovacevic, Marko
  2018-12-12 19:59 ` [dpdk-dev] [PATCH 2/3] crypto/qat: fix message for CCM when setting unused counter Arek Kusztal
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Arek Kusztal @ 2018-12-12 19:59 UTC (permalink / raw)
  To: akhil.goyal; +Cc: dev, fiona.trahe, Arek Kusztal, stable

Error code of qat_hash_get_block_size needs to be handle properly.

Fixes: 10b49880e3c5 ("crypto/qat: make the session struct variable in size")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/qat/qat_sym_session.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 8196e23..272177f 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1143,8 +1143,8 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,
 	}
 
 	block_size = qat_hash_get_block_size(hash_alg);
-	if (block_size <= 0)
-		return -EFAULT;
+	if (block_size < 0)
+		return block_size;
 	/* init ipad and opad from key and xor with fixed values */
 	memset(ipad, 0, block_size);
 	memset(opad, 0, block_size);
@@ -1490,9 +1490,13 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC
 			)
 		hash->auth_counter.counter = 0;
-	else
-		hash->auth_counter.counter = rte_bswap32(
-				qat_hash_get_block_size(cdesc->qat_hash_alg));
+	else {
+		int block_size = qat_hash_get_block_size(cdesc->qat_hash_alg);
+
+		if (block_size < 0)
+			return block_size;
+		hash->auth_counter.counter = rte_bswap32(block_size);
+	}
 
 	cdesc->cd_cur_ptr += sizeof(struct icp_qat_hw_auth_setup);
 
-- 
2.1.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] [PATCH 2/3] crypto/qat: fix message for CCM when setting unused counter
  2018-12-12 19:59 [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash Arek Kusztal
  2018-12-12 19:59 ` [dpdk-dev] [PATCH 1/3] crypto/qat: handle error msg of block size properly Arek Kusztal
@ 2018-12-12 19:59 ` Arek Kusztal
  2018-12-14 14:23   ` Akhil Goyal
  2018-12-17 12:16   ` Kovacevic, Marko
  2018-12-12 19:59 ` [dpdk-dev] [PATCH 3/3] crypto/qat: fix message for NULL algo " Arek Kusztal
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 11+ messages in thread
From: Arek Kusztal @ 2018-12-12 19:59 UTC (permalink / raw)
  To: akhil.goyal; +Cc: dev, fiona.trahe, Arek Kusztal, stable

AES-CCM algo does not to set counter flag so it should be zeroed.

Fixes: ab56c4d9ed9a ("crypto/qat: support AES-CCM")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/qat/qat_sym_session.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 272177f..d8cc702 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1488,6 +1488,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_KASUMI_F9
 		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3
 		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC
+		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_AES_CBC_MAC
 			)
 		hash->auth_counter.counter = 0;
 	else {
-- 
2.1.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] [PATCH 3/3] crypto/qat: fix message for NULL algo setting unused counter
  2018-12-12 19:59 [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash Arek Kusztal
  2018-12-12 19:59 ` [dpdk-dev] [PATCH 1/3] crypto/qat: handle error msg of block size properly Arek Kusztal
  2018-12-12 19:59 ` [dpdk-dev] [PATCH 2/3] crypto/qat: fix message for CCM when setting unused counter Arek Kusztal
@ 2018-12-12 19:59 ` Arek Kusztal
  2018-12-13 23:01 ` [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash Trahe, Fiona
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Arek Kusztal @ 2018-12-12 19:59 UTC (permalink / raw)
  To: akhil.goyal; +Cc: dev, fiona.trahe, Arek Kusztal, stable

NULL algo algo does not to set counter flag so it should be zeroed.

Fixes: db0e952a5c01 ("crypto/qat: add NULL capability")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/qat/qat_sym_session.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index d8cc702..4d7ec01 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1489,6 +1489,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
 		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3
 		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC
 		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_AES_CBC_MAC
+		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_NULL
 			)
 		hash->auth_counter.counter = 0;
 	else {
-- 
2.1.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash
  2018-12-12 19:59 [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash Arek Kusztal
                   ` (2 preceding siblings ...)
  2018-12-12 19:59 ` [dpdk-dev] [PATCH 3/3] crypto/qat: fix message for NULL algo " Arek Kusztal
@ 2018-12-13 23:01 ` Trahe, Fiona
  2018-12-17 12:15 ` Kovacevic, Marko
  2018-12-18 10:29 ` Akhil Goyal
  5 siblings, 0 replies; 11+ messages in thread
From: Trahe, Fiona @ 2018-12-13 23:01 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, akhil.goyal; +Cc: dev, Trahe, Fiona



> -----Original Message-----
> From: Kusztal, ArkadiuszX
> Sent: Wednesday, December 12, 2018 12:59 PM
> To: akhil.goyal@nxp.com
> Cc: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Kusztal, ArkadiuszX
> <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH 0/3] Fix handling of block size in qat for hash
> 
> This patchset fixes invalid message which is caused by not
> entirely correct way of checking for block size.
> 
> Arek Kusztal (3):
>   crypto/qat: handle error msg of block size properly
>   crypto/qat: fix message for CCM when setting unused counter
>   crypto/qat: fix message for NULL algo setting unused counter
> 
>  drivers/crypto/qat/qat_sym_session.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> --
> 2.1.0
Series-acked-by: Fiona Trahe <fiona.trahe@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH 2/3] crypto/qat: fix message for CCM when setting unused counter
  2018-12-12 19:59 ` [dpdk-dev] [PATCH 2/3] crypto/qat: fix message for CCM when setting unused counter Arek Kusztal
@ 2018-12-14 14:23   ` Akhil Goyal
  2018-12-14 14:39     ` Kusztal, ArkadiuszX
  2018-12-17 12:16   ` Kovacevic, Marko
  1 sibling, 1 reply; 11+ messages in thread
From: Akhil Goyal @ 2018-12-14 14:23 UTC (permalink / raw)
  To: Arek Kusztal; +Cc: dev, fiona.trahe, stable



On 12/13/2018 1:29 AM, Arek Kusztal wrote:
> AES-CCM algo does not to set counter flag so it should be zeroed.
>
> Fixes: ab56c4d9ed9a ("crypto/qat: support AES-CCM")
> Cc: stable@dpdk.org
>
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
>   drivers/crypto/qat/qat_sym_session.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
> index 272177f..d8cc702 100644
> --- a/drivers/crypto/qat/qat_sym_session.c
> +++ b/drivers/crypto/qat/qat_sym_session.c
> @@ -1488,6 +1488,7 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
>   		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_KASUMI_F9
>   		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3
>   		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC
> +		|| cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_AES_CBC_MAC
>   			)
>   		hash->auth_counter.counter = 0;
>   	else {
title and code change do not match.
AES-CCM or AES-CBC??

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH 2/3] crypto/qat: fix message for CCM when setting unused counter
  2018-12-14 14:23   ` Akhil Goyal
@ 2018-12-14 14:39     ` Kusztal, ArkadiuszX
  0 siblings, 0 replies; 11+ messages in thread
From: Kusztal, ArkadiuszX @ 2018-12-14 14:39 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: dev, Trahe, Fiona, stable

Hi Akhil,

> -----Original Message-----
> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]
> Sent: Friday, December 14, 2018 3:23 PM
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Cc: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 2/3] crypto/qat: fix message for CCM when
> setting unused counter
> 
> 
> 
> On 12/13/2018 1:29 AM, Arek Kusztal wrote:
> > AES-CCM algo does not to set counter flag so it should be zeroed.
> >
> > Fixes: ab56c4d9ed9a ("crypto/qat: support AES-CCM")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> > ---
> >   drivers/crypto/qat/qat_sym_session.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/crypto/qat/qat_sym_session.c
> b/drivers/crypto/qat/qat_sym_session.c
> > index 272177f..d8cc702 100644
> > --- a/drivers/crypto/qat/qat_sym_session.c
> > +++ b/drivers/crypto/qat/qat_sym_session.c
> > @@ -1488,6 +1488,7 @@ int
> qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
> >   		|| cdesc->qat_hash_alg ==
> ICP_QAT_HW_AUTH_ALGO_KASUMI_F9
> >   		|| cdesc->qat_hash_alg ==
> ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3
> >   		|| cdesc->qat_hash_alg ==
> ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC
> > +		|| cdesc->qat_hash_alg ==
> ICP_QAT_HW_AUTH_ALGO_AES_CBC_MAC
> >   			)
> >   		hash->auth_counter.counter = 0;
> >   	else {
> title and code change do not match.
> AES-CCM or AES-CBC??

CCM is AEAD mode where Counter for cipher and CBC-MAC for hash is used. Hence CBC-MAC for hash. Ref. RFC 3610, SP800-38C.

Thanks,
Arek

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] crypto/qat: handle error msg of block size properly
  2018-12-12 19:59 ` [dpdk-dev] [PATCH 1/3] crypto/qat: handle error msg of block size properly Arek Kusztal
@ 2018-12-17 12:12   ` Kovacevic, Marko
  0 siblings, 0 replies; 11+ messages in thread
From: Kovacevic, Marko @ 2018-12-17 12:12 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, akhil.goyal
  Cc: dev, Trahe, Fiona, Kusztal, ArkadiuszX, stable

Tested-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash
  2018-12-12 19:59 [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash Arek Kusztal
                   ` (3 preceding siblings ...)
  2018-12-13 23:01 ` [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash Trahe, Fiona
@ 2018-12-17 12:15 ` Kovacevic, Marko
  2018-12-18 10:29 ` Akhil Goyal
  5 siblings, 0 replies; 11+ messages in thread
From: Kovacevic, Marko @ 2018-12-17 12:15 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, akhil.goyal; +Cc: dev, Trahe, Fiona, Kusztal, ArkadiuszX

Series-acked-by: Marko Kovacevic <marko.kovacevic@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH 2/3] crypto/qat: fix message for CCM when setting unused counter
  2018-12-12 19:59 ` [dpdk-dev] [PATCH 2/3] crypto/qat: fix message for CCM when setting unused counter Arek Kusztal
  2018-12-14 14:23   ` Akhil Goyal
@ 2018-12-17 12:16   ` Kovacevic, Marko
  1 sibling, 0 replies; 11+ messages in thread
From: Kovacevic, Marko @ 2018-12-17 12:16 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, akhil.goyal
  Cc: dev, Trahe, Fiona, Kusztal, ArkadiuszX, stable

Tested-by: Marko Kovacevic <marko.kovacevic@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash
  2018-12-12 19:59 [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash Arek Kusztal
                   ` (4 preceding siblings ...)
  2018-12-17 12:15 ` Kovacevic, Marko
@ 2018-12-18 10:29 ` Akhil Goyal
  5 siblings, 0 replies; 11+ messages in thread
From: Akhil Goyal @ 2018-12-18 10:29 UTC (permalink / raw)
  To: Arek Kusztal; +Cc: dev, fiona.trahe



On 12/13/2018 1:29 AM, Arek Kusztal wrote:
> This patchset fixes invalid message which is caused by not
> entirely correct way of checking for block size.
>
> Arek Kusztal (3):
>    crypto/qat: handle error msg of block size properly
>    crypto/qat: fix message for CCM when setting unused counter
>    crypto/qat: fix message for NULL algo setting unused counter
>
>   drivers/crypto/qat/qat_sym_session.c | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
>
Applied to dpdk-next-crypto

Thanks

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-12-18 10:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-12 19:59 [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash Arek Kusztal
2018-12-12 19:59 ` [dpdk-dev] [PATCH 1/3] crypto/qat: handle error msg of block size properly Arek Kusztal
2018-12-17 12:12   ` Kovacevic, Marko
2018-12-12 19:59 ` [dpdk-dev] [PATCH 2/3] crypto/qat: fix message for CCM when setting unused counter Arek Kusztal
2018-12-14 14:23   ` Akhil Goyal
2018-12-14 14:39     ` Kusztal, ArkadiuszX
2018-12-17 12:16   ` Kovacevic, Marko
2018-12-12 19:59 ` [dpdk-dev] [PATCH 3/3] crypto/qat: fix message for NULL algo " Arek Kusztal
2018-12-13 23:01 ` [dpdk-dev] [PATCH 0/3] Fix handling of block size in qat for hash Trahe, Fiona
2018-12-17 12:15 ` Kovacevic, Marko
2018-12-18 10:29 ` Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).