Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Mar 2004 00:55:02 -0800 (PST) Received: from mail006.syd.optusnet.com.au (mail006.syd.optusnet.com.au [211.29.132.63]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i2H8sqKO004977 for ; Wed, 17 Mar 2004 00:54:55 -0800 Received: from mail.chubb.wattle.id.au (c211-30-52-142.randw1.nsw.optusnet.com.au [211.30.52.142]) by mail006.syd.optusnet.com.au (8.11.6p2/8.11.6) with ESMTP id i2H8sTw20302; Wed, 17 Mar 2004 19:54:29 +1100 Received: from peterc by mail.chubb.wattle.id.au with local (Exim 3.36 #1 (Debian)) id 1B3Wom-0002XO-00; Wed, 17 Mar 2004 19:54:28 +1100 From: Peter Chubb MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16472.4676.684522.635248@wombat.chubb.wattle.id.au> Date: Wed, 17 Mar 2004 19:54:28 +1100 To: "David S. Miller" Cc: Peter Chubb , linux-ia64@vger.kernel.org, linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Making the NS83820 usable on IA64 In-Reply-To: <20040316214912.32b4c530.davem@redhat.com> References: <16471.52400.222262.824746@wombat.disy.cse.unsw.edu.au> <20040316214912.32b4c530.davem@redhat.com> X-Mailer: VM 7.17 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid Comments: Hyperbole mail buttons accepted, v04.18. X-Face: GgFg(Z>fx((4\32hvXq<)|jndSniCH~~$D)Ka:P@e@JR1P%Vr}EwUdfwf-4j\rUs#JR{'h# !]])6%Jh~b$VA|ALhnpPiHu[-x~@<"@Iv&|%R)Fq[[,(&Z'O)Q)xCqe1\M[F8#9l8~}#u$S$Rm`S9% \'T@`:&8>Sb*c5d'=eDYI&GF`+t[LfDH="MP5rwOO]w>ALi7'=QJHz&y&C&TE_3j! X-archive-position: 4073 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: peter@chubb.wattle.id.au Precedence: bulk X-list: netdev Content-Length: 1831 Lines: 39 >>>>> "David" == David S Miller writes: David> On Wed, 17 Mar 2004 14:57:36 +1100 Peter Chubb David> wrote: >> The idea is to tell gcc that the IP header is 2-byte aligned, so it >> can generate the right code to access it. Otherwise, it tries to >> do a 4-byte load when trying to extract the header length bitfield, >> which traps. As far as I read the C standard, gcc can do almost >> whatever it wants as regarding the alignment and underlying storage >> size of a bitfield, so it's free to assume 32-bit alignment if it >> wants. David> This makes every piece of code only able to assume 2-byte David> alignment. I don't think this will get accepted :) Well, there are at least two other alternatives. One is to copy the buffer to force iphdr to be 4-byte aligned. If you want to access a bitfield, it should be aligned at whatever the compiler expects bitfields to be aligned at -- in this case, 4-bytes. Last time I brought up this solution it was shouted down. The other is to get rid of the bitfields and to do explicit masking and shifting, every time ihl and version are accessed. And something may have to be done if we ever port to a big-endian machine with struct alignment constraints. We're saved at present by ntohl and friends on the non-aligned saddr and daddr etc. Something has to be done, however. The standard driver plus stack won't even do 100Mb/s; with any kind of network load the whole machine becomes unusable. with the patch I sent before, it gets to 315Mb/s (UDP echo server, 1024 byte packets). If I enable interrupt holdoff code (currently disabled) I can push it to 340Mb/s (and it's spending most of its time in rx_interrupt() -- system time close to 99%). Even this is pretty appalling. (Numbers derived using ipbench.sf.net)