Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3305454ybh; Mon, 16 Mar 2020 20:31:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtNA579HTI9nEf9RyV7oSRJ4xlZYYDclSbYy7pjc7yhqpLD8/GXxQTby3nrCPGW2UVV+j08 X-Received: by 2002:aca:62d5:: with SMTP id w204mr1909731oib.119.1584415889869; Mon, 16 Mar 2020 20:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584415889; cv=none; d=google.com; s=arc-20160816; b=ibXJXFh0hN8FO3X2Kv3BOW2XHQl/DDLWhsKCUM2BKqB0cFaBz7eYBg1aRh0iolUWn3 KQLdnEh4Te5TzFN4REP/Jj20cp8wWY057Pr90tr429gPbQl+1KBxA52iztCNnYpXm7SD iMf4VbMSjzArRLCQdb/lHE4gwdrCxxpZZjY48kD9gkR4j7lLvWIGYyKMZOxoASMcD1YS TXX2+eiDZrAHJ8SlgPs72DjEpSEh967+zMM38dnK+jKLhxzYAyfASuuM6Fu2BOq3UpZ6 IF0yNnaqq3tAFH11GN+sgpzECxFXlkhuCm/3O1MS5XHxLf8Bz9EsyoZq2wTJpU0f0gG9 B+9Q== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=FlN06LX2WqQ5BuSLqn0+jTyviAqF7PBNFuYr1l7UcZo=; b=U85AbXiP1bUWTiGbVaIn7+gPJz375jBVVg6NRAIz/2XGdjm3hwpeleVXKETr8HfBoP j4YFH528+Nfo0XSAlMZj+5PzUb0EO3T1pHoANPOQI2PINdP8ylM3IFkhUUgsx0jOIm91 9LlhIHdOKDWjNb0N4C24LIAyr5U8Uht9Cg3bRc4GJ1WA1A8af58vg00X2QumdbQQewnH fAWHBtiwmV4uFG2DzSp9XafDeBn9xXtDWk9veSGFUDvzpHhBTTK+w/bMjV3+VKVvLSaM hZ5o15tQm3uSbLHajYHRjkNxj9Cq6Ra39GUWtF/1zn/+bOA67zVbdU5Be94vqfB4dtKs j+nQ== 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 d22si928066oti.316.2020.03.16.20.31.13; Mon, 16 Mar 2020 20:31:29 -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 S1726962AbgCQDXH (ORCPT + 99 others); Mon, 16 Mar 2020 23:23:07 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:38864 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbgCQDXH (ORCPT ); Mon, 16 Mar 2020 23:23:07 -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 1jE2oW-0007Oi-Rq; Tue, 17 Mar 2020 14:22:45 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Tue, 17 Mar 2020 14:22:44 +1100 Date: Tue, 17 Mar 2020 14:22:44 +1100 From: Herbert Xu To: Horia =?utf-8?Q?Geant=C4=83?= Cc: Iuliana Prodan , Baolin Wang , Ard Biesheuvel , Corentin Labbe , 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: <20200317032244.GA18743@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> <61c28d90-af55-25a1-3729-90a622f2a7b2@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <61c28d90-af55-25a1-3729-90a622f2a7b2@nxp.com> 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 01:05:32PM +0200, Horia Geantă wrote: > On 3/12/2020 5:26 AM, Herbert Xu wrote: > > On Mon, Mar 09, 2020 at 12:51:32AM +0200, Iuliana Prodan wrote: > >> > >> ret = enginectx->op.do_one_request(engine, async_req); > >> - if (ret) { > >> - dev_err(engine->dev, "Failed to do one request from queue: %d\n", ret); > >> - goto req_err; > >> + can_enq_more = ret; > >> + if (can_enq_more < 0) { > >> + dev_err(engine->dev, "Failed to do one request from queue: %d\n", > >> + ret); > >> + goto req_err_1; > >> + } > > > > So this now includes the case of the hardware queue being full > > and the request needs to be queued until space opens up again. > I see no difference when compared with existing implementation: > in both cases failing the transfer from SW queue to HW queue means > losing the request irrespective of the error code returned by .do_one_request. > > This doesn't mean it shouldn't be fixed. I don't think they are the same though. With the existing code, you only ever have one outstanding request so a new one is only given over to the hardware after the previous one has completed. That means that the only errors you expect to get from the driver are fatal ones that you cannot recover from. With parallel requests, you will be giving as many requests to the driver as it can take. In fact the error condition is now used to tell the engine to stop giving more requests. This is in no way the same as a fatal error from before. We should not print out an error in this case and we should ensure that the request is put back on the queue and reprocessed when the driver comes back for more. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt