Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752351AbcDRH7E (ORCPT ); Mon, 18 Apr 2016 03:59:04 -0400 Received: from mail-yw0-f176.google.com ([209.85.161.176]:35096 "EHLO mail-yw0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299AbcDRH7A (ORCPT ); Mon, 18 Apr 2016 03:59:00 -0400 MIME-Version: 1.0 In-Reply-To: <20160418072434.GA17954@gondor.apana.org.au> References: <20160415134849.GA32694@gondor.apana.org.au> <20160418054511.GA17368@gondor.apana.org.au> <20160418070407.GA17760@gondor.apana.org.au> <20160418072434.GA17954@gondor.apana.org.au> Date: Mon, 18 Apr 2016 15:58:59 +0800 Message-ID: Subject: Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework From: Baolin Wang To: Herbert Xu Cc: David Miller , Alasdair G Kergon , Mike Snitzer , Jens Axboe , dm-devel@redhat.com, Andrew Morton , david.s.gordon@intel.com, Tom Lendacky , Robert Jarzmik , Masahiro Yamada , smueller@chronox.de, tadeusz.struk@intel.com, Masanari Iida , shli@kernel.org, Mark Brown , Linus Walleij , Arnd Bergmann , LKML , linux-crypto@vger.kernel.org, linux-raid@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1675 Lines: 43 On 18 April 2016 at 15:24, Herbert Xu wrote: > On Mon, Apr 18, 2016 at 03:21:16PM +0800, Baolin Wang wrote: >> >> I don't think so, the dm-crypt can not send maximal requests at some >> situations. For example, the 'cbc(aes)' cipher, it must be handled >> sector by sector (IV is dependency for each sector), so the dm-crypt >> can not send maximal requests, but must sector by sector in this >> situation. > > If you can't merge them as requests, then how is the hardware going > to benefit from batching them? Or are you talking about parallel That depends on the hardware engine. Some cipher hardware engines (like xts(aes) engine) can handle the intermediate values (IV) by themselves in one bulk block, which means we can increase the size of the request by merging request rather than always 512 bytes and thus increase the hardware engine processing speed. But for some other hardware engines (like cbc(aes) engine), they can not support bulk block, must sector by sector. So the engine drivers can select the suitable mode to do encryption/decryption. > processing similar to sha-mb? > > Even with batching we should be involving the user because only the > user knows (if anyone does) whether more data will be forthcoming. If this cipher engine can support bulk block encryption, the crypto engine framework can merge requests if they are eligible automatically. Don't need to worry about how many data will be forthcoming. > > Cheers, > -- > Email: Herbert Xu > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- Baolin.wang Best Regards