Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp412035pxu; Tue, 1 Dec 2020 14:38:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzihQvkJbJWbNVKAJ0wJA/omkZfXnsvn+2AiIP2mlh4Vp1UWFB7TeRHW6dEWYIovLLUms9I X-Received: by 2002:a50:9f4a:: with SMTP id b68mr3247550edf.296.1606862306703; Tue, 01 Dec 2020 14:38:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606862306; cv=none; d=google.com; s=arc-20160816; b=XawLfIJOAisr0hhkPmHPs3O2bVRZcPwgMjuyUL1Qb1x2uihQA91qTfqE1M18V12/qF 8xe5wcMvYJbKbjLVoj/psg9+PNnQzYR/gR7gvnfcKIh+aItH9hId1VsK9rzONYrOnX1+ lbCcqT8+rCmG/CrybPoyw/nGFlLRqfxxYIgIGUK3A5bWUeJblL5pktjDUsArJXuk6iCb NSLbjTaNhRXf4Wl9Ayd9ETSAErArSOgc3QQ3IlJpCbRYq/IW2tLVj8vYMQsM3bD4wZK5 ZS/on3/PSyTEv7Yt/PY66GJNgtLVwfJQQFxcfooaED7BxGnQoIDaFEmhoe0yXOrnODvK DYUg== 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=T3j8w0xx35i6AgT5xP8MynLtjVy+9Y7///qhNQy+7n4=; b=H1UH6/oWaP+uqpvZI6N3MHTaJqPKys8WICyD2/BkOuyM5RAvCP06VmfwKhQhfwsfY/ pU+pDX8vg7mIX2J0qaWdN04JuPB1LgkkcVrAiqieGo++7EgAMf5g/yiqGKQsa6AAMUfx E1uB+fwsQu3F3iqnjaeItPpIXDOjxSBiZ4vgPToP0vxnxBqi117LrOOGmAp4rj4WMxHn Gor1DLTsFRwL+h/bKvvGkllWR07I5q0mfGtzhKvpjDYC/nr1Y/MpJsdjfBNYZ2WXJDoA N8RRAQAJLJg0VCnjD3vjl7EWQ0dX9ZPYVR6heRQiPHpP/KjYeioTc3Jf2Hd//WctzEQ0 H46w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IJOeVEvy; 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 x2si795620ejd.604.2020.12.01.14.38.02; Tue, 01 Dec 2020 14:38:26 -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=IJOeVEvy; 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 S1726921AbgLAW2q (ORCPT + 99 others); Tue, 1 Dec 2020 17:28:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:36940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726817AbgLAW2p (ORCPT ); Tue, 1 Dec 2020 17:28:45 -0500 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A68402087C for ; Tue, 1 Dec 2020 22:28:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606861684; bh=oUk3t9aepAO2x9YAWK+7mS8/O2YqOb4mMpEVIf7EkYc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IJOeVEvyx+IQ33/DOhuQtGjVGh88gI98PR/wU3H1Hy4dkekKgGYqVkkeAZTp57xYt QFI8IXvacB5IDdAbeiSB5EcG3ySpl1OmF13s2kQ977Yog/zrR3yXsQlRCTqz0tp8PS cmapt9t52qwIEz4DSQ1QcuiWKHnk+v8N5Oh+5Az8= Received: by mail-ot1-f51.google.com with SMTP id j21so3166949otp.8 for ; Tue, 01 Dec 2020 14:28:04 -0800 (PST) X-Gm-Message-State: AOAM532pNpznhwS/X9ExK4uWEg0HCDd1KGZE33NqrNa80laMVT8/ogm5 ic3VdEF1XkrnXazy3w5sjGaux/Yw+Rt3/E3mEyo= X-Received: by 2002:a05:6830:3099:: with SMTP id f25mr3428489ots.77.1606861683870; Tue, 01 Dec 2020 14:28:03 -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> In-Reply-To: <20201201221628.GA32130@gondor.apana.org.au> From: Ard Biesheuvel Date: Tue, 1 Dec 2020 23:27:52 +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 Tue, 1 Dec 2020 at 23:16, Herbert Xu wrote: > > On Tue, Dec 01, 2020 at 11:12:32PM +0100, Ard Biesheuvel wrote: > > > > What do you mean by just one direction? Ben just confirmed a > > The TX direction generally executes in process context, which > would benefit from an accelerated sync implementation. The RX > side on the other hand is always in softirq context. > Yes, and in both cases, irq_fpu_usable() will return true, unless RX and TX are running on the same core. > > substantial speedup for his use case, which requires the use of > > software encryption even on hardware that could support doing it in > > hardware, and that software encryption currently only supports the > > synchronous interface. > > The problem is that the degradation would come at the worst time, > when the system is loaded. IOW when you get an interrupt during > your TX path and get RX traffic that's when you'll take the fallback > path. > I can see how in the general case, this is something you would prefer to avoid. However, on SMP x86_64 systems that implement AES-NI (which runs at ~1 cycle per byte), I don't see this as a real problem for this driver. What we could do is expose both versions, where the async version has a slightly higher priority, so that all users that do support the async interface will get it, and the wifi stack can use the sync interface instead.