Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757931Ab3ENScm (ORCPT ); Tue, 14 May 2013 14:32:42 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:43494 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757842Ab3ENSck (ORCPT ); Tue, 14 May 2013 14:32:40 -0400 Date: Tue, 14 May 2013 11:32:39 -0700 (PDT) Message-Id: <20130514.113239.791038636818706716.davem@davemloft.net> To: bhutchings@solarflare.com Cc: geert@linux-m68k.org, heiko.carstens@de.ibm.com, linux-net-drivers@solarflare.com, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCHv2 net 2/2] sfc: Reduce RX scatter buffer size, and reduce alignment if appropriate From: David Miller In-Reply-To: <1368482482.3305.50.camel@bwh-desktop.uk.solarflarecom.com> References: <1368482311.3305.48.camel@bwh-desktop.uk.solarflarecom.com> <1368482482.3305.50.camel@bwh-desktop.uk.solarflarecom.com> X-Mailer: Mew version 6.5 on Emacs 24.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (shards.monkeyblade.net [0.0.0.0]); Tue, 14 May 2013 11:32:40 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1869 Lines: 39 From: Ben Hutchings Date: Mon, 13 May 2013 23:01:22 +0100 > efx_start_datapath() asserts that we can fit 2 RX scatter buffers plus > a software structure, each appropriately aligned, into a single page. > Where L1_CACHE_BYTES == 256 and PAGE_SIZE == 4096, which is the case > on s390, this assertion fails. > > The current scatter buffer size is also not a multiple of 64 or 128, > which are more common cache line sizes. If we can make both the start > and end of a scatter buffer cache-aligned, this will reduce the need > for read-modify-write operations on inter- processor links. > > Fix the alignment by reducing EFX_RX_USR_BUF_SIZE to 2048 - 256 == > 1792. (We could use 2048 - L1_CACHE_BYTES, but EFX_RX_USR_BUF_SIZE > also affects user-level networking where a larger amount of > housekeeping data may be needed. Although this version of the driver > does not support user-level networking, I prefer to keep scattering > behaviour consistent with the out-of-tree version.) > > This still doesn't fix the s390 build because like most architectures > it has NET_IP_ALIGN == 2. When NET_IP_ALIGN != 0 we cannot achieve > cache line alignment at either the start or end of a scatter buffer, > so there is actually no point in padding the buffers to a multiple of > the cache line size. All we need is 4-byte alignment of the network > header, so do that. > > Adjust the assertions accordingly. > > Reported-by: Geert Uytterhoeven > Reported-by: Heiko Carstens > Signed-off-by: Ben Hutchings Applied. -- 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/