Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3948446rwa; Tue, 23 Aug 2022 13:08:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR4OELAGe7MTOky0fUZjc9fulK942nSbXYK9Yk1AAV/Wpu31OzFu0aqBXe32wPUtWQOBK9Xu X-Received: by 2002:a17:90b:4a51:b0:1f5:8308:6ed7 with SMTP id lb17-20020a17090b4a5100b001f583086ed7mr4713628pjb.177.1661285310031; Tue, 23 Aug 2022 13:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661285310; cv=none; d=google.com; s=arc-20160816; b=YuohBxXB678cRI6tky7uvkxU9mdONqmcvwD2FL5AWSTV/hwTzXLLs8w/wRL5sYmvaM AlEVMdCXHkViFBc9gZhDemkDE6VThmtkoQI0clDEy2Qils31CYbX2k1CFZxtP62qXEPg +o+p5+J1yHOH134ckhfWK5esC5hSGAnfb+4iP3qinVfChN9XPuBOHssWeTswTi/j0y0L Wv5UbmrN9Nuqjj667zXYILgMxNzUgumwVZYGHJEcFpfI+6wNzxUUc2yhzDVwSyTFg7do 4tobYIFJ4wrOjKDNAI2QiSQKP0zgWL7iklfDVth/T/bAX1E6V99mtjT9fxIvY0FIACJR AyJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=EjIVVDKgfAQnTIDHdcgii05+dfZdL98r/ZOX4AyAXIQ=; b=SXS3tIrMoXOSq6LOSeVblB77IU9TR3FcZv5YAQgPFkxLP9y8S7hifwYh/zxN2kA1+1 omu7op3ulntMsg0F+ERG+g1sWPy/ewt0a43x8YxpwRtyUpgtcXsHUPa/WuCyuYF8Rj4Z xuKukt6yfIhfZ3YIW6i1BjMM4kcbSva2znHD7XIAeqk9LHDC1D58S/Inr+S8SxVeWS/Z ZR8iD5Ojchw8CkoDqPP/vmGZwQx4bSsCJgrqpt1xFju0ao3liqx6oZTnthr0xi7Cg5MS l4aBGjsO7OIO7oFQNNv5nJ10pAQYHh5ujOx45KKT4eMvGHOepdzb2MzyDOeMsNSBkxb7 u8jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=Bz6hrSMn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a056a000cc700b0052acba35ae1si16732969pfv.135.2022.08.23.13.08.05; Tue, 23 Aug 2022 13:08:30 -0700 (PDT) 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; dkim=pass header.i=@arista.com header.s=google header.b=Bz6hrSMn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234013AbiHWUGm (ORCPT + 99 others); Tue, 23 Aug 2022 16:06:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231402AbiHWUGS (ORCPT ); Tue, 23 Aug 2022 16:06:18 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA368053E for ; Tue, 23 Aug 2022 12:23:37 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id bq11so11585314wrb.12 for ; Tue, 23 Aug 2022 12:23:37 -0700 (PDT) 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; bh=EjIVVDKgfAQnTIDHdcgii05+dfZdL98r/ZOX4AyAXIQ=; b=Bz6hrSMnZUAIEh8kyYJEhdmt9Abs8gtuk6WWV8UVViegyv1yBUIRpF+7JkuuhUfSI/ rmS6vJa2Sh+JAmIRmoH2m/UI0OmFPOuHhbHTwbwIV4wZwlddIgisZ4THhp2q01sywyIH Hh0WeSm6TgtlGKLOqRbq4jIfwsyhC1MFztTMd3KUIlQOxf5bwGijguJbniSrr9ZTF0B+ 66CgYodLOH8qEBXRZirm0Hc97k3H8IrR7Mt0tyDnVDsE5HDMXShvl0HUBYXjNrHYJaDL fhY4/ai44IFYTsD4NDAuGfTbxDMuUShNs+r8QC5pvwGmTb9Znd1vK2oyh8wPiyra3RLQ u18g== 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; bh=EjIVVDKgfAQnTIDHdcgii05+dfZdL98r/ZOX4AyAXIQ=; b=u3TlVIyLLRg6yca/njHmiUF2XO1N54ETLWzn8tdVJlFfPGhvcU454AEaL8KFOv3WTS lbFNNdiMd+hKsq94FS/Q8gi6L6drydsuyuB2v2tixSfuoQRHYDOS9XjHFxgQEIfHRUjG 0svDCSMNctMvclK+6+ECZem42Nh/xzz610236XgSopKssj3LYyLblE5LEmB8j77kpz2t ET6NTLG9iyDBQbgrkYUZWq5OAtM/tX2J3i5zcriKb44JsvZE3PtLmTSmWiuUOLJxZCp5 +M4Bukrz2WmkacgrOfEm3SdEF3l4MBzHpXDWiCw63rRMrwdsfglKylG4P5GP3SakmKKD SLSg== X-Gm-Message-State: ACgBeo3nUqtldxhCfsawUGcK1xrvbDebhjfbAwpijgEJxYiaXvMMfK0B 8L4vmAFzRWWGOb1rDkseZovjgA== X-Received: by 2002:a5d:64ee:0:b0:225:6ad3:34df with SMTP id g14-20020a5d64ee000000b002256ad334dfmr1949606wri.313.1661282615706; Tue, 23 Aug 2022 12:23:35 -0700 (PDT) Received: from [10.83.37.24] ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id h3-20020a05600c2ca300b003a5ea1cc63csm22779453wmc.39.2022.08.23.12.23.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Aug 2022 12:23:34 -0700 (PDT) Message-ID: <59313d4e-6934-77dd-f3a1-6c4d76f3c7d1@arista.com> Date: Tue, 23 Aug 2022 20:23:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH 6/6] net/ipv6: sr: Switch to using crypto_pool Content-Language: en-US To: liulongfang , linux-kernel@vger.kernel.org Cc: Dmitry Safonov <0x7f454c46@gmail.com>, Andy Lutomirski , Ard Biesheuvel , David Ahern , "David S. Miller" , Eric Biggers , Eric Dumazet , Francesco Ruggeri , Herbert Xu , Hideaki YOSHIFUJI , Jakub Kicinski , Leonard Crestez , Paolo Abeni , Salam Noureddine , netdev@vger.kernel.org, linux-crypto@vger.kernel.org References: <20220726201600.1715505-1-dima@arista.com> <20220726201600.1715505-7-dima@arista.com> <22bbcbf7-c51b-4933-af3d-feed77ffd352@huawei.com> From: Dmitry Safonov In-Reply-To: <22bbcbf7-c51b-4933-af3d-feed77ffd352@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 8/8/22 04:40, liulongfang wrote: > On 2022/7/27 4:16, Dmitry Safonov Wrote: >> The conversion to use crypto_pool has the following upsides: >> - now SR uses asynchronous API which may potentially free CPU cycles and >> improve performance for of CPU crypto algorithm providers; > > Is there any specific test data for this performance improvement? > How much has the memory increased? > How much has the performance improved? I have no test data for this. The idea behind this improvement is the same as behind crypto ahash: if your CPU can benefit by offloading work to hw hash accelerator and there is a driver that provides crypto backend, you may certainly win some performance. The number depends on platform/driver in use. >> - hash descriptors now don't have to be allocated on boot, but only at >> the moment SR starts using HMAC and until the last HMAC secret is >> deleted; >> - potentially reuse ahash_request(s) for different users >> - allocate only one per-CPU scratch buffer rather than a new one for >> each user >> - have a common API for net/ users that need ahash on RX/TX fast path [..] Thanks, Dmitry