* [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout
@ 2019-03-07 14:13 Konstantin Ananyev
2019-03-08 12:59 ` Trahe, Fiona
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Konstantin Ananyev @ 2019-03-07 14:13 UTC (permalink / raw)
To: dev
Cc: akhil.goyal, umesh.kartha, pablo.de.lara.guarch, shally.verma,
Konstantin Ananyev
in 18.08 new cache-aligned structure rte_crypto_asym_op was introduced.
As it also was included into rte_crypto_op, it caused implicit change
in rte_crypto_op layout and alignment: now rte_crypto_op is cahce-line
aligned has a hole of 40/104 bytes between phys_addr and sym/asym op.
It looks like unintended ABI breakage, plus such change can cause
negative performance effects:
- now status and sym[0].m_src lies on different cache-lines, so
post-process code would need extra cache-line read.
- new alignment causes grow of the space requirements and cache-line
reads/updates for structures that contain rte_crypto_op inside.
As there seems no actual need to have rte_crypto_asym_op cache-line
aligned, and rte_crypto_asym_op is not intended to be used on it's own -
the simplest fix is just to remove cache-line alignment for it.
As the immediate positive effect: on IA ipsec-secgw performance increased
by 5-10% (depending on the crypto-dev and algo used).
My guess that on machines with 128B cache-line and lookaside-protocol
capable crypto devices the impact will be even more noticeable.
Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op definitions")
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
doc/guides/rel_notes/release_19_05.rst | 7 +++++++
lib/librte_cryptodev/Makefile | 2 +-
lib/librte_cryptodev/meson.build | 2 +-
lib/librte_cryptodev/rte_crypto_asym.h | 2 +-
4 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst
index c0390ca16..ec2651b65 100644
--- a/doc/guides/rel_notes/release_19_05.rst
+++ b/doc/guides/rel_notes/release_19_05.rst
@@ -116,6 +116,13 @@ ABI Changes
Also, make sure to start the actual text at the margin.
=========================================================
+* cryptodev: in 18.08 new structure ``rte_crypto_asym_op`` was introduced and
+ included into ``rte_crypto_op``. As ``rte_crypto_asym_op`` structure was
+ defined as cache-line aligned that caused unintended changes in
+ ``rte_crypto_op`` structure layout and alignment. Remove cache-line
+ alignment for ``rte_crypto_asym_op`` to restore expected ``rte_crypto_op``
+ layout and alignment.
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_cryptodev/Makefile b/lib/librte_cryptodev/Makefile
index 859c4f0f1..c20e090a8 100644
--- a/lib/librte_cryptodev/Makefile
+++ b/lib/librte_cryptodev/Makefile
@@ -7,7 +7,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
LIB = librte_cryptodev.a
# library version
-LIBABIVER := 6
+LIBABIVER := 7
# build flags
CFLAGS += -O3
diff --git a/lib/librte_cryptodev/meson.build b/lib/librte_cryptodev/meson.build
index bcd969437..9e009d466 100644
--- a/lib/librte_cryptodev/meson.build
+++ b/lib/librte_cryptodev/meson.build
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017-2019 Intel Corporation
-version = 6
+version = 7
allow_experimental_apis = true
sources = files('rte_cryptodev.c', 'rte_cryptodev_pmd.c')
headers = files('rte_cryptodev.h',
diff --git a/lib/librte_cryptodev/rte_crypto_asym.h b/lib/librte_cryptodev/rte_crypto_asym.h
index 5e185b2dd..70465c90d 100644
--- a/lib/librte_cryptodev/rte_crypto_asym.h
+++ b/lib/librte_cryptodev/rte_crypto_asym.h
@@ -487,7 +487,7 @@ struct rte_crypto_asym_op {
struct rte_crypto_dh_op_param dh;
struct rte_crypto_dsa_op_param dsa;
};
-} __rte_cache_aligned;
+};
#ifdef __cplusplus
}
--
2.17.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout
2019-03-07 14:13 [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout Konstantin Ananyev
@ 2019-03-08 12:59 ` Trahe, Fiona
2019-03-12 12:04 ` Shally Verma
2019-03-19 13:33 ` Akhil Goyal
2 siblings, 0 replies; 7+ messages in thread
From: Trahe, Fiona @ 2019-03-08 12:59 UTC (permalink / raw)
To: Ananyev, Konstantin, dev
Cc: akhil.goyal, umesh.kartha, De Lara Guarch, Pablo, shally.verma,
Ananyev, Konstantin, Trahe, Fiona
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Konstantin Ananyev
> Sent: Thursday, March 7, 2019 2:13 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; umesh.kartha@caviumnetworks.com; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; shally.verma@caviumnetworks.com; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>
> Subject: [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout
>
> in 18.08 new cache-aligned structure rte_crypto_asym_op was introduced.
> As it also was included into rte_crypto_op, it caused implicit change
> in rte_crypto_op layout and alignment: now rte_crypto_op is cahce-line
> aligned has a hole of 40/104 bytes between phys_addr and sym/asym op.
> It looks like unintended ABI breakage, plus such change can cause
> negative performance effects:
> - now status and sym[0].m_src lies on different cache-lines, so
> post-process code would need extra cache-line read.
> - new alignment causes grow of the space requirements and cache-line
> reads/updates for structures that contain rte_crypto_op inside.
> As there seems no actual need to have rte_crypto_asym_op cache-line
> aligned, and rte_crypto_asym_op is not intended to be used on it's own -
> the simplest fix is just to remove cache-line alignment for it.
> As the immediate positive effect: on IA ipsec-secgw performance increased
> by 5-10% (depending on the crypto-dev and algo used).
> My guess that on machines with 128B cache-line and lookaside-protocol
> capable crypto devices the impact will be even more noticeable.
>
> Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op definitions")
>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout
2019-03-07 14:13 [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout Konstantin Ananyev
2019-03-08 12:59 ` Trahe, Fiona
@ 2019-03-12 12:04 ` Shally Verma
2019-03-19 13:33 ` Akhil Goyal
2 siblings, 0 replies; 7+ messages in thread
From: Shally Verma @ 2019-03-12 12:04 UTC (permalink / raw)
To: Konstantin Ananyev, dev
Cc: akhil.goyal, umesh.kartha, pablo.de.lara.guarch, shally.verma
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Konstantin Ananyev
> Sent: Thursday, March 7, 2019 7:43 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; umesh.kartha@caviumnetworks.com;
> pablo.de.lara.guarch@intel.com; shally.verma@caviumnetworks.com;
> Konstantin Ananyev <konstantin.ananyev@intel.com>
> Subject: [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and
> layout
>
> in 18.08 new cache-aligned structure rte_crypto_asym_op was introduced.
> As it also was included into rte_crypto_op, it caused implicit change in
> rte_crypto_op layout and alignment: now rte_crypto_op is cahce-line aligned
> has a hole of 40/104 bytes between phys_addr and sym/asym op.
> It looks like unintended ABI breakage, plus such change can cause negative
> performance effects:
> - now status and sym[0].m_src lies on different cache-lines, so
> post-process code would need extra cache-line read.
> - new alignment causes grow of the space requirements and cache-line
> reads/updates for structures that contain rte_crypto_op inside.
> As there seems no actual need to have rte_crypto_asym_op cache-line
> aligned, and rte_crypto_asym_op is not intended to be used on it's own - the
> simplest fix is just to remove cache-line alignment for it.
> As the immediate positive effect: on IA ipsec-secgw performance increased
> by 5-10% (depending on the crypto-dev and algo used).
> My guess that on machines with 128B cache-line and lookaside-protocol
> capable crypto devices the impact will be even more noticeable.
>
> Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op definitions")
>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> ---
It's a valid point that asym_op is not going to be used standalone. Thanks for pointing it out.
Acked-by: Shally Verma <shally.verma@marvell.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout
2019-03-07 14:13 [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout Konstantin Ananyev
2019-03-08 12:59 ` Trahe, Fiona
2019-03-12 12:04 ` Shally Verma
@ 2019-03-19 13:33 ` Akhil Goyal
2019-03-19 13:33 ` Akhil Goyal
2019-03-19 14:00 ` Akhil Goyal
2 siblings, 2 replies; 7+ messages in thread
From: Akhil Goyal @ 2019-03-19 13:33 UTC (permalink / raw)
To: Konstantin Ananyev, dev; +Cc: umesh.kartha, pablo.de.lara.guarch, shally.verma
Hi Konstantin,
On 3/7/2019 7:43 PM, Konstantin Ananyev wrote:
> in 18.08 new cache-aligned structure rte_crypto_asym_op was introduced.
> As it also was included into rte_crypto_op, it caused implicit change
> in rte_crypto_op layout and alignment: now rte_crypto_op is cahce-line
> aligned has a hole of 40/104 bytes between phys_addr and sym/asym op.
> It looks like unintended ABI breakage, plus such change can cause
> negative performance effects:
> - now status and sym[0].m_src lies on different cache-lines, so
> post-process code would need extra cache-line read.
> - new alignment causes grow of the space requirements and cache-line
> reads/updates for structures that contain rte_crypto_op inside.
> As there seems no actual need to have rte_crypto_asym_op cache-line
> aligned, and rte_crypto_asym_op is not intended to be used on it's own -
> the simplest fix is just to remove cache-line alignment for it.
> As the immediate positive effect: on IA ipsec-secgw performance increased
> by 5-10% (depending on the crypto-dev and algo used).
> My guess that on machines with 128B cache-line and lookaside-protocol
> capable crypto devices the impact will be even more noticeable.
>
> Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op definitions")
>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> ---
> doc/guides/rel_notes/release_19_05.rst | 7 +++++++
> lib/librte_cryptodev/Makefile | 2 +-
> lib/librte_cryptodev/meson.build | 2 +-
> lib/librte_cryptodev/rte_crypto_asym.h | 2 +-
> 4 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst
> index c0390ca16..ec2651b65 100644
> --- a/doc/guides/rel_notes/release_19_05.rst
> +++ b/doc/guides/rel_notes/release_19_05.rst
> @@ -116,6 +116,13 @@ ABI Changes
> Also, make sure to start the actual text at the margin.
> =========================================================
>
> +* cryptodev: in 18.08 new structure ``rte_crypto_asym_op`` was introduced and
> + included into ``rte_crypto_op``. As ``rte_crypto_asym_op`` structure was
> + defined as cache-line aligned that caused unintended changes in
> + ``rte_crypto_op`` structure layout and alignment. Remove cache-line
> + alignment for ``rte_crypto_asym_op`` to restore expected ``rte_crypto_op``
> + layout and alignment.
> +
>
ABI version should be bumped in the release notes as well. I will update
that while merging.
Apart from that
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
> Shared Library Versions
> -----------------------
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout
2019-03-19 13:33 ` Akhil Goyal
@ 2019-03-19 13:33 ` Akhil Goyal
2019-03-19 14:00 ` Akhil Goyal
1 sibling, 0 replies; 7+ messages in thread
From: Akhil Goyal @ 2019-03-19 13:33 UTC (permalink / raw)
To: Konstantin Ananyev, dev; +Cc: umesh.kartha, pablo.de.lara.guarch, shally.verma
Hi Konstantin,
On 3/7/2019 7:43 PM, Konstantin Ananyev wrote:
> in 18.08 new cache-aligned structure rte_crypto_asym_op was introduced.
> As it also was included into rte_crypto_op, it caused implicit change
> in rte_crypto_op layout and alignment: now rte_crypto_op is cahce-line
> aligned has a hole of 40/104 bytes between phys_addr and sym/asym op.
> It looks like unintended ABI breakage, plus such change can cause
> negative performance effects:
> - now status and sym[0].m_src lies on different cache-lines, so
> post-process code would need extra cache-line read.
> - new alignment causes grow of the space requirements and cache-line
> reads/updates for structures that contain rte_crypto_op inside.
> As there seems no actual need to have rte_crypto_asym_op cache-line
> aligned, and rte_crypto_asym_op is not intended to be used on it's own -
> the simplest fix is just to remove cache-line alignment for it.
> As the immediate positive effect: on IA ipsec-secgw performance increased
> by 5-10% (depending on the crypto-dev and algo used).
> My guess that on machines with 128B cache-line and lookaside-protocol
> capable crypto devices the impact will be even more noticeable.
>
> Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op definitions")
>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> ---
> doc/guides/rel_notes/release_19_05.rst | 7 +++++++
> lib/librte_cryptodev/Makefile | 2 +-
> lib/librte_cryptodev/meson.build | 2 +-
> lib/librte_cryptodev/rte_crypto_asym.h | 2 +-
> 4 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst
> index c0390ca16..ec2651b65 100644
> --- a/doc/guides/rel_notes/release_19_05.rst
> +++ b/doc/guides/rel_notes/release_19_05.rst
> @@ -116,6 +116,13 @@ ABI Changes
> Also, make sure to start the actual text at the margin.
> =========================================================
>
> +* cryptodev: in 18.08 new structure ``rte_crypto_asym_op`` was introduced and
> + included into ``rte_crypto_op``. As ``rte_crypto_asym_op`` structure was
> + defined as cache-line aligned that caused unintended changes in
> + ``rte_crypto_op`` structure layout and alignment. Remove cache-line
> + alignment for ``rte_crypto_asym_op`` to restore expected ``rte_crypto_op``
> + layout and alignment.
> +
>
ABI version should be bumped in the release notes as well. I will update
that while merging.
Apart from that
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
> Shared Library Versions
> -----------------------
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout
2019-03-19 13:33 ` Akhil Goyal
2019-03-19 13:33 ` Akhil Goyal
@ 2019-03-19 14:00 ` Akhil Goyal
2019-03-19 14:00 ` Akhil Goyal
1 sibling, 1 reply; 7+ messages in thread
From: Akhil Goyal @ 2019-03-19 14:00 UTC (permalink / raw)
To: Konstantin Ananyev, dev; +Cc: umesh.kartha, pablo.de.lara.guarch, shally.verma
On 3/19/2019 7:03 PM, Akhil Goyal wrote:
> Hi Konstantin,
>
> On 3/7/2019 7:43 PM, Konstantin Ananyev wrote:
>> in 18.08 new cache-aligned structure rte_crypto_asym_op was introduced.
>> As it also was included into rte_crypto_op, it caused implicit change
>> in rte_crypto_op layout and alignment: now rte_crypto_op is cahce-line
>> aligned has a hole of 40/104 bytes between phys_addr and sym/asym op.
>> It looks like unintended ABI breakage, plus such change can cause
>> negative performance effects:
>> - now status and sym[0].m_src lies on different cache-lines, so
>> post-process code would need extra cache-line read.
>> - new alignment causes grow of the space requirements and cache-line
>> reads/updates for structures that contain rte_crypto_op inside.
>> As there seems no actual need to have rte_crypto_asym_op cache-line
>> aligned, and rte_crypto_asym_op is not intended to be used on it's own -
>> the simplest fix is just to remove cache-line alignment for it.
>> As the immediate positive effect: on IA ipsec-secgw performance increased
>> by 5-10% (depending on the crypto-dev and algo used).
>> My guess that on machines with 128B cache-line and lookaside-protocol
>> capable crypto devices the impact will be even more noticeable.
>>
>> Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op definitions")
>>
>> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>> ---
>> doc/guides/rel_notes/release_19_05.rst | 7 +++++++
>> lib/librte_cryptodev/Makefile | 2 +-
>> lib/librte_cryptodev/meson.build | 2 +-
>> lib/librte_cryptodev/rte_crypto_asym.h | 2 +-
>> 4 files changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst
>> index c0390ca16..ec2651b65 100644
>> --- a/doc/guides/rel_notes/release_19_05.rst
>> +++ b/doc/guides/rel_notes/release_19_05.rst
>> @@ -116,6 +116,13 @@ ABI Changes
>> Also, make sure to start the actual text at the margin.
>> =========================================================
>>
>> +* cryptodev: in 18.08 new structure ``rte_crypto_asym_op`` was introduced and
>> + included into ``rte_crypto_op``. As ``rte_crypto_asym_op`` structure was
>> + defined as cache-line aligned that caused unintended changes in
>> + ``rte_crypto_op`` structure layout and alignment. Remove cache-line
>> + alignment for ``rte_crypto_asym_op`` to restore expected ``rte_crypto_op``
>> + layout and alignment.
>> +
>>
> ABI version should be bumped in the release notes as well. I will update
> that while merging.
> Apart from that
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
>> Shared Library Versions
>> -----------------------
>>
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout
2019-03-19 14:00 ` Akhil Goyal
@ 2019-03-19 14:00 ` Akhil Goyal
0 siblings, 0 replies; 7+ messages in thread
From: Akhil Goyal @ 2019-03-19 14:00 UTC (permalink / raw)
To: Konstantin Ananyev, dev; +Cc: umesh.kartha, pablo.de.lara.guarch, shally.verma
On 3/19/2019 7:03 PM, Akhil Goyal wrote:
> Hi Konstantin,
>
> On 3/7/2019 7:43 PM, Konstantin Ananyev wrote:
>> in 18.08 new cache-aligned structure rte_crypto_asym_op was introduced.
>> As it also was included into rte_crypto_op, it caused implicit change
>> in rte_crypto_op layout and alignment: now rte_crypto_op is cahce-line
>> aligned has a hole of 40/104 bytes between phys_addr and sym/asym op.
>> It looks like unintended ABI breakage, plus such change can cause
>> negative performance effects:
>> - now status and sym[0].m_src lies on different cache-lines, so
>> post-process code would need extra cache-line read.
>> - new alignment causes grow of the space requirements and cache-line
>> reads/updates for structures that contain rte_crypto_op inside.
>> As there seems no actual need to have rte_crypto_asym_op cache-line
>> aligned, and rte_crypto_asym_op is not intended to be used on it's own -
>> the simplest fix is just to remove cache-line alignment for it.
>> As the immediate positive effect: on IA ipsec-secgw performance increased
>> by 5-10% (depending on the crypto-dev and algo used).
>> My guess that on machines with 128B cache-line and lookaside-protocol
>> capable crypto devices the impact will be even more noticeable.
>>
>> Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op definitions")
>>
>> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>> ---
>> doc/guides/rel_notes/release_19_05.rst | 7 +++++++
>> lib/librte_cryptodev/Makefile | 2 +-
>> lib/librte_cryptodev/meson.build | 2 +-
>> lib/librte_cryptodev/rte_crypto_asym.h | 2 +-
>> 4 files changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst
>> index c0390ca16..ec2651b65 100644
>> --- a/doc/guides/rel_notes/release_19_05.rst
>> +++ b/doc/guides/rel_notes/release_19_05.rst
>> @@ -116,6 +116,13 @@ ABI Changes
>> Also, make sure to start the actual text at the margin.
>> =========================================================
>>
>> +* cryptodev: in 18.08 new structure ``rte_crypto_asym_op`` was introduced and
>> + included into ``rte_crypto_op``. As ``rte_crypto_asym_op`` structure was
>> + defined as cache-line aligned that caused unintended changes in
>> + ``rte_crypto_op`` structure layout and alignment. Remove cache-line
>> + alignment for ``rte_crypto_asym_op`` to restore expected ``rte_crypto_op``
>> + layout and alignment.
>> +
>>
> ABI version should be bumped in the release notes as well. I will update
> that while merging.
> Apart from that
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
>> Shared Library Versions
>> -----------------------
>>
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-03-19 14:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 14:13 [dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout Konstantin Ananyev
2019-03-08 12:59 ` Trahe, Fiona
2019-03-12 12:04 ` Shally Verma
2019-03-19 13:33 ` Akhil Goyal
2019-03-19 13:33 ` Akhil Goyal
2019-03-19 14:00 ` Akhil Goyal
2019-03-19 14:00 ` 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).