Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751808AbcDRFbN (ORCPT ); Mon, 18 Apr 2016 01:31:13 -0400 Received: from mail-yw0-f171.google.com ([209.85.161.171]:36758 "EHLO mail-yw0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751354AbcDRFbK (ORCPT ); Mon, 18 Apr 2016 01:31:10 -0400 MIME-Version: 1.0 In-Reply-To: <20160415134849.GA32694@gondor.apana.org.au> References: <20160415134849.GA32694@gondor.apana.org.au> Date: Mon, 18 Apr 2016 13:31:09 +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: 1430 Lines: 39 Hi Herbert, On 15 April 2016 at 21:48, Herbert Xu wrote: > On Tue, Mar 15, 2016 at 03:47:58PM +0800, Baolin Wang wrote: >> Now some cipher hardware engines prefer to handle bulk block by merging requests >> to increase the block size and thus increase the hardware engine processing speed. >> >> This patchset introduces request bulk mode to help the crypto hardware drivers >> improve in efficiency. > > Could you please explain why this merging can't be done in dm-crypt > instead? We've tried to do this in dm-crypt, but it failed. The dm-crypt maintainer explained to me that I should optimize the driver, not add strange hw-dependent crypto modes to dm-crypt, this is not the first crypto accelerator that is just not suited for this kind of use. He thought if it can process batch of chunks of data each with own IV, then it can work with dm-crypt, but he thought such optimized code should be inside crypto API, not in dmcrypt. I think his suggestion is reasonable, so we introduce the crypto engine framework to factor out the common patterns for driving the queue of operations. Then it will be more reasonable to do the bulk mode optimization in crypto engine framework. Thanks. > > Thanks, > -- > 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