From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
To: Milan Broz <gmazyland@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: <agk@redhat.com>, <snitzer@redhat.com>,
<herbert@gondor.apana.org.au>, <dm-devel@redhat.com>,
<linux-kernel@vger.kernel.org>, <arnd@arndb.de>,
<jonathan.cameron@huawei.com>
Subject: Re: [PATCH 4/5] crypto: Add IV generation templates
Date: Thu, 19 Jul 2018 09:46:04 +0800 [thread overview]
Message-ID: <cda1d3de-3f21-2dfc-0423-c1cf456838b4@huawei.com> (raw)
In-Reply-To: <82248c13-42fe-b598-0cd7-68e5db0b51be@gmail.com>
Hi,
On 2018/7/19 1:17, Milan Broz wrote:
> On 18/07/18 18:46, Mark Brown wrote:
>> On Wed, Jul 18, 2018 at 10:16:05AM +0200, Milan Broz wrote:
>>
>>> So we are here again and moving INTERNAL dm-crypt functionality into
>>> cryptoapi.
> (namely TCW and LMK) do much more that IV - they modify encryption mode.
> This was a hack to support some FDE encryption modes (old Truecrypt and loopAES)
> and that should not spread outside dm-crypt (and blame me for this code hacks :).
>
> 2) If the reason is performance, please provide numbers with the patch.
> What I see now is that the performance is almost the same. So why you are doing it?
> Any real hw that benefits from it?
I add IV templates, such as 'plain()', 'benbi()'
When applying it to the existing algorithm, such as 'aes-cbc', and so on,
it generates new algorithm 'aes-cbc-plain', 'aes-cbc-benbi.
This patch modify the dm-crypt to rely on the new algorithm 'aes-cbc-benbi'.
Dm-crypt passes the whole 'bio' to 'aes-cbc-benbi', rather than divide
the bio into sectors, and alternatively pass each sector to 'aes-cbc'.
Because the internal implementation of the IV template 'benbi()' is still
dividing the whole bio into sectors, so the performance is almost the same.
The purpose of this patch is to let dm-crypt rely on the new algorithm 'aes-cbc-benbi'
and pass the whole bio to the new algorithm.
And then if the hardware driver implements this new algorithm, it can get the data of
the bio at one time, and return the processed data at one time.
I think it will decrease the overhead of passing each sector alternatively.
But the hardware need to implement the new algorithm if it want to benefit from this.
Thanks,
Xiongfeng
>
> I added 4k sector support in dmcrypt and IMO this helps much more
> than some hw IV accelerations (AFAIK is is already used in some mainframe
> accelerators this way because of performance).
>
> Milan
>
>
next prev parent reply other threads:[~2018-07-19 1:46 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-18 7:30 [PATCH 0/5] crypto: add " Xiongfeng Wang
2018-07-18 7:30 ` [PATCH 1/5] crypto: api - introduce API to (un)register a array of templates Xiongfeng Wang
2018-07-18 7:30 ` [PATCH 2/5] crypto: ccm - use template array registering API to simplify the code Xiongfeng Wang
2018-07-18 7:30 ` [PATCH 3/5] crypto: gcm " Xiongfeng Wang
2018-07-18 7:30 ` [PATCH 4/5] crypto: Add IV generation templates Xiongfeng Wang
2018-07-18 8:16 ` Milan Broz
2018-07-18 8:48 ` Xiongfeng Wang
2018-07-18 13:11 ` Mike Snitzer
2018-07-18 16:46 ` Mark Brown
2018-07-18 17:17 ` Milan Broz
2018-07-18 17:47 ` Mark Brown
2018-07-19 1:46 ` Xiongfeng Wang [this message]
2018-07-19 8:50 ` Arnd Bergmann
2018-07-19 8:54 ` Herbert Xu
2018-07-19 13:30 ` Mark Brown
2018-07-19 18:14 ` kbuild test robot
2018-07-18 7:30 ` [PATCH 5/5] dm-crypt: modify dm-crypt to rely on " Xiongfeng Wang
2018-07-18 10:59 ` [PATCH 0/5] crypto: add " Arnd Bergmann
2018-07-18 15:34 ` Ard Biesheuvel
2018-07-19 10:55 ` Xiongfeng Wang
2018-07-19 14:08 ` Ard Biesheuvel
2018-07-19 15:50 ` Mark Brown
2018-07-20 1:02 ` Ard Biesheuvel
2018-07-20 11:45 ` Mark Brown
2018-07-20 12:23 ` Ard Biesheuvel
2018-07-20 12:32 ` Mark Brown
2018-07-22 13:39 ` Gilad Ben-Yossef
2018-07-23 0:13 ` Ard Biesheuvel
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=cda1d3de-3f21-2dfc-0423-c1cf456838b4@huawei.com \
--to=wangxiongfeng2@huawei.com \
--cc=agk@redhat.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=dm-devel@redhat.com \
--cc=gmazyland@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=jonathan.cameron@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®