Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3142655pxb; Tue, 24 Aug 2021 16:35:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwytX2eAxQKZRUi0CePpcrSh4/SlP7NTek8tbvayszSrKLiwa4fz6PTnroJl6AxML54cndn X-Received: by 2002:a02:9a02:: with SMTP id b2mr37720534jal.89.1629848141192; Tue, 24 Aug 2021 16:35:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629848141; cv=none; d=google.com; s=arc-20160816; b=dhL33PMaVRLYL7nBcgJnIgvG3qXS+OdL0igAqus0UNAq6APnpCekeupWQeeC1Jvt3/ 40piRTvvAExsEgzJnni1lcQHB8cU29AkNjok/Mn+MjruqBEnn5eYDGpq8NI/mfB56ps6 Cf2+UCKnKQvd4qqB68+ZXivlk/2pp022KyVFdGC+RLl1Zdn9u8MhyT99RxLwVEdI4zZE 2IkJaVDKr3sVhcfc8SYUIBlwBonJgF/tLBdO5baVytce3pp/Y4nfatGRDVALYWsP5TVO 7cl+cc5Wzzequ2fAeCVVU3MBY5OHpUKZ924PxeIIgLSgDJZldpEllB2D8Llp7MmcTDGA foVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=rNShSQwThr6gncf6KciCpz1nmilWRZIh2pd8pXlgU2w=; b=gjyX/G4DX0tHVLJYI26AdbxZIDYVwuAyWkZoV+SM2aILzFLoSiT4hifwin9gn7qGa3 funHBPvayjnn3AqBkNA/e2/bVgdr/r2g9UfT7fGT9tYVLJRSZztdIjNUyqYbgGoOKvgl RGu34Tf318+WWspW9cd/d589lHxC8iYa/ScIV9k5XmftWjRIXX1cDbpbRkl8jAiXPCoT pgGm1Zzzlp68zcflT8LPNEpYieBRYxOCO0ubGqLJpVTJnEymePptzgYN87oSYmlQs6/Y xi1IEr0v8IZ3Ke0s1ELSGvTGV+DJIW0dCopeDzNSTGrEUFFm3geEr1orpHE9Mjx7D4O2 mP2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qRrg8f3X; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si18428299ioh.63.2021.08.24.16.35.04; Tue, 24 Aug 2021 16:35:41 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qRrg8f3X; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233930AbhHXXfr (ORCPT + 99 others); Tue, 24 Aug 2021 19:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231552AbhHXXfq (ORCPT ); Tue, 24 Aug 2021 19:35:46 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FBDCC061757; Tue, 24 Aug 2021 16:35:02 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id j2so8807829pll.1; Tue, 24 Aug 2021 16:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rNShSQwThr6gncf6KciCpz1nmilWRZIh2pd8pXlgU2w=; b=qRrg8f3X14HU1hkXdQP2hJUuaFNZYL39Ld42quI9OZKOctN7lNB8oYiHtcPq8o85rx t2LFCX4VxkZx2JodOA7t466wfzDaVrsVEehzkHmXn5oUpa/CTb98rTfUTQAgPfWxlke1 Zg7A+78CwG+D5Ai4Yi5a7ZAuReNfUQmP5QrskBruh+QnFy3JBpZhRlSACUjFqFcOcgul yg8QDQj2fv66GheIAi44mofDz6n3AknY1FvLR4shJnVc6r/7LbTNmsv23LydETjW8+kX F7OL7chebPpqAtWv2QThWl4+NLoIscun6D1ZckwTlB0iJhzznRXXog3/zvpazvSGPKsc ZHzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rNShSQwThr6gncf6KciCpz1nmilWRZIh2pd8pXlgU2w=; b=QNkbxae/b5Jfu+BkLx90tRmdrfSSXj5hTgs/syXdFvvHtJsp393K5tACXixztcIivD Q/FE2A4qqGLnRxNEjbL0qepJADN4Xdy/oyx0i/deHvNasTfLxupNP1FyEiL8DspUtGt+ fPxb77SAgFfIjNh22TQru3zzaS34a77qcx785DzDKhDbU3D2x9q9/VV89wesDuOBLpLD bFUPebhVRMGLfXmW5AL0UM9XI8Aflmjgtg/tBcCtvNPBGRGG0H4+t92ESlJwUVMwMRFs FdBiJFIENf0AgBeCfxJygrgNe6sNW9UsvNzvbRZGTrNnrhUXp879NDIdpzNqwLp/e4I3 MLjw== X-Gm-Message-State: AOAM532C8Q6GquVY5OatQphDhmM7vw4F8M4EwocMmleWH+CMbjPRvSKu 5DV2haP7OxfNE9XBiZeHtwX6J4IgkCs= X-Received: by 2002:a17:902:8f97:b0:12f:fff9:bad4 with SMTP id z23-20020a1709028f9700b0012ffff9bad4mr25335111plo.65.1629848101603; Tue, 24 Aug 2021 16:35:01 -0700 (PDT) Received: from [192.168.86.235] (c-73-241-150-58.hsd1.ca.comcast.net. [73.241.150.58]) by smtp.gmail.com with ESMTPSA id ev12sm3308395pjb.57.2021.08.24.16.34.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Aug 2021 16:35:01 -0700 (PDT) Subject: Re: [RFCv3 05/15] tcp: authopt: Add crypto initialization To: Leonard Crestez , Dmitry Safonov <0x7f454c46@gmail.com>, David Ahern , Shuah Khan Cc: Eric Dumazet , "David S. Miller" , Herbert Xu , 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 References: From: Eric Dumazet Message-ID: <30f73293-ea03-d18f-d923-0cf499d4b208@gmail.com> Date: Tue, 24 Aug 2021 16:34:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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.