[dpdk-dev] [PATCH] cryptodev: fix restore crypto op alignment and layout

Shally Verma shallyv at marvell.com
Tue Mar 12 13:04:02 CET 2019

> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Konstantin Ananyev
> Sent: Thursday, March 7, 2019 7:43 PM
> To: dev at dpdk.org
> Cc: akhil.goyal at nxp.com; umesh.kartha at caviumnetworks.com;
> pablo.de.lara.guarch at intel.com; shally.verma at caviumnetworks.com;
> Konstantin Ananyev <konstantin.ananyev at 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 at 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 at marvell.com>

More information about the dev mailing list