From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756669AbbLARUQ (ORCPT ); Tue, 1 Dec 2015 12:20:16 -0500 Received: from mga14.intel.com ([192.55.52.115]:1670 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756120AbbLARUM (ORCPT ); Tue, 1 Dec 2015 12:20:12 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,369,1444719600"; d="scan'208";a="862326200" Message-ID: <1448990373.22260.0.camel@schen9-desk2.jf.intel.com> Subject: Re: [PATCH v3 5/5] crypto: AES CBC multi-buffer glue code From: Tim Chen To: Herbert Xu Cc: "H. Peter Anvin" , "David S.Miller" , Stephan Mueller , Chandramouli Narayanan , Vinodh Gopal , James Guilford , Wajdi Feghali , Jussi Kivilinna , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 01 Dec 2015 09:19:33 -0800 In-Reply-To: <20151126084912.GA22103@gondor.apana.org.au> References: <1447971340.4933.81.camel@schen9-desk2.jf.intel.com> <20151124094710.GA32679@gondor.apana.org.au> <1448389806.4933.112.camel@schen9-desk2.jf.intel.com> <20151126084912.GA22103@gondor.apana.org.au> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.8.5 (3.8.5-2.fc19) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-11-26 at 16:49 +0800, Herbert Xu wrote: > On Tue, Nov 24, 2015 at 10:30:06AM -0800, Tim Chen wrote: > > > > On the decrypt path, we don't need to use multi-buffer algorithm > > as aes-cbc decrypt can be parallelized inherently on a single > > request. So most of the time the outer layer algorithm > > cbc_mb_async_ablk_decrypt can bypass mcryptd and > > invoke mb_aes_cbc_decrypt synchronously > > to do aes_cbc_dec when fpu is available. > > This avoids the overhead of going through mcryptd. Hence > > the use of blkcipher on the inner layer. For the mcryptd > > path, we will complete a decrypt request in one shot so > > blkcipher usage should be fine. > > I think there is a misunderstanding here. Just because you're > using/exporting through the ablkcipher interface doesn't mean > that you are asynchrounous. For example, all blkcipher algorithms > can be accessed through the ablkcipher interface and they of course > remain synchrounous. > > So I don't see how using an ablkcipher in the inner layer changes > anything at all. You can still return immediately and not bother > with completion functions when you are synchrounous. > > Cheers, OK, I'll try to see if I can cast things back to the original ablkcipher request and use that to walk the sg list. Tim