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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D7A4C54EBD for ; Mon, 9 Jan 2023 21:18:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238235AbjAIVST (ORCPT ); Mon, 9 Jan 2023 16:18:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238213AbjAIVRl (ORCPT ); Mon, 9 Jan 2023 16:17:41 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8281A13E20 for ; Mon, 9 Jan 2023 13:16:15 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id d17so9623470wrs.2 for ; Mon, 09 Jan 2023 13:16:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=J9KM35Fv2Dw9JmJ+2t7GGA9jMoE7j/7O85W6URim/jg=; b=jUHKr9R1sQwJJ2bJxAnapKyyeWwjbh0ONbLgUVCE3TuUCBEiAKy24tFJxSxhrS04oE 1pSA3H6dh/OY00v7xUleL9fx9CNo5u1hHUFeGOdx/9GOaARQDKglqB0LosYGGysuZP2A Ui7TFTmuyIvjIl3kJ0xumIr94MUKJLZb7rFkih9v2xYi0G7aIJpHzeos75blvPUOLW7w da1Hu4JZdKjqM4YcqlHqV0FRsAgOc3PIVh6IGWzHxDNBexNUHnKkYIHMY/Rppd/PI6Uv Uve+ynbBFDpRLFtrcLQr2ZQfruqmfREKhqmKmXL4VwdGZKl0Y/zsS7kxK3LSfTir9e+h Igow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=J9KM35Fv2Dw9JmJ+2t7GGA9jMoE7j/7O85W6URim/jg=; b=XWc2Q1gensWLKUQx7xVEdZsImCZanZwa7MfsKgKOJY0PWxOO8DIXKUpa0DW12rvemD +1DzmF6guTmh1sDZ2dZy3uIAwZQTKYCQP7/NH835LInD8fXJUlY2q67RzQh+9241P05H b+LKs9YWNk/dPwbvvXkx+rHQyH88SOFmQqNNZJA0+TcApA9Ij3qEwKS8pXt5lcZWs3Pc nk4ymVwYEeE8Y4fjI8AZEvm2jjmFu2THy7+bmRI/2aMfIAd/chV6uX3gTu62TlkFHq19 uZkWefv5m5Bcu5/+FwF9EeLnw54q2SLX/bmPH4I8locpLJMYVej0Y2SdeDnwCfZL6ZZA ZghA== X-Gm-Message-State: AFqh2kouUKlug7+8T+f35nol756Jyj7xTGav4F6bWA5aWs8+qJ1yLtst wnZlkrz7EWEWDl6rbteh8dNn+Q== X-Google-Smtp-Source: AMrXdXv/cm6IaIy2SIh+NbQ31mBw1A15x3wThIGG/18avpBuj1g5CAbRI4qwwLVQyj0JSlJYYytNTA== X-Received: by 2002:a05:6000:383:b0:242:5a80:79b8 with SMTP id u3-20020a056000038300b002425a8079b8mr43660704wrf.20.1673298974073; Mon, 09 Jan 2023 13:16:14 -0800 (PST) Received: from [10.83.37.24] ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id t10-20020a5d534a000000b00272c0767b4asm9430012wrv.109.2023.01.09.13.16.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Jan 2023 13:16:13 -0800 (PST) Message-ID: Date: Mon, 9 Jan 2023 21:16:12 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v2 3/5] crypto/net/tcp: Use crypto_pool for TCP-MD5 Content-Language: en-US To: Jakub Kicinski Cc: linux-kernel@vger.kernel.org, David Ahern , Eric Dumazet , Herbert Xu , "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 References: <20230103184257.118069-1-dima@arista.com> <20230103184257.118069-4-dima@arista.com> <20230106180526.6e65b54d@kernel.org> From: Dmitry Safonov In-Reply-To: <20230106180526.6e65b54d@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/7/23 02:05, Jakub Kicinski wrote: > On Tue, 3 Jan 2023 18:42:55 +0000 Dmitry Safonov wrote: >> Use crypto_pool API that was designed with tcp_md5sig_pool in mind. >> The conversion to use crypto_pool will allow: >> - to reuse ahash_request(s) for different users >> - to allocate only one per-CPU scratch buffer rather than a new one for >> each user >> - to have a common API for net/ users that need ahash on RX/TX fast path > >> config TCP_MD5SIG >> bool "TCP: MD5 Signature Option support (RFC2385)" >> - select CRYPTO >> + select CRYPTO_POOL > > Are you sure we don't need to select CRYPTO any more? > select does not resolve dependencies. Yeah, stumbled into it when I was rebasing TCP-AO patches on the top: they select both and I think you're right that it still needs to select CRYPTO here as well (noticed only after sending v2). > >> select CRYPTO_MD5 >> help >> RFC2385 specifies a method of giving MD5 protection to TCP sessions. > >> @@ -749,29 +746,27 @@ static int tcp_v6_md5_hash_skb(char *md5_hash, >> daddr = &ip6h->daddr; >> } >> >> - hp = tcp_get_md5sig_pool(); >> - if (!hp) >> + if (crypto_pool_get(tcp_md5_crypto_pool_id, (struct crypto_pool *)&hp)) > > &hp.base ? To avoid the cast Oh, that's nice, will do! Thanks, Dmitry