All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Danny Tsen <dtsen@linux.ibm.com>
Cc: linux-crypto@vger.kernel.org, stable@vger.kernel.org,
	leitao@debian.org, nayna@linux.ibm.com, appro@cryptogams.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	mpe@ellerman.id.au, ltcgcw@linux.vnet.ibm.com, dtsen@us.ibm.com
Subject: Re: [PATCH v2] crypto: powerpc/p10-aes-gcm - Fix IPsec stall on bond failover
Date: Fri, 27 Nov 2026 13:17:00 +0800	[thread overview]
Message-ID: <awkSTCnlXZ5gmsVs@gondor.apana.org.au> (raw)
In-Reply-To: <20261120181657.6396-1-dtsen@linux.ibm.com>

On Fri, Nov 20, 2026 at 01:16:57PM -0500, Danny Tsen wrote:
> The Power10 AES-GCM driver registers its gcm(aes) and
> rfc4106(gcm(aes)) algorithms through the crypto SIMD helper. When
> crypto_simd_usable() is false, for example in softirq context, the
> helper defers requests to cryptd and completes them asynchronously
> with -EINPROGRESS.
> 
> This breaks IPsec traffic during a bond failover. With the crypto
> offload device active, traffic is switched to a passive device that
> has only software encryption, and the ESP requests then go through
> aes_gcm_p10_crypto. Under heavy load, some or all of the TCP streams
> drop to zero throughput and do not recover. The stack is seen to drop
> the ACKs as invalid, which points to the cryptd queueing delaying or
> reordering the packets.
> 
> Fix this by registering the algorithms directly as aead_alg with
> CRYPTO_ALG_NEED_FALLBACK, and allocating a "gcm(aes)" or
> "rfc4106(gcm(aes))" fallback tfm in ->init(). When VSX cannot be used
> (!crypto_simd_usable()), the key was not set up for SIMD, or
> cryptlen < 64, the request is handed to the fallback and completed
> synchronously in the caller's context. The driver no longer defers
> work to cryptd.
> 
> Remove Kconfig option CRYPTO_SIMD and add CRYPTO_AES and CRYPTO_GCM.
> 
> Fixes: c954b252dee9 ("crypto: powerpc/p10-aes-gcm - Register modules as SIMD")
> 
> Signed-off-by: Danny Tsen <dtsen@linux.ibm.com>
> ---
> Tested with tcrypt.ko (including the self-tests) and with IPsec traffic
> across a bond failover. TCP throughput no longer drops to zero.
> 
>  arch/powerpc/crypto/Kconfig            |   3 +-
>  arch/powerpc/crypto/aes-gcm-p10-glue.c | 155 +++++++++++++++++++------
>  2 files changed, 119 insertions(+), 39 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      parent reply	other threads:[~2026-11-27  5:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 18:16 [PATCH v2] crypto: powerpc/p10-aes-gcm - Fix IPsec stall on bond failover Danny Tsen
2026-11-20 20:14 ` Breno Leitao
2026-11-20 20:40   ` Danny Tsen
2026-11-27  5:17 ` Herbert Xu [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=awkSTCnlXZ5gmsVs@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=appro@cryptogams.org \
    --cc=dtsen@linux.ibm.com \
    --cc=dtsen@us.ibm.com \
    --cc=leitao@debian.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ltcgcw@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=nayna@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.