Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753124AbcKHIBi (ORCPT ); Tue, 8 Nov 2016 03:01:38 -0500 Received: from sitav-80046.hsr.ch ([152.96.80.46]:58063 "EHLO mail.strongswan.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752315AbcKHIBg (ORCPT ); Tue, 8 Nov 2016 03:01:36 -0500 X-Greylist: delayed 534 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Nov 2016 03:01:36 EST Message-ID: <1478591559.5216.7.camel@strongswan.org> Subject: Re: [PATCH v4] poly1305: generic C can be faster on chips with slow unaligned access From: Martin Willi To: "Jason A. Donenfeld" , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Biggers , =?ISO-8859-1?Q?Ren=E9?= van Dorst Date: Tue, 08 Nov 2016 08:52:39 +0100 In-Reply-To: <20161107194709.20457-1-Jason@zx2c4.com> References: <20161107191253.17998-1-Jason@zx2c4.com> <20161107194709.20457-1-Jason@zx2c4.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 540 Lines: 16 > By using the unaligned access helpers, we drastically improve > performance on small MIPS routers that have to go through the > exception fix-up handler for these unaligned accesses. I couldn't measure any slowdown here, so: Acked-by: Martin Willi > -       dctx->s[0] = le32_to_cpuvp(key +  0); > +       dctx->s[0] = get_unaligned_le32(key +  0); Not sure what the exact alignment rules for key/iv are, but maybe we want to replace the same function in chacha20_generic.c as well? Martin