Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp664143imm; Wed, 18 Jul 2018 08:36:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcCnKVQVaXJ4D2/LcTWmBu6KNswgeSph6m2oKotu6l1fJKgrrici3z6EGbjDGU6Fx8kvoAq X-Received: by 2002:a65:6104:: with SMTP id z4-v6mr6248854pgu.361.1531928217881; Wed, 18 Jul 2018 08:36:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531928217; cv=none; d=google.com; s=arc-20160816; b=Wku9oLgwMoGiCkKlQLpu0KUvLgtyORLX76r3HbP8XKdaecMWEArlYg5dflLnsumqvr TkhrwcjzTwOKkIBhpTOAvD++z24Gc8fG2Bb5XRrU7NedFp5CV32ITUyvdvjKkaghtwcG E4InTdq41Rk/M21Id4VYcpQRODgIe2haRS2+JJa+jlV3WrAi5gZscDPPMM+JkqptJVkQ KeqlhE/CiGyAlfP/XdyH6q9lqOrka4lAEUnwerNQYtCZdKpdCjR7IdFZuq0mgPdRN7QL h3vMaDdBnMygmKc9rYtRW+dH7KUVdebFEeA8CymogR60DjMk4rs/s7/t6EeYaMzNUo4Q /XaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=He4vNQKX8oC642qSp1p3CYf4pfQMdNTC3BpNRAtzA3Q=; b=wnZNw2RLZMN9vFDBBfabNhN9LkNCyNQYrc77u037WRa4LK7lCVahiIXSH7/ZWDvarU gFlznMaBHa1aCF37b+zG/bzaBGU/0UeIM/SClRbDbh8tOzLxsyymkUjCSy0pvzdJsG/Y J6yBdUxtgsbSAGp9htEEm7kzWPZD3ffMdIV/yX5Qwz8vpbeQFo1lPaLP3Tba5LUcS2CK 5g+QYj8clOl6U9vAppuHHooff57LW2mTnUXcWEMz0TRjxDiBciE7ipKM7gj2pR1RsJni dbIXT7HJMjs1t6TFit5WekZ1+cuFhq8rT40z0Q/kcsi/GRIGLhKVgm7Spbe6Qoe95dLi KJrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b1agXNsj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t8-v6si3450776ply.139.2018.07.18.08.36.42; Wed, 18 Jul 2018 08:36:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@linaro.org header.s=google header.b=b1agXNsj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731235AbeGRQN1 (ORCPT + 99 others); Wed, 18 Jul 2018 12:13:27 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:40551 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731031AbeGRQN1 (ORCPT ); Wed, 18 Jul 2018 12:13:27 -0400 Received: by mail-it0-f65.google.com with SMTP id 188-v6so4883808ita.5 for ; Wed, 18 Jul 2018 08:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=He4vNQKX8oC642qSp1p3CYf4pfQMdNTC3BpNRAtzA3Q=; b=b1agXNsj3vOjMJf1hIDaY7rJFTEtc3fwMIpqoC7SiQGf1kWNkGsSx0Wji9fs25hE5+ UuQxKAtcq2sVrbUnpFRWegiz6BkLSPtY/P3+aetamsHJgfYM5RDpyXRbvdYcwppmUDCb loESN1bkreIsYS6h79+UpEzTjNVQspvxD8R1M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=He4vNQKX8oC642qSp1p3CYf4pfQMdNTC3BpNRAtzA3Q=; b=JG4BDMsO1lhcQnp7smzUTfL2+YMtH8VvQ7jBM1zboiZ49/U0Fv988Ej8Lp5VtW75+Q uIZ0/hezWvZ4K+eocEzUTUx/4ukk87JH2xVPZ00j5OpVgs8TPQcSk4U9Q1zKZA88qgmo D3/Pp5K7imukD5SHe6ROQQeRCvMbja96N/EEKwDHmedHwCVgrPnuPfUiDOUdP0p/ZXq9 ou48AN57/38lJA7mT94t0rvhacGzcPV/rJk3p0YP4IsIJUZMjkeciVYMwnqUbW9TW/fL Mq3WU4QECVTs/Rj4VZ4/DEVpUc6O/Vd8FFuwOfOe9DFS6A4l07Nds6J5C63XEPprnKvs xx6g== X-Gm-Message-State: AOUpUlHtapm2GOzDUZFV+JwH9vnpluxaN9Uw3t0eJKrCucqcWLTYkzQv MV9uOXKwjoylfyM8C14jVZjEy6jw7rYBTZWbq4zQtA== X-Received: by 2002:a24:d7c5:: with SMTP id y188-v6mr2417126itg.50.1531928100360; Wed, 18 Jul 2018 08:35:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ac05:0:0:0:0:0 with HTTP; Wed, 18 Jul 2018 08:34:59 -0700 (PDT) In-Reply-To: References: <1531899055-29362-1-git-send-email-wangxiongfeng2@huawei.com> From: Ard Biesheuvel Date: Thu, 19 Jul 2018 00:34:59 +0900 Message-ID: Subject: Re: [PATCH 0/5] crypto: add IV generation templates To: Arnd Bergmann Cc: Xiongfeng Wang , Alasdair Kergon , Mike Snitzer , Herbert Xu , dm-devel@redhat.com, Linux Kernel Mailing List , Mark Brown , Jonathan Cameron Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18 July 2018 at 19:59, Arnd Bergmann wrote: > On Wed, Jul 18, 2018 at 9:30 AM, Xiongfeng Wang > wrote: >> >> I tested the performance of software implemented ciphers before and after >> applying this patchset. The performance didn't change much except for >> slight regression when writting. The detail information is as follows. >> >> The command I used: >> cryptsetup -y -c aes-xts-plain -s 256 --hash sha256 luksFormat /dev/sdd1 >> cryptsetup -y -c aes-cbc-essiv:sha256 -s 256 --hash sha256 luksFormat /dev/sdd1 >> cryptsetup -y -c aes-cbc-benbi -s 256 --hash sha256 luksFormat /dev/sdd1 >> >> cryptsetup luksOpen /dev/sdd1 crypt_fun >> time dd if=/dev/mapper/crypt_fun of=/dev/null bs=1M count=500 iflag=direct >> time dd if=/dev/zero of=/dev/mapper/crypt_fun bs=1M count=500 oflag=direct >> >> Performance comparision: >> -------------------------------------------------------- >> algorithms | before applying | after applying >> -------------------------------------------------------- >> | read | write | read | write >> -------------------------------------------------------- >> aes-xts-plain | 145.34 | 145.09 | 145.89 | 144.2 >> -------------------------------------------------------- >> aes-cbc-essiv | 146.87 | 144.62 | 146.74 | 143.41 >> -------------------------------------------------------- >> aes-cbc-benbi | 146.03 | 144.74 | 146.77 | 144.46 >> -------------------------------------------------------- > > Do you have any estimate of the expected gains for hardware > implementations? > > Would it make sense to try out implementing aes-cbc-essiv > on the ARMv8 crypto extensions? I see that Ard has done > some prior work on aes-ccm in arch/arm64/crypto/aes-ce-ccm-* > that (AFAICT) has a similar goal of avoiding overhead by > combining the usual operations, so maybe the same can > be done here. > I am having trouble understanding what exactly this series aims to achieve. Calling into the crypto layer fewer times is a nice goal, but a disk sector seems like a reasonable granularity for the dm layer to operate on, and I don't think any hardware exists that operates on multi sector sequences, where it would pay off to amortize the latency of invoking the hardware over an entire bio. So in summary, you need to explain to us why we need this. It is really very easy to convince people if your changes make things go faster.