Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932108Ab0AML42 (ORCPT ); Wed, 13 Jan 2010 06:56:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752773Ab0AML41 (ORCPT ); Wed, 13 Jan 2010 06:56:27 -0500 Received: from one.firstfloor.org ([213.235.205.2]:35887 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886Ab0AML41 (ORCPT ); Wed, 13 Jan 2010 06:56:27 -0500 Date: Wed, 13 Jan 2010 12:56:17 +0100 From: Andi Kleen To: William Allen Simpson Cc: Linux Kernel Developers , Linux Kernel Network Developers , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Eric Dumazet , Andi Kleen Subject: Re: [PATCH v4] tcp: harmonize tcp_vx_rcv header length assumptions Message-ID: <20100113115617.GA24818@basil.fritz.box> References: <4B49D001.4000302@gmail.com> <4B4DA4F4.6060007@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B4DA4F4.6060007@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 997 Lines: 24 On Wed, Jan 13, 2010 at 05:48:20AM -0500, William Allen Simpson wrote: > Harmonize tcp_v4_rcv() and tcp_v6_rcv() -- better document tcp doff > and header length assumptions. > > Reduces multiply/shifts, marginally improving speed. > > Removes redundant tcp header length checks before checksumming. I wonder if this actually improves performance on x86. On x86 and several other architecture there's a addressing mode which allows to scale numbers by small factors (like 4). So doing a *4 is very cheap. That's likely cheaper than using another register for the scaled value, especially on 32bit x86 which doesn't have many. It's difficult to benchmark this code, but did you check that the code shrinks after applying this patch at least? -andi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/