Subject: Re: [PATCH] crypto: aesni-intel - avoid IPsec re-ordering

From: Ming Liu <[email-masked]>
Date: Thu, 13 Nov 2014 09:53:39 +0800

On 11/12/2014 07:48 PM, Steffen Klassert wrote:
> On Wed, Nov 12, 2014 at 06:41:28PM +0800, Ming Liu wrote:
>> On 11/12/2014 04:41 PM, Steffen Klassert wrote:
>>> On Wed, Nov 12, 2014 at 01:49:31PM +0800, Ming Liu wrote:
>>>>   }
>>>> @@ -147,11 +149,9 @@ static void cryptd_queue_worker(struct work_struct *work)
>>>>   	preempt_disable();
>>>>   	backlog = crypto_get_backlog(&cpu_queue->queue);
>>>>   	req = crypto_dequeue_request(&cpu_queue->queue);
>>>> -	preempt_enable();
>>>> -	local_bh_enable();
>>> Everything below the local_bh_enable() should not run in atomic context
>>> as the subsequent functions may set the CRYPTO_TFM_REQ_MAY_SLEEP flag.
>> If I turn off all the CRYPTO_TFM_REQ_MAY_SLEEP in cryptd.c, is that
>> going to work?
> Well, this might make the cryptd function accessible in atomic context,
> but it does not solve the other problems with this approach. Also,
> cryptd can be used to move requests out of atomic context and I think
> it should stay as it is.

OK, got it. Thanks for the information.

the best,
thank you