Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2190126ybv; Fri, 21 Feb 2020 10:36:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzDBOtUco6FIYFBhpjKTeh/lwFmulXwystoBzYcI+leqec39Mvp2t9SDVY2KO6tkvGSRd+B X-Received: by 2002:aca:2312:: with SMTP id e18mr3247976oie.34.1582310160041; Fri, 21 Feb 2020 10:36:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582310160; cv=none; d=google.com; s=arc-20160816; b=eCEwzzaZmLfkxnGDIyCfNQuJypiHKo7IqztWV25qlpdlz+h/Hey8t3lJvv6UdF9Dvn q7PKOXiCLSSghZjcruKKIFzaaV0M1XMqk0YP1RU1+bKkdnsLDo8ogRFsvWWCoq/nbaIt uBbc2pXvWQGtjZe6fbkDgM5O1X9May19EriuB19xcFXezywv14a5hWb1OeBs/Te67UNt 8Iq6xZ2RLY10hLRQr7BaWaKypXItGG+kKV/C3EIIYC6+YUPTOqu5iy57K1RJueua7OHh 2rVDfgircaN/H9jkGLWq/Ml/fUFIT0MfSLva+03ntJuUAhiGA32i0dLAkW+X7pAoNVCp qs/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=dCUuVoqNQjd5NJmm/hHmkRe9F4vsP+f95HiLsrWoQ9Y=; b=1A6sGWlBTWiVsjd1H4xXhYeszrERVXAa+4ZWx3dtunKCtaSFIzs+FZmVR4TlzVttfg 1jmA0d6h8egmkrY1DyJK7QrLvujKa67oQ5GGqduzxoK5PBHA08rkaytemCCYP4AwFeee xpwWUjfq+VSlzLtqSwIrAAEeWPeaorB/4wMLHH7C/osvS7PyLGaUN8n7NaokT4LLASOF WhKriktTOvr4nbsiqSaK/qTVlzI6hz8rngbSi+2jTA844M5RSTtSimNW5h+NtCH/DJ2e mVXe1YrCJ6yQwXJjvtOsUnFbYzH54T6/cUdadTzJie/0xV4kcPDAuFOYGfog2SPS5vk3 SxCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XaZHrOsm; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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. [209.132.180.67]) by mx.google.com with ESMTP id l10si1835970oth.243.2020.02.21.10.35.43; Fri, 21 Feb 2020 10:36:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XaZHrOsm; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 S1726423AbgBUSek (ORCPT + 99 others); Fri, 21 Feb 2020 13:34:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:39068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbgBUSek (ORCPT ); Fri, 21 Feb 2020 13:34:40 -0500 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1A5A7206E2; Fri, 21 Feb 2020 18:34:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582310079; bh=AwjpQ9bU1S2PO28VwY0r/NJG8mG+uZ8wB0q2OyWZklI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XaZHrOsm4cKVGzTCJY6bfly9OlJApRJV01unB788BikFgj7nIXYnCUmRTcAAYB5Lk niWLuT62tt+H6Iz1PEcuGjjCzamgspIlE4BfnGw93Mvp/jtCANModDTSBO7mEresJ5 Jxh+dq6sU2WasMLiA+ukMwijngpv7Ww26sVXImW0= Date: Fri, 21 Feb 2020 10:34:37 -0800 From: Eric Biggers To: Christoph Hellwig Cc: Satya Tangirala , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, Barani Muthukumaran , Kuohong Wang , Kim Boojin Subject: Re: [PATCH v7 3/9] block: blk-crypto-fallback for Inline Encryption Message-ID: <20200221183437.GC925@sol.localdomain> References: <20200221115050.238976-1-satyat@google.com> <20200221115050.238976-4-satyat@google.com> <20200221173539.GA6525@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200221173539.GA6525@infradead.org> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Feb 21, 2020 at 09:35:39AM -0800, Christoph Hellwig wrote: > High-level question: Does the whole keyslot manager concept even make > sense for the fallback? With the work-queue we have item that exectutes > at a time per cpu. So just allocatea per-cpu crypto_skcipher for > each encryption mode and there should never be a slot limitation. Or > do I miss something? It does make sense because if blk-crypto-fallback didn't use a keyslot manager, it would have to call crypto_skcipher_setkey() on the I/O path for every bio to ensure that the CPU's crypto_skcipher has the correct key. That's undesirable, because setting a new key can be expensive with some encryption algorithms, and also it can require a memory allocation which can fail. For example, with the Adiantum algorithm, setting a key requires encrypting ~1100 bytes of data in order to generate subkeys. It's better to set a key once and use it many times. Making blk-crypto-fallback use the keyslot manager also allows the keyslot manager to be tested by routine filesystem regression testing, e.g. 'gce-xfstests -c ext4/encrypt -g auto -m inlinecrypt'. - Eric