patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Akhil Goyal <gakhil@marvell.com>
To: Jack Bond-Preston <jack.bond-preston@foss.arm.com>,
	Kai Ji <kai.ji@intel.com>, Fan Zhang <fanzhang.oss@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>,
	Wathsala Vithanage <wathsala.vithanage@arm.com>
Subject: RE: [EXTERNAL] [PATCH v5 1/5] crypto/openssl: fix GCM and CCM thread unsafe ctxs
Date: Wed, 3 Jul 2024 15:20:46 +0000	[thread overview]
Message-ID: <CO6PR18MB44845EAC10E9A5808A8FFA10D8DD2@CO6PR18MB4484.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20240703134552.1439633-2-jack.bond-preston@foss.arm.com>

> Subject: [EXTERNAL] [PATCH v5 1/5] crypto/openssl: fix GCM and CCM thread
> unsafe ctxs
> 
> Commit 67ab783b5d70 ("crypto/openssl: use local copy for session
> contexts") introduced a fix for concurrency bugs which could occur when
> using one OpenSSL PMD session across multiple cores simultaneously. The
> solution was to clone the EVP contexts per-buffer to avoid them being
> used concurrently.
> 
> However, part of commit 75adf1eae44f ("crypto/openssl: update HMAC
> routine with 3.0 EVP API") reverted this fix, only for combined ops
> (AES-GCM and AES-CCM).
> 
> Fix the concurrency issue by cloning EVP contexts per-buffer. An extra
> workaround is required for OpenSSL versions which are >= 3.0.0, and
> <= 3.2.0. This is because, prior to OpenSSL 3.2.0, EVP_CIPHER_CTX_copy()
> is not implemented for AES-GCM or AES-CCM. When using these OpenSSL
> versions, create and initialise the context from scratch, per-buffer.
> 
> Throughput performance uplift measurements for AES-GCM-128 encrypt on
> Ampere Altra Max platform:
> 1 worker lcore
> |   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
> |-----------------+---------------+--------------------+----------|
> |              64 |          2.60 |               1.31 |   -49.5% |
> |             256 |          7.69 |               4.45 |   -42.1% |
> |            1024 |         15.33 |              11.30 |   -26.3% |
> |            2048 |         18.74 |              15.37 |   -18.0% |
> |            4096 |         21.11 |              18.80 |   -10.9% |
> 
> 8 worker lcores
> |   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
> |-----------------+---------------+--------------------+----------|
> |              64 |         19.94 |               2.83 |   -85.8% |
> |             256 |         58.84 |              11.00 |   -81.3% |
> |            1024 |        119.71 |              42.46 |   -64.5% |
> |            2048 |        147.69 |              80.91 |   -45.2% |
> |            4096 |        167.39 |             121.25 |   -27.6% |
> 
> Fixes: 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVP API")
> Cc: stable@dpdk.org

Since this fix is reducing the performance significantly.
Backporting it alone would reduce performance on stable releases.

I would suggest applying all the patches in this series for backports.


> Signed-off-by: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
> Acked-by: Kai Ji <kai.ji@intel.com>
> Reviewed-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
Applied to dpdk-next-crypto
Thanks for the optimizations.

      reply	other threads:[~2024-07-03 15:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240603160119.1279476-1-jack.bond-preston@foss.arm.com>
2024-06-03 16:01 ` [PATCH " Jack Bond-Preston
     [not found] ` <20240603184348.1310331-1-jack.bond-preston@foss.arm.com>
2024-06-03 18:43   ` [PATCH v2 " Jack Bond-Preston
     [not found] ` <20240603185939.1312680-1-jack.bond-preston@foss.arm.com>
2024-06-03 18:59   ` Jack Bond-Preston
     [not found] ` <20240606102043.2926695-1-jack.bond-preston@foss.arm.com>
2024-06-06 10:20   ` [PATCH v3 " Jack Bond-Preston
2024-06-06 10:44     ` [EXTERNAL] " Akhil Goyal
     [not found] ` <20240607124756.3968704-1-jack.bond-preston@foss.arm.com>
2024-06-07 12:47   ` [PATCH v4 " Jack Bond-Preston
2024-07-01 12:55     ` Ji, Kai
2024-07-02 15:39     ` [EXTERNAL] " Akhil Goyal
2024-07-03 10:49       ` Jack Bond-Preston
     [not found] ` <20240703134552.1439633-1-jack.bond-preston@foss.arm.com>
2024-07-03 13:45   ` [PATCH v5 " Jack Bond-Preston
2024-07-03 15:20     ` Akhil Goyal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO6PR18MB44845EAC10E9A5808A8FFA10D8DD2@CO6PR18MB4484.namprd18.prod.outlook.com \
    --to=gakhil@marvell.com \
    --cc=dev@dpdk.org \
    --cc=fanzhang.oss@gmail.com \
    --cc=jack.bond-preston@foss.arm.com \
    --cc=kai.ji@intel.com \
    --cc=stable@dpdk.org \
    --cc=wathsala.vithanage@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).