Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3305896ybh; Mon, 16 Mar 2020 20:32:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vubXnp2dmaBhRzfOsQEHXfaCOQW2zgUuImSyDxS0/FmqpmXrW939NgnZG2Aijd9P0ZWfLmk X-Received: by 2002:aca:fcd8:: with SMTP id a207mr2161169oii.56.1584415921144; Mon, 16 Mar 2020 20:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584415921; cv=none; d=google.com; s=arc-20160816; b=lJ332jsHHv2GXXyoLA2z/J0yauKel5J2aVOCTR1kycaANaC3KWDRslr2qbjm+IC9AA Q+CHlfxXHhrle395uRGKF6lZ2G1iLuuVAS16KdumtZDAJMQ+zXXvtt7cNz/8q7h+/h/T EuY2SxWVc3j+qNn3qxVfJIPIu12TR9P7fDhpgGVXaVbY7s3Jm6O/cyS2+MqqTs6KignO MovvrrA7+SIargIHqJdsTEvNlIToQUarXyGJg7SOc4stFTPU0GWDCFjy4QnmHcdOHJcX 0m6hxCWakk3r3jst5Uilgtv64sAir8HmxTjZgfxUmoOjNjtNsAxCoLVeHL/UkfZng5T6 stsA== 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; bh=sSvSUC7BJ1/ffFAOAJWSrp4QvuJnVV8Xj8SFCfF8eKk=; b=HemtxoOV5lgmvh5tX5W8aLfyj79NqpthCTYty2sDpvqtoxJTLSpLI5Nk83DI1aqMtL rZPCYu9Xolm6FiT1OEMs4RbAgNAHx6Nl1hxU7/6lWCeO3Ky+2lCf4YUuxcQDm4HhGiuL S6KKst2pIC1T/QoULRFOPv9rmJh8BiR7f44yrIN2ALHA3UKCbLTSNDaV36aiv7P4lOmZ X1uWwCngAVn58VMWLqzZtz5wyLckr5gZrX/IlnOyR7K9tyrcJzoBN06EuPM39VZHj4f8 9bFhY6ZfwhGlcHc2sy+hl6gmbwBbNPjhAGCeKWP0tbJsyEappznv+I7CFYELLqOwxyxd ZSlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 w13si990195otm.111.2020.03.16.20.31.49; Mon, 16 Mar 2020 20:32:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725837AbgCQD3j (ORCPT + 99 others); Mon, 16 Mar 2020 23:29:39 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:38896 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbgCQD3j (ORCPT ); Mon, 16 Mar 2020 23:29:39 -0400 Received: from gwarestrin.me.apana.org.au ([192.168.0.7] helo=gwarestrin.arnor.me.apana.org.au) by fornost.hmeau.com with smtp (Exim 4.89 #2 (Debian)) id 1jE2uy-0007TK-Gt; Tue, 17 Mar 2020 14:29:25 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Tue, 17 Mar 2020 14:29:24 +1100 Date: Tue, 17 Mar 2020 14:29:24 +1100 From: Herbert Xu To: Iuliana Prodan Cc: Baolin Wang , Ard Biesheuvel , Corentin Labbe , Horia Geanta , Maxime Coquelin , Alexandre Torgue , Maxime Ripard , Aymen Sghaier , "David S. Miller" , Silvano Di Ninno , Franck Lenormand , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx Subject: Re: [PATCH v4 1/2] crypto: engine - support for parallel requests Message-ID: <20200317032924.GB18743@gondor.apana.org.au> References: <1583707893-23699-1-git-send-email-iuliana.prodan@nxp.com> <1583707893-23699-2-git-send-email-iuliana.prodan@nxp.com> <20200312032553.GB19920@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Mar 12, 2020 at 12:45:54PM +0000, Iuliana Prodan wrote: > > There are two aspects here: > - if all requests go through crypto-engine, and, in this case, if there > is no space in hw queue, do_one_req returns 0, and actually there will > be no case of do_one_request() < 0; OK, that makes sense. However, this way of signaling for more requests can be racy. Unless you can guarantee that the driver is not taking any requests from another engine queue (or any other source), just because it returned a positive value now does not mean that it would be able to take a request the next time you come around the loop. > I've tried this, but it implies modifications in all drivers. For > example, a driver, in case of error, it frees the resources of the > request. So, will need to map again a request. I think what we are doing here is a major overhaul to the crypto engine API so while it's always a good idea to minimise the impact, we should not let the existing drivers constrain us too much. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt