From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B3CAC4338F for ; Wed, 25 Aug 2021 08:08:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 35DD860F21 for ; Wed, 25 Aug 2021 08:08:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239334AbhHYIJj (ORCPT ); Wed, 25 Aug 2021 04:09:39 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:54326 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbhHYIJf (ORCPT ); Wed, 25 Aug 2021 04:09:35 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtp (Exim 4.92 #5 (Debian)) id 1mInxZ-0004dm-Th; Wed, 25 Aug 2021 16:08:33 +0800 Received: from herbert by gondobar with local (Exim 4.92) (envelope-from ) id 1mInxJ-00051r-IH; Wed, 25 Aug 2021 16:08:17 +0800 Date: Wed, 25 Aug 2021 16:08:17 +0800 From: Herbert Xu To: Eric Dumazet , Ard Biesheuvel , Eric Biggers Cc: Leonard Crestez , Dmitry Safonov <0x7f454c46@gmail.com>, David Ahern , Shuah Khan , Eric Dumazet , "David S. Miller" , Kuniyuki Iwashima , Hideaki YOSHIFUJI , Jakub Kicinski , Yuchung Cheng , Francesco Ruggeri , Mat Martineau , Christoph Paasch , Ivan Delalande , Priyaranjan Jha , Menglong Dong , netdev@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFCv3 05/15] tcp: authopt: Add crypto initialization Message-ID: <20210825080817.GA19149@gondor.apana.org.au> References: <30f73293-ea03-d18f-d923-0cf499d4b208@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30f73293-ea03-d18f-d923-0cf499d4b208@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 24, 2021 at 04:34:58PM -0700, Eric Dumazet wrote: > > On 8/24/21 2:34 PM, Leonard Crestez wrote: > > The crypto_shash API is used in order to compute packet signatures. The > > API comes with several unfortunate limitations: > > > > 1) Allocating a crypto_shash can sleep and must be done in user context. > > 2) Packet signatures must be computed in softirq context > > 3) Packet signatures use dynamic "traffic keys" which require exclusive > > access to crypto_shash for crypto_setkey. > > > > The solution is to allocate one crypto_shash for each possible cpu for > > each algorithm at setsockopt time. The per-cpu tfm is then borrowed from > > softirq context, signatures are computed and the tfm is returned. > > > > I could not see the per-cpu stuff that you mention in the changelog. Perhaps it's time we moved the key information from the tfm into the request structure for hashes? Or at least provide a way for the key to be in the request structure in addition to the tfm as the tfm model still works for IPsec. Ard/Eric, what do you think about that? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt