Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7766632ybl; Thu, 16 Jan 2020 05:21:27 -0800 (PST) X-Google-Smtp-Source: APXvYqwfO/749/HTOIjp0lUMGPLJCt5MK9SiLEFhdQVQXTyBy2+MBEvLT2Yy7rSpA8X9o8E2Xj0D X-Received: by 2002:a54:468b:: with SMTP id k11mr3852447oic.134.1579180887578; Thu, 16 Jan 2020 05:21:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579180887; cv=none; d=google.com; s=arc-20160816; b=wJLiQ21PWmpQc162cipz2BvK+gnGHSDNX7vrQqEJunuILtjrw6N+1jnCrPuB+wd/ru kAThunvqUKzR5SuLWvu6pMcUAScpI7nxHBKvBSpvEROQRq5d3pY4PBUp2XSyfqaXLslF mvkgXH9CGdTyD5HuaCVql2997i+99twc5vIefHq+RBv8DCIsTtydvbqMIDHOs6SnS8XP Tw5myDNgel22p2cXZTAC1JWF2QHg8K0vLy8HGnWNb00GDmNs4pobZjL627EOTg9Em6sc aChdofaZKo8r1oUrWK0HJxyYAOyd39gaF5f5IKGwChLBER2QxHYASRCcJurIxgLn9gBQ li3Q== 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:dkim-signature; bh=tbAt5pOcctelyMI0Pw/2Boj48DssPhA/WaoryvyZ5m0=; b=ASiTR/Ayt8xS7CXtWIKXrEUiB/MREFx/mnVqYUd788NlcuRe8E2Q1CxOYhKku/GIoA +y5jxgwe+biXHGMtp3lwruSMf/qxVWOZDcvyjzHeM5O2c9subbNwp5t7ODXWMXvXiMU5 6MZQLVFOKCADP88uyYDfvLsuptzdcXCAfR6p5Onq05umN0uIam2JTGRvlP2qBgB5dXul 8syAypAbyfhkZnY6Z3/FgqgxaQAoQlbDHk3iz6f8gQOHnMc0Gr/OL5bnpltbD8fmYWZE SDVOcMmuaIQBUBnbsoyowsfZUVkG3soquC/3R+AbvZUDr/+l4gB+zvJI/ffdKKBFx/NJ Muww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y1tnjYY9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si10270199oiz.237.2020.01.16.05.21.15; Thu, 16 Jan 2020 05:21:27 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y1tnjYY9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726827AbgAPNVN (ORCPT + 99 others); Thu, 16 Jan 2020 08:21:13 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43868 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgAPNVN (ORCPT ); Thu, 16 Jan 2020 08:21:13 -0500 Received: by mail-wr1-f65.google.com with SMTP id d16so19128178wre.10; Thu, 16 Jan 2020 05:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tbAt5pOcctelyMI0Pw/2Boj48DssPhA/WaoryvyZ5m0=; b=Y1tnjYY9zApO2OQtTlDt04IWqpItEAIZ5N7I1UyRyrMF0VujSdOWoWeW23YpRJREit Ye7auccjOUK5vicYqb5Kybo0WeIT3zvCnpw2YhunRBvypG34tKCGQO+Am7f7xzTZmKzG O/CU2sLyQOWI0vysFxCMbgNRbAFQK7aw6ke/dLrtXqmXBOxY7x1mSWOtn8uIb/A5+bcO VSayKSZztrGF42u+FDH0K6DMs3+GPpUFxslOKs//lWPYKSNF+Vc+xUua0Top/zxAdZhO rQEOPlOwktWilbCv0LX37iTT08dPftP+a5KI+ymcN1qZpKbzkkhaYj8DmKqhEKoWAlck x1+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tbAt5pOcctelyMI0Pw/2Boj48DssPhA/WaoryvyZ5m0=; b=pI7/AQgLgWXKo7zwk+sgBhsFRHD72+22H3PuKWCQWv7S16nMCYnQLAbJLxRVNXcKm4 GQjZVMMrLIWKkIzNP+th/P3b+ECcwU1JdTG+3FToOUQIldTJL+GhyJyW2CQ34V67RUw+ j1PUWh3Drv6+lhgrxB8AZechvsADvIiJOMa6xs/WVDKFtCMN3NnNGcnmT4eJ8Nzpabt5 jXMaQUfKHNlh/2MUAii016YX+2WG12vuvn7cBRhSzdJrHxyBOWntQx4duw/Q+T/c3iCw pCk4e7bedZ7LkCPa2Y2Dc2Tfr+ymvoe0xaVz5x5JDUyoKI2EP46c0sCT/gk6Yol4RvKI R/dg== X-Gm-Message-State: APjAAAUfp66ZxPRWY+3ZHo8I2+gxbOQ4nj7toDlWakaPbtpGEYSTbqG7 sxnL0V8MRgpesX9+4NEJiDQ= X-Received: by 2002:a05:6000:1187:: with SMTP id g7mr3415042wrx.109.1579180870884; Thu, 16 Jan 2020 05:21:10 -0800 (PST) Received: from Red ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id o15sm29681752wra.83.2020.01.16.05.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2020 05:21:09 -0800 (PST) Date: Thu, 16 Jan 2020 14:21:07 +0100 From: Corentin Labbe To: Iuliana Prodan Cc: "alexandre.torgue@st.com" , "davem@davemloft.net" , "herbert@gondor.apana.org.au" , "mcoquelin.stm32@gmail.com" , "mripard@kernel.org" , "wens@csie.org" , Horia Geanta , Aymen Sghaier , "linux-arm-kernel@lists.infradead.org" , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-sunxi@googlegroups.com" Subject: Re: [PATCH RFC 06/10] crypto: engine: introduce ct Message-ID: <20200116132107.GB26487@Red> References: <20200114135936.32422-1-clabbe.montjoie@gmail.com> <20200114135936.32422-7-clabbe.montjoie@gmail.com> 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, Jan 16, 2020 at 11:34:19AM +0000, Iuliana Prodan wrote: > On 1/14/2020 4:00 PM, Corentin Labbe wrote: > > We will store the number of request in a batch in engine->ct. > > This patch adds all loop to unprepare all requests of a batch. > > > > Signed-off-by: Corentin Labbe > > --- > > crypto/crypto_engine.c | 30 ++++++++++++++++++------------ > > include/crypto/engine.h | 2 ++ > > 2 files changed, 20 insertions(+), 12 deletions(-) > > > > diff --git a/crypto/crypto_engine.c b/crypto/crypto_engine.c > > index b72873550587..591dea5ddeec 100644 > > --- a/crypto/crypto_engine.c > > +++ b/crypto/crypto_engine.c > > @@ -28,6 +28,7 @@ static void crypto_finalize_request(struct crypto_engine *engine, > > bool finalize_cur_req = false; > > int ret; > > struct crypto_engine_ctx *enginectx; > > + int i = 0; > > > > spin_lock_irqsave(&engine->queue_lock, flags); > > if (engine->cur_reqs[0].req == req) > You're checking here just the first request, but do the completion for > all? Why? Shouldn't we check for each request if it was done by hw or not? The first request is a sort of key for the whole batch. > > I've also seen that the do_one_request is called only on the first > request, from the batch. Since the request are linked, this is not a problem. But I miss this explanaition in the code. > > In your driver you do the prepare/unprepare for the whole batch at once, > but not all drivers, who uses crypto-engine, are doing this (see virtio, > amlogic, stm32). And I don't know if they can... prepare is optionnal, and unprepare is optional even if prepare is done. Furthermore, doing prepare/unprepare is optional per request. I have tested this serie on sun8i-ss and amlogic which dont use prepare/unprepare.