* [PATCH] app/crypto-perf: fix aad offset alignment
@ 2025-03-11 9:01 Shani Peretz
2025-03-17 10:22 ` [EXTERNAL] " Akhil Goyal
0 siblings, 1 reply; 3+ messages in thread
From: Shani Peretz @ 2025-03-11 9:01 UTC (permalink / raw)
To: dev
Cc: suanmingm, Shani Peretz, stable, Brian Dooley, Pablo de Lara,
Akhil Goyal
AAD offset in AES-GCM crypto test was calculated by adding
16-byte alignment after the IV, which is only needed in AES-CCM.
The patch correct the AAD offset calculation in AES-GCM algorithm tests.
Fixes: 0b242422d385 ("app/crypto-perf: set AAD after the crypto operation")
Cc: stable@dpdk.org
Signed-off-by: Shani Peretz <shperetz@nvidia.com>
---
app/test-crypto-perf/cperf_ops.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 6d5f510220..f9be51e17f 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -688,7 +688,9 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
uint16_t i;
/* AAD is placed after the IV */
uint16_t aad_offset = iv_offset +
- RTE_ALIGN_CEIL(test_vector->aead_iv.length, 16);
+ ((options->aead_algo == RTE_CRYPTO_AEAD_AES_CCM) ?
+ RTE_ALIGN_CEIL(test_vector->aead_iv.length, 16) :
+ test_vector->aead_iv.length);
for (i = 0; i < nb_ops; i++) {
struct rte_crypto_sym_op *sym_op = ops[i]->sym;
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [EXTERNAL] [PATCH] app/crypto-perf: fix aad offset alignment
2025-03-11 9:01 [PATCH] app/crypto-perf: fix aad offset alignment Shani Peretz
@ 2025-03-17 10:22 ` Akhil Goyal
2025-03-26 7:13 ` Shani Peretz
0 siblings, 1 reply; 3+ messages in thread
From: Akhil Goyal @ 2025-03-17 10:22 UTC (permalink / raw)
To: Shani Peretz, dev; +Cc: suanmingm, stable, Brian Dooley, Pablo de Lara
Hi,
> AAD offset in AES-GCM crypto test was calculated by adding
> 16-byte alignment after the IV, which is only needed in AES-CCM.
Agreed that CCM has a requirement for 16B alignment.
But for GCM, does it break any protocol? Can we not align to byte boundary for performance?
This is a performance application which mainly focus on getting the best throughput.
Did you check if it is having some performance degradation?
>
> The patch correct the AAD offset calculation in AES-GCM algorithm tests.
>
> Fixes: 0b242422d385 ("app/crypto-perf: set AAD after the crypto operation")
> Cc: stable@dpdk.org
>
> Signed-off-by: Shani Peretz <shperetz@nvidia.com>
> ---
> app/test-crypto-perf/cperf_ops.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
> index 6d5f510220..f9be51e17f 100644
> --- a/app/test-crypto-perf/cperf_ops.c
> +++ b/app/test-crypto-perf/cperf_ops.c
> @@ -688,7 +688,9 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
> uint16_t i;
> /* AAD is placed after the IV */
> uint16_t aad_offset = iv_offset +
> - RTE_ALIGN_CEIL(test_vector->aead_iv.length, 16);
> + ((options->aead_algo == RTE_CRYPTO_AEAD_AES_CCM)
> ?
> + RTE_ALIGN_CEIL(test_vector->aead_iv.length, 16) :
> + test_vector->aead_iv.length);
>
> for (i = 0; i < nb_ops; i++) {
> struct rte_crypto_sym_op *sym_op = ops[i]->sym;
> --
> 2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [EXTERNAL] [PATCH] app/crypto-perf: fix aad offset alignment
2025-03-17 10:22 ` [EXTERNAL] " Akhil Goyal
@ 2025-03-26 7:13 ` Shani Peretz
0 siblings, 0 replies; 3+ messages in thread
From: Shani Peretz @ 2025-03-26 7:13 UTC (permalink / raw)
To: Akhil Goyal, dev; +Cc: Suanming Mou, stable, Brian Dooley, Pablo de Lara
> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Monday, 17 March 2025 12:23
> To: Shani Peretz <shperetz@nvidia.com>; dev@dpdk.org
> Cc: Suanming Mou <suanmingm@nvidia.com>; stable@dpdk.org; Brian
> Dooley <brian.dooley@intel.com>; Pablo de Lara
> <pablo.de.lara.guarch@intel.com>
> Subject: RE: [EXTERNAL] [PATCH] app/crypto-perf: fix aad offset alignment
>
> External email: Use caution opening links or attachments
>
>
> Hi,
> > AAD offset in AES-GCM crypto test was calculated by adding 16-byte
> > alignment after the IV, which is only needed in AES-CCM.
>
> Agreed that CCM has a requirement for 16B alignment.
> But for GCM, does it break any protocol? Can we not align to byte boundary
> for performance?
> This is a performance application which mainly focus on getting the best
> throughput.
> Did you check if it is having some performance degradation?
>
> >
> > The patch correct the AAD offset calculation in AES-GCM algorithm tests.
> >
> > Fixes: 0b242422d385 ("app/crypto-perf: set AAD after the crypto
> > operation")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Shani Peretz <shperetz@nvidia.com>
> > ---
> > app/test-crypto-perf/cperf_ops.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/app/test-crypto-perf/cperf_ops.c
> > b/app/test-crypto-perf/cperf_ops.c
> > index 6d5f510220..f9be51e17f 100644
> > --- a/app/test-crypto-perf/cperf_ops.c
> > +++ b/app/test-crypto-perf/cperf_ops.c
> > @@ -688,7 +688,9 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
> > uint16_t i;
> > /* AAD is placed after the IV */
> > uint16_t aad_offset = iv_offset +
> > - RTE_ALIGN_CEIL(test_vector->aead_iv.length, 16);
> > + ((options->aead_algo == RTE_CRYPTO_AEAD_AES_CCM)
> > ?
> > + RTE_ALIGN_CEIL(test_vector->aead_iv.length, 16) :
> > + test_vector->aead_iv.length);
> >
> > for (i = 0; i < nb_ops; i++) {
> > struct rte_crypto_sym_op *sym_op = ops[i]->sym;
> > --
> > 2.25.1
I checked the throughput test, and I haven't noticed any degradation compared to upstream. I can share the results if needed.
Note that regardless of the performance it fixes several segmentation faults in the test.
(The problem is that we allocate the crypto_op_private_size without alignment, but we try to access as if it was 16 byte alignment)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-26 7:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-11 9:01 [PATCH] app/crypto-perf: fix aad offset alignment Shani Peretz
2025-03-17 10:22 ` [EXTERNAL] " Akhil Goyal
2025-03-26 7:13 ` Shani Peretz
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).