Re: [PATCH 08/12] crypto: caam - support crypto_engine framework for SKCIPHER algorithms

From: Iuliana Prodan
Date: Fri Nov 22 2019 - 09:11:57 EST

On 11/22/2019 1:09 PM, Herbert Xu wrote:
> On Fri, Nov 22, 2019 at 11:05:59AM +0000, Iuliana Prodan wrote:
>> Sorry, but I don't understand what is wrong here? I'm using the correct
>> type, the specific type, for the request when sending it to crypto engine.
>> This transfer_request_to_engine function is called from caam_jr_enqueue,
>> where I have all types of request, so I'm using the async_request, and
>> when transferring to crypto engine I cast it to the specific type.
> These internal types are only for use by the crypto API and helper
> code such as crypto_engine. They should not be used by drivers in
> general.
So, just to be clear, I shouldn't use crypto_async_request in driver code?
I see that this generic crypto request is used in multiple drivers.

>> I believe is an overhead to sent all request to crypto engine since most
>> of them can be directly executed by hw.
>> Also, in case there is no need for backlog and the hw is busy we can
>> drop the request.
> If the crypto_engine has so much overhead then you should work on
> fixing crypto_engine and not work around it like this.
I can try sending _all_ requests to crypto engine and make some
performance measurements to see which solution is best.