Re: [PATCH] dm: switch dm-verity to async hash crypto API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Odrej,

On Thu, Jan 26, 2017 at 1:34 PM, Ondrej Mosnáček
<omosnacek+linux-crypto@xxxxxxxxx> wrote:
> Hi Gilad,
>
> 2017-01-24 15:38 GMT+01:00 Gilad Ben-Yossef <gilad@xxxxxxxxxxxxx>:
>> -       v->tfm = crypto_alloc_shash(v->alg_name, 0, 0);
>> +       v->tfm = crypto_alloc_ahash(v->alg_name, 0, CRYPTO_ALG_ASYNC);
>
> I believe you should pass zero as the mask here. When flags == 0 and
> mask == CRYPTO_ALG_ASYNC, you are basically saying "I want only algs
> that have flags & CRYPTO_ALG_ASYNC == 0", which means you should only
> get ahash tfms that are always synchronous (see [1]). However, since
> you set a non-NULL callback in verity_hash_init, I don't think this
> was your intention. By setting the mask to zero, you should be able to
> get also an actual async tfm.
>
> Thanks,
> Ondrej
>
> [1] https://lkml.org/lkml/2016/12/13/904

Thank you very much for the review.

I am the first to admit that I find the Crypto API very cryptic (pun
intended)... :-)

I actually followed the example in Documentation/crypto/api-intro.txt.
I see now the example is
not doing what I though it was doing. Thank you for clarifying this. I
will send out a 2nd version.

The thing I find puzzling in this is that I saw a difference in
latency when a async algorythm
provider driver with high priority (3000) was loaded vs. not. Based on
your description I would
expect the performance not to change. I will retest with the change
and will publish the results.

Thanks!
Gilad




-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux