[dpdk-dev] app/test: fix aad padding size in SGL operation
Checks
Commit Message
This commit fixes unnecessary padding of aad for GCM using
scatter-gather list
Fixes: b71990ffa7e4 ("app/test: add SGL tests to cryptodev QAT suite")
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
app/test/test_cryptodev.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
Comments
Hi Arek,
> -----Original Message-----
> From: Kusztal, ArkadiuszX
> Sent: Tuesday, January 03, 2017 3:39 PM
> To: dev@dpdk.org
> Cc: Trahe, Fiona; De Lara Guarch, Pablo; Griffin, John; Jain, Deepak K;
> Kusztal, ArkadiuszX
> Subject: [PATCH] app/test: fix aad padding size in SGL operation
>
> This commit fixes unnecessary padding of aad for GCM using
> scatter-gather list
>
> Fixes: b71990ffa7e4 ("app/test: add SGL tests to cryptodev QAT suite")
>
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
I can merge this patch to the commit above in the subtree, as it has not been upstreamed to the mainline.
Is that OK?
Thanks,
Pablo
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Monday, January 09, 2017 1:39 PM
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; Griffin, John
> <john.griffin@intel.com>; Jain, Deepak K <deepak.k.jain@intel.com>
> Subject: RE: [PATCH] app/test: fix aad padding size in SGL operation
>
> Hi Arek,
>
> > -----Original Message-----
> > From: Kusztal, ArkadiuszX
> > Sent: Tuesday, January 03, 2017 3:39 PM
> > To: dev@dpdk.org
> > Cc: Trahe, Fiona; De Lara Guarch, Pablo; Griffin, John; Jain, Deepak
> > K; Kusztal, ArkadiuszX
> > Subject: [PATCH] app/test: fix aad padding size in SGL operation
> >
> > This commit fixes unnecessary padding of aad for GCM using
> > scatter-gather list
> >
> > Fixes: b71990ffa7e4 ("app/test: add SGL tests to cryptodev QAT suite")
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
>
> I can merge this patch to the commit above in the subtree, as it has not been
> upstreamed to the mainline.
> Is that OK?
Hi Pablo,
Sure, I think it is the best solution.
Thanks,
Arek
>
> Thanks,
> Pablo
> -----Original Message-----
> From: Kusztal, ArkadiuszX
> Sent: Monday, January 09, 2017 2:09 PM
> To: De Lara Guarch, Pablo; dev@dpdk.org
> Cc: Trahe, Fiona; Griffin, John; Jain, Deepak K
> Subject: RE: [PATCH] app/test: fix aad padding size in SGL operation
>
>
>
> > -----Original Message-----
> > From: De Lara Guarch, Pablo
> > Sent: Monday, January 09, 2017 1:39 PM
> > To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
> > Cc: Trahe, Fiona <fiona.trahe@intel.com>; Griffin, John
> > <john.griffin@intel.com>; Jain, Deepak K <deepak.k.jain@intel.com>
> > Subject: RE: [PATCH] app/test: fix aad padding size in SGL operation
> >
> > Hi Arek,
> >
> > > -----Original Message-----
> > > From: Kusztal, ArkadiuszX
> > > Sent: Tuesday, January 03, 2017 3:39 PM
> > > To: dev@dpdk.org
> > > Cc: Trahe, Fiona; De Lara Guarch, Pablo; Griffin, John; Jain, Deepak
> > > K; Kusztal, ArkadiuszX
> > > Subject: [PATCH] app/test: fix aad padding size in SGL operation
> > >
> > > This commit fixes unnecessary padding of aad for GCM using
> > > scatter-gather list
> > >
> > > Fixes: b71990ffa7e4 ("app/test: add SGL tests to cryptodev QAT suite")
> > >
> > > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> >
> > I can merge this patch to the commit above in the subtree, as it has not
> been
> > upstreamed to the mainline.
> > Is that OK?
>
> Hi Pablo,
>
> Sure, I think it is the best solution.
>
> Thanks,
> Arek
Applied to dpdk-next-crypto.
Thanks,
Pablo
@@ -5983,7 +5983,7 @@ create_gcm_operation_SGL(enum rte_crypto_cipher_operation op,
const unsigned int iv_len = tdata->iv.len;
const unsigned int aad_len = tdata->aad.len;
- unsigned int iv_pad_len = 0, aad_buffer_len = 0;
+ unsigned int iv_pad_len = 0;
/* Generate Crypto op data structure */
ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
@@ -6023,17 +6023,15 @@ create_gcm_operation_SGL(enum rte_crypto_cipher_operation op,
rte_memcpy(sym_op->cipher.iv.data, tdata->iv.data, iv_pad_len);
- aad_buffer_len = ALIGN_POW2_ROUNDUP(aad_len, 16);
-
sym_op->auth.aad.data = (uint8_t *)rte_pktmbuf_prepend(
- ut_params->ibuf, aad_buffer_len);
+ ut_params->ibuf, aad_len);
TEST_ASSERT_NOT_NULL(sym_op->auth.aad.data,
"no room to prepend aad");
sym_op->auth.aad.phys_addr = rte_pktmbuf_mtophys(
ut_params->ibuf);
sym_op->auth.aad.length = aad_len;
- memset(sym_op->auth.aad.data, 0, aad_buffer_len);
+ memset(sym_op->auth.aad.data, 0, aad_len);
rte_memcpy(sym_op->auth.aad.data, tdata->aad.data, aad_len);
TEST_HEXDUMP(stdout, "iv:", sym_op->cipher.iv.data, iv_pad_len);
@@ -6041,9 +6039,9 @@ create_gcm_operation_SGL(enum rte_crypto_cipher_operation op,
sym_op->auth.aad.data, aad_len);
sym_op->cipher.data.length = tdata->plaintext.len;
- sym_op->cipher.data.offset = aad_buffer_len + iv_pad_len;
+ sym_op->cipher.data.offset = aad_len + iv_pad_len;
- sym_op->auth.data.offset = aad_buffer_len + iv_pad_len;
+ sym_op->auth.data.offset = aad_len + iv_pad_len;
sym_op->auth.data.length = tdata->plaintext.len;
return 0;