Received: by 10.192.165.148 with SMTP id m20csp2871939imm; Mon, 7 May 2018 02:36:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr5J0gVi82QjQ5lh/MLkOpXzGYpFsqMd5wBRKcdDQyHvLMu3MJfBSEFGPccFe9LiylLS+66 X-Received: by 2002:a65:65d1:: with SMTP id y17-v6mr25216010pgv.270.1525685771438; Mon, 07 May 2018 02:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525685771; cv=none; d=google.com; s=arc-20160816; b=wq4W16JGyWUkIWU/4i5yIcCJ27jUuTPPQa05RtYWAkwEvYeWeIK/TgQy+t5F1JIbdF tUwjBsEMp7mqeGCX8sgMCURc7MfyVm6DC3wofchwoyL0FkE2u+rfDsuX9scWPdfePa4E 1DQc1aiZ3ZAQ/uiJMEjvGYW5qwvz7H+P5Ho3aEYUc/EfP7zNRLbyCSK6ZJFEXgWyRY7q BYxFTuKdw8HvcNLin4uLV94dGTHDQvzoVH6XWYHMiJ/rFOw7YSjJ0Ab5+EWgIIRNYFhI t19q4qrB9X8xcgSiC8eSp1mUoyof2oNrTTecs+5/nSdENSq/QQtoNmE09PMcD8tmja9y FX/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=4iDJx7qPDF+P7BBFNYvtUlEbsj3ioPuGVQjLRt0h54o=; b=AF6q+ujKYENKyiI01k2bfCdzNAyShVMVQmlcS4aKVVAy13uw5WrZzMMwCD3DO7MMWY RxpZcx3Nb+l6lp5dirQiaO5kCQolkEolsIjMZoKNxoROER2UmKY6pfRZ/Rcz8H+Z5v5r jihtVm3yZ9udb7j+FTvRZLJHFeSJfAdv9ZhtVOcGfB2Ber+uLLIcHTEy52TxJHnQqRfx GrPXv5uJZqbvcpBKnJJnxRhTcjC6+le8VtXIQkWpBvaM5cDzz8VjBuxbPieAV6xMcTRB 185zlel2FLb1B1kRwDHqYOxuDDtoQpRskAHhC+PKju9z03INBSRXUgqla/mxfp5lLOAT 6drw== 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 u8-v6si22297689plm.134.2018.05.07.02.35.57; Mon, 07 May 2018 02:36:11 -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 S1752219AbeEGJfY (ORCPT + 99 others); Mon, 7 May 2018 05:35:24 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:50420 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751764AbeEGJfX (ORCPT ); Mon, 7 May 2018 05:35:23 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1fFcYD-0008Kz-LC; Mon, 07 May 2018 17:35:21 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1fFcY3-0007Pf-FI; Mon, 07 May 2018 17:35:11 +0800 Date: Mon, 7 May 2018 17:35:11 +0800 From: Herbert Xu 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 Message-ID: <20180507093511.jscgnk436e3ba4un@gondor.apana.org.au> References: <20180118113905.GA19904@gondor.apana.org.au> <1516322661.2526.3.camel@megha-Z97X-UD7-TH> <20180316145351.GA6231@gondor.apana.org.au> <20180418110115.v2w3o5yfv4u3gc4r@gondor.apana.org.au> <20180419032525.6csodbz6lrksyudd@gondor.apana.org.au> <20180426094445.4jiwondmtbenepo2@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 01, 2018 at 10:39:15PM +0000, Dey, Megha wrote: > > crypto/simd.c provides a simd_skcipher_create_compat. I have used the same template to introduce simd_ahash_create_compat > which would wrap around the inner hash algorithm. > > Hence we would still register 2 algs, outer and inner. Right. > Currently we have outer_alg -> mcryptd alg -> inner_alg > > Mcryptd is mainly providing the following: > 1. Ensuring the lanes(8 in case of AVX2) are full before dispatching to the lower inner algorithm. This is obviously why we would expect better performance for multi-buffer as opposed to the present single-buffer algorithms. > 2. If there no new incoming jobs, issue a flush. > 3. A glue layer which sends the correct pointers and completions. > > If we get rid of mcryptd, these functions needs to be done by someone. Since all multi-buffer algorithms would require this tasks, where do you suggest these helpers live, if not the current mcryptd.c? That's the issue. I don't think mcryptd is doing any of these claimed functions except for hosting the flush helper which could really live anywhere. All these functions are actually being carried out in the inner algorithm already. > I am not sure if you are suggesting that we need to get rid of the mcryptd work queue itself. In that case, we would need to execute in the context of the job requesting the crypto transformation. Which is fine as long as you can disable the FPU. If not the simd wrapper will defer the job to kthread context as required. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt