Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp448512pxu; Tue, 1 Dec 2020 15:45:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJypFbCjYOtUnYffYLupAlR3dvphPPdJh0ESEJ76xusJHTMfLf/fNDg008kSKJ2YGz+dU1+/ X-Received: by 2002:a05:6402:1542:: with SMTP id p2mr34133edx.298.1606866354594; Tue, 01 Dec 2020 15:45:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606866354; cv=none; d=google.com; s=arc-20160816; b=dm5gBLZV9uKiB1BYSGJdk2VgsLqvGFsrZBPDerbZj4zaPhumR6MpEisGkhikx7Nd20 qchjwHFtwBdbzBCuMsUIBz7og1tXyjwONV+7wNqnPrgy45vsuSn9yNJr8VKoFVI37NpL FWQeVK4IVT3DBvCfkAs9ZnDywxYKqvXpOSOUNxAEUSqtELyd2mz8dx+jPZmpziMHmlW+ d6lTmCqGph0d2oe4kMLxdRqYi+ra11ehI7RcrVawGMRwRGS4OX22KdtCEjQ1ys5+TV/N 3hneufao/220emQKjqeAph3xde68+U1pgkaE/rswJpqvEXZTnfJ1AeRkKW3aEnFBeDDP RcrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vQf12KCT2Gu6Hozzrq9Ime1Qq4YOxFLv/o3z1hyhUPw=; b=hfurhBJdLbrMw/aQaAZyb9cpxBrRnE27Xv0ZjtLjM492yGZ9g9zqdw0NtaQyPq04BL n8CHHmyXSCKIi440HkPg1hK2aHmf8AG5KEXJ+ebQEBaKTwqiCKXnWLriNI6rhqCzKK3p 5sosHPYLzmy4F78WZGz/ZNnvhwDZnGbCgYnvovTNzG8ihlIaOVX9tBcdSWO5r2hKh/PE 0RzvHqUrRV2+/WMDujp8vVB67rcO2o3aXDsfArWasFpZ7YRtvZtbD8QjqayzMrJdB8E/ NYfwknt84t1zMr5hUm2rdWDroacQUKU152ifpVulHB6BHqDT12TksquqwdUM3axDBrs+ 8fOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="fVbWXn/H"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si912711ejb.243.2020.12.01.15.45.24; Tue, 01 Dec 2020 15:45:54 -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=@kernel.org header.s=default header.b="fVbWXn/H"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727266AbgLAXm3 (ORCPT + 99 others); Tue, 1 Dec 2020 18:42:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:51670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727046AbgLAXm3 (ORCPT ); Tue, 1 Dec 2020 18:42:29 -0500 X-Gm-Message-State: AOAM530C8aXBtWOi6SMLgKNTK5AKy1NmXHSKKUV431YmsApovkvlhZCU 2dQcPVn+78LCaB2JtT0+vB/yKMV+wUe0fk3IO4U= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606866108; bh=S0e8qOgN+iRW8W/+JNaIHLOYPv7to3nrUyCAxe7bt34=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fVbWXn/HypZpWTgRBEOnji3/wE0wWGoVkjq7EZ2TZOPSr52WKQFWLtZmTeK4JqJrB uCpiXiTBNO9GXEO/dREUURnrA3dmOEwDuE2/T8ikOKlcOpnXqMa1cW4aNJtngFzb/D avjEHxprq7w297OlaVPEj7tfp1nzLf3ylTG9mnXg= X-Received: by 2002:a05:6830:214c:: with SMTP id r12mr3647640otd.90.1606866107385; Tue, 01 Dec 2020 15:41:47 -0800 (PST) MIME-Version: 1.0 References: <20201201194556.5220-1-ardb@kernel.org> <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> In-Reply-To: <20201201233024.GB32382@gondor.apana.org.au> From: Ard Biesheuvel Date: Wed, 2 Dec 2020 00:41:36 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] crypto: aesni - add ccm(aes) algorithm implementation To: Herbert Xu Cc: Linux Crypto Mailing List , Ben Greear , Steve deRosier Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, 2 Dec 2020 at 00:30, Herbert Xu wrote: > > On Wed, Dec 02, 2020 at 12:24:47AM +0100, Ard Biesheuvel wrote: > > > > True. But the fallback only gets executed if the scheduler is stupid > > enough to schedule the TX task onto the core that is overloaded doing > > RX softirqs. So in the general case, both TX and RX will be using > > AES-NI instructions (unless the CCMP is done in hardware which is the > > most common case by far) > > I don't think this makes sense. TX is typically done in response > to RX so the natural alignment is for it to be on the same CPU. > 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? > > Wireless is very different. Wifi uses a medium that is fundamentally > > shared, and so the load it can induce is bounded. There is no way a > > wifi interface is going to saturate a 64-bit AES-NI core doing CCMP in > > software. > > This sounds pretty tenuous. In any case, even if wireless itself > doesn't get you, there could be loads running on top of it, for > example, IPsec. > Yes, but IPsec will not use the synchronous interface. > > Given the above, can't we be pragmatic here? This code addresses a > > niche use case, which is not affected by the general concerns > > regarding async crypto. > > We already have a framework for acceleration that works properly > in aesni, I don't want to see us introduce another broken model > within the same driver. > > So either just leave the whole thing along or do it properly by > making wireless async. > 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.