Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp745743rwb; Thu, 19 Jan 2023 02:02:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXvyDtWl6fpLM+YPW+AOk9YKmrJYEV2/Cjx3WniYb7q5O0VVe+rOx5VqP8nVJUfE9Fe506q2 X-Received: by 2002:a17:902:bb89:b0:194:9b5e:a0a5 with SMTP id m9-20020a170902bb8900b001949b5ea0a5mr13138903pls.43.1674122546779; Thu, 19 Jan 2023 02:02:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674122546; cv=none; d=google.com; s=arc-20160816; b=VcdQE8s1oSWwgKnstCCm7vi6VoS0g2h7XdJN5xInMaov+NxEgSmb8kPpIJ75pd07hm ZXijiCPwAL7CFCJgPKHc5eI1SHjoy9Pt8wNsJ7FjOZkHiYeeM/cvMfpidzGBP/OPtpkT CAu0gKU3GnO8+HZqBufW8S8geOXsZZt7Q2fGA+5P+zUqm+QsRlKOSsaQK3oTXlT/If1Y XAvIJlJYjstVt6ST7mRbombRRlYE2saxN2GQEnAvmi9ERflSaKNUH9ImVGcJH+WyIAJL VRZiSlCd41ff/y3twAbFdIiUqXlyxvAF3KyF3Q5bG8zPS7dhM+fx7mvz5/tiZSSuw0Lh vhiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Kf9eVJnL2w7+o5ogp1CCLGtbUrx96Lfhe3iUVFC/dsg=; b=p4pZX87+cP8cDlu156pXG5b1uOMfW9BvNrSnhSBsoG9w69ZrjvoBmrKuV5GlHI/y8Y zzo3jZseIQYdMY8S0KcOsJcwELYboSanHPvuEyxD7pSYLLEMTTwt/e06usM5Jat8QAtf Rz4RqQ9ksJenpVsEoMUHSiriYiC3cAd4Fe+reK/gOikZS+3hfMewCtC/ZpXTGj/w+FKu 97QoKUHfCDyKuQynIr+yl6wwJRdInu8iRlDS1Y+xSvLX5yDPeVdoETQ/CyjfqGmbvPLO VWmaZFgSdT2UIVuLfEZ36R3XCZx4pTJ/szGagJM4w6uQIVUekJMojkZxYg2kcZ2UDybt ttLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o17-20020a170902779100b00189005c48aesi35694491pll.108.2023.01.19.02.02.07; Thu, 19 Jan 2023 02:02:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230200AbjASJvu (ORCPT + 99 others); Thu, 19 Jan 2023 04:51:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230227AbjASJvf (ORCPT ); Thu, 19 Jan 2023 04:51:35 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EAC8676F2; Thu, 19 Jan 2023 01:51:30 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1pIRZh-001hVL-5O; Thu, 19 Jan 2023 17:51:14 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Thu, 19 Jan 2023 17:51:13 +0800 Date: Thu, 19 Jan 2023 17:51:13 +0800 From: Herbert Xu To: Dmitry Safonov Cc: linux-kernel@vger.kernel.org, David Ahern , Eric Dumazet , Jakub Kicinski , "David S. Miller" , Andy Lutomirski , Bob Gilligan , Dmitry Safonov <0x7f454c46@gmail.com>, Hideaki YOSHIFUJI , Leonard Crestez , Paolo Abeni , Salam Noureddine , netdev@vger.kernel.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH v4 1/4] crypto: Introduce crypto_pool Message-ID: References: <20230118214111.394416-1-dima@arista.com> <20230118214111.394416-2-dima@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230118214111.394416-2-dima@arista.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jan 18, 2023 at 09:41:08PM +0000, Dmitry Safonov wrote: > Introduce a per-CPU pool of async crypto requests that can be used > in bh-disabled contexts (designed with net RX/TX softirqs as users in > mind). Allocation can sleep and is a slow-path. > Initial implementation has only ahash as a backend and a fix-sized array > of possible algorithms used in parallel. > > Signed-off-by: Dmitry Safonov > --- > crypto/Kconfig | 3 + > crypto/Makefile | 1 + > crypto/crypto_pool.c | 333 ++++++++++++++++++++++++++++++++++++++++++ > include/crypto/pool.h | 46 ++++++ > 4 files changed, 383 insertions(+) > create mode 100644 crypto/crypto_pool.c > create mode 100644 include/crypto/pool.h I'm still nacking this. I'm currently working on per-request keys which should render this unnecessary. With per-request keys you can simply do an atomic kmalloc when you compute the hash. Modelling tcp_md5 is just propagating bad code. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt