[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4Cz/xJKYbdOyjiB@arm.com>
Date: Fri, 25 Nov 2022 12:24:31 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Ard Biesheuvel <ardb@...nel.org>, Will Deacon <will@...nel.org>,
Marc Zyngier <maz@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Linux Memory Management List <linux-mm@...ck.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Linux Crypto Mailing List <linux-crypto@...r.kernel.org>
Subject: Re: [v2 PATCH 3/9] crypto: aead - Add ctx helpers with DMA alignment
On Fri, Nov 25, 2022 at 12:36:33PM +0800, Herbert Xu wrote:
> diff --git a/include/crypto/internal/aead.h b/include/crypto/internal/aead.h
> index d482017f3e20..cd8cb1e921b7 100644
> --- a/include/crypto/internal/aead.h
> +++ b/include/crypto/internal/aead.h
> @@ -39,6 +39,11 @@ static inline void *crypto_aead_ctx(struct crypto_aead *tfm)
> return crypto_tfm_ctx(&tfm->base);
> }
>
> +static inline void *crypto_aead_ctx_dma(struct crypto_aead *tfm)
> +{
> + return crypto_tfm_ctx_dma(&tfm->base);
> +}
I wonder, if drivers end up calling this, isn't it easier to do the
alignment in crypto_aead_ctx() directly? There are over 300 callers (not
sure about the padding though, it may need still driver changes unless
we can add it to something like crypto_tfm_alg_alignmask()). Or is the
expectation that not all drivers need a DMA alignment?
--
Catalin
Powered by blists - more mailing lists