Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp841858imm; Wed, 26 Sep 2018 07:37:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV606165LyAhAoFF2tfRSfVyf/vTohpejfYeIuEBNZ2iWravNQ2IecuGPZuXoQQOEyYW82sKe X-Received: by 2002:a63:170b:: with SMTP id x11-v6mr5835690pgl.364.1537972636961; Wed, 26 Sep 2018 07:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537972636; cv=none; d=google.com; s=arc-20160816; b=mlCgTUpIBhfaDA7fCbPu+SEigZSWtRF2pzBelxd4PyJwt/QP4xfmnduo7yqicu/HjX HavA7Mnxk3mXFKQhtwWg+ruLgLe2zsbwSquRCLzbUck4A2lV95TgJMO3fRA63uJTGk0S QHcj+0YTfbch8vASXnIzisfVqSU0dAR0h9REJCuZFVf6xCFAmnfoW3J9K6l2Rpkj93q4 MRAiYijslI1DBdxNdMlMlr0dD1WZwpGDrcLV+tixOxeuSceytEaUj7XKBzAbcgh8HjEM QNaQs5zVtqZlpuOsDO8aIGCabOwlbtuEaarr+YDxZ6sg0U2aDutVgZAukQtn+iR7mtW1 Q7kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4lNDk2Damm3eF7pXdfWI+NlmCC5OyVOA7lyOShtZc+k=; b=PaGsrbcmuCBXu7or/KAEWhbh7BNfc7Lxg7vUaB7BlLDiabGD/F7pugscg9QU3uHXUc SAH3pObCAdXPgFHQg+jv2Z5kHH6DGccudknIUoFbx9XB/6h9IR4vGaAIljY12HsTQmin GV0uRc/jILSpC8OBQmWBbRXQRHqb1D9fTAHTFSVOBwf+GGl+ZgxKsZp2PjfZM8NHRYOl 9NI3prMzYU2iH/9QSmEY4BVtgFZKQIrovcxOajCnIIhpKopCth8ZvQOMhnIHjBjp5rKQ t3MeJtJwdMYsCfEqKlDFgMynvF9pBjnLI9RRd7TjFTa9D/rQ32LQNZEf56Hahs2RtXcf dc+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=zs5rjHGb; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5-v6si5441793pgj.627.2018.09.26.07.37.01; Wed, 26 Sep 2018 07:37:16 -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=@lunn.ch header.s=20171124 header.b=zs5rjHGb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728025AbeIZUto (ORCPT + 99 others); Wed, 26 Sep 2018 16:49:44 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:46322 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbeIZUto (ORCPT ); Wed, 26 Sep 2018 16:49:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=4lNDk2Damm3eF7pXdfWI+NlmCC5OyVOA7lyOShtZc+k=; b=zs5rjHGbI//5YVaa+EFPY1qGdMibaJ3qY6XwjHW7aBCIEiYHKEX0HdI+klCvqoDWKkuMaT5ECISpgOP2BSX0qC9VU2PHYUW7km3aVmlIa8ghrC3wjA+NVzxqjEAnzQ1KToJqT28AZ9gtrgiXlIKE2ytr3w3nO4nYWDojK8iWvlM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1g5AvG-0008IT-60; Wed, 26 Sep 2018 16:36:14 +0200 Date: Wed, 26 Sep 2018 16:36:14 +0200 From: Andrew Lunn To: "Jason A. Donenfeld" Cc: Ard Biesheuvel , Jean-Philippe Aumasson , Netdev , LKML , Russell King - ARM Linux , Samuel Neves , Linux Crypto Mailing List , Andrew Lutomirski , Greg Kroah-Hartman , David Miller , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net-next v6 07/23] zinc: ChaCha20 ARM and ARM64 implementations Message-ID: <20180926143614.GL1676@lunn.ch> References: <20180925145622.29959-1-Jason@zx2c4.com> <20180925145622.29959-8-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Also, this still has unbounded worst case scheduling latency, given > > that the outer library function passes its entire input straight into > > the NEON routine. > > The vast majority of crypto routines in arch/*/crypto/ follow this > same exact pattern, actually. I realize a few don't -- probably the > ones you had a hand in :) -- but I think this is up to the caller to > handle. I made a change so that in chacha20poly1305.c, it calls > simd_relax after handling each scatter-gather element, so a > "construction" will handle this gracefully. But I believe it's up to > the caller to decide on what sizes of information it wants to pass to > primitives. Put differently, this also hasn't ever been an issue > before -- the existing state of the tree indicates this -- and so I > don't anticipate this will be a real issue now. And if it becomes one, > this is something we can address *later*, but certainly there's no use > of adding additional complexity to the initial patchset to do this > now. Hi Jason This is not my area of expertise, so you should verify what i'm say here... My guess is, IPSEC will mostly ask the crypto code to work on 1500 byte full MTU packets and 64 byte TCP ACK packets. Disk encryption i guess works on 4K blocks. So these requests are all quite small, keeping the latency reasonably bounded. The wireguard interface claims it is GSO capable. This means the network stack will pass it big chunks of data and leave it to the network interface to perform the segmentation into 1500 byte MTU frames on the wire. I've not looked at how wireguard actually handles these big chunks. But to get maximum performance, it should try to keep them whole, just add a header and/or trailer. Will wireguard pass these big chunks of data to the crypto code? Do we now have 64K blocks being worked on? Does the latency jump from 4K to 64K? That might be new, so the existing state of the tree does not help you here. Andrew