Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp456509pxu; Tue, 1 Dec 2020 16:02:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPjOiAB0VevKiR7fQ/h+nE7taR9Gk9+xt4EoVG8YR9Gcnq8LXgO4sB8TzIXRAf741z/P+M X-Received: by 2002:a17:906:b143:: with SMTP id bt3mr5569015ejb.318.1606867336206; Tue, 01 Dec 2020 16:02:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606867336; cv=none; d=google.com; s=arc-20160816; b=AZlcYk0D7ngYaxJxraDcRnYWNmBYMA2tMh+pb4Pf/SqWH6BI5qE5sBWTktDBSSbrhH iWrKRgoKaPJRBIsgi4+XzcRkt6qtlHHTv5gNYCBf0kttZfjePbK/KmJwMbqWr+1m5rcu 6XchBr/KkFE+dj1C4rC9xsv+A3tScyCcFsBpr1PMFHCDlkSnt0fomKPNCKk8HKvhRTtN PBdKh2m8qZtI0hqTP2pvjNWaHiHWSaw0cMpOFsksczpPwrwtIlPNu82HM9n3WVTT1RRO 5pb/974l4dkK+NgCu7JUOp05S726zbqK01rNsK6SgjmSICvaKUbphuRj1LAUR77alVfU AWKw== 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:organization :from:references:cc:to:subject:dkim-signature:dkim-filter; bh=lbb0i6eUynf21qBSZN1T+qrGv5Q0QO+DehED5bgMisA=; b=VxYpU4Cc1hT0GtsctVqaIBc0asflsLWXB91kBCVD0HiKE0jkmvhyf0Y9WrbJ0hLg2Q HjQqCL4tYyksOqB1upvY3r6S0CBnz9ByYC0p9qZDMlZ+lxejTkjTDdr0ZHQvIVjN3VUD 3pw0Xfz12oUTGLtOhLJ5wOoqb4cVz0HybWQNccDailiXyK6tVfewF6nJWWC7r7Y0WCTS 5fcxhIig4ncxSv/YUmrL1FY8MVo5Z2OuhngiOkFs5lLQIAXkICdV7+x0/4t6HdpoMx+7 zyKwzrU4B5sEQwMoivTZOsqXxoyoLwN4g121XAT68WVVBF/PgJtryWzJq9qQS4Zc2oqD jRlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=WBmORSOv; 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=NONE dis=NONE) header.from=candelatech.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si933840ejx.279.2020.12.01.16.01.46; Tue, 01 Dec 2020 16:02:16 -0800 (PST) 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=@candelatech.com header.s=default header.b=WBmORSOv; 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=NONE dis=NONE) header.from=candelatech.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726684AbgLBABp (ORCPT + 99 others); Tue, 1 Dec 2020 19:01:45 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:35088 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726011AbgLBABp (ORCPT ); Tue, 1 Dec 2020 19:01:45 -0500 Received: from [192.168.254.6] (unknown [50.46.158.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail3.candelatech.com (Postfix) with ESMTPSA id 76F6B13C2B0; Tue, 1 Dec 2020 16:01:04 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 76F6B13C2B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1606867264; bh=WTX+Mnb1chP7Q0YoQxvMpvJjUt3fUG1EFWiHaisdiw4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=WBmORSOveRa30UoQVvE/1ZHi8VHjMmIQAlGImqBgEJdTlhAC8gMcwfmp62xPOpQZe KToEs5qCXORSFSKKn2F3TyhNiLIQWtIWmYdgHmRz49BD3pGgM/0IGFSxvpfE02nRi7 RRpl9lFK2GG5+AWLseKgx6qPUy1WG1+1+y7kmrd8= Subject: Re: [PATCH v2] crypto: aesni - add ccm(aes) algorithm implementation To: Herbert Xu , Ard Biesheuvel Cc: Linux Crypto Mailing List , Steve deRosier References: <20201201215722.GA31941@gondor.apana.org.au> <20201201220431.GA32072@gondor.apana.org.au> <20201201221628.GA32130@gondor.apana.org.au> <20201201231158.GA32274@gondor.apana.org.au> <20201201233024.GB32382@gondor.apana.org.au> <20201201234812.GA32538@gondor.apana.org.au> From: Ben Greear Organization: Candela Technologies Message-ID: Date: Tue, 1 Dec 2020 16:01:03 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20201201234812.GA32538@gondor.apana.org.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-MW Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 12/1/20 3:48 PM, Herbert Xu wrote: > On Wed, Dec 02, 2020 at 12:41:36AM +0100, Ard Biesheuvel wrote: >> >> You just explained that TX typically runs in process context, whereas >> RX is handled in softirq context. So how exactly are these going to >> end up on the same core? > > When you receive a TCP packet via RX, this should wake up your user- > space thread on the same CPU as otherwise you'll pay extra cost > on pulling the data into memory again. > >> Yes, but IPsec will not use the synchronous interface. > > That doesn't matter when the underlying wireless code is using > the sync interface. An async user is completely capable of making > the aesni code-path unavailable to the sync user. > >> Fair enough. But it is unfortunate that we cannot support Ben's use >> case without a lot of additional work that serves no purpose >> otherwise. > > To the contrary, I think to fully support Ben's use case you must > use the async code path. Otherwise sure you'll see good numbers > when you do simple benchmarks like netperf, but when you really > load up the system it just falls apart. I can generate some very complicated traffic to test this, including bi-directional traffic, mix of tcp/udp/https, etc. If numbers will sway your opinion, let me know what traffic tests will make you happy and I'll do the testing. I know for sure that in download traffic (which is normal dominant direction for wifi stations), Ard's patch gives me about 3x increase of throughput. Without the patch, softirqd is pegged 100% futzing around with enabling and disabling the fpu. The wifi stack people do not want any extra complexity in their code, and async processing of this would be a lot of complexity. So, even if I wanted to implement it, likely it would never make it upstream anyway. I also suspect that general users may benefit from this aesni patch since many older wifi chipsets don't support wpa3 in hardware and wpa3 is the new hotness in wifi. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com