From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.44.254]) by listman.redhat.com (Postfix) with ESMTP id D5FD83EA4B for ; Tue, 11 Dec 2001 06:02:02 -0500 (EST) Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id fBBB22p07313 for ; Tue, 11 Dec 2001 06:02:02 -0500 Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id fBBB22706058 for axp-list@listman.redhat.com; Tue, 11 Dec 2001 06:02:02 -0500 Received: from jurassic.park.msu.ru (jurassic.park.msu.ru [195.208.223.243]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id fBBB1xw06040 for ; Tue, 11 Dec 2001 06:01:59 -0500 Received: (from ink@localhost) by jurassic.park.msu.ru (8.11.6/8.11.2) id fBBB1bE07312 for axp-list@redhat.com; Tue, 11 Dec 2001 14:01:37 +0300 Date: Tue, 11 Dec 2001 14:01:37 +0300 From: Ivan Kokshaysky To: axp-list@redhat.com Subject: Re: Kernel unaligned accesses Message-ID: <20011211140137.A7087@jurassic.park.msu.ru> References: <20011210151133.A23257@linux04.mro.cpqcorp.net> <20011210204949.51405.qmail@web11208.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011210204949.51405.qmail@web11208.mail.yahoo.com>; from tomdropka@yahoo.com on Mon, Dec 10, 2001 at 12:49:49PM -0800 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: On Mon, Dec 10, 2001 at 12:49:49PM -0800, Tom Dropka wrote: > BTW, I saw the same unaligned accesses with the stock RH 2.4.3-12 > kernel, which is why I tried 2.4.16. If you have the driver compiled as module (which is probably the case for stock RH kernel), you can try to fix it even without recompiling - pass "rx_copybreak=1518" option to the module. Or try appended patch. > > Don Becker's drivers, when "adjusted" for Alpha, force a copy of the > > data from the "raw" buffer to another buffer where the data will be > > appropriately aligned, thus avoiding any unaligned accesses at the > > price of the packet copy. Yes - it's a common problem on alpha and several other platforms with network cards capable to DMA only on a 32-bit boundary (via-rhine is one of those). Without copying the packet to another buffer IP header will be misaligned, and you'll have tons of unaligned traps in the TCP/IP layer. Ivan. --- linux/drivers/net/via-rhine.c.orig Sat Nov 10 00:45:36 2001 +++ linux/drivers/net/via-rhine.c Tue Dec 11 13:11:33 2001 @@ -87,7 +87,12 @@ static int max_interrupt_work = 20; /* Set the copy breakpoint for the copy-only-tiny-frames scheme. Setting to > 1518 effectively disables this feature. */ -static int rx_copybreak; +#if defined(__alpha__) || defined(__sparc__) || defined(__mips__) || \ + defined(__arm__) +static int rx_copybreak = 1518; +#else +static int rx_copybreak = 200; +#endif /* Used to pass the media type, etc. Both 'options[]' and 'full_duplex[]' should exist for driver