Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752866AbdCAPi3 (ORCPT ); Wed, 1 Mar 2017 10:38:29 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34230 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbdCAPiX (ORCPT ); Wed, 1 Mar 2017 10:38:23 -0500 Subject: Re: [RFC PATCH v4] IV Generation algorithms for dm-crypt To: Gilad Ben-Yossef References: <1486463731-6224-1-git-send-email-binoy.jayan@linaro.org> <68f70534-a309-46ba-a84d-8acc1e6620e5@gmail.com> <2aef6e54-805f-e09b-ae66-c198f8c05335@gmail.com> Cc: Binoy Jayan , Oded , Ofir , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, Mark Brown , Arnd Bergmann , Linux kernel mailing list , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Shaohua Li , linux-raid@vger.kernel.org, Rajendra , Ondrej Mosnacek From: Milan Broz Message-ID: Date: Wed, 1 Mar 2017 16:38:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 In-Reply-To: <2aef6e54-805f-e09b-ae66-c198f8c05335@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1245 Lines: 34 On 03/01/2017 02:04 PM, Milan Broz wrote: > On 03/01/2017 01:42 PM, Gilad Ben-Yossef wrote: > ... > >> I can certainly understand if you don't wont to take the patch until >> we have results with >> dm-crypt itself but the difference between 8 separate invocation of >> the engine for 512 >> bytes of XTS and a single invocation for 4KB are pretty big. > > Yes, I know it. But the same can be achieved if we just implement > 4k sector encryption in dmcrypt. It is incompatible with LUKS1 > (but next LUKS version will support it) but I think this is not > a problem for now. > > If the underlying device supports atomic write of 4k sectors, then > there should not be a problem. > > This is one of the speed-up I would like to compare with the IV approach, > because everyone should benefit from 4k sectors in the end. > And no crypto API changes are needed here. > > (I have an old patch for this, so I will try to revive it.) If anyone interested, simple experimental patch for larger sector size (up to the page size) for dmcrypt is in this branch: http://git.kernel.org/cgit/linux/kernel/git/mbroz/linux.git/log/?h=dm-crypt-4k-sector It would be nice to check what performance gain could be provided by this simple approach. Milan