Received: by 10.192.165.156 with SMTP id m28csp381454imm; Tue, 17 Apr 2018 11:43:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+NflqD2s0MAl7o5bF3eEV3Q7YNjoE0rsUxv6iYQ4LU2C+dIZ0Bw14Ko5dvQp0f7reo/GCq X-Received: by 2002:a17:902:9303:: with SMTP id bc3-v6mr3088814plb.18.1523990623843; Tue, 17 Apr 2018 11:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523990623; cv=none; d=google.com; s=arc-20160816; b=q2gjiVHajpKFOjqr0fI1CRrMncuOJmXSu+1QnhuaZiEyFaob/GxUq2PlBKtyU2lUfh rddebaINv3tJSV784o4Bgx7kXG1kwz0ayKNGfkxTPCdMQ0scYpRQ9iVMGbwBYtJMy4VD 4ouCFHhfVsnkOVvKXvxkQ0PQkfjiZvRgA7BqshCtNDNfmcrAkb+u1z1dRR2zZ8melhGu wyXi/3PmQWk3MhheB/B8zAgR3ronAnzbr/w/EyLsK3NBayQlmVE3Iv3ZMh4g4O/gIkam 7KMArGOdCFw3DOp8EDOH4AzJC8BjDkPizMkmpocuIqIo3XpdcHoZLgwxlFOg2UEugnll rHHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=fNoCvlrrQ+qdHWNaVEA+pd9cC+J/1JB1g0VghxKY//Q=; b=ozrEdb9XK83gfzJIyhiPDz5jsslCf0dvSSqwhMZY1uTpgspGd+NnXsJcGZlsU5tsN2 lRQQWKys5FZcgKeZi6vz4kcERzY4xaEi8bOqwZeo4Jt4zS6/IBP3Fce7531INpnX1oHJ LTV3G82jfmiRjB5B5pu2+ZcOF8/dWgu94kt2/p5PNboI4U7aosUXwavM8fL6WqNoHi17 CYfBrlK754LLJ0S6fDzIJcFgk46YqThcMZ/W6JFRo1sC2O/70aSt8tKNvLr0xXgf5x6N GpGA7yAs0g3opAuJWQFRmOt+tNb/izb6VfpFQYFJgBdd6A2VHsqRiDpGJNyYFdaZWIkS y2pg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13-v6si12580867plt.142.2018.04.17.11.43.29; Tue, 17 Apr 2018 11:43:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753001AbeDQSkW convert rfc822-to-8bit (ORCPT + 99 others); Tue, 17 Apr 2018 14:40:22 -0400 Received: from mga18.intel.com ([134.134.136.126]:13307 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120AbeDQSkU (ORCPT ); Tue, 17 Apr 2018 14:40:20 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2018 11:40:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,464,1517904000"; d="scan'208";a="42672322" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by FMSMGA003.fm.intel.com with ESMTP; 17 Apr 2018 11:40:19 -0700 Received: from orsmsx159.amr.corp.intel.com (10.22.240.24) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 17 Apr 2018 11:40:19 -0700 Received: from orsmsx111.amr.corp.intel.com ([169.254.12.154]) by ORSMSX159.amr.corp.intel.com ([169.254.11.191]) with mapi id 14.03.0319.002; Tue, 17 Apr 2018 11:40:18 -0700 From: "Dey, Megha" To: Herbert Xu CC: "linux-kernel@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "davem@davemloft.net" Subject: RE: [PATCH V8 1/5] crypto: Multi-buffer encryption infrastructure support Thread-Topic: [PATCH V8 1/5] crypto: Multi-buffer encryption infrastructure support Thread-Index: AQHTiaT71VA7Q5Or9ESQdIw+yX/ir6N6FLYAgFlFdnuAMogJgA== Date: Tue, 17 Apr 2018 18:40:17 +0000 Message-ID: References: <1515542948-24041-1-git-send-email-megha.dey@linux.intel.com> <1515542948-24041-2-git-send-email-megha.dey@linux.intel.com> <20180118113905.GA19904@gondor.apana.org.au> <1516322661.2526.3.camel@megha-Z97X-UD7-TH> <20180316145351.GA6231@gondor.apana.org.au> In-Reply-To: <20180316145351.GA6231@gondor.apana.org.au> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjllM2RiZDAtOTc2My00YTNhLWJjZDUtYmEzM2Y4MmY1MmIxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjRnNXVtM2Jod1dha3o0cXI5SGozN1pPVWp0TFpySUxXVGRVektFQlR1OE09In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >-----Original Message----- >From: Herbert Xu [mailto:herbert@gondor.apana.org.au] >Sent: Friday, March 16, 2018 7:54 AM >To: Dey, Megha >Cc: linux-kernel@vger.kernel.org; linux-crypto@vger.kernel.org; >davem@davemloft.net >Subject: Re: [PATCH V8 1/5] crypto: Multi-buffer encryption infrastructure >support > >On Thu, Jan 18, 2018 at 04:44:21PM -0800, Megha Dey wrote: >> >> > So the mcryptd template is in fact completely superfluous. You can >> > remove it and just have all the main encrypt/decrypt functions >> > invoke the underlying encrypt/decrypt function directly and achieve >> > the same result. >> > >> > Am I missing something? >> >> Hi Herbert, >> >> After discussing with Tim, it seems like the mcryptd is responsible >> for queuing up the encrypt requests and dispatching them to the actual >> multi-buffer raw algorithm. It also flushes the queue if we wait too >> long without new requests coming in to force dispatch of the requests >> in queue. >> >> Its function is analogous to cryptd but it has its own multi-lane >> twists so we haven't reused the cryptd interface. > >I have taken a deeper look and I'm even more convinced now that mcryptd is >simply not needed in your current model. > >The only reason you would need mcryptd is if you need to limit the rate of >requests going into the underlying mb algorithm. > >However, it doesn't do that all. Even though it seems to have a batch size of >10, but because it immediately reschedules itself after the batch runs out, >it's essentially just dumping all requests at the underlying algorithm as fast >as they're coming in. The underlying algorithm doesn't have need throttling >anyway because it'll do the work when the queue is full synchronously. > >So why not just get rid of mcryptd completely and expose the underlying >algorithm as a proper async skcipher/hash? Hi Herbert, Most part of the cryptd.c and mcryptd.c are similar, except the logic used to flush out partially completed jobs in the case of multibuffer algorithms. I think I will try to merge the cryptd and mcryptd adding necessary quirks for multibuffer where needed. Also, in cryptd.c, I see shash interface being used for hash digests, update, finup, setkey etc. whereas we have shifted to ahash interface for mcryptd. Is this correct? Thanks, Megha > >Thanks, >-- >Email: Herbert Xu Home Page: >http://gondor.apana.org.au/~herbert/ >PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt