Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1741291ybz; Thu, 23 Apr 2020 05:03:17 -0700 (PDT) X-Google-Smtp-Source: APiQypI02DG9msMUGfdx8WhvohGBeRZJwZoR5I6d4ZdwFaOxeeG9vEbvHpm2zU+VOkSbiUYL2ACF X-Received: by 2002:a50:9dc9:: with SMTP id l9mr2470417edk.39.1587643397694; Thu, 23 Apr 2020 05:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587643397; cv=none; d=google.com; s=arc-20160816; b=nFIcvPm/K3mFCAIls6zUjMe45Z6hUmEIqeWLBgWoSmCRmejCJbzt6EVMYZu7PUnNm8 fOwFj3zqEKIBmeHIJeRw693HTqy5LzIwAGWRlUkxgE7SpdiEcV20nePgZ2H28Zjfio6h 6H7M+QjQ5gJpoZNXfQgNthtA4ZsMMHbXMPnHOK5yL/LRwiWGcET7eOLiE61V39bTNjXy xFp/dDR41pXf9fppZuiNupG+9sWZJ+5CHanezcVNbPBTAdTm6fNAforsSoi4eGagjFg6 GqUktDRxv4W9mR0VT/WjACR4Ri+4NibQw9gIad2bx2VmgsiVgQIZf2Api8ZE43bkqx7L fwGg== 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=V8flSaIY+gZrOnIkeqCyXdQFYQ6jyXvvVgWRm3xPiuA=; b=VkrLBONPR4zbQuaxneYmaXBAQQSy4AXR/qPyO6Di+BcDDp6IZJlAwvlOq1L4y57d7w uzgq8blH5OLya2kkL0EWkFT+0Mnr0MPucmrxSk+mCmrrvKAejF/smQu2+YzNxfrW+4FG YWT+7li1q4S6bRW+JIqFw0jQ3A2xzTSgSp/a415mU1F8q8nIqqSLA6lVRivqKLD/0z1o uPVJovPd/DWj17/B+MgiSYZ5lfwBaYp43rQse6pITNz3graHxuQojpAM41qM1sMuNsfQ iH1F3xmNrnlO6FrhrR9UdAHUFN2wUCPyRoQyHmM3AZ5d31BhG/sXrIMngwlEdccBXBrC L15w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si1032163edt.393.2020.04.23.05.02.41; Thu, 23 Apr 2020 05:03:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728146AbgDWLrJ (ORCPT + 99 others); Thu, 23 Apr 2020 07:47:09 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:37446 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728017AbgDWLrJ (ORCPT ); Thu, 23 Apr 2020 07:47:09 -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 1jRaJU-0001c8-A7; Thu, 23 Apr 2020 21:46:41 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 23 Apr 2020 21:46:40 +1000 Date: Thu, 23 Apr 2020 21:46:40 +1000 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, linux-imx Subject: Re: [PATCH v5 2/3] crypto: engine - support for parallel requests based on retry mechanism Message-ID: <20200423114640.GA14399@gondor.apana.org.au> References: <1586982375-18710-1-git-send-email-iuliana.prodan@nxp.com> <1586982375-18710-3-git-send-email-iuliana.prodan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1586982375-18710-3-git-send-email-iuliana.prodan@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 Wed, Apr 15, 2020 at 11:26:14PM +0300, Iuliana Prodan wrote: > Added support for executing multiple requests, in parallel, > for crypto engine based on a retry mechanism. > If hardware was unable to execute a backlog request, enqueue it > back in front of crypto-engine queue, to keep the order > of requests. > > A new variable is added, retry_support (this is to keep the > backward compatibility of crypto-engine) , which keeps track > whether the hardware has support for retry mechanism and, > also, if can run multiple requests. > > If do_one_request() returns: > >= 0: hardware executed the request successfully; > < 0: this is the old error path. If hardware has support for retry > mechanism, the request is put back in front of crypto-engine queue. > For backwards compatibility, if the retry support is not available, > the crypto-engine will work as before. > Only MAY_BACKLOG requests are enqueued back into > crypto-engine's queue, since the others can be dropped. This looks a lot nicer! However, I do have one little issue with the error case. I think we should not lump all errors together. For queueing errors, we should requeue regardless of MAY_BACKLOG. After all, we don't want to have random packet loss just becayse the queue was full. For other errors (e.g., a kmalloc error), we should requeue the MAY_BACKLOG requests and drop everythin else. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt