Subject: Re: [PATCH 2/4] net: esp: check CRYPTO_TFM_REQ_DMA flag when allocating crypto request

From: Horia Geantă <[email-masked]>
Date: Sat, 14 Mar 2015 14:16:37 +0200

On 3/13/2015 9:46 PM, David Miller wrote:
> From: Horia Geanta <[email-masked]>
> Date: Fri, 13 Mar 2015 19:15:22 +0200
> 
>> Some crypto backends might require the requests' private contexts
>> to be allocated in DMA-able memory.
>>
>> Signed-off-by: Horia Geanta <[email-masked]>
> 
> No way.
> 
> Upper layers should be absolutely not required to know about such
> requirements.
> 
> Such details _must_ be hidden inside of the crypto layer and drivers
> and not leak out into the users of the crypto interfaces.

If you look at patch 1/4:
http://www.mail-archive.com/[email-masked]/msg13428.html
that's what's done for {aead,ablkcipher,ahash}_request_alloc().

Thus users (upper layers) that allocate the crypto requests using the
crypto API are unaware of the requirement.

However, ESP is not using aead_request_alloc(). This breaks the
interface and thus some crypto implementation details are not transparent.