All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilad Ben-Yossef <gilad@benyossef.com>
To: "Ondrej Mosnáček" <omosnacek+linux-crypto@gmail.com>
Cc: Mike Snitzer <snitzer@redhat.com>,
	gilad.benyossef@arm.com, dm-devel@redhat.com,
	linux-crypto@vger.kernel.org, Alasdair Kergon <agk@redhat.com>,
	Ofir <ofir.drang@arm.com>
Subject: Re: [PATCH] dm: switch dm-verity to async hash crypto API
Date: Sun, 29 Jan 2017 09:39:20 +0200	[thread overview]
Message-ID: <CAOtvUMfx4xYQk7_NQTQsc0xxGnsKkQdGk97XY5vv2tE0aHLpfw@mail.gmail.com> (raw)
In-Reply-To: <CAAUqJDsC8BVnudsirn96O2qTHh4jMmYYe4YBiO83UW-PGfy+Qg@mail.gmail.com>

Hi Odrej,

On Thu, Jan 26, 2017 at 1:34 PM, Ondrej Mosnáček
<omosnacek+linux-crypto@gmail.com> wrote:
> Hi Gilad,
>
> 2017-01-24 15:38 GMT+01:00 Gilad Ben-Yossef <gilad@benyossef.com>:
>> -       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

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

  reply	other threads:[~2017-01-29  7:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 14:38 [PATCH] dm: switch dm-verity to async hash crypto API Gilad Ben-Yossef
2017-01-26 11:34 ` Ondrej Mosnáček
2017-01-29  7:39   ` Gilad Ben-Yossef [this message]
2017-01-30  0:28     ` Eric Biggers
2017-02-06 14:02       ` Gilad Ben-Yossef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOtvUMfx4xYQk7_NQTQsc0xxGnsKkQdGk97XY5vv2tE0aHLpfw@mail.gmail.com \
    --to=gilad@benyossef.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=gilad.benyossef@arm.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=ofir.drang@arm.com \
    --cc=omosnacek+linux-crypto@gmail.com \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.