From margitsw@t-online.de Fri Oct 1 01:28:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 01:28:59 -0700 (PDT) Received: from mailout06.sul.t-online.com (mailout06.sul.t-online.com [194.25.134.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i918Sl34001160 for ; Fri, 1 Oct 2004 01:28:48 -0700 Received: from fwd08.aul.t-online.de by mailout06.sul.t-online.com with smtp id 1CDIlu-0001TT-01; Fri, 01 Oct 2004 10:28:10 +0200 Received: from margit.t-online.de (Eq72tqZQYeFJSATDoI6WHGJ8lJbKO6salRcY6pGgjMmnF2ZtYJpI6M@[80.128.216.173]) by fwd08.sul.t-online.com with esmtp id 1CDIlk-1TXdRo0; Fri, 1 Oct 2004 10:28:00 +0200 Message-Id: <5.1.0.14.2.20041001084419.02570b18@pop.t-online.de> X-Sender: margitsw@pop.t-online.de X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 01 Oct 2004 09:04:27 +0200 To: Jeff Garzik From: margitsw@t-online.de (Margit Schubert-While) Subject: Re: [PATCH 2.6.9-rc2 17/38] net/islpci_dev: replace schedule_timeout() with msleep() Cc: nacc@us.ibm.com, hvr@gnu.org, mcgrof@studorgs.rutgers.edu, kernel-janitors@lists.osdl.org, prism54-devel@prism54.org, netdev@oss.sgi.com In-Reply-To: <415CD9D9.2000607@pobox.com> References: <5.1.0.14.2.20040924074745.00b1cd40@pop.t-online.de> <20040923221303.GB13244@us.ibm.com> <20040923221303.GB13244@us.ibm.com> <5.1.0.14.2.20040924074745.00b1cd40@pop.t-online.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-ID: Eq72tqZQYeFJSATDoI6WHGJ8lJbKO6salRcY6pGgjMmnF2ZtYJpI6M X-TOI-MSGID: ba701764-ae02-4cb2-8a64-3c7b741aec8c X-archive-position: 9760 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev At 00:15 01.10.2004 -0400, Jeff scribeth: >I would rather see an msleep implementation in 2.4.x... Hear, hear. And can we PLEASE have a "#define HAVE_MSLEEP" in delay.h ?!!! (2.4. AND 2.6) Margit From laforge@netfilter.org Fri Oct 1 02:02:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 02:02:45 -0700 (PDT) Received: from ganesha.gnumonks.org (Debian-exim@ganesha.gnumonks.org [213.95.27.120]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i9192dsY001982 for ; Fri, 1 Oct 2004 02:02:39 -0700 Received: from dsl-213-023-154-116.arcor-ip.net ([213.23.154.116] helo=sunbeam.gnumonks.org) by ganesha.gnumonks.org with asmtp (TLSv1:RC4-SHA:128) (Exim 4.30) id 1CDJJ1-0006Kj-CT; Fri, 01 Oct 2004 11:02:23 +0200 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.34) id 1CDJIz-00077K-Hi; Fri, 01 Oct 2004 11:02:21 +0200 Date: Fri, 1 Oct 2004 11:02:21 +0200 From: Harald Welte To: Yasuyuki Kozakai Cc: kaber@trash.net, okir@suse.de, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, usagi-core@linux-ipv6.org Subject: When to submit to which list (was Re: [PATCH] netfilter6: Skip extension headers when matching icmp6-type) Message-ID: <20041001090221.GO1860@sunbeam.de.gnumonks.org> Mail-Followup-To: Harald Welte , Yasuyuki Kozakai , kaber@trash.net, okir@suse.de, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, usagi-core@linux-ipv6.org References: <200409301244.i8UCid17009482@toshiba.co.jp> <415C1CC9.2090604@trash.net> <200410010019.i910JlZY002193@toshiba.co.jp> <200410010509.i9159Cg2021037@toshiba.co.jp> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/T+UM55GOh1Yge7W" Content-Disposition: inline In-Reply-To: <200410010509.i9159Cg2021037@toshiba.co.jp> User-Agent: Mutt/1.5.6+20040818i X-archive-position: 9761 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@netfilter.org Precedence: bulk X-list: netdev --/T+UM55GOh1Yge7W Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 01, 2004 at 02:09:10PM +0900, Yasuyuki Kozakai wrote: > # Sometimes I confuse I should send patches to netdev, or send them to > # netfilter-devel and core team of netfilter review/send it to netdev. I don't know what Patrick told you, but I think as a general rule of thumb, all netfilter-related patches should go to netfilter-devel first. Patrick or I will then push them upstream to DaveM (most times with Cc to netdev). For urgent/critical bugfixes (that are not too complex), I am ok if netfilter-devel is bypassed and you submit it to netdev/davem immediately. Pragmatically speaking, Patrick or me will read your emails on either list - but a number of other netfilter developers is not following netdev, so you deprive them of the chance to give comments before it is submitted ;) Thanks! --=20 - Harald Welte http://www.netfilter.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --/T+UM55GOh1Yge7W Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBXR0dXaXGVTD0i/8RAlTsAJ9kMxhFyec9cXf20Z7dH4U+HotAlgCePMol Fs2rfgLUkx5j3K3s7G1oDbQ= =ng6f -----END PGP SIGNATURE----- --/T+UM55GOh1Yge7W-- From yasuyuki.kozakai@toshiba.co.jp Fri Oct 1 02:33:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 02:33:48 -0700 (PDT) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i919Xc4i003075 for ; Fri, 1 Oct 2004 02:33:39 -0700 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id i919X6bv004952; Fri, 1 Oct 2004 18:33:06 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id i919X6J5003553; Fri, 1 Oct 2004 18:33:06 +0900 (JST) Received: from tis2 [133.199.160.66] by tsb-wall.toshiba.co.jp with SMTP id UAA03552 ; Fri, 1 Oct 2004 18:33:06 +0900 Received: from mx.toshiba.co.jp by tis2.tis.toshiba.co.jp id SAA12611; Fri, 1 Oct 2004 18:33:05 +0900 (JST) Received: by toshiba.co.jp id i919X4R9010911; Fri, 1 Oct 2004 18:33:04 +0900 (JST) Date: Fri, 01 Oct 2004 18:33:02 +0900 (JST) Message-Id: <200410010933.i919X4R9010911@toshiba.co.jp> To: laforge@netfilter.org Cc: yasuyuki.kozakai@toshiba.co.jp, kaber@trash.net, okir@suse.de, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, usagi-core@linux-ipv6.org Subject: Re: When to submit to which list From: Yasuyuki Kozakai In-Reply-To: <20041001090221.GO1860@sunbeam.de.gnumonks.org> References: <200410010019.i910JlZY002193@toshiba.co.jp> <200410010509.i9159Cg2021037@toshiba.co.jp> <20041001090221.GO1860@sunbeam.de.gnumonks.org> X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 9762 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yasuyuki.kozakai@toshiba.co.jp Precedence: bulk X-list: netdev OK, I'll send patches to netfilter-devel as ever. Thanks, ----------------------------------------------------------------- Yasuyuki KOZAKAI @ USAGI Project From: Harald Welte Date: Fri, 1 Oct 2004 11:02:21 +0200 > On Fri, Oct 01, 2004 at 02:09:10PM +0900, Yasuyuki Kozakai wrote: > > # Sometimes I confuse I should send patches to netdev, or send them to > > # netfilter-devel and core team of netfilter review/send it to netdev. > > I don't know what Patrick told you, but I think as a general rule of > thumb, all netfilter-related patches should go to netfilter-devel first. > Patrick or I will then push them upstream to DaveM (most times with Cc > to netdev). > > For urgent/critical bugfixes (that are not too complex), I am ok if > netfilter-devel is bypassed and you submit it to netdev/davem > immediately. > > Pragmatically speaking, Patrick or me will read your emails on either > list - but a number of other netfilter developers is not following > netdev, so you deprive them of the chance to give comments before it is > submitted ;) > > Thanks! > > -- > - Harald Welte http://www.netfilter.org/ > ============================================================================ > "Fragmentation is like classful addressing -- an interesting early > architectural error that shows how much experimentation was going > on while IP was being designed." -- Paul Vixie From ak@suse.de Fri Oct 1 03:11:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 03:11:51 -0700 (PDT) Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91ABhKB005813 for ; Fri, 1 Oct 2004 03:11:45 -0700 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 6B52ECB05CC; Fri, 1 Oct 2004 12:11:26 +0200 (CEST) Date: Fri, 1 Oct 2004 12:11:23 +0200 From: Andi Kleen To: "David S. Miller" Cc: netdev@oss.sgi.com, jheffner@psc.edu, herbert@gondor.apana.org.au Subject: Re: Current 2.6.x TSO state Message-Id: <20041001121123.19511403.ak@suse.de> In-Reply-To: <20040930213221.06a3f5b3.davem@davemloft.net> References: <20040930213221.06a3f5b3.davem@davemloft.net> X-Mailer: Sylpheed version 0.9.11 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9763 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev On Thu, 30 Sep 2004 21:32:21 -0700 "David S. Miller" wrote: > > 1) Andi sees performance anomaly to 2.6.5 kernels. > Hopefully fixed by diff3 above, merely awaiting > retesting by him. Didn't fix the problem unfortunately, it's even a bit slower with TSO than the previous kernel I tested. The stretch acks are still quite visible, see http://www.firstfloor.org/~andi/tso-stretch-ack1.gz for the full log. I will try to do the ACK instrumentation on the receiver you suggested later, unfortunately have some other urgent things to do first. Do you want me to play with the new sysctl too? tcptrace output for the last run as overview: complete conn: yes first packet: Fri Oct 1 12:02:39.725840 2004 last packet: Fri Oct 1 12:02:49.729142 2004 elapsed time: 0:00:10.003302 total packets: 315102 filename: /tmp/LOG e->f: f->e: total packets: 298495 total packets: 16607 ack pkts sent: 298494 ack pkts sent: 16607 pure acks sent: 2 pure acks sent: 16605 unique bytes sent: 432215424 unique bytes sent: 0 actual data pkts: 298492 actual data pkts: 0 actual data bytes: 432215424 actual data bytes: 0 rexmt data pkts: 0 rexmt data pkts: 0 rexmt data bytes: 0 rexmt data bytes: 0 outoforder pkts: 0 outoforder pkts: 0 pushed data pkts: 16715 pushed data pkts: 0 SYN/FIN pkts sent: 1/1 SYN/FIN pkts sent: 1/1 req 1323 ws/ts: Y/Y req 1323 ws/ts: Y/Y adv wind scale: 2 adv wind scale: 0 req sack: Y req sack: Y sacks sent: 0 sacks sent: 0 mss requested: 1460 bytes mss requested: 1460 bytes max segm size: 1448 bytes max segm size: 0 bytes min segm size: 456 bytes min segm size: 0 bytes avg segm size: 1447 bytes avg segm size: 0 bytes max win adv: 5840 bytes max win adv: 63712 bytes min win adv: 5840 bytes min win adv: 5792 bytes zero win adv: 0 times zero win adv: 0 times avg win adv: 5840 bytes avg win adv: 63673 bytes initial window: 4344 bytes initial window: 0 bytes initial window: 3 pkts initial window: 0 pkts ttl stream length: 432215424 bytes ttl stream length: 0 bytes missed data: 0 bytes missed data: 0 bytes truncated data: 423260664 bytes truncated data: 0 bytes truncated packets: 298492 pkts truncated packets: 0 pkts data xmit time: 10.003 secs data xmit time: 0.000 secs idletime max: 8.4 ms idletime max: 8.6 ms throughput: 43207275 Bps throughput: 0 Bps No SACKs etc. -Andi From ak@suse.de Fri Oct 1 03:23:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 03:23:38 -0700 (PDT) Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91ANRPx006257 for ; Fri, 1 Oct 2004 03:23:28 -0700 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id DB57ECB075C; Fri, 1 Oct 2004 12:23:09 +0200 (CEST) Date: Fri, 1 Oct 2004 12:23:06 +0200 From: Andi Kleen To: "David S. Miller" Cc: herbert@gondor.apana.org.au, jheffner@psc.edu, ak@suse.de, niv@us.ibm.com, andy.grover@gmail.com, anton@samba.org, netdev@oss.sgi.com Subject: Re: bad TSO performance in 2.6.9-rc2-BK Message-ID: <20041001102306.GA4898@wotan.suse.de> References: <20040929162923.796d142e.davem@davemloft.net> <20040929170310.46c58095.davem@davemloft.net> <20040930001007.GB10496@gondor.apana.org.au> <20040930173439.3e0d2799.davem@davemloft.net> <20040930181248.48185e41.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040930181248.48185e41.davem@davemloft.net> X-archive-position: 9764 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev > With such small receive buffers, netperf simply can't clear > the receive queue fast enough when a burst of TSO created > frames come in. I increased the receive buffers on the target and the difference between TSO and non TSO is much less now (only 5MB/s instead of 20MB/s) Your theory seems to make some sense. -Andi From ak@suse.de Fri Oct 1 03:38:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 03:38:51 -0700 (PDT) Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91Aceql006711 for ; Fri, 1 Oct 2004 03:38:41 -0700 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 43E15CAC565; Fri, 1 Oct 2004 12:35:55 +0200 (CEST) Date: Fri, 1 Oct 2004 12:35:54 +0200 From: Andi Kleen To: "David S. Miller" Cc: herbert@gondor.apana.org.au, jheffner@psc.edu, ak@suse.de, niv@us.ibm.com, andy.grover@gmail.com, anton@samba.org, netdev@oss.sgi.com Subject: Re: bad TSO performance in 2.6.9-rc2-BK Message-ID: <20041001103554.GB4898@wotan.suse.de> References: <20040929162923.796d142e.davem@davemloft.net> <20040929170310.46c58095.davem@davemloft.net> <20040930001007.GB10496@gondor.apana.org.au> <20040930173439.3e0d2799.davem@davemloft.net> <20040930181248.48185e41.davem@davemloft.net> <20040930204005.69115c0e.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040930204005.69115c0e.davem@davemloft.net> X-archive-position: 9765 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev > How do things look for you with this change Andi? > If things are still out of whack, play around with > different values of /proc/sys/net/ipv4/tcp_tso_win_divisor Still slower, like previously reported. But I tried tweaking the sysctl now. Result is that 2 is pretty good (only 3MB/s) slower and >20 is also pretty good (2MB/s slower). Everything inbetween is a lot slower, varying a bit. I wasn't able to find a setting that gave the same results as TSO off though, although the difference is not that dramatic anymore. -Andi From mlindner@syskonnect.de Fri Oct 1 04:51:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 04:51:58 -0700 (PDT) Received: from gatekeeper.syskonnect.de (gatekeeper.syskonnect.de [213.144.13.149]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91Bpomx011603 for ; Fri, 1 Oct 2004 04:51:51 -0700 Received: from syskonnect.de (skd.de [10.9.15.1]) by gatekeeper.syskonnect.de (8.12.10/8.12.10) with ESMTP id i91Bq1FR023834; Fri, 1 Oct 2004 13:52:01 +0200 (MET DST) Received: from syskonnect.de (localhost [127.0.0.1]) by syskonnect.de (8.12.9-patch8.359.2.8/8.12.9) with ESMTP id i91Bpa7A006792; Fri, 1 Oct 2004 13:51:37 +0200 (MET DST) Message-ID: <415D46BE.3080904@syskonnect.de> Date: Fri, 01 Oct 2004 13:59:58 +0200 From: Mirko Lindner User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michal Schmidt CC: netdev@oss.sgi.com Subject: Re: [PATCH 2.6.9-rc3] sk98lin - register the driver with hotplug References: <415C8322.7030005@stud.feec.vutbr.cz> In-Reply-To: <415C8322.7030005@stud.feec.vutbr.cz> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 9766 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mlindner@syskonnect.de Precedence: bulk X-list: netdev Hi Michal, thanks for the patch. I'll include the changes into the driver. Cheers, Mirko Michal Schmidt wrote: > Hello, > > The attached patch allows the sk98lin module to be loaded automatically > by hotplug. > > Michal Schmidt > > > ------------------------------------------------------------------------ > > --- linux-2.6.9-rc3.orig/drivers/net/sk98lin/skge.c 2004-09-30 23:38:44.181252712 +0200 > +++ linux-2.6.9-rc3/drivers/net/sk98lin/skge.c 2004-09-30 21:02:04.000000000 +0200 > @@ -5169,6 +5169,8 @@ static struct pci_device_id skge_pci_tbl > { 0, } > }; > > +MODULE_DEVICE_TABLE(pci, skge_pci_tbl); > + > static struct pci_driver skge_driver = { > .name = "skge", > .id_table = skge_pci_tbl, From hadi@znyx.com Fri Oct 1 05:26:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 05:26:29 -0700 (PDT) Received: from lotus.znyx.com (znx208-2-156-007.znyx.com [208.2.156.7]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91CQN5I012596 for ; Fri, 1 Oct 2004 05:26:24 -0700 Received: from [127.0.0.1] ([208.2.156.2]) by lotus.znyx.com (Lotus Domino Release 5.0.11) with ESMTP id 2004100105282612:10211 ; Fri, 1 Oct 2004 05:28:26 -0700 Subject: e1000 patchlet From: Jamal Hadi Salim Reply-To: hadi@znyx.com To: Jeff Garzik , john.ronciak@intel.com, ganesh.venkatesan@intel.com Cc: netdev@oss.sgi.com Organization: ZNYX Networks Message-Id: <1096633537.1041.87.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 01 Oct 2004 08:25:37 -0400 X-MIMETrack: Itemize by SMTP Server on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 10/01/2004 05:28:26 AM, Serialize by Router on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 10/01/2004 05:29:00 AM, Serialize complete at 10/01/2004 05:29:00 AM Content-Type: multipart/mixed; boundary="=-5j0yS34gsvXTv80xkOnb" X-archive-position: 9767 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@znyx.com Precedence: bulk X-list: netdev --=-5j0yS34gsvXTv80xkOnb Content-Transfer-Encoding: 7bit Content-Type: text/plain attached cheers, jamal --=-5j0yS34gsvXTv80xkOnb Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=e1000p1 Content-Type: text/plain; name=e1000p1; charset=ISO-8859-1 --- a/drivers/net/e1000/e1000_main.c 2004/10/01 12:09:51 1.1 +++ b/drivers/net/e1000/e1000_main.c 2004/10/01 12:12:48 @@ -1773,7 +1773,6 @@ unsigned int mss = 0; int count = 0; unsigned int f; - nr_frags = skb_shinfo(skb)->nr_frags; len -= skb->data_len; if(unlikely(skb->len <= 0)) { --=-5j0yS34gsvXTv80xkOnb-- From herbert@gondor.apana.org.au Fri Oct 1 06:06:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 06:06:43 -0700 (PDT) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91D6XGp014609 for ; Fri, 1 Oct 2004 06:06:35 -0700 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CDN71-00059X-00; Fri, 01 Oct 2004 23:06:15 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CDN6w-0001p1-00; Fri, 01 Oct 2004 23:06:10 +1000 Date: Fri, 1 Oct 2004 23:06:09 +1000 To: "David S. Miller" Cc: netdev@oss.sgi.com, ak@suse.de, jheffner@psc.edu Subject: Re: Current 2.6.x TSO state Message-ID: <20041001130609.GA6979@gondor.apana.org.au> References: <20040930213221.06a3f5b3.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040930213221.06a3f5b3.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 9768 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Thu, Sep 30, 2004 at 09:32:21PM -0700, David S. Miller wrote: > > diff4) Obey MSS in tso handling, shrink tcp_skb_cb This looks great. But can we please rename tcp_skb_psize to tcp_skb_mss? Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From vkondra@mail.ru Fri Oct 1 07:32:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 07:32:30 -0700 (PDT) Received: from mx1.mail.ru (mx1.mail.ru [194.67.23.121]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91EWMtE016447 for ; Fri, 1 Oct 2004 07:32:23 -0700 Received: from [82.80.3.97] (port=10097 helo=[192.168.10.2]) by mx1.mail.ru with esmtp id 1CDORx-000Bpr-00; Fri, 01 Oct 2004 18:32:01 +0400 From: Vladimir Kondratiev To: netdev@oss.sgi.com Subject: generic 802.11 stack Date: Fri, 1 Oct 2004 16:30:42 +0200 User-Agent: KMail/1.7 Cc: "Luis R. Rodriguez" , "David S. Miller" , acx100-devel@lists.sourceforge.net, prism54-devel@prism54.org References: <200408312111.02438.vda@port.imtp.ilyichevsk.odessa.ua> <200409290910.13201.vkondra@mail.ru> <20040929080011.GO30131@ruslug.rutgers.edu> In-Reply-To: <20040929080011.GO30131@ruslug.rutgers.edu> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart16626391.WQu7vuWcJy"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200410011630.59465.vkondra@mail.ru> X-Spam: Not detected X-archive-position: 9769 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vkondra@mail.ru Precedence: bulk X-list: netdev --nextPart16626391.WQu7vuWcJy Content-Type: multipart/mixed; boundary="Boundary-01=_ToWXBwX6OFYnK9d" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_ToWXBwX6OFYnK9d Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Attached is 1-st iteration for generic 802.11 stack framework. Based on code from Dave. I make it compile for 2.6 and wrote simple skeleton for native 802.11 drive= r.=20 This skeleton is able to simulate Rx using ioctl; perl script to invoke ioc= tl=20 included. Argument for script is binary frame image. I removed all code for 802.11 header removal from p80211_type_trans for=20 several reasons: =2D I'd like to have all frames coming to stack with the same 802.11 header= ,=20 this will help for sniffer =2D header removal for data is a bit more complex: we should determine QoS= =20 header and strip 24 or 26 bytes. =2D I'd like to do fragmentation and reassembly on stack, not in driver. Nothing functional yet, but one can start debugging stack using Rx imitatio= n;=20 and driver do print packets it gets to Tx. P.S. question: I saw in all xxx_type_trans functions, skb->dev never assigned, it is done = by=20 driver instead. What is the reason? Why not assign skb->dev in=20 xxx_type_trans? --Boundary-01=_ToWXBwX6OFYnK9d Content-Type: application/x-tbz; name="p80211.tar.bz2" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="p80211.tar.bz2" QlpoOTFBWSZTWYXE8hIAUOr/9f38TIB//////////v////8gQAQAFAAAAQAQAghgM5599ut87u9b zrld9y6N7l4PvdlU+qe97vVVHdzjM969bdECXdPcere4hdc70a69TnvOknXe7ZnszoKPiAAAAN9f b3e+tcNmi6+++vvtZ9PV2uws3TNj47NOu7dKUGh9b4x6+VKt93EHt7lV7heN673e9z3tbPnmJV9j VPsDT66HZoEoRGgIwE0Jo1MJkwpmI0TNE2mjSaaNTEAAeppo0ABtQYiAEJqYqeyCnponpTaR5T1N 6p5Q9CeoPUPUDQMgMgANAABIRESY0VT8CNKm9U3qemmqflT9TZTTSNNtU9Rp6gN6p5MkAAxAGgAY Sn6pSEmVP0piB6m0mj1NAeo9QAepoaA0aAAAAAAAAESSCmjJqMAmJiPQE0jTTUxHqeU9EM1PUwQZ MyjIPUAeoA0ESRAIBAJpiE0yCYQmnkpoPUHqaeoHknqB5Q09QGmh6jTQPQA6f0fnkPnlQu7ehTo+ zSCGUGUSMBmmAKbmCUg6wVO5znR1S0k6suT6I2G0CRAzAxcTL6i1bY0Vapc0tfXLDvuCGobwGKBI Nd2YWVqyZZTVlxklWKZMyREkRaUdVXH1pVB6aWm4KYR9MDGOo3tX5/JP2N6Dq+aI9axr7IeyKKf1 qsbzsimjJVi+p0s/0dt/0V2Tya47MUJJFGQkCbdCjREqqRjEJRm7ZtMMSpJfZfOXhcvLWjIyGNDb OtrgzpZTCbcevOJ0/fu6YW6a0xdJsjRKn0dzcfh8NG73VR3+LfPwaPC1aV86zVX9Wl2wmqOWN49f 45uTbYzGzkJUMXOIjOj3VCk70AA0yDo+Xk9GLhIoRQ0UJStUU8kqEA9NFRkGYjKKwLLDm1kkGWEt 3mSxBWEV1pEaISHO9rYQShGRAACSxlen23FJ+xWc+K3DMoxEQM+cotJAH4Yeqp7FiV+L1MSBDU8o SHyeTw+46sH+3H6DaxVTQHBigzEFNqjWW45HIcNNRAnpkxiENDGKkuhQdUnNfvhR+D/D2/40Ghv0 DobFhtKi0UFgUIQEhAHSrXDAyiPzym6JE/biVEXHBux03tZVJjer0t5bbFyFLVljb8tuoTOVuSWk wbbLdqJMscue3JxlZxvI4aQq0LRGU/ezVNPLIsMpWMtjpRDqRxsZbuZuZtMw0vO3k5Skqi5AEvmS +gPDEuihaDUZBqK1FCo5Yes7JJQ4fF5eEd0xW2hjp3GwEMvfqEBoGL2iZQaPjgb6CGCQh8EIacPm O/7nT/n/Du7uvXerEkMYOmEbHtI2XImNptOmsOhnAeD8thXhI4Kd7OEkUgkHRKDJgkk+1jyRs8k9 mBC5ur5TV03+vbdnX2JkuJeDlsIXLbbeW3CzixRFKAwyTojYh1gTQ+L0cw7gy57+IwvsItMwzYQg eeXNSksueQHueFr3AjbiHTrJCV/MHPX0H5aB9ny7k639+hhED4EAzuxeTFkSmYkD1418r3HP9TFF SgacqRfGvjebu86TTeRmvoKRzL8lGU/JdEa8/pbgQGFIyCyDh7ZZXvIkIEJiQcxw7rGIex7KuLjw 7nHFal32XCyMoosjKMuJDo3EuEZTSyMtZqiyEqNRoJBqSCSLxjREwUUuCBpBTlvygZbm1i1h4QTd BkRgKJ7s8PkrvTku0dWpn5Oc5YORRTEGKKakFFPH00KXe52NLbsEUCMFIQTmo4+be5vV1djV97e0 78uHfusBbnoQv9byWyQR0HqpQ8RfDK7wdZ5IWm6d3Dot2iHDDwHahqZlNwJlwrE6xt+M4/f88qJe yDIkhK6faDZ8pHkE5W5fN9uQDh+7SvJqNCFJebIHXU38heQ9Xd9Fz0PuGV8r+dnEGdSPfiJziwmh jf8+6UWw0Ap0Q+HLddPkBD7YSSSDy3H44P5jm5xOUFONpkFURBwiJinj4SkeDCd/cf+35LB/HCz9 mq9ExtkvbwTx3X7u5Nk8i2xERAgd1XPZmlLHvezNI+Jf75M0m0F+xSg0X6j0+/A85eGtDqvpA1sS Yf3HZvmqG7IVdZ7rtdLkO3nxStruBkITe+94gClui2qsaww7Fz9inJ5juZldNN/3qdRgYXOUMViV AiEPHnSH1RZDgklOWb35pL+1W9B/OQ0OndLZVlftOVfA9RXDbmzL4lojzZevv0AIbnQICdpnAprV DIqY41QomVjbRZxGJAnOXMX7dcz4kBmEBX4rNW5sLPCAmWm0bVJIisAogTUB7YSQflofICWrTA4a CObCkom8wpgdh1jjs9Po9r1/uxrZm9mzuJfOFrQZpyd7TtGdmalncSsLWgzT5PWOqp3BjtRXkDy9 7bcmzRDTDk/rvEgj4kNqRJwiKDhBLIT1qTQbhYT1StKOOkhdPOHKKkqgwoDL3gFXvZHC/LFTLBbw RlxakKhIMyZN348+aE5rvBdk7HT5/ivDPaiG3EQmchxv2Wd8tY8hg7eUpot30Q9OdW9g46XbwyZI PK3bAcCEIkIwlRoUV4hWbTP1KozSt88B85SKUA+XLVXq6REmuWyfal2Yr4oedbrC6prcQQ2Q2tf1 rZS57BOb2HyY2D3C2+qOaAbzxe5tyiWB5RqZzS4rVlftPMkZSiUx1nbGBhmCQYm4BNJJE9nHD8WK mxF9w7yPRt65zGM3YSRYdwYnWG3j9q0joG1DWI+nRmDJupMkROQzPjSo1rmSYMN4pZbOtrRsNVxE aIcY06YeLICdJU1mNyDjPwdgzeaVts2VLK3ztAuLmKaqgeUxIB6mQidvwB2WfBR+efsEVFBhsodY yDATVXDGKBIKCDQegs/ZlaE8QhcR1fF7w9Gc56SfsyaJPHa3VCLkd7XRl57k8dfGOLgQprSfF8Y3 benFOAHEceIFL3uCR3tgGzWzyZqpy9d/2Oq+HDO8jfKxI5zvK4PG4YlJI3HG4SBuZUFCKhBfXBQp UILULkDPMxtlNlwydF9D5bnPrSYk4tNtL0aF9q0GOyZYSUKq03KNQ+EHx5dxxGS6Ah4+qeiOKFsR Sg98WVBoZeOO+EbnFe/U0JRkSnJIAw5T8QnYMKwcCGtt+7m0Gca9NSZJBAEpXQJPvXbWz7dnd5Jj uWpprffr04d9onOPSL4E4AaO1lMRskL5Pzvie+udxSPQzHhAkEsPDyV0iPRos25bWrltb7Kzwh4G cZCEM3vjvw8pqXOWmqi9pFBL3pLwYQxbQ8pKN3kGUGQ6oX7oBSYRdJ5o89sEApWUq53TcPOp8ZNg JHeofYGJoVNwUq9oHOCK78uc7peyE5Zg5C+PnNl555z7AWlBQVFB4oJIa3lGMD/lNICFMRJBWyX8 ldmT8Lv3Y3BStg5I1CNtnvciG1mD8sIfOevT9INJSEAvWRSEGSanNosbm7m3qKc3ewAnm8w9IZxD SlOhrd8Qj3Z96OYn6VZWDu8kIQa41BpUbfsth+iQv6aLvcGPtk88XnAsCfmnbO6Z0YH126DZ8Z0E 5xDOzn3XBiyODF7+T7Rd4O9mtI27r67+RrcgwM1YDo4OZUlkwMPUbVxgYkkk9E4c+JIiLwiLNTpR ccR7qlKwRK1oK1ntLF5rO7LCGBPVluppiDpNp3Go4TvK/NQimzhs8dNO5jfmo0op/Ng9t70sk3Cg XJOlozxiytOaniD1w9LJMKa15N+/O+Ka2nW9NMlKtVPSD30elkmzwM7ZWxSVLxjOU8rqk5qeUHrk 9BZlTJaCqeRb8siqLIzP3FRjHK5NzTm4M2E43yLSL7bmi2VY6vkMq9NmaXZ2mSbk+Kl05ayNUMII zICMTtO6KaC2Gl8b5YamiUkUrdrs9y+6mbva/Whu8tcQcu+Z3bFiTHDvaHIEOqFm32abl0Xw1ark cVmjTKp6KSjPol48rUcjcbpS+nMaszHb2C7NR8padR16NGiVOWYqWfr2ZIou/s1ZYrdpUTfzyx7H k0Ofoi92wTBbA+JvBRRvkdnIsZfkJda1xU0PK4ViCOomzbEK/VHmpla1aYWfX7Gq6p6nb1d9xy22 ZQg2zSLaLhfweyklpUUgKcGklSzbuqF6Ki3LE5Vl5A+igNs5+CEQty7d8vq7eWgXfLWxTYfkcIhg IhtY5mohLfxUwcVYuuXiu7tnRYehfjQk+oi2YMJTSUkZFjALUlNo1UCIVMjO4yRKmlPzyq+zIDGB 3A4x9fZF4252LApdLLFF6pICHwRfr+ujxEA8cQdaDrPwNXQEkJAkQkRyjQ0lERF7JBgErn3j+/9m Kdjfrh5br3PZ3imMJB9sJAQ86iqImspNZ4x4pGcY4UjOkeOJDbHExMSDDDjdSFH0iQHCgw+J0kne 7+7Yg7cOJxXLYpFvc0joEapXd4SXB+c5X8cOnC2mOtpy7JEoUfdgmclurzSBLNgY7XlnNnrw0zCg JeJxykIUpJ69LAJer1AEpgCegLIV2vZ0qCJAERVhCiKmcenNJLZdVpLOb6l8maYNiV/XevWxyl3B vqIbt3RugwaPecUSdgrVgEHXYB75REdQ/JhTI6/FIlB6UXS0IQtFylhAlk4YZSY9c0qIsjRtIlaj IqKgJJ3ZDHabk86KCqIiOcxtY1AJ/izcI9zCt0+4/zrR9cFFduXw4XOffFre0PSviJxhu4sUq9SD OSoVElHDj19Pc/PxIiSJ4bijIAnh4TSdp+YgobHKMhz6zeEgeBkRhKIpJVZhW42GuWq7dgzEe+oG 7AWGMrbE8nwlWtd47156mjvgg+HJ61kteLnv1EI9TQC5GFg7SJjgo2oODIoNpNEAH9JEDg/uw/Vs v469u/y9PL4p1A8JvZ0htHBhGjw4xSLPA4I92NEjbE59wYBA3H9i4Cvi5m4me5DWoU9UXOdzsWbJ HP63/rqu35vKKtilfhxlKtrw5OTSGWpgfa3Hg4/L7Uu30CJLfsgSSDPjTW9y3ZWxjbOoiIEUI4pN Qnn8fq9zeZm325AE7PeyAf8wYuonlA58EoqAdJUEJAIQkSMrmDisgdcwwepWgopQRMCAKB/ObsYB pMxpDc7Y091worFUHW8sK1Ir9XhCyRkCib0QsJhEPoaDIU2Ljf40QoYhJtMaCwkgmwGxHwf2wFUg KJhYmIT25uG7Bw6LtXROdwqEQv35wo4um29YAshfUC26V9mz3qfGfeSVRr2xRijBZ5SwAIxFUijE YiIEYuuUBm1crXsaVANnuf8QUNAL2gJglV6G79fs0NekD4w7nOaTO4JC4FeAgIGizLkhdYkIkcXR OQQmyoS4SJhIEIjN9LF99mano9mBthWgtjelxYcjiGA2QIJAFcmac30tdxwROw3mU4GeYq64CNpZ TdNvTUBjDkHKtBAabSt5pNui634MV7asmtgXp0PDU1sMZqidNkN4ztRhgFDPGBa11UfBlKMBKQDI ZISFMPIBQjKnmQlLIGtU8QjaFN0O1EghlAW7Ddu2DOhNQG+Bfyz9BLm8Y66a5ml9/CsBuYE3F6uQ 1EdR7RdMaBOcDnYMLib0DcdsgxH7XlaVFCw8NyKrACgxRJDBQW5wm74Th8jMUH4Rw9F8Dnq9B/nl ncd368vlki9bSg7venCD/I4TgkLDtbvaLBlZgYFGCLnWq/1uBNSNvP7Dn0tQpxPXi4cI88rfS9QR AkhND9q95eR2gvuBun2RG2RwI8woMOHi5FBEeomquMiqbXO7EkMtYXDM5kPoWN9rHvmCICIfNIYT 59iOIz7dN1sU0zSmMriBkENm6nFQU5siA8VjE2hCGdPJ7sKcsxNDYjELHLN9QskYLhVe7Tl4T4cg 26Xz9122tyxgESkketmKQTWuZyNW0bjbWLBWDKQmfoU9KkYmxYxOsxW3Q/BnS8DEJVYLVMtG0shh sRoMzUY8A4+L69iShTOR7oqaL2DWAc9P7t7iprOnUVJ6p895JKoAtBsAfPC9UiR+DIyyGWV18e24 eozVLbqepWbK46N2Qmon4v1fSNIckAT22KD+oih+GV98KQJCECfD/C3xfLDRhkYBRIivyCis1mGs MVMEm9x4HHFBJDEiYRTzw/Hl5dpNa45g117b/qPU+vur9P6Nce3w5dGS+12tsut7PPXzAJn3xNWA jDLFV8iAjvn9Hg7zna4o9i9j7fi9VOH0SOkjzphnXyHr/guLWEjjj9aYFBfyqfhgN8FqJ+xE+RGU JNYJy+8d3C7h28Aua31DplCWkkISTU5CO7epzAxYM5kyhJIGgOuAGJA4bmT85AMv1h1tJtJzAAat wW/WB4St77TsiQjjzfMwlBZfCNMa7djzqnnDb/ZRhU3uCdPNzVmx68dLQNgqTIxcOngAaiYAzswF LSPBK2mRj1R2iZkiChgFmWYhUG4ueAOaGWxp0pf+8LlwtbizDsDF1N16UqMjIft1/h8qqUR9367X z4ZgdUPPriG8WBCjfkjJIEIygoDDDrt4ZvFDfgVCvYfv74nAPLxOOIWhbwMBVX3PsDjtMc6H0XTH W/VqIAHMQANS8DxNLKpT0DZHzHEV7ThcAtt1HnhqAQ248QTJT3J2CYGQmwqW4myP+UAh7kkbY6tK Oc/aOJ7iq7QwDWhJDYgIwjTGwRbEUDuWBdAALhiQKKNw9XC7TY2z47rgDeNlUKHDAtyukYh+5s4+ tK5QJQFIsAXkFU7pK31gJ6F7DVj3UPmHsKHv7EyYmsHM6zjNkgSxAtbyAAtvsadVrwW4CZWTm8I3 5HWZtbdOKeRnVvfiKYYmYKMZ5kX2rjjiJZZqtkiImIiIiIt4uOIiIiJImUikIAtiIl08wAI6b4FA etg9oR47s2w4iTkeJ6CpHCPIPBwzHfic4HWFyBlAPdYpJ59PVfgWhAfGSzvCK68tkJnGgeZtuG3Q mHbWUEjOxNcbJ4lYIsFShsHEux3erZQxALPtlJhxmWnHB4CO0AbMRC567Tt+mis+emQbnYevKoQH +MeS9AgWCQQ/149w2N7mHmGgX1/dENTyIm8GNJCuCQdE1PmyUdMrjklkyCQR6vlCm+S5gTH6IVmj pkAaq2tc8549/q9bXf46geRIbRLSUhQPyCGeQwgSgNdR6lDRcAx8dCEWeyv5DFR53Om401E6sXG4 jbGtZ7pCHHKHp3TfZCnf2mHG+zG4jwnR46dk8QJFVS/7N2ouHkf6exvtrjD1kjJKqpK5ic8fogG8 g9D2e2wmkhh752gHPzasYgkkogEuppxJi/DQMzhGQPI4+v1a+HpjkNy24VLBqRY+NCZ8dS+fTNxD EE9MQNF81HAxxANXQSHVEXecVLDnYj3eOevqKkkwP1YZBSVbgbrYl0dUnbs3DzEe4OTq8sCJ6HKr RQDMDrobhuun0JVA8cmEHhbnhs9gaxgd2wBY0FTsttPbkLuYCIcg799hMhHTs8QthytBUvyHv8HP ssYy9++9iEOo5h3XoTIKFoHgQE6l4w1ATP7f3cP24Z6Q6p3kSlsIxFdSt3D5rFiGPoW06uzUkmXO HA6s4QkEC0ZTQRhGCFLS0jUAjEJVQgIwaQgC52DuaRchMU9SPgBsibzt01TZN0LeHBTHJTY+E1HO LxpOPq8BHHLtMbH4ICecGoMgHJfbXunA7TuT/ZCrQ6zkpuIYLkuJioxZJ6dXf3CaqgMEcwuyOT2f D774ujiD4yAHiIIvfwX5PnDr9wfiB/1cwEogJMOpoHJUdCKdBvQ89u/1YREF6fLsCDr0bBVFFG0b J5zwvoPpfOfMfEcBneFxw33OZzOaDQaDQ1GhsNBoNBodDOWhy2JEbDselBDq5eTsB8CAWyN28t5K cSP5mGCkBEA8CVic4h+7k4e7tqKDxZZizOiznjL5fl9nby97BALEkGcK96D7qkAdjWcbGqwdtRlM l6m+qFrA0g47cLmzN4XMk/Dgn0n3atsdnLViXHo7ijettOIprxTm8bHoDEGDTpIDtStjbIlfDFfy 2aetSBqpF5pIQcCbVUJJJCQkwpzBlUaxSXMPIQFfAMMqkHJeGCqBkJdoRslHHIetgtgyhgsPEo6d E6fA2LC+lu5el769rH1ty+Fm3F7nlbCQkeZbbCR+HMyrnbl4fqzLya6e8OY3dtTdN3bbYSGmjd26 Z3kM669K6q+vipndOu64/Fltt27u22wkJHXLZsWJNX5CZTBxSkTAwJPqM5n1M0mJskO5iczB/Xlv JHI23l26N3SGWJsjMKqpAiQuHFd9k46AIH8QSbyHXpNNiZxgHMwIQgkkkkmMSYxJJJJjIxkkkkJc 63mGQHBwuA79MyHVQVLEJJTjDfrCQIHEYllrAscdxiBobGpJjpJAjJAjGEkkhN7inCj+QeTljzwb m95h2d3O264SEjtlKkxKC8fpmaTOaI0MxZoPec7NRtjG6ASUq2NjeEl03YiJK7mXK6R1d15LOLrs yzMnQo5ZAMBUgnkLnvPtc0ApjbrZZyZmgat2j4QCYEqRBZODxQrakLwuCCYWquaIlIlSc9AJsFkP qiOaLtgOweS2ARPGEELogQodpPGtdaJpdlNAEprVbU0XSDMwzMMzCigxi9OVUbg+hqOcDvhhGStC 536yQkO0q9pUqWsN/X8v6yWgVVJUFSmgoKqF6OqDcAj6h0SuWSNS1AtCQLUw5rU0PoQT5ZMXzbqz IiCDqSMvT0yupdlL5cmI/K+Qb0xiYlOxnOeB9dQJOhBh6vhkY8e3TQ1T+XAbAY7G7Mcv12UbE0DM HVNnOlJLPrtIde+v8MyTED+E2N8MNZsiexQzMLPK8oBMAJdL7fV6nrzPBmeNiZRmYnB7Jrb1y04h Ro3ksBYUSG4eyxYCHZ4SFHHE180bVaSSSEP5rFuPTlxSJueacw6p+A3ogIcrsU8oQHVNc2D6bemL 7F0rTGLzg7Q7V0RPPpiF3i0dh8xxB/d8tDxOJgXvxHPnlT6Ufspt+6jXFA2ZcO+hryxG2yRCyQ1R 4uD4I4JdrAERy2m2233HdRRC2vFqDyWxX4g3Xc5AGQJuAmv8G8oLh+E7lD15OcQN26gG0bwtagC8 qDBvQwHUxhNZr5U3ZC3mYVtSzhbFZtM2okzCs6eL1XcWrU9QI9R8bz1d9SGh8h8E3LmBhmYj+c3h Y1NwU2i5MOv8WMmJdUvuR7ur2IAh1nThRqGonIdgWpFqMS/MGw9ejSe04YncQUXem4KD1z9N7yEe ZjazyiYwJeOQQhahitZsVEs1RuOrp33HVc4JF4oGu6J6pmaVuh20CDIwLYPFSFPBS50GtYCViiB4 xa6reMBK5qxi1tAjQRHaIbh951llMgiFzrvIYEpeUeaVCLISooHO3JwXHrkNF1b8SpLVnQE3IbW4 DGAJEuRE2GjM8Wi3Tn2eqhpmGE6k5e0q//IkFFwojwATLe90PcmBi12ncSrESN7VNrsUgNtDVBhx G9Q+mU+P8dFOmsaaFA3iBiG5AZBhhHNHXYbIXHkeJ3qLrysUZb3ch3BxkAkJJAYIEUSMYwMRGJYG 1spoHueFK+iZFzWg3YcNPs893ybzhQV/0/gzrHD3X9+h26gesgQyvjjudblI6mbbD47YGACYLAhs RqOO/aSAqYmBMb3IyMjJEAqx7r9/SVKxAHanH13xTPZUNlWuIZVziIWs2iVLQneIhDFRE18MYQGQ yyiKiArbZt7EIZ4mbjkwyRTBbElCDYAiz4k4zUYSVlbjN9CJELhZgQcyAJXy6NtNsNtmSTDey2fe KwsVAsG8msLLbTpNjYQ0t2vYDgi6X1De15GI2HmxBILv/fMyAWR6+I2iH57tdA3WhoQsW6EFF5nk Ycu2AkK82AH2qdGI209ybVvKjMumDHCmZXzOCMI2QIAGm9Ax0AbpVCK18NKMVziYGQXVFNwHI/KT 2vq+eHJO5XzQ0pdjgDp0ClZEWQN7ddWSEFFg9DmiGGBfkWMdZoGgHU/GM8wDu4dmrqJIkgpIRZu3 YGhi5MXa+l+F1VnKWzcEUDXQooeGssQmEXIcJ5ehMSOJOfLqPX4BIjyBuzS2mq2aABtRO7Dl7pbK gkjHHNMb3g9YIWkZFBT5ArdKdTDixwjDggTaO+Ro8xmsQCxfY3mVIUg3bUXpJSCfecOHh8VnRPoy 001HZUPjAVwOQhy+WCCSIT1lCvE605D9eZjOR5lvvg6LTlQ39GqBniqUoBF5A6o1CD+OrAGBg+dC dG0fu/T/kLGGcfrHZc/rrw94D1OYh2AUGGPpiDmuoqE1xMg7g1/s29UINhFaGiO56HFcQBC7uRDA x61+lmB0gw0BnhMg9Gg3ERbZG8YUuZ0p06xrA3nVBJE5RKSWCjxVvmc4hDI1OJbNTAMT5VLIZj/w /7fW+Bw0NSSSiZ8nsQnk/GgatZoD5YHzVCJgAkQuYVz951+OnZbJMQK/qVpbE+ZK3GuiSSZCBE5z XOEFiUiZMCH3Slxi3NS+IE8qH23AF+qAu2BpAQRwWbzOG7akCwGXUHIzI1Qfn4pzNWSQx/EB/1sT l7hP2+PAOFO2ookfd88CwfEVxqJxTi3SksSQXlRIUtMShUKS4RHmGfq5gFBob8BO7+L1FUwZ76bR kJEsRS7+VNB18Umt9caH7cv5/2ef+6/T36+HUH0pvOQwQPZjZ3A2gJUkVwbatAPMg00gmBMZUKCp NYH3fXvE0y7wR3Iq6ntjTdFdCICR/kePPkDWSbRR9sTgZ6xxe6JPSAzIjQoOi4KPUsXo7m+dvgt3 26587c5kwAAAAAAAAAAAAAAAAAHO9lxyknT2noy3AQ5ihRsIJH5SkOxB6vxlHQ6/sVFMQPD01PBJ JCEu4jbcifQa66fJ+TxM2qrCSkktJKINoNDvE19MIHQdSA8xSzqBaSa8vYwWIhxsiEmCoFIEUBO/ eWM8IeSWEPAV6sdb48fgfgAZcHD2Ce8BmfcPmA0sRQcGTZsuEkH54OHPIsqVGxoRCAlGxtIvRDRM FoyyDRNLFgtcObnn+bf3h2m6fN0TeaWd5Cqg8Kot2yqJSzrAWhQdIiahgJg9PzReJ+BkwQwvfi8r cKC1rt/bbBwTCGNV/NjjgYfk23J6cTmqKd7ALj1Hpf1pZETV9E114ihyw9OmwdYF012mvCpONgiA xEiXQYQUKkF1VYPRpzQa/1tAcwkbvemGWdUugBcEfl8jeDjpOuvLP3QcTaLLhXNDiG2U2UQUKIIn BEFR1nWHVzomPG8R3LkNF+ymVXZUzqQiOYxOAzA9EWCJUu+shCYFDSp0KSToUlyWawPK6KMvSScW tGZvHcn1BVcfnOj1kKdtySWwX6A8wi8MLmu0g117rjOoQJgdbqtPRASzcsIQ4MCirKRTIyR1RQ8t H3RKztxMBCNuII0dbQUMQ/ker1mTCCmBaViqCIG7CCr4XORx7KtuRdMZBgIzTW0AqCFJBAaISDMR uWRs6iNVgqLaASo5BDmhfa/KPXZdflLZGCJAn1cEr9B0D6YWPtWoYH03sTRLUf7Scg5KCEiJ0J8O dKmMTrCOJ157g+EDufOiirh7677POtRdjU2QjJCkK2uFjyEzFjFhRWZmFXDNewpu0F2FhiIDqsSs AwcRC4tcGIoDVagJxQES3lh1+PmDoOyotQVDYut3SvyQOYlxEtKnh6rXuVE900G2lf5xuasAe1hu 2kB8fj5GWDuGQBiYtNKMP46zXrB58w+lJJFkCKe3YLVEfBq8ABpesiHrmtRM/HBJCBJV0/VBXt6A 4riBCjNLPJMdq6rjzbCG2A/NMMAwHYsZBMS5BoLp15t9PG9uMJyadVNA/UnTqXGJrN59oUdJ4ph9 xzTsuX0+tdl8PahwQQwNHRjMql5yMmu2vIm/xHFlTTBWVFVSSMMaCJlpeXWGY0NjOYJhoevXhuV0 kKDba1eajJwY4yhTg9wuiasyYgkp84cYvhWKwy5CcxJjAhAYWy8IgRlkoTKdFMlL1sppmSFMjGyU F0MBmOKFswXHXqZ0fk/1/39/wz/D7/h8PhRcoqiJmRai5kDZ4waNnuQiHsmAr1IiIiIiIiIiIiMy yIiIiOS1EREREREREREZlkREY2NjcZbH8cJ8cI77H3D/OuHeS/N4s7uR0GiakkJDx/gabJxu4oPG 4FOoPb6cTa5ME7xdtUvnvQorC16MIp/AcZRyB/D6x9EJGQccHGMCjFeVTRHdemX2J7uFvwM5718W ULpmBFRlQXOhZD1kCGA+cFfyCMT8ftKCpJKZA21oLSWsXo6SHp4Q46qhgocEEmBYtWmLMLOUseNl wzWHF63eFDNu21YUljuM5dPG0RNrOlUm2zDA+1A0JD23k7TuxvSaG1MAlHoWWgGQCbbqsee5okWR RLGRaxOGedWTTDLCDwMqLxbsoBz3P5zFWy952QsQVoEoFqS5dVRp2Gd6rJaSjDTJIMyLQiFsjKy3 Gu1p4NTp5d9GwP3NujNv0KLkzToTeUDENe7j0ZFRTT0zoHqqh+7t/+/EtC0CQ5ZTuyo4hxhKeFxD iTw3buAUEDROI7MKkQak4ZQISEgCswPiwIYoHb3R/EgxWAmQEsCJ4J1uMRFLmqokYJBlpL1ZdZ56 K5i5Ieqy2cXXxAzV0iXZwC5VjckA7FLAZgghjXYBEMH7sj4aSNCSgjMYVX9v/bx3R9Lz+1WkBoIx qoNCkUPG4DfGiHKXUtwrdw7Nv0ne1ajHz3IEfOi0gxkY2OYjerqKwu6evxYrPREpir3Y11bZjBji ZxB6LqGAhHjBjPN6iiNI5pnfhO8SeHiWxNSSSBmPv3J9Wblbl3Jr3EikgEKOIXkuIXdpe2XwHlqA rrd5WqP2GNg0DE1tj+JY1EwGsyKYCmPchYwu77CYyRJBEHVw3IAui56ZBJemS5EECMSUR8zKD0vB rBq7oyy2NlxHlDcuPdF9RAsabIAfs5g4/6L2EJaYgzxHq39QZL2xBE+YSKdzugW1ew2Nu4gdK0AZ nLdzCqWMeCgbQ7zG8HIHgBq6yfEUTJubaMxnp1045cio6Zxtukb3uMtMTOUkSLNy73PjlMwTv/is MQFZn2KyqabEhoScIo9COoIVNpsEpVQy6qMhJcrjYR3w1oyM+k37rEy659Cnj59I8LzI7LpB4tNG ppCymORM91GL/GH0hkVplR+WfJHEkQNct8M8Kg6YpUFMTOKErUYgS4GpY6701hhaSAdVoFOZom80 3ZqgGsAMTSs9COdUGlFGFJTTJTIEl+PTUZRv0Ksolx6YuqNDAzgi8pp3Zis4o2FhkxJi6xeuYOtA mS27GhDINcQotJ0rQ051ZRDK40XsSwagoG/kNu428rgnX8spTdBFJAiGqbIJspvIEIYQOhDX6pcm JyQw+yDLVxw02+koHeoQOOYmloXSw6CiZhtRa1Dbr6cbhIugm6sCXMkCCAaeU+HvoDgkIQeQLS5Z p4iXcK4Gtt6+ArWITDhxL2yB1FpEEP70oAyIZPOY9skkkIWtvOEtD1Y2SNqFB5eHVv8By8Z5iIvZ TNTmWW6LCSYJUPrFB9deZHZ2mzoiwTGEie6WBbFC7EELBgA47kdwIIeII8xD6P0SRXkAj3CQDupO NESf5tImGdBMkg9EA7UgmWskA6GvDBgvwxc5SO1TuYMMmx59XkyJwArjkHXAQfvzd0dmagdjFhbe 2PsBvfNmoWEAhB7B1jdV9o3comK8BQ93pgEWoJnEKgkhUajIglMSAqSAyDIlHg6YGKInKxpL51pe 9kzB54n1QVun8oOwPj+Hyrf5EDvgSEkg2Q+za3My/BubnbAzger8xaxzJv+NCIGAxG0kRbPKgfP2 a+D6xg19WGCTpjhI4JKFejeY7ZfaSBbCtLzv8j0PAG/Jue5/XG/vChiKIXQBxSDCLA3U2NpbIujt hzLptWM3TyWGdVpg8JAnVBIUOEYR/CmSYBTtwDAh3etRcUxL8p2eYU7XYUOWASJBAIQSBIRjAIPi IhUHCAf6GDjBue0JmlKrICY2AnMv3r7xvlMA2qGhbIh/8XckU4UJCFxPISA= --Boundary-01=_ToWXBwX6OFYnK9d-- --nextPart16626391.WQu7vuWcJy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBBXWojqxdj7mhC6o0RApj6AKCFkyLZ/ge8sdgGqoGaeowKYhlVKgCghugH 21AIH4NzEcj9q1RRPAdU4Lw= =vK7r -----END PGP SIGNATURE----- --nextPart16626391.WQu7vuWcJy-- From cfriesen@nortelnetworks.com Fri Oct 1 09:36:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 09:36:19 -0700 (PDT) Received: from zcars04e.nortelnetworks.com (zcars04e.nortelnetworks.com [47.129.242.56]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91GaDkk024975 for ; Fri, 1 Oct 2004 09:36:14 -0700 Received: from zcard303.ca.nortel.com (zcard303.ca.nortel.com [47.129.242.59]) by zcars04e.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id i91GZsR20546; Fri, 1 Oct 2004 12:35:54 -0400 (EDT) Received: from nortelnetworks.com (acart21w.ca.nortel.com [47.130.25.15]) by zcard303.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SPNPKMFM; Fri, 1 Oct 2004 12:35:53 -0400 Message-ID: <415D8768.8080808@nortelnetworks.com> Date: Fri, 01 Oct 2004 10:35:52 -0600 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com, linuxppc-dev@ozlabs.org Subject: kernel crash with G5 Xserve and sungem driver Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 9770 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cfriesen@nortelnetworks.com Precedence: bulk X-list: netdev I have patched 2.6.9-rc2 to run in 32-bit mode on the G5 Xserve. When I compile a kernel with the tigon driver and the sungem driver both built-in, the kernel crashes. Removing the sungem driver fixes the problem. Is there a known incompatibility between the sungem driver and the Xserve? I don't have crash output at the moment, but I can probably get it eventually. Chris From greg@kroah.com Fri Oct 1 09:55:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 09:55:57 -0700 (PDT) Received: from perch.kroah.org (mail.kroah.org [69.55.234.183]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91GtpSv025464 for ; Fri, 1 Oct 2004 09:55:52 -0700 Received: from DYN319081BLD.beaverton.ibm.com (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated) by perch.kroah.org (8.11.6/8.11.6) with ESMTP id i91GtZG03896; Fri, 1 Oct 2004 09:55:35 -0700 Received: from greg by echidna.kroah.org with local (masqmail 0.2.19) id 1CDQgl-33X-00; Fri, 01 Oct 2004 09:55:23 -0700 Date: Fri, 1 Oct 2004 09:55:23 -0700 From: Greg KH To: Margit Schubert-While Cc: Jeff Garzik , netdev@oss.sgi.com, kernel-janitors@lists.osdl.org, mcgrof@studorgs.rutgers.edu, prism54-devel@prism54.org, hvr@gnu.org Subject: Re: [Kernel-janitors] Re: [PATCH 2.6.9-rc2 17/38] net/islpci_dev: replace schedule_timeout() with msleep() Message-ID: <20041001165523.GC11646@kroah.com> References: <5.1.0.14.2.20040924074745.00b1cd40@pop.t-online.de> <20040923221303.GB13244@us.ibm.com> <20040923221303.GB13244@us.ibm.com> <5.1.0.14.2.20040924074745.00b1cd40@pop.t-online.de> <5.1.0.14.2.20041001084419.02570b18@pop.t-online.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20041001084419.02570b18@pop.t-online.de> User-Agent: Mutt/1.5.6i X-archive-position: 9771 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greg@kroah.com Precedence: bulk X-list: netdev On Fri, Oct 01, 2004 at 09:04:27AM +0200, Margit Schubert-While wrote: > At 00:15 01.10.2004 -0400, Jeff scribeth: > >I would rather see an msleep implementation in 2.4.x... > > Hear, hear. > And can we PLEASE have a > "#define HAVE_MSLEEP" in delay.h ?!!! > (2.4. AND 2.6) No, this is not how the kernel source tree works, sorry. greg k-h From laforge@gnumonks.org Fri Oct 1 12:32:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 12:32:14 -0700 (PDT) Received: from ganesha.gnumonks.org (Debian-exim@ganesha.gnumonks.org [213.95.27.120]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91JW807031757 for ; Fri, 1 Oct 2004 12:32:09 -0700 Received: from dsl-213-023-154-116.arcor-ip.net ([213.23.154.116] helo=sunbeam.gnumonks.org) by ganesha.gnumonks.org with asmtp (TLSv1:RC4-SHA:128) (Exim 4.30) id 1CDT8F-0004zt-66; Fri, 01 Oct 2004 21:31:55 +0200 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.34) id 1CDT8D-0007W7-CX; Fri, 01 Oct 2004 21:31:53 +0200 Date: Fri, 1 Oct 2004 21:31:53 +0200 From: Harald Welte To: Chris Friesen Cc: netdev@oss.sgi.com, linuxppc-dev@ozlabs.org Subject: Re: kernel crash with G5 Xserve and sungem driver Message-ID: <20041001193153.GN27499@sunbeam.de.gnumonks.org> References: <415D8768.8080808@nortelnetworks.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1y1tiN5hVw5cPBDe" Content-Disposition: inline In-Reply-To: <415D8768.8080808@nortelnetworks.com> User-Agent: Mutt/1.5.6+20040907i X-archive-position: 9772 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@gnumonks.org Precedence: bulk X-list: netdev --1y1tiN5hVw5cPBDe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 01, 2004 at 10:35:52AM -0600, Chris Friesen wrote: >=20 > I have patched 2.6.9-rc2 to run in 32-bit mode on the G5 Xserve. >=20 > When I compile a kernel with the tigon driver and the sungem driver both= =20 > built-in, the kernel crashes. Removing the sungem driver fixes the probl= em. Yes, I had that too. The Problem is that the XServe G5 actually has two sungem MAC's in the chipset but doesn't use them (and apparently their interrupt lines are not connected either). Apple just doesn't put them in their OF tree, but on the PCI they are visible. The ethernet chips actually used and connected to the ethernet sockets on the back side are th3. Just don't compile (or load) the sungem driver on those boxes. > Is there a known incompatibility between the sungem driver and the Xserve? yes. --=20 - Harald Welte http://www.gnumonks.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D Programming is like sex: One mistake and you have to support it your lifeti= me --1y1tiN5hVw5cPBDe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBXbCpXaXGVTD0i/8RApp7AJwKFtyJL91PowHWs4uTO6DnaNrthwCgtU9t sJl0u37ydJljoTsEsvOrDlU= =+Ev2 -----END PGP SIGNATURE----- --1y1tiN5hVw5cPBDe-- From cfriesen@nortelnetworks.com Fri Oct 1 12:43:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 12:43:17 -0700 (PDT) Received: from zcars04e.nortelnetworks.com (zcars04e.nortelnetworks.com [47.129.242.56]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91JhCMD032196 for ; Fri, 1 Oct 2004 12:43:12 -0700 Received: from zcard303.ca.nortel.com (zcard303.ca.nortel.com [47.129.242.59]) by zcars04e.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id i91Jgk410733; Fri, 1 Oct 2004 15:42:46 -0400 (EDT) Received: from nortelnetworks.com (acart21w.ca.nortel.com [47.130.25.15]) by zcard303.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SPNPKN0J; Fri, 1 Oct 2004 15:42:46 -0400 Message-ID: <415DB334.4010809@nortelnetworks.com> Date: Fri, 01 Oct 2004 13:42:44 -0600 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Harald Welte CC: netdev@oss.sgi.com, linuxppc-dev@ozlabs.org Subject: Re: kernel crash with G5 Xserve and sungem driver References: <415D8768.8080808@nortelnetworks.com> <20041001193153.GN27499@sunbeam.de.gnumonks.org> In-Reply-To: <20041001193153.GN27499@sunbeam.de.gnumonks.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 9773 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cfriesen@nortelnetworks.com Precedence: bulk X-list: netdev Harald Welte wrote: > Just don't compile (or load) the sungem driver on those boxes. Hmm. That's a pain. We've got G5 desktops too, and it would be nice to be able to run one kernel for both. It'd be better (IMHO) to fix the driver so it doesn't crash. Chris From laforge@gnumonks.org Fri Oct 1 12:46:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 12:46:49 -0700 (PDT) Received: from ganesha.gnumonks.org (Debian-exim@ganesha.gnumonks.org [213.95.27.120]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91Jkhud032520 for ; Fri, 1 Oct 2004 12:46:44 -0700 Received: from dsl-213-023-154-116.arcor-ip.net ([213.23.154.116] helo=sunbeam.gnumonks.org) by ganesha.gnumonks.org with asmtp (TLSv1:RC4-SHA:128) (Exim 4.30) id 1CDTMN-0005OS-0d; Fri, 01 Oct 2004 21:46:31 +0200 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.34) id 1CDTMM-0007Wk-32; Fri, 01 Oct 2004 21:46:30 +0200 Date: Fri, 1 Oct 2004 21:46:30 +0200 From: Harald Welte To: Chris Friesen Cc: netdev@oss.sgi.com, linuxppc-dev@ozlabs.org Subject: Re: kernel crash with G5 Xserve and sungem driver Message-ID: <20041001194630.GO27499@sunbeam.de.gnumonks.org> References: <415D8768.8080808@nortelnetworks.com> <20041001193153.GN27499@sunbeam.de.gnumonks.org> <415DB334.4010809@nortelnetworks.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bzq2cJcN05fcPrs+" Content-Disposition: inline In-Reply-To: <415DB334.4010809@nortelnetworks.com> User-Agent: Mutt/1.5.6+20040907i X-archive-position: 9774 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@gnumonks.org Precedence: bulk X-list: netdev --Bzq2cJcN05fcPrs+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 01, 2004 at 01:42:44PM -0600, Chris Friesen wrote: > Harald Welte wrote: >=20 > >Just don't compile (or load) the sungem driver on those boxes. >=20 > Hmm. That's a pain. We've got G5 desktops too, and it would be nice to = be=20 > able to run one kernel for both. It'd be better (IMHO) to fix the driver= =20 > so it doesn't crash. I recommend talking to Bejamin Herrenschmidt, IIRC he already had something in mind in order to fix the issue. I mean, you can always hardcode some exemption into the driver, that's two easy lines ;) > Chris --=20 - Harald Welte http://www.gnumonks.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D Programming is like sex: One mistake and you have to support it your lifeti= me --Bzq2cJcN05fcPrs+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBXbQWXaXGVTD0i/8RAolKAJ92G/5zs4wo4XSF2WAsqAaD1+GIkwCeICAs cHBju+40g4MUwbRTfk6R/Zs= =qWQ2 -----END PGP SIGNATURE----- --Bzq2cJcN05fcPrs+-- From davem@davemloft.net Fri Oct 1 12:49:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 12:49:18 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91JnCw0000412 for ; Fri, 1 Oct 2004 12:49:12 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDTNN-0006NR-00; Fri, 01 Oct 2004 12:47:33 -0700 Date: Fri, 1 Oct 2004 12:47:33 -0700 From: "David S. Miller" To: Andi Kleen Cc: netdev@oss.sgi.com, jheffner@psc.edu, herbert@gondor.apana.org.au Subject: Re: Current 2.6.x TSO state Message-Id: <20041001124733.1ac4266a.davem@davemloft.net> In-Reply-To: <20041001121123.19511403.ak@suse.de> References: <20040930213221.06a3f5b3.davem@davemloft.net> <20041001121123.19511403.ak@suse.de> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9775 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 1 Oct 2004 12:11:23 +0200 Andi Kleen wrote: > Do you want me to play with the new sysctl too? Yes. > max win adv: 5840 bytes max win adv: 63712 bytes > min win adv: 5840 bytes min win adv: 5792 bytes That stinks that the receiver is only using a 64K window, that's way too small for gigabit. From ak@suse.de Fri Oct 1 12:52:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 12:52:10 -0700 (PDT) Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91Jq4U2000753 for ; Fri, 1 Oct 2004 12:52:05 -0700 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 2AB5BCB5E52; Fri, 1 Oct 2004 21:51:47 +0200 (CEST) Date: Fri, 1 Oct 2004 21:51:47 +0200 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , netdev@oss.sgi.com, jheffner@psc.edu, herbert@gondor.apana.org.au Subject: Re: Current 2.6.x TSO state Message-ID: <20041001195146.GA23046@wotan.suse.de> References: <20040930213221.06a3f5b3.davem@davemloft.net> <20041001121123.19511403.ak@suse.de> <20041001124733.1ac4266a.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041001124733.1ac4266a.davem@davemloft.net> X-archive-position: 9776 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev On Fri, Oct 01, 2004 at 12:47:33PM -0700, David S. Miller wrote: > On Fri, 1 Oct 2004 12:11:23 +0200 > Andi Kleen wrote: > > > Do you want me to play with the new sysctl too? > > Yes. Already did, see my other mail (I should not read incoming mail in the wrong order @) > > > max win adv: 5840 bytes max win adv: 63712 bytes > > min win adv: 5840 bytes min win adv: 5792 bytes > > That stinks that the receiver is only using a 64K window, > that's way too small for gigabit. Just using the default, no tuning. I have some patches in the pipeline to do automatic window tuning based on link speed based on dev->features. But they were actually more intended for 10Gbit/s (where all the defaults are completely inadequate) And it needs a bit more work. -Andi From davem@davemloft.net Fri Oct 1 12:58:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 12:58:27 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91JwMQK001187 for ; Fri, 1 Oct 2004 12:58:22 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDTWF-0006P0-00; Fri, 01 Oct 2004 12:56:43 -0700 Date: Fri, 1 Oct 2004 12:56:43 -0700 From: "David S. Miller" To: Andi Kleen Cc: ak@suse.de, netdev@oss.sgi.com, jheffner@psc.edu, herbert@gondor.apana.org.au Subject: Re: Current 2.6.x TSO state Message-Id: <20041001125643.30c6830f.davem@davemloft.net> In-Reply-To: <20041001195146.GA23046@wotan.suse.de> References: <20040930213221.06a3f5b3.davem@davemloft.net> <20041001121123.19511403.ak@suse.de> <20041001124733.1ac4266a.davem@davemloft.net> <20041001195146.GA23046@wotan.suse.de> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9777 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 1 Oct 2004 21:51:47 +0200 Andi Kleen wrote: > > > max win adv: 5840 bytes max win adv: 63712 bytes > > > min win adv: 5840 bytes min win adv: 5792 bytes > > > > That stinks that the receiver is only using a 64K window, > > that's way too small for gigabit. > > Just using the default, no tuning. > > I have some patches in the pipeline to do automatic window tuning > based on link speed based on dev->features. But they were actually more > intended for 10Gbit/s (where all the defaults are completely inadequate) > And it needs a bit more work. As mentioned, the TCP receive buffer auto-tuning takes care of all of this in 2.6.6 and later. It's just 2.6.5 doesn't have John Heffner's auto-tuning code which is why your test case is so stuck in the mud. Also, the stretch ACK's are quite normal. If the receiver can't advertize a larger window, we won't spit out an ACK until the ack timeout. From ak@suse.de Fri Oct 1 13:04:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 13:05:00 -0700 (PDT) Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91K4qOO001574 for ; Fri, 1 Oct 2004 13:04:55 -0700 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id D15E1CB3481; Fri, 1 Oct 2004 22:01:02 +0200 (CEST) Date: Fri, 1 Oct 2004 22:01:02 +0200 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , netdev@oss.sgi.com, jheffner@psc.edu, herbert@gondor.apana.org.au Subject: Re: Current 2.6.x TSO state Message-ID: <20041001200102.GB23046@wotan.suse.de> References: <20040930213221.06a3f5b3.davem@davemloft.net> <20041001121123.19511403.ak@suse.de> <20041001124733.1ac4266a.davem@davemloft.net> <20041001195146.GA23046@wotan.suse.de> <20041001125643.30c6830f.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041001125643.30c6830f.davem@davemloft.net> X-archive-position: 9778 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev > As mentioned, the TCP receive buffer auto-tuning takes care > of all of this in 2.6.6 and later. It's just 2.6.5 doesn't > have John Heffner's auto-tuning code which is why your test > case is so stuck in the mud. > > Also, the stretch ACK's are quite normal. If the receiver can't > advertize a larger window, we won't spit out an ACK until > the ack timeout. Ok, but why is the TSO case still slower? -Andi From davem@davemloft.net Fri Oct 1 13:17:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 13:17:20 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91KHEYk002064 for ; Fri, 1 Oct 2004 13:17:14 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDToV-0006Tx-00; Fri, 01 Oct 2004 13:15:35 -0700 Date: Fri, 1 Oct 2004 13:15:34 -0700 From: "David S. Miller" To: Andi Kleen Cc: ak@suse.de, netdev@oss.sgi.com, jheffner@psc.edu, herbert@gondor.apana.org.au Subject: Re: Current 2.6.x TSO state Message-Id: <20041001131534.7bcb87ee.davem@davemloft.net> In-Reply-To: <20041001200102.GB23046@wotan.suse.de> References: <20040930213221.06a3f5b3.davem@davemloft.net> <20041001121123.19511403.ak@suse.de> <20041001124733.1ac4266a.davem@davemloft.net> <20041001195146.GA23046@wotan.suse.de> <20041001125643.30c6830f.davem@davemloft.net> <20041001200102.GB23046@wotan.suse.de> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9779 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 1 Oct 2004 22:01:02 +0200 Andi Kleen wrote: > > As mentioned, the TCP receive buffer auto-tuning takes care > > of all of this in 2.6.6 and later. It's just 2.6.5 doesn't > > have John Heffner's auto-tuning code which is why your test > > case is so stuck in the mud. > > > > Also, the stretch ACK's are quite normal. If the receiver can't > > advertize a larger window, we won't spit out an ACK until > > the ack timeout. > > Ok, but why is the TSO case still slower? It isn't for me. With the auto-tuning code present at the receiver, at least in my case, the TSO case runs more quickly since my sender is PCI bandwidth limited since the tg3 sits on a 32mhz/33bit PCI bus. From jheffner@psc.edu Fri Oct 1 13:34:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 13:34:06 -0700 (PDT) Received: from mailer1.psc.edu (mailer1.psc.edu [128.182.58.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91KY1Ne002632 for ; Fri, 1 Oct 2004 13:34:01 -0700 Received: from dexter.psc.edu (dexter.psc.edu [128.182.61.232]) by mailer1.psc.edu (8.12.10/8.12.5) with ESMTP id i91KXY30002310 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Oct 2004 16:33:34 -0400 (EDT) Received: from dexter.psc.edu (dexter.psc.edu [128.182.61.232]) by dexter.psc.edu (8.12.10/8.12.5) with ESMTP id i91KXXCW025446; Fri, 1 Oct 2004 16:33:33 -0400 (EDT) Date: Fri, 1 Oct 2004 16:33:33 -0400 (EDT) From: John Heffner To: Andi Kleen cc: "David S. Miller" , , Subject: Re: Current 2.6.x TSO state In-Reply-To: <20041001200102.GB23046@wotan.suse.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: clamd / ClamAV version 0.75, clamav-milter version 0.75 on mailer1.psc.edu X-Virus-Status: Clean X-archive-position: 9780 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jheffner@psc.edu Precedence: bulk X-list: netdev On Fri, 1 Oct 2004, Andi Kleen wrote: > > As mentioned, the TCP receive buffer auto-tuning takes care > > of all of this in 2.6.6 and later. It's just 2.6.5 doesn't > > have John Heffner's auto-tuning code which is why your test > > case is so stuck in the mud. > > > > Also, the stretch ACK's are quite normal. If the receiver can't > > advertize a larger window, we won't spit out an ACK until > > the ack timeout. > > Ok, but why is the TSO case still slower? Because with TSO enabled, you get bigger back-to-back bursts during which the receiving app can't run. -John From davem@davemloft.net Fri Oct 1 13:58:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 13:58:35 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91KwQOR003448 for ; Fri, 1 Oct 2004 13:58:27 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDUSD-0006ZB-00; Fri, 01 Oct 2004 13:56:37 -0700 Date: Fri, 1 Oct 2004 13:56:36 -0700 From: "David S. Miller" To: Duncan Sands Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, laforge@gnumonks.org Subject: Re: Oops at __neigh_for_each_release (2.6.9-rc3) Message-Id: <20041001135636.0c071602.davem@davemloft.net> In-Reply-To: <200410012217.35264.baldrick@free.fr> References: <200410012217.35264.baldrick@free.fr> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9781 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 1 Oct 2004 22:17:35 +0200 Duncan Sands wrote: > EIP is at __neigh_for_each_release+0x32/0xb0 Give this patch a try. And please report networking bugs to netdev@oss.sgi.com in the future, thanks. ===== net/atm/clip.c 1.42 vs edited ===== --- 1.42/net/atm/clip.c 2004-09-23 18:02:32 -07:00 +++ edited/net/atm/clip.c 2004-10-01 13:35:40 -07:00 @@ -984,19 +984,7 @@ static int __init atm_clip_init(void) { - /* we should use neigh_table_init() */ - clip_tbl.lock = RW_LOCK_UNLOCKED; - clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id, - clip_tbl.entry_size, 0, SLAB_HWCACHE_ALIGN, NULL, NULL); - - if (!clip_tbl.kmem_cachep) - return -ENOMEM; - - /* so neigh_ifdown() doesn't complain */ - clip_tbl.proxy_timer.data = 0; - clip_tbl.proxy_timer.function = NULL; - init_timer(&clip_tbl.proxy_timer); - skb_queue_head_init(&clip_tbl.proxy_queue); + neigh_table_init(&clip_tbl); clip_tbl_hook = &clip_tbl; register_atm_ioctl(&clip_ioctl_ops); @@ -1022,7 +1010,6 @@ deregister_atm_ioctl(&clip_ioctl_ops); - neigh_ifdown(&clip_tbl, NULL); dev = clip_devs; while (dev) { next = PRIV(dev)->next; @@ -1030,9 +1017,11 @@ free_netdev(dev); dev = next; } - if (start_timer == 0) del_timer(&idle_timer); - kmem_cache_destroy(clip_tbl.kmem_cachep); + neigh_table_clear(&clip_tbl); + + if (start_timer == 0) + del_timer(&idle_timer); clip_tbl_hook = NULL; } From davem@davemloft.net Fri Oct 1 15:15:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 15:15:11 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91MF5MA004832 for ; Fri, 1 Oct 2004 15:15:05 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDVeX-00083S-00; Fri, 01 Oct 2004 15:13:25 -0700 Date: Fri, 1 Oct 2004 15:13:25 -0700 From: "David S. Miller" To: Fernando Gont Cc: netdev@oss.sgi.com Subject: Re: TCP's reaction to soft errors Message-Id: <20041001151325.1bf112a5.davem@davemloft.net> In-Reply-To: <4.3.2.7.2.20040915112853.00cf9980@mail.daleclick.com> References: <4.3.2.7.2.20040915112853.00cf9980@mail.daleclick.com> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9782 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Wed, 15 Sep 2004 11:44:14 -0300 Fernando Gont wrote: > The draft proposes to change TCP's reaction to soft errors so that > connections that are in the SYN-SENT or SYN-RECEIVED states are aborted > upon receipt of an ICMP error message that indicates a soft error. I have verified that Linux behaves in a way compliant to this proposal. No changes are necessary. From davem@davemloft.net Fri Oct 1 15:19:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 15:19:20 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91MJEk6005187 for ; Fri, 1 Oct 2004 15:19:14 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDViX-00084B-00; Fri, 01 Oct 2004 15:17:33 -0700 Date: Fri, 1 Oct 2004 15:17:32 -0700 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] [NET] NEIGHBOUR: hold refcnt of net_device from proxy neighbor entries. Message-Id: <20041001151732.60899c38.davem@davemloft.net> In-Reply-To: <20040930.170729.51800585.yoshfuji@linux-ipv6.org> References: <20040930.170729.51800585.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i91MJEk6005187 X-archive-position: 9783 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Sep 2004 17:07:29 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > [NET] NEIGHBOUR: hold refcnt of net_device from proxy neighbor entries. > > We did not hold refcnt of net_device from proxy neighbor entries > while we did from neighbor entries. > > Signed-off-by: Hideaki YOSHIFUJI Applied, thanks. From davem@davemloft.net Fri Oct 1 15:21:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 15:21:11 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91ML4Hq005516 for ; Fri, 1 Oct 2004 15:21:04 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDVkJ-00084W-00; Fri, 01 Oct 2004 15:19:23 -0700 Date: Fri, 1 Oct 2004 15:19:23 -0700 From: "David S. Miller" To: Yasuyuki Kozakai Cc: netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH]: fixed typo of reassembly.c Message-Id: <20041001151923.261b42b3.davem@davemloft.net> In-Reply-To: <200409301023.i8UANRGp002783@toshiba.co.jp> References: <200409301023.i8UANRGp002783@toshiba.co.jp> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9784 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Sep 2004 19:23:26 +0900 (JST) Yasuyuki Kozakai wrote: > This patch fixes byte ordering. Please apply this. It is textual fix only, do you realize this? Both ntohs() and htons() perform the same transformation on a 16-bit data item. It really does not matter which one you actually use, in practice. I will apply your patch anyways, I just wanted to be clear that this does not actually fix any bug. :-) THanks. From davem@davemloft.net Fri Oct 1 15:54:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 15:54:58 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91MsprD006267 for ; Fri, 1 Oct 2004 15:54:53 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDWH1-0008Dd-00; Fri, 01 Oct 2004 15:53:11 -0700 Date: Fri, 1 Oct 2004 15:53:10 -0700 From: "David S. Miller" To: Vladimir Kondratiev Cc: netdev@oss.sgi.com, mcgrof@studorgs.rutgers.edu, acx100-devel@lists.sourceforge.net, prism54-devel@prism54.org Subject: Re: generic 802.11 stack Message-Id: <20041001155310.515ee09e.davem@davemloft.net> In-Reply-To: <200410011630.59465.vkondra@mail.ru> References: <200408312111.02438.vda@port.imtp.ilyichevsk.odessa.ua> <200409290910.13201.vkondra@mail.ru> <20040929080011.GO30131@ruslug.rutgers.edu> <200410011630.59465.vkondra@mail.ru> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9785 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Why this change? -extern void hh_data_is_too_small(void); +static void hh_data_is_too_small(void) +{ + printk(KERN_ERR "hh_data_is_too_small\n"); +} We don't define the function because it is meant to cause a compile time error if hh->hh_data is too small to hold the full p80211_data_header structure. Please undo this change. And therefore undo this change too: - if (sizeof(hh->hh_data) < sizeof(*p)) + if (sizeof(hh->hh_data) < sizeof(*p)) { hh_data_is_too_small(); + return -1; + } Next, what's this? - dev->hard_header = p80211_header; + dev->hard_header = p80211_header; dev->rebuild_header = p80211_rebuild_header; Your merely changing the tab character after dev->hard_header into spaces. Please don't do this. This makes a lot of white space noise when making diffs against the original davem-p80211 code thus making it harder to review the changes you actually made. Next: + dev->mtu = 2304; + dev->type = ARPHRD_IEEE80211; Is this really the correct default MTU for wireless devices? @@ -342,7 +343,7 @@ int p80211_recv_cfackpoll(struct sk_buff static struct packet_type p80211_packet_type = { .type = __constant_htons(ETH_P_802_11), .func = p80211_rcv, - .data = (void *) 1, /* understands shared SKBs */ + .af_packet_priv = (void *) 1, /* understands shared SKBs */ }; You can just remove this line entirely for 2.6.x kernels. Otherwise looks fine :-) From shemminger@osdl.org Fri Oct 1 15:57:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 15:57:55 -0700 (PDT) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91MvnBF006615 for ; Fri, 1 Oct 2004 15:57:49 -0700 Received: from zqx3.pdx.osdl.net (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id i91MvVWL008069 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Oct 2004 15:57:31 -0700 Date: Fri, 1 Oct 2004 15:55:54 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (1/3) tcp - choose congestion algorithm at initialization Message-Id: <20041001155554.51763dc0@zqx3.pdx.osdl.net> In-Reply-To: <20040927121610.68f942a4.davem@redhat.com> References: <20040927111834.48c7baab@zqx3.pdx.osdl.net> <20040927121610.68f942a4.davem@redhat.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i686-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.86 $ X-Scanned-By: MIMEDefang 2.36 X-archive-position: 9786 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Here is the 2.4 version of the change to store congest algorithm per socket. Signed-off-by: Stephen Hemminger diff -Nru a/include/net/sock.h b/include/net/sock.h --- a/include/net/sock.h 2004-10-01 15:51:48 -07:00 +++ b/include/net/sock.h 2004-10-01 15:51:48 -07:00 @@ -256,6 +256,13 @@ __u32 end_seq; }; +enum tcp_congestion_algo { + TCP_RENO=0, + TCP_VEGAS, + TCP_WESTWOOD, + TCP_BIC, +}; + struct tcp_opt { int tcp_header_len; /* Bytes of tcp header to send */ @@ -428,7 +435,8 @@ unsigned int keepalive_intvl; /* time interval between keep alive probes */ int linger2; - int frto_counter; /* Number of new acks after RTO */ + __u8 adv_cong; /* Using Vegas, Westwood, or BIC */ + __u8 frto_counter; /* Number of new acks after RTO */ __u32 frto_highmark; /* snd_nxt when RTO occurred */ unsigned long last_synq_overflow; @@ -465,7 +473,6 @@ __u32 beg_snd_nxt; /* right edge during last RTT */ __u32 beg_snd_una; /* left edge during last RTT */ __u32 beg_snd_cwnd; /* saves the size of the cwnd */ - __u8 do_vegas; /* do vegas for this connection */ __u8 doing_vegas_now;/* if true, do vegas for this RTT */ __u16 cntRTT; /* # of RTTs measured within last RTT */ __u32 minRTT; /* min of RTTs measured within last RTT (in usec) */ diff -Nru a/include/net/tcp.h b/include/net/tcp.h --- a/include/net/tcp.h 2004-10-01 15:51:48 -07:00 +++ b/include/net/tcp.h 2004-10-01 15:51:48 -07:00 @@ -1110,6 +1110,13 @@ return tp->packets_out - tp->left_out + tp->retrans_out; } +/* + * Which congestion algorithim is in use on the connection. + */ +#define tcp_is_vegas(__tp) ((__tp)->adv_cong == TCP_VEGAS) +#define tcp_is_westwood(__tp) ((__tp)->adv_cong == TCP_WESTWOOD) +#define tcp_is_bic(__tp) ((__tp)->adv_cong == TCP_BIC) + /* Recalculate snd_ssthresh, we want to set it to: * * Reno: @@ -1122,7 +1129,7 @@ */ static inline __u32 tcp_recalc_ssthresh(struct tcp_opt *tp) { - if (sysctl_tcp_bic) { + if (tcp_is_bic(tp)) { if (sysctl_tcp_bic_fast_convergence && tp->snd_cwnd < tp->bictcp.last_max_cwnd) tp->bictcp.last_max_cwnd @@ -1141,11 +1148,6 @@ /* Stop taking Vegas samples for now. */ #define tcp_vegas_disable(__tp) ((__tp)->vegas.doing_vegas_now = 0) - -/* Is this TCP connection using Vegas (regardless of whether it is taking - * Vegas measurements at the current time)? - */ -#define tcp_is_vegas(__tp) ((__tp)->vegas.do_vegas) static inline void tcp_vegas_enable(struct tcp_opt *tp) { @@ -1179,7 +1181,7 @@ /* Should we be taking Vegas samples right now? */ #define tcp_vegas_enabled(__tp) ((__tp)->vegas.doing_vegas_now) -extern void tcp_vegas_init(struct tcp_opt *tp); +extern void tcp_ca_init(struct tcp_opt *tp); static inline void tcp_set_ca_state(struct tcp_opt *tp, u8 ca_state) { @@ -1978,7 +1980,7 @@ static inline void tcp_westwood_update_rtt(struct tcp_opt *tp, __u32 rtt_seq) { - if (sysctl_tcp_westwood) + if (tcp_is_westwood(tp)) tp->westwood.rtt = rtt_seq; } @@ -2015,13 +2017,13 @@ static inline void tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb) { - if (sysctl_tcp_westwood) + if (tcp_is_westwood(&(sk->tp_pinfo.af_tcp))) __tcp_westwood_fast_bw(sk, skb); } static inline void tcp_westwood_slow_bw(struct sock *sk, struct sk_buff *skb) { - if (sysctl_tcp_westwood) + if (tcp_is_westwood(&(sk->tp_pinfo.af_tcp))) __tcp_westwood_slow_bw(sk, skb); } @@ -2035,7 +2037,7 @@ { __u32 ret = 0; - if (sysctl_tcp_westwood) + if (tcp_is_westwood(tp)) ret = (__u32) (max(__tcp_westwood_bw_rttmin(tp), 2U)); return ret; @@ -2046,7 +2048,7 @@ int ret = 0; __u32 ssthresh; - if (sysctl_tcp_westwood) { + if (tcp_is_westwood(tp)) { if (!(ssthresh = tcp_westwood_bw_rttmin(tp))) return ret; @@ -2062,7 +2064,7 @@ int ret = 0; __u32 cwnd; - if (sysctl_tcp_westwood) { + if (tcp_is_westwood(tp)) { if (!(cwnd = tcp_westwood_bw_rttmin(tp))) return ret; @@ -2077,7 +2079,7 @@ { int ret = 0; - if (sysctl_tcp_westwood) { + if (tcp_is_westwood(tp)) { if (tcp_westwood_cwnd(tp)) { tp->snd_ssthresh = tp->snd_cwnd; ret = 1; diff -Nru a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c --- a/net/ipv4/tcp_input.c 2004-10-01 15:51:48 -07:00 +++ b/net/ipv4/tcp_input.c 2004-10-01 15:51:48 -07:00 @@ -549,17 +549,20 @@ tcp_grow_window(sk, tp, skb); } -/* Set up a new TCP connection, depending on whether it should be - * using Vegas or not. - */ -void tcp_vegas_init(struct tcp_opt *tp) +/* When starting a new connection, pin down the current choice of + * congestion algorithm. + */ +void tcp_ca_init(struct tcp_opt *tp) { - if (sysctl_tcp_vegas_cong_avoid) { - tp->vegas.do_vegas = 1; + if (sysctl_tcp_westwood) + tp->adv_cong = TCP_WESTWOOD; + else if (sysctl_tcp_bic) + tp->adv_cong = TCP_BIC; + else if (sysctl_tcp_vegas_cong_avoid) { + tp->adv_cong = TCP_VEGAS; tp->vegas.baseRTT = 0x7fffffff; tcp_vegas_enable(tp); - } else - tcp_vegas_disable(tp); + } } /* Do RTT sampling needed for Vegas. @@ -2007,7 +2010,7 @@ static inline __u32 bictcp_cwnd(struct tcp_opt *tp) { /* orignal Reno behaviour */ - if (!sysctl_tcp_bic) + if (!tcp_is_bic(tp)) return tp->snd_cwnd; if (tp->bictcp.last_cwnd == tp->snd_cwnd && diff -Nru a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c --- a/net/ipv4/tcp_minisocks.c 2004-10-01 15:51:48 -07:00 +++ b/net/ipv4/tcp_minisocks.c 2004-10-01 15:51:48 -07:00 @@ -788,7 +788,7 @@ newtp->mss_clamp = req->mss; TCP_ECN_openreq_child(newtp, req); - tcp_vegas_init(newtp); + tcp_ca_init(newtp); TCP_INC_STATS_BH(TcpPassiveOpens); } return newsk; diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c --- a/net/ipv4/tcp_output.c 2004-10-01 15:51:48 -07:00 +++ b/net/ipv4/tcp_output.c 2004-10-01 15:51:48 -07:00 @@ -1197,7 +1197,7 @@ tp->window_clamp = dst->window; tp->advmss = dst->advmss; tcp_initialize_rcv_mss(sk); - tcp_vegas_init(tp); + tcp_ca_init(tp); tcp_select_initial_window(tcp_full_space(sk), tp->advmss - (tp->ts_recent_stamp ? tp->tcp_header_len - sizeof(struct tcphdr) : 0), @@ -1248,7 +1248,7 @@ TCP_SKB_CB(buff)->end_seq = tp->write_seq; tp->snd_nxt = tp->write_seq; tp->pushed_seq = tp->write_seq; - tcp_vegas_init(tp); + tcp_ca_init(tp); /* Send it off. */ TCP_SKB_CB(buff)->when = tcp_time_stamp; From shemminger@osdl.org Fri Oct 1 15:57:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 15:57:57 -0700 (PDT) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91MvoYQ006616 for ; Fri, 1 Oct 2004 15:57:50 -0700 Received: from zqx3.pdx.osdl.net (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id i91MvXWL008095 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Oct 2004 15:57:33 -0700 Date: Fri, 1 Oct 2004 15:56:20 -0700 From: Stephen Hemminger To: Davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH] (2/3) tcp diag info for 2.4 Message-Id: <20041001155620.2f11f9f0@zqx3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i686-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.86 $ X-Scanned-By: MIMEDefang 2.36 X-archive-position: 9787 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev This adds vegas style bandwidth info to 2.4. Also: makes 2.6 and 2.4 version of tcp_diag.h identical. Signed-off-by: Stephen Hemminger diff -Nru a/include/linux/tcp_diag.h b/include/linux/tcp_diag.h --- a/include/linux/tcp_diag.h 2004-10-01 15:52:21 -07:00 +++ b/include/linux/tcp_diag.h 2004-10-01 15:52:21 -07:00 @@ -98,9 +98,10 @@ TCPDIAG_NONE, TCPDIAG_MEMINFO, TCPDIAG_INFO, + TCPDIAG_VEGASINFO, }; -#define TCPDIAG_MAX TCPDIAG_INFO +#define TCPDIAG_MAX TCPDIAG_VEGASINFO /* TCPDIAG_MEM */ @@ -112,5 +113,15 @@ __u32 tcpdiag_fmem; __u32 tcpdiag_tmem; }; + +/* TCPDIAG_VEGASINFO */ + +struct tcpvegas_info { + __u32 tcpv_enabled; + __u32 tcpv_rttcnt; + __u32 tcpv_rtt; + __u32 tcpv_minrtt; +}; + #endif /* _TCP_DIAG_H_ */ diff -Nru a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c --- a/net/ipv4/tcp_diag.c 2004-10-01 15:52:21 -07:00 +++ b/net/ipv4/tcp_diag.c 2004-10-01 15:52:21 -07:00 @@ -49,6 +49,7 @@ struct nlmsghdr *nlh; struct tcp_info *info = NULL; struct tcpdiag_meminfo *minfo = NULL; + struct tcpvegas_info *vinfo = NULL; unsigned char *b = skb->tail; nlh = NLMSG_PUT(skb, pid, seq, TCPDIAG_GETSOCK, sizeof(*r)); @@ -58,6 +59,10 @@ minfo = TCPDIAG_PUT(skb, TCPDIAG_MEMINFO, sizeof(*minfo)); if (ext & (1<<(TCPDIAG_INFO-1))) info = TCPDIAG_PUT(skb, TCPDIAG_INFO, sizeof(*info)); + + if ((tcp_is_westwood(tp) || tcp_is_vegas(tp)) + && (ext & (1<<(TCPDIAG_VEGASINFO-1)))) + vinfo = TCPDIAG_PUT(skb, TCPDIAG_VEGASINFO, sizeof(*vinfo)); } r->tcpdiag_family = sk->family; r->tcpdiag_state = sk->state; @@ -184,6 +189,20 @@ info->tcpi_snd_cwnd = tp->snd_cwnd; info->tcpi_advmss = tp->advmss; info->tcpi_reordering = tp->reordering; + } + + if (vinfo) { + if (tcp_is_vegas(tp)) { + vinfo->tcpv_enabled = tp->vegas.doing_vegas_now; + vinfo->tcpv_rttcnt = tp->vegas.cntRTT; + vinfo->tcpv_rtt = (1000000*tp->vegas.baseRTT)/HZ; + vinfo->tcpv_minrtt = (1000000*tp->vegas.minRTT)/HZ; + } else { + vinfo->tcpv_enabled = 0; + vinfo->tcpv_rttcnt = 0; + vinfo->tcpv_rtt = (1000000*tp->westwood.rtt)/HZ; + vinfo->tcpv_minrtt = (1000000*tp->westwood.rtt_min)/HZ; + } } nlh->nlmsg_len = skb->tail - b; From shemminger@osdl.org Fri Oct 1 15:57:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 15:57:58 -0700 (PDT) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91MvpGC006617 for ; Fri, 1 Oct 2004 15:57:51 -0700 Received: from zqx3.pdx.osdl.net (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id i91MvYWL008115 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Oct 2004 15:57:34 -0700 Date: Fri, 1 Oct 2004 15:57:25 -0700 From: Stephen Hemminger Cc: davem@redhat.com Subject: [PATCH] (3/3) tcp westwood cleanup for 2.4 Message-Id: <20041001155725.3cd22049@zqx3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i686-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.86 $ X-Scanned-By: MIMEDefang 2.36 X-archive-position: 9788 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Backport of the 2.6 code cleanup for Westwood TCP. Signed-off-by: Stephen Hemminger diff -Nru a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c --- a/net/ipv4/tcp_input.c 2004-10-01 15:54:14 -07:00 +++ b/net/ipv4/tcp_input.c 2004-10-01 15:54:14 -07:00 @@ -2556,15 +2556,13 @@ * WESTWOOD_RTT_MIN minimum bound since we could be on a LAN! */ -static inline __u32 westwood_update_rttmin(struct sock *sk) +static inline __u32 westwood_update_rttmin(const struct sock *sk) { - struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); + const struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); __u32 rttmin = tp->westwood.rtt_min; - if (tp->westwood.rtt == 0) - return rttmin; - - if (tp->westwood.rtt < tp->westwood.rtt_min || !rttmin) + if (tp->westwood.rtt != 0 && + (tp->westwood.rtt < tp->westwood.rtt_min || !rttmin)) rttmin = tp->westwood.rtt; return rttmin; @@ -2575,9 +2573,9 @@ * Evaluate increases for dk. */ -static __u32 westwood_acked(struct sock *sk) +static __u32 westwood_acked(const struct sock *sk) { - struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); + const struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); return ((tp->snd_una) - (tp->westwood.snd_una)); } @@ -2591,9 +2589,9 @@ * window, 1 if the sample has to be considered in the next window. */ -static int westwood_new_window(struct sock *sk) +static int westwood_new_window(const struct sock *sk) { - struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); + const struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); __u32 left_bound; __u32 rtt; int ret = 0; @@ -2627,14 +2625,13 @@ struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); __u32 delta = now - tp->westwood.rtt_win_sx; - if (!delta) - return; - - if (tp->westwood.rtt) - westwood_filter(sk, delta); - - tp->westwood.bk = 0; - tp->westwood.rtt_win_sx = tcp_time_stamp; + if (delta) { + if (tp->westwood.rtt) + westwood_filter(sk, delta); + + tp->westwood.bk = 0; + tp->westwood.rtt_win_sx = tcp_time_stamp; + } } static void westwood_update_window(struct sock *sk, __u32 now) @@ -2688,7 +2685,7 @@ static inline int westwood_may_change_cumul(struct tcp_opt *tp) { - return ((tp->westwood.cumul_ack) > westwood_mss(tp)); + return (tp->westwood.cumul_ack > westwood_mss(tp)); } static inline void westwood_partial_update(struct tcp_opt *tp) @@ -2709,7 +2706,7 @@ * delayed or partial acks. */ -static __u32 westwood_acked_count(struct sock *sk) +static inline __u32 westwood_acked_count(struct sock *sk) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); @@ -2723,7 +2720,7 @@ if (westwood_may_change_cumul(tp)) { /* Partial or delayed ack */ - if ((tp->westwood.accounted) >= (tp->westwood.cumul_ack)) + if (tp->westwood.accounted >= tp->westwood.cumul_ack) westwood_partial_update(tp); else westwood_complete_update(tp); From ak@suse.de Fri Oct 1 16:22:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 16:22:56 -0700 (PDT) Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91NMoPU011330 for ; Fri, 1 Oct 2004 16:22:50 -0700 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 05957CB5C94; Sat, 2 Oct 2004 01:19:40 +0200 (CEST) Date: Sat, 2 Oct 2004 01:19:39 +0200 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , netdev@oss.sgi.com, jheffner@psc.edu, herbert@gondor.apana.org.au Subject: Re: Current 2.6.x TSO state Message-ID: <20041001231939.GC23046@wotan.suse.de> References: <20040930213221.06a3f5b3.davem@davemloft.net> <20041001121123.19511403.ak@suse.de> <20041001124733.1ac4266a.davem@davemloft.net> <20041001195146.GA23046@wotan.suse.de> <20041001125643.30c6830f.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041001125643.30c6830f.davem@davemloft.net> X-archive-position: 9789 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev > As mentioned, the TCP receive buffer auto-tuning takes care > of all of this in 2.6.6 and later. It's just 2.6.5 doesn't How do you explain the 2-4MB/s less with manually increased receive buffers? -Andi From vkondra@mail.ru Fri Oct 1 16:26:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 16:27:02 -0700 (PDT) Received: from mx2.mail.ru (mx2.mail.ru [194.67.23.122]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i91NQtuq011669 for ; Fri, 1 Oct 2004 16:26:56 -0700 Received: from [82.80.3.97] (port=35851 helo=[192.168.10.2]) by mx2.mail.ru with esmtp id 1CDWnN-0002DW-00; Sat, 02 Oct 2004 03:26:39 +0400 From: Vladimir Kondratiev To: "David S. Miller" Subject: Re: generic 802.11 stack Date: Sat, 2 Oct 2004 01:25:32 +0200 User-Agent: KMail/1.7 Cc: netdev@oss.sgi.com, mcgrof@studorgs.rutgers.edu, acx100-devel@lists.sourceforge.net, prism54-devel@prism54.org References: <200408312111.02438.vda@port.imtp.ilyichevsk.odessa.ua> <200410011630.59465.vkondra@mail.ru> <20041001155310.515ee09e.davem@davemloft.net> In-Reply-To: <20041001155310.515ee09e.davem@davemloft.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6206511.VO1UjDSxoh"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200410020125.40669.vkondra@mail.ru> X-Spam: Probable Spam X-archive-position: 9790 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vkondra@mail.ru Precedence: bulk X-list: netdev --nextPart6206511.VO1UjDSxoh Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 02 October 2004 00:53, David S. Miller wrote: DS> DS> Why this change? DS> DS> -extern void hh_data_is_too_small(void); DS> +static void hh_data_is_too_small(void) DS> +{ DS> + printk(KERN_ERR "hh_data_is_too_small\n"); DS> +} My misunderstanding. Sorry. DS> DS> We don't define the function because it is meant to DS> cause a compile time error if hh->hh_data is too small to DS> hold the full p80211_data_header structure. Please undo DS> this change. DS> DS> And therefore undo this change too: DS> DS> - if (sizeof(hh->hh_data) < sizeof(*p)) DS> + if (sizeof(hh->hh_data) < sizeof(*p)) { DS> hh_data_is_too_small(); DS> + return -1; DS> + } As above. DS> DS> Next, what's this? DS> DS> - dev->hard_header =3D p80211_header; DS> + dev->hard_header =3D p80211_header; DS> dev->rebuild_header =3D p80211_rebuild_header; DS> DS> Your merely changing the tab character after dev->hard_header DS> into spaces. Please don't do this. This makes a lot of white DS> space noise when making diffs against the original davem-p80211 DS> code thus making it harder to review the changes you actually made. My editor did it for me. I'll be more carefull to check this behind the sce= ne=20 things. Maybe, I'll do one patch to do all spaces accordingly to kernel=20 coding style, and since that will follow it. DS> DS> Next: DS> DS> + dev->mtu =3D 2304; DS> + dev->type =3D ARPHRD_IEEE80211; DS> DS> Is this really the correct default MTU for wireless devices? Yes, 802.11e (QoS) defines this value. DS> DS> @@ -342,7 +343,7 @@ int p80211_recv_cfackpoll(struct sk_buff DS> static struct packet_type p80211_packet_type =3D { DS> .type =3D __constant_htons(ETH_P_802_11), DS> .func =3D p80211_rcv, DS> - .data =3D (void *) 1, /* understands shared SKBs */ DS> + .af_packet_priv =3D (void *) 1, /* understands shared SKBs */ DS> }; DS> DS> You can just remove this line entirely for 2.6.x kernels. Thanks, I will. I was confused by this member and did simplest trick to mak= e=20 it compile. DS> DS> Otherwise looks fine :-) Really, thus far I did almost nothing. It is just foundation for playing wi= th=20 stack. My intention was to decouple driver and stack ASAP to enable separat= e=20 development for each part. Next step I will do data path, with some code to enable QoS 26 byte headers= =20 but without real QoS, which is, by the way, pretty complicated as defined i= n=20 TGe. May be, it is better to start with WME w.r.t QoS. Then, it is management's turn. Association, scanning. Then, once again, data path. Fragmentation, reassembly. Framework for=20 security. Then - let's see how this will develop. --nextPart6206511.VO1UjDSxoh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBBXed0qxdj7mhC6o0RAo7iAJ0QM7tZtzzcVIKzG1GDm2h3iQbcsgCfdP06 k+A04teh0Hj/6vwDpiOZR8c= =53Am -----END PGP SIGNATURE----- --nextPart6206511.VO1UjDSxoh-- From davem@davemloft.net Fri Oct 1 17:06:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 17:06:44 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i9206dfY012457 for ; Fri, 1 Oct 2004 17:06:39 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDXOS-0008Il-00; Fri, 01 Oct 2004 17:04:56 -0700 Date: Fri, 1 Oct 2004 17:04:56 -0700 From: "David S. Miller" To: Andi Kleen Cc: ak@suse.de, netdev@oss.sgi.com, jheffner@psc.edu, herbert@gondor.apana.org.au Subject: Re: Current 2.6.x TSO state Message-Id: <20041001170456.3ec52222.davem@davemloft.net> In-Reply-To: <20041001231939.GC23046@wotan.suse.de> References: <20040930213221.06a3f5b3.davem@davemloft.net> <20041001121123.19511403.ak@suse.de> <20041001124733.1ac4266a.davem@davemloft.net> <20041001195146.GA23046@wotan.suse.de> <20041001125643.30c6830f.davem@davemloft.net> <20041001231939.GC23046@wotan.suse.de> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9791 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 2 Oct 2004 01:19:39 +0200 Andi Kleen wrote: > > As mentioned, the TCP receive buffer auto-tuning takes care > > of all of this in 2.6.6 and later. It's just 2.6.5 doesn't > > How do you explain the 2-4MB/s less with manually increased > receive buffers? Some scheduling differences, I suppose. Frankly, I've done what I can with the TSO stuff at this point. All I get from you are "it's slower" and no code, I've had to write and fix and debug everything for you. The performance is close or on-par to non-TSO and more importantly TSO abides by the congestion window and MSS values properly now. That's 10 times more important than 2-4MB/s performance difference. Or maybe I should revert all of the TSO work so that all SpecWEB submissions done with 2.6.x kernels get invalidated? From davem@davemloft.net Fri Oct 1 17:13:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 17:13:45 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i920DdTJ012845 for ; Fri, 1 Oct 2004 17:13:39 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDXVG-0008Jj-00; Fri, 01 Oct 2004 17:11:58 -0700 Date: Fri, 1 Oct 2004 17:11:58 -0700 From: "David S. Miller" To: Vladimir Kondratiev Cc: netdev@oss.sgi.com, mcgrof@studorgs.rutgers.edu, acx100-devel@lists.sourceforge.net, prism54-devel@prism54.org Subject: Re: generic 802.11 stack Message-Id: <20041001171158.489e3cf1.davem@davemloft.net> In-Reply-To: <200410020125.40669.vkondra@mail.ru> References: <200408312111.02438.vda@port.imtp.ilyichevsk.odessa.ua> <200410011630.59465.vkondra@mail.ru> <20041001155310.515ee09e.davem@davemloft.net> <200410020125.40669.vkondra@mail.ru> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9792 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 2 Oct 2004 01:25:32 +0200 Vladimir Kondratiev wrote: > DS> Next: > DS> > DS> + dev->mtu = 2304; > DS> + dev->type = ARPHRD_IEEE80211; > DS> > DS> Is this really the correct default MTU for wireless devices? > > Yes, 802.11e (QoS) defines this value. All existing wireless drivers use the standard ethernet MTU. I really think it is supposed to be 1500. That's why I left it at ether_setup()'s setting. Upper layers really want to see a 1500 byte standard ethernet MTU by default. It's OK to let people set this higher via netdev->change_mtu() configuration calls, but by default it should be something that makes sense for most networks and that is 1500. Yes, btw, your tabs are all screwed up. Please configure your editor to use real tab characters. Your's is using spaces and using a tab-stop of 4 when it should be 8. From jheffner@psc.edu Fri Oct 1 18:32:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 18:32:46 -0700 (PDT) Received: from mailer1.psc.edu (mailer1.psc.edu [128.182.58.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i921WeH4013997 for ; Fri, 1 Oct 2004 18:32:41 -0700 Received: from dexter.psc.edu (dexter.psc.edu [128.182.61.232]) by mailer1.psc.edu (8.12.10/8.12.5) with ESMTP id i921WP30006051 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Oct 2004 21:32:26 -0400 (EDT) Received: from dexter.psc.edu (dexter.psc.edu [128.182.61.232]) by dexter.psc.edu (8.12.10/8.12.5) with ESMTP id i921WPCW026692; Fri, 1 Oct 2004 21:32:25 -0400 (EDT) Date: Fri, 1 Oct 2004 21:32:25 -0400 (EDT) From: John Heffner To: "David S. Miller" cc: Subject: Re: bad TSO performance in 2.6.9-rc2-BK In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: clamd / ClamAV version 0.75, clamav-milter version 0.75 on mailer1.psc.edu X-Virus-Status: Clean X-archive-position: 9793 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jheffner@psc.edu Precedence: bulk X-list: netdev > On Thu, 30 Sep 2004, David S. Miller wrote: > > > Please help debug this John since I'm not seeing this here. Here's what I've observed now: on one machine I have interface hangs after a non-deterministic amount of time (usually within a few seconds) with TSO on if I'm sending at a reasonably high rate with a 1500 byte MTU. I get no hangs with a 9000 byte mtu, or at a low rate (sending to a FastE host). Interestingly, if the interface mtu is 9000, but I'm sending 1500 byte packets, it does not seem to hang. On a different machine (both P4's with e1000's) I get no hangs. The hangs happen even with 2.6.8.1 before the recent TSO changes, so it's not a bug there. I looked at some tcpdumps and saw no strangeness in the last segments sent. The good machine has an e7500 chipset and a 82544EI. The bad machine has a ServerWorks chipset and a 82545GM. Any suggestions on where to look for what's going wrong with the interface? Thanks, -John From herbert@gondor.apana.org.au Fri Oct 1 22:02:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 22:03:03 -0700 (PDT) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i9252pEg020353 for ; Fri, 1 Oct 2004 22:02:55 -0700 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CDc2O-0003R0-00; Sat, 02 Oct 2004 15:02:28 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CDc2I-0003wP-00; Sat, 02 Oct 2004 15:02:22 +1000 From: Herbert Xu To: davem@davemloft.net (David S. Miller) Subject: Re: [PATCH]: fixed typo of reassembly.c Cc: yasuyuki.kozakai@toshiba.co.jp, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Organization: Core In-Reply-To: <20041001151923.261b42b3.davem@davemloft.net> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Sat, 02 Oct 2004 15:02:22 +1000 X-archive-position: 9794 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev David S. Miller wrote: > > It is textual fix only, do you realize this? > Both ntohs() and htons() perform the same transformation > on a 16-bit data item. It really does not matter which > one you actually use, in practice. It might make a difference in future if the sparse people decide to annotate its arguments/return values. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From davem@davemloft.net Fri Oct 1 23:40:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Oct 2004 23:40:39 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i926eWJu022688 for ; Fri, 1 Oct 2004 23:40:33 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CDdXN-00006x-00; Fri, 01 Oct 2004 23:38:33 -0700 Date: Fri, 1 Oct 2004 23:38:32 -0700 From: "David S. Miller" To: Herbert Xu Cc: yasuyuki.kozakai@toshiba.co.jp, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH]: fixed typo of reassembly.c Message-Id: <20041001233832.34bd0a91.davem@davemloft.net> In-Reply-To: References: <20041001151923.261b42b3.davem@davemloft.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9795 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 02 Oct 2004 15:02:22 +1000 Herbert Xu wrote: > David S. Miller wrote: > > > > It is textual fix only, do you realize this? > > Both ntohs() and htons() perform the same transformation > > on a 16-bit data item. It really does not matter which > > one you actually use, in practice. > > It might make a difference in future if the sparse people decide to > annotate its arguments/return values. That's true. Al Viro has done this on the filesystems and "cpu_to_{be,le}{16,32,64}()" et al. interfaces. I'm sure he'll hit the networking before long. From herbert@gondor.apana.org.au Sat Oct 2 00:51:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 00:51:40 -0700 (PDT) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i927pUVD027127 for ; Sat, 2 Oct 2004 00:51:31 -0700 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CDefX-0003yy-00; Sat, 02 Oct 2004 17:51:03 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CDefL-0004hQ-00; Sat, 02 Oct 2004 17:50:51 +1000 Date: Sat, 2 Oct 2004 17:50:51 +1000 To: "David S. Miller" Cc: laforge@gnumonks.org, netdev@oss.sgi.com Subject: Re: [6/6]: jenkins hash for neigh Message-ID: <20041002075051.GA18037@gondor.apana.org.au> References: <20040925005623.2faf8faf.davem@davemloft.net> <20040927111520.4f495b17.davem@davemloft.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: <20040927111520.4f495b17.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 9796 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 27, 2004 at 11:15:20AM -0700, David S. Miller wrote: > On Mon, 27 Sep 2004 21:48:33 +1000 > Herbert Xu wrote: > > > > - if (tbl->entries > (tbl->hash_mask + 1)) > > > + if (tbl->entries > (tbl->hash_mask + 1)) { > > > + write_lock_bh(&tbl->lock); > > > neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); > > > + write_unlock_bh(&tbl->lock); > > > + } > > > > The locking should be outside the if block as otherwise you may grow > > unnecessarily or grow into the same size :) > > I'm not going to do that, because then we're grabbing that lock > twice on every neigh create operation and I was trying hard > to avoid that overhead. Actually, why don't we just move the expansion into the locked section? Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/core/neighbour.c 1.51 vs edited ===== --- 1.51/net/core/neighbour.c 2004-10-02 07:58:21 +10:00 +++ edited/net/core/neighbour.c 2004-10-02 17:47:11 +10:00 @@ -406,12 +406,6 @@ goto out; } - if (tbl->entries > (tbl->hash_mask + 1)) { - write_lock_bh(&tbl->lock); - neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); - write_unlock_bh(&tbl->lock); - } - memcpy(n->primary_key, pkey, key_len); n->dev = dev; dev_hold(dev); @@ -432,6 +426,9 @@ n->confirmed = jiffies - (n->parms->base_reachable_time << 1); write_lock_bh(&tbl->lock); + + if (tbl->entries > (tbl->hash_mask + 1)) { + neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; --PNTmBPCT7hxwcZjr-- From duncan.sands@math.u-psud.fr Sat Oct 2 01:17:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 01:17:46 -0700 (PDT) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i928Hd0s027878 for ; Sat, 2 Oct 2004 01:17:40 -0700 Received: from pbaldrick.hd.free.fr (massena-4-82-67-197-146.fbx.proxad.net [82.67.197.146]) by postfix4-2.free.fr (Postfix) with ESMTP id 2FEA820F423; Sat, 2 Oct 2004 10:17:26 +0200 (CEST) Received: by pbaldrick.hd.free.fr (Postfix, from userid 500) id 1D7F8A8728; Sat, 2 Oct 2004 09:58:02 +0200 (CEST) From: Duncan Sands To: "David S. Miller" Subject: Re: Oops at __neigh_for_each_release (2.6.9-rc3) Date: Sat, 2 Oct 2004 09:58:00 +0200 User-Agent: KMail/1.6.2 Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, laforge@gnumonks.org References: <200410012217.35264.baldrick@free.fr> <20041001135636.0c071602.davem@davemloft.net> In-Reply-To: <20041001135636.0c071602.davem@davemloft.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200410020958.01197.baldrick@free.fr> X-archive-position: 9797 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: baldrick@free.fr Precedence: bulk X-list: netdev > > EIP is at __neigh_for_each_release+0x32/0xb0 > > Give this patch a try. And please report networking bugs > to netdev@oss.sgi.com in the future, thanks. OK, will do. I tested the patch Linus committed - it indeed fixes the oops. Thanks a lot! Duncan. From margitsw@t-online.de Sat Oct 2 02:26:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 02:26:47 -0700 (PDT) Received: from mailout04.sul.t-online.com (mailout04.sul.t-online.com [194.25.134.18]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i929Qeb4029197 for ; Sat, 2 Oct 2004 02:26:41 -0700 Received: from fwd09.aul.t-online.de by mailout04.sul.t-online.com with smtp id 1CDg9l-0000Q8-01; Sat, 02 Oct 2004 11:26:21 +0200 Received: from margit.t-online.de (XdwFZZZSwegAYW0xWWI8kv7S+wRqQhro5aZnpGSy2fu0RZvqO8wprh@[217.226.116.15]) by fwd09.sul.t-online.com with esmtp id 1CDg9f-29F1H60; Sat, 2 Oct 2004 11:26:15 +0200 Message-Id: <5.1.0.14.2.20041002105713.026705d8@pop.t-online.de> X-Sender: margitsw@pop.t-online.de X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sat, 02 Oct 2004 11:07:18 +0200 To: Greg KH From: margitsw@t-online.de (Margit Schubert-While) Subject: Re: [Kernel-janitors] Re: [PATCH 2.6.9-rc2 17/38] net/islpci_dev: replace schedule_timeout() with msleep() Cc: jgarzik@pobox.com, netdev@oss.sgi.com, kernel-janitors@lists.osdl.org, mcgrof@studorgs.rutgers.edu, prism54-devel@prism54.org, hvr@gnu.org In-Reply-To: <20041001165523.GC11646@kroah.com> References: <5.1.0.14.2.20041001084419.02570b18@pop.t-online.de> <5.1.0.14.2.20040924074745.00b1cd40@pop.t-online.de> <20040923221303.GB13244@us.ibm.com> <20040923221303.GB13244@us.ibm.com> <5.1.0.14.2.20040924074745.00b1cd40@pop.t-online.de> <5.1.0.14.2.20041001084419.02570b18@pop.t-online.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-ID: XdwFZZZSwegAYW0xWWI8kv7S+wRqQhro5aZnpGSy2fu0RZvqO8wprh X-TOI-MSGID: 985859d3-d2bd-4320-99fa-e11d875a8fbf X-archive-position: 9798 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev At 09:55 01.10.2004 -0700, Greg scribeth: >On Fri, Oct 01, 2004 at 09:04:27AM +0200, Margit Schubert-While wrote: > > At 00:15 01.10.2004 -0400, Jeff scribeth: > > >I would rather see an msleep implementation in 2.4.x... > > > > Hear, hear. > > And can we PLEASE have a > > "#define HAVE_MSLEEP" in delay.h ?!!! > > (2.4. AND 2.6) > >No, this is not how the kernel source tree works, sorry. Well it happened with netdev_priv ;-) (HAVE_NETDEV_PRIV) Margit From yoshfuji@linux-ipv6.org Sat Oct 2 03:31:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 03:31:36 -0700 (PDT) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92AVTTN001590 for ; Sat, 2 Oct 2004 03:31:30 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id A6C3833CE5; Sat, 2 Oct 2004 19:31:38 +0900 (JST) Date: Sat, 02 Oct 2004 19:31:38 +0900 (JST) Message-Id: <20041002.193138.94763422.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH 2.6] [IPV6] SIT: dst leakage in error path. From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 9799 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. We failed to put rt in error path. Signed-off-by: Hideaki YOSHIFUJI ===== net/ipv6/sit.c 1.41 vs edited ===== --- 1.41/net/ipv6/sit.c 2004-09-17 05:10:00 +09:00 +++ edited/net/ipv6/sit.c 2004-10-02 19:24:05 +09:00 @@ -487,6 +487,7 @@ } } if (rt->rt_type != RTN_UNICAST) { + ip_rt_put(rt); tunnel->stat.tx_carrier_errors++; goto tx_error_icmp; } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sat Oct 2 03:34:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 03:34:20 -0700 (PDT) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92AYFGi001956 for ; Sat, 2 Oct 2004 03:34:15 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 1BF2633CE5; Sat, 2 Oct 2004 19:34:25 +0900 (JST) Date: Sat, 02 Oct 2004 19:34:24 +0900 (JST) Message-Id: <20041002.193424.76694251.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH 2.6] [IPV6] SIT: dst leakage in error path. From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20041002.193138.94763422.yoshfuji@linux-ipv6.org> References: <20041002.193138.94763422.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-archive-position: 9800 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20041002.193138.94763422.yoshfuji@linux-ipv6.org> (at Sat, 02 Oct 2004 19:31:38 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > We failed to put rt in error path. > > Signed-off-by: Hideaki YOSHIFUJI And this also applies 2.4 (with some fuzz). --yoshfuji From benh@kernel.crashing.org Sat Oct 2 04:54:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 04:54:46 -0700 (PDT) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92BsdUr006897 for ; Sat, 2 Oct 2004 04:54:40 -0700 Received: from localhost (localhost [127.0.0.1]) by gate.crashing.org (8.12.8/8.12.8) with ESMTP id i92BlOKM010068; Sat, 2 Oct 2004 06:47:26 -0500 Subject: Re: kernel crash with G5 Xserve and sungem driver From: Benjamin Herrenschmidt To: Harald Welte Cc: Chris Friesen , netdev@oss.sgi.com, linuxppc-dev@ozlabs.org In-Reply-To: <20041001194630.GO27499@sunbeam.de.gnumonks.org> References: <415D8768.8080808@nortelnetworks.com> <20041001193153.GN27499@sunbeam.de.gnumonks.org> <415DB334.4010809@nortelnetworks.com> <20041001194630.GO27499@sunbeam.de.gnumonks.org> Content-Type: text/plain Message-Id: <1096717811.3634.45.camel@gaston> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sat, 02 Oct 2004 21:50:11 +1000 Content-Transfer-Encoding: 7bit X-archive-position: 9801 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: benh@kernel.crashing.org Precedence: bulk X-list: netdev On Sat, 2004-10-02 at 05:46, Harald Welte wrote: > On Fri, Oct 01, 2004 at 01:42:44PM -0600, Chris Friesen wrote: > > Harald Welte wrote: > > > > >Just don't compile (or load) the sungem driver on those boxes. > > > > Hmm. That's a pain. We've got G5 desktops too, and it would be nice to be > > able to run one kernel for both. It'd be better (IMHO) to fix the driver > > so it doesn't crash. > > I recommend talking to Bejamin Herrenschmidt, IIRC he already had > something in mind in order to fix the issue. > > I mean, you can always hardcode some exemption into the driver, that's > two easy lines ;) Or just have the driver test the return value of pci_device_to_OF_node() for NULL :) One thing is that I'm about to push a patch that will "hide" PCI devices from the kernel that are absent from the OF tree since there are other issues with newer machines, so that will fix the problem. Both 64 bits and 32 bits patches are below: ===== arch/ppc64/kernel/pmac_pci.c 1.5 vs edited ===== --- 1.5/arch/ppc64/kernel/pmac_pci.c 2004-07-25 14:51:52 +10:00 +++ edited/arch/ppc64/kernel/pmac_pci.c 2004-08-04 10:26:07 +10:00 @@ -271,7 +271,7 @@ int offset, int len, u32 *val) { struct pci_controller *hose; - struct device_node *busdn; + struct device_node *busdn, *dn; unsigned long addr; if (bus->self) @@ -282,6 +282,16 @@ return PCIBIOS_DEVICE_NOT_FOUND; hose = busdn->phb; if (hose == NULL) + return PCIBIOS_DEVICE_NOT_FOUND; + + /* We only allow config cycles to devices that are in OF device-tree + * as we are apparently having some weird things going on with some + * revs of K2 on recent G5s + */ + for (dn = busdn->child; dn; dn = dn->sibling) + if (dn->devfn == devfn) + break; + if (dn == NULL) return PCIBIOS_DEVICE_NOT_FOUND; addr = u3_ht_cfg_access(hose, bus->number, devfn, offset); ===== arch/ppc/platforms/pmac_pci.c 1.21 vs edited ===== --- 1.21/arch/ppc/platforms/pmac_pci.c 2004-07-29 14:58:35 +10:00 +++ edited/arch/ppc/platforms/pmac_pci.c 2004-08-17 14:18:09 +10:00 @@ -315,6 +315,10 @@ unsigned int addr; int i; + struct device_node *np = pci_busdev_to_OF_node(bus, devfn); + if (np == NULL) + return PCIBIOS_DEVICE_NOT_FOUND; + /* * When a device in K2 is powered down, we die on config * cycle accesses. Fix that here. @@ -362,6 +366,9 @@ unsigned int addr; int i; + struct device_node *np = pci_busdev_to_OF_node(bus, devfn); + if (np == NULL) + return PCIBIOS_DEVICE_NOT_FOUND; /* * When a device in K2 is powered down, we die on config * cycle accesses. Fix that here. From margitsw@t-online.de Sat Oct 2 07:48:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 07:48:54 -0700 (PDT) Received: from mailout03.sul.t-online.com (mailout03.sul.t-online.com [194.25.134.81]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92EmnEe009380 for ; Sat, 2 Oct 2004 07:48:49 -0700 Received: from fwd08.aul.t-online.de by mailout03.sul.t-online.com with smtp id 1CDlBa-0008IN-00; Sat, 02 Oct 2004 16:48:34 +0200 Received: from roglap.local (XRIpreZ-ZeuSY3MYmmmLhklyopvTlIR65EeJl4mHH73oPHF-F2fmcm@[80.128.222.170]) by fwd08.sul.t-online.com with esmtp id 1CDlBN-27CFjE0; Sat, 2 Oct 2004 16:48:21 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 0/4 linux-2.6.9-rc3/linux-2.4.28-pre3] prism54 bugs/patches Date: Sat, 2 Oct 2004 16:34:56 +0200 User-Agent: KMail/1.5.4 Cc: netdev@oss.sgi.com, prism54-devel@prism54.org MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200410021634.56857.margitsw@t-online.de> X-ID: XRIpreZ-ZeuSY3MYmmmLhklyopvTlIR65EeJl4mHH73oPHF-F2fmcm X-TOI-MSGID: 49f6f2a3-5fec-4188-8eb3-419d470f2f21 X-archive-position: 9802 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev 2004-10-02 Margit Schubert-While * 01_remtrace.patch * Remove TRACE to please the janitors * 02_schedbug.patch * Bug in loop around schedule_timeout * We must rearm the task * * Make timeout message meaningful * 03_fwprint.patch * Print firmware version * * As per convention, make errno return negative * 04_mgtcommit.patch * Change mgt_commit from void to int * We call this from device initialization, * therefore we need to know that it has succeeded * If it hasn't, we do not have a working device and * should pass a non-zero value upwards Jeff, as usual, applies to both 2.4 and 2.6; however, there are outstanding patches for 2.4. Margit From margitsw@t-online.de Sat Oct 2 07:53:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 07:53:43 -0700 (PDT) Received: from mailout09.sul.t-online.com (mailout09.sul.t-online.com [194.25.134.84]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92Erc6U009726 for ; Sat, 2 Oct 2004 07:53:39 -0700 Received: from fwd07.aul.t-online.de by mailout09.sul.t-online.com with smtp id 1CDlGG-0005An-02; Sat, 02 Oct 2004 16:53:24 +0200 Received: from roglap.local (X7jIUUZfoejiSTCM5XlTGmrOL-+j9sTYPtAidfQlhR6oZ2gkDLznEC@[80.128.222.170]) by fwd07.sul.t-online.com with esmtp id 1CDlG5-1W5CTI0; Sat, 2 Oct 2004 16:53:13 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 1/4 linux-2.6.9-rc3/linux-2.4.28-pre3] prism54 remove TRACE Date: Sat, 2 Oct 2004 16:39:48 +0200 User-Agent: KMail/1.5.4 Cc: netdev@oss.sgi.com, prism54-devel@prism54.org MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_02rXBe1fWCdgDwu" Message-Id: <200410021639.48960.margitsw@t-online.de> X-ID: X7jIUUZfoejiSTCM5XlTGmrOL-+j9sTYPtAidfQlhR6oZ2gkDLznEC X-TOI-MSGID: cd1c3969-4a6b-45e5-9ce3-7ae019fe5059 X-archive-position: 9803 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev --Boundary-00=_02rXBe1fWCdgDwu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 2004-10-02 Margit Schubert-While * 01_remtrace.patch * Remove TRACE to please the janitors Margit --Boundary-00=_02rXBe1fWCdgDwu Content-Type: text/x-diff; charset="us-ascii"; name="01_remtrace.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="01_remtrace.patch" diff -Naur linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_hotplug.c linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_hotplug.c --- linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_hotplug.c 2004-08-14 07:36:57.000000000 +0200 +++ linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_hotplug.c 2004-09-25 11:15:41.000000000 +0200 @@ -107,9 +107,6 @@ islpci_private *priv; int rvalue; - /* TRACE(DRV_NAME); */ - - /* Enable the pci device */ if (pci_enable_device(pdev)) { printk(KERN_ERR "%s: pci_enable_device() failed.\n", DRV_NAME); diff -Naur linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_mgt.h linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_mgt.h --- linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_mgt.h 2004-08-14 07:36:18.000000000 +0200 +++ linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_mgt.h 2004-09-25 11:15:54.000000000 +0200 @@ -31,8 +31,6 @@ #define K_DEBUG(f, m, args...) do { if(f & m) printk(KERN_DEBUG args); } while(0) #define DEBUG(f, args...) K_DEBUG(f, pc_debug, args) -#define TRACE(devname) K_DEBUG(SHOW_TRACING, VERBOSE, "%s: -> " __FUNCTION__ "()\n", devname) - extern int pc_debug; #define init_wds 0 /* help compiler optimize away dead code */ --Boundary-00=_02rXBe1fWCdgDwu-- From margitsw@t-online.de Sat Oct 2 07:58:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 07:58:21 -0700 (PDT) Received: from mailout02.sul.t-online.com (mailout02.sul.t-online.com [194.25.134.17]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92EwGoM010172 for ; Sat, 2 Oct 2004 07:58:17 -0700 Received: from fwd09.aul.t-online.de by mailout02.sul.t-online.com with smtp id 1CDlK2-0005Db-01; Sat, 02 Oct 2004 16:57:18 +0200 Received: from roglap.local (ES14IYZpZegS6qLBet6nnK2321OcOLeKV0JTp3uXNpkh-Eav9+pR8M@[80.128.222.170]) by fwd09.sul.t-online.com with esmtp id 1CDlJo-0dc8q80; Sat, 2 Oct 2004 16:57:04 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 2/4 linux-2.6.9-rc3/linux-2.4.28-pre3] prism54 Bug in timeout scheduling Date: Sat, 2 Oct 2004 16:43:40 +0200 User-Agent: KMail/1.5.4 Cc: netdev@oss.sgi.com, prism54-devel@prism54.org MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_c6rXBEu8/u0bS+K" Message-Id: <200410021643.40328.margitsw@t-online.de> X-ID: ES14IYZpZegS6qLBet6nnK2321OcOLeKV0JTp3uXNpkh-Eav9+pR8M X-TOI-MSGID: d203d6cf-f6a3-4b65-9a2f-98d23fc47ba2 X-archive-position: 9804 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev --Boundary-00=_c6rXBEu8/u0bS+K Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 2004-10-02 Margit Schubert-While * 02_schedbug.patch * Bug in loop around schedule_timeout * We must rearm the task * * Make timeout message meaningful Margit --Boundary-00=_c6rXBEu8/u0bS+K Content-Type: text/x-diff; charset="us-ascii"; name="02_schedbug.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="02_schedbug.patch" diff -Naur linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_dev.c linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_dev.c --- linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_dev.c 2004-10-02 12:23:39.000000000 +0200 +++ linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_dev.c 2004-10-02 12:26:51.000000000 +0200 @@ -486,6 +486,7 @@ /* The software reset acknowledge needs about 220 msec here. * Be conservative and wait for up to one second. */ + set_current_state(TASK_UNINTERRUPTIBLE); remaining = schedule_timeout(HZ); if(remaining > 0) { @@ -496,14 +497,14 @@ /* If we're here it's because our IRQ hasn't yet gone through. * Retry a bit more... */ - printk(KERN_ERR "%s: reset problem: no 'reset complete' IRQ seen\n", + printk(KERN_ERR "%s: no 'reset complete' IRQ seen - retrying\n", priv->ndev->name); } finish_wait(&priv->reset_done, &wait); if (result) { - printk(KERN_ERR "%s: islpci_reset_if: failure\n", priv->ndev->name); + printk(KERN_ERR "%s: interface reset failure\n", priv->ndev->name); return result; } diff -Naur linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_mgt.c linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_mgt.c --- linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_mgt.c 2004-10-02 12:23:40.000000000 +0200 +++ linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_mgt.c 2004-10-02 12:27:10.000000000 +0200 @@ -473,6 +473,7 @@ int timeleft; struct islpci_mgmtframe *frame; + set_current_state(TASK_UNINTERRUPTIBLE); timeleft = schedule_timeout(wait_cycle_jiffies); frame = xchg(&priv->mgmt_received, NULL); if (frame) { --Boundary-00=_c6rXBEu8/u0bS+K-- From margitsw@t-online.de Sat Oct 2 07:59:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 08:00:03 -0700 (PDT) Received: from mailout10.sul.t-online.com (mailout10.sul.t-online.com [194.25.134.21]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92Ext6Q010505 for ; Sat, 2 Oct 2004 07:59:56 -0700 Received: from fwd10.aul.t-online.de by mailout10.sul.t-online.com with smtp id 1CDlML-0005AP-01; Sat, 02 Oct 2004 16:59:41 +0200 Received: from roglap.local (SgBpZZZGoeMj0Ayfv3Mnl1BD99O2HulixO5sPOlqbmEAsMbV7a69Ui@[80.128.222.170]) by fwd10.sul.t-online.com with esmtp id 1CDlME-0mCVWa0; Sat, 2 Oct 2004 16:59:34 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 3/4 linux-2.6.9-rc3/linux-2.4.28-pre3] prism54 print firmware version Date: Sat, 2 Oct 2004 16:46:10 +0200 User-Agent: KMail/1.5.4 Cc: netdev@oss.sgi.com, prism54-devel@prism54.org MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_y8rXBnhfvfllDc6" Message-Id: <200410021646.10748.margitsw@t-online.de> X-ID: SgBpZZZGoeMj0Ayfv3Mnl1BD99O2HulixO5sPOlqbmEAsMbV7a69Ui X-TOI-MSGID: 3e5ec238-fb00-4491-9449-f785492e916b X-archive-position: 9805 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev --Boundary-00=_y8rXBnhfvfllDc6 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 2004-10-02 Margit Schubert-While * 03_fwprint.patch * Print firmware version * * As per convention, make errno return negative Margit --Boundary-00=_y8rXBnhfvfllDc6 Content-Type: text/x-diff; charset="us-ascii"; name="03_fwprint.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="03_fwprint.patch" diff -Naur linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_dev.c linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_dev.c --- linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_dev.c 2004-09-25 11:37:09.000000000 +0200 +++ linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_dev.c 2004-09-25 12:03:58.000000000 +0200 @@ -105,7 +105,7 @@ "%s: firmware '%s' size is not multiple of 32bit, aborting!\n", "prism54", priv->firmware); release_firmware(fw_entry); - return EILSEQ; /* Illegal byte sequence */; + return -EILSEQ; /* Illegal byte sequence */; } while (fw_len > 0) { @@ -142,6 +142,10 @@ BUG_ON(fw_len != 0); + /* Firmware version is at offset 40 (also for "newmac") */ + printk(KERN_DEBUG "%s: firmware version: %.8s\n", + priv->ndev->name, fw_entry->data + 40); + release_firmware(fw_entry); } --Boundary-00=_y8rXBnhfvfllDc6-- From margitsw@t-online.de Sat Oct 2 08:02:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 08:02:16 -0700 (PDT) Received: from mailout06.sul.t-online.com (mailout06.sul.t-online.com [194.25.134.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92F28F7010854 for ; Sat, 2 Oct 2004 08:02:09 -0700 Received: from fwd05.aul.t-online.de by mailout06.sul.t-online.com with smtp id 1CDlOT-0004Bj-00; Sat, 02 Oct 2004 17:01:53 +0200 Received: from roglap.local (GuEkgvZYgeYOrWw2ME6psZQZtjo2Xa5PpxWtk-S9H2GyoBQO7EqYw3@[80.128.222.170]) by fwd05.sul.t-online.com with esmtp id 1CDlOH-01UwWu0; Sat, 2 Oct 2004 17:01:41 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 4/4 linux-2.6.9-rc3/linux-2.4.28-pre3] prism54 bug initialization/mgt_commit Date: Sat, 2 Oct 2004 16:48:17 +0200 User-Agent: KMail/1.5.4 Cc: netdev@oss.sgi.com, prism54-devel@prism54.org MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_x+rXBVB5F4FxvYp" Message-Id: <200410021648.17552.margitsw@t-online.de> X-ID: GuEkgvZYgeYOrWw2ME6psZQZtjo2Xa5PpxWtk-S9H2GyoBQO7EqYw3 X-TOI-MSGID: 721ad578-3b1a-4954-97da-89ae23940950 X-archive-position: 9806 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev --Boundary-00=_x+rXBVB5F4FxvYp Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 2004-10-02 Margit Schubert-While * 04_mgtcommit.patch * Change mgt_commit from void to int * (and pass a return code) * We call this from device initialization, * therefore we need to know that it has succeeded * If it hasn't, we do not have a working device and * should pass a non-zero value upwards Margit --Boundary-00=_x+rXBVB5F4FxvYp Content-Type: text/x-diff; charset="us-ascii"; name="04_mgtcommit.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="04_mgtcommit.patch" diff -Naur linux-2.6.9rc2/drivers/net/wireless/prism54/isl_ioctl.c linux-2.6.9-rc2msw/drivers/net/wireless/prism54/isl_ioctl.c --- linux-2.6.9rc2/drivers/net/wireless/prism54/isl_ioctl.c 2004-10-02 12:23:39.000000000 +0200 +++ linux-2.6.9-rc2msw/drivers/net/wireless/prism54/isl_ioctl.c 2004-10-02 15:09:25.000000000 +0200 @@ -340,7 +340,10 @@ mgt_set(priv, DOT11_OID_MLMEAUTOLEVEL, &mlmeautolevel); - mgt_commit(priv); + if (mgt_commit(priv)) { + up_write(&priv->mib_sem); + return -EIO; + } priv->ndev->type = (priv->iw_mode == IW_MODE_MONITOR) ? priv->monitor_type : ARPHRD_ETHER; up_write(&priv->mib_sem); @@ -1401,7 +1404,10 @@ mlmeautolevel = DOT11_MLME_EXTENDED; mgt_set(priv, DOT11_OID_MLMEAUTOLEVEL, &mlmeautolevel); /* restart the card with our new policy */ - mgt_commit(priv); + if (mgt_commit(priv)) { + up_write(&priv->mib_sem); + return -EIO; + } up_write(&priv->mib_sem); return 0; diff -Naur linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_dev.c linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_dev.c --- linux-2.6.9rc2/drivers/net/wireless/prism54/islpci_dev.c 2004-10-02 12:31:55.000000000 +0200 +++ linux-2.6.9-rc2msw/drivers/net/wireless/prism54/islpci_dev.c 2004-10-02 15:04:56.000000000 +0200 @@ -522,7 +522,12 @@ isl38xx_enable_common_interrupts(priv->device_base); down_write(&priv->mib_sem); - mgt_commit(priv); + result = mgt_commit(priv); + if (result) { + printk(KERN_ERR "%s: interface reset failure\n", priv->ndev->name); + up_write(&priv->mib_sem); + return result; + } up_write(&priv->mib_sem); islpci_set_state(priv, PRV_STATE_READY); diff -Naur linux-2.6.9rc2/drivers/net/wireless/prism54/oid_mgt.c linux-2.6.9-rc2msw/drivers/net/wireless/prism54/oid_mgt.c --- linux-2.6.9rc2/drivers/net/wireless/prism54/oid_mgt.c 2004-10-02 12:23:40.000000000 +0200 +++ linux-2.6.9-rc2msw/drivers/net/wireless/prism54/oid_mgt.c 2004-10-02 15:01:21.000000000 +0200 @@ -697,14 +697,14 @@ #define VEC_SIZE(a) (sizeof(a)/sizeof(a[0])) -void +int mgt_commit(islpci_private *priv) { int rvalue; u32 u; if (islpci_get_state(priv) < PRV_STATE_INIT) - return; + return 0; rvalue = mgt_commit_list(priv, commit_part1, VEC_SIZE(commit_part1)); @@ -720,6 +720,7 @@ incoherent state. We should reset it ! */ printk(KERN_DEBUG "%s: mgt_commit: failure\n", priv->ndev->name); } + return rvalue; } /* The following OIDs need to be "unlatched": diff -Naur linux-2.6.9rc2/drivers/net/wireless/prism54/oid_mgt.h linux-2.6.9-rc2msw/drivers/net/wireless/prism54/oid_mgt.h --- linux-2.6.9rc2/drivers/net/wireless/prism54/oid_mgt.h 2004-10-02 12:23:39.000000000 +0200 +++ linux-2.6.9-rc2msw/drivers/net/wireless/prism54/oid_mgt.h 2004-10-02 15:01:41.000000000 +0200 @@ -48,7 +48,7 @@ void mgt_get(islpci_private *, enum oid_num_t, void *); -void mgt_commit(islpci_private *); +int mgt_commit(islpci_private *); void mgt_unlatch_all(islpci_private *); int mgt_mlme_answer(islpci_private *); --Boundary-00=_x+rXBVB5F4FxvYp-- From olh@suse.de Sat Oct 2 08:31:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 08:31:46 -0700 (PDT) Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92FVeJH014672 for ; Sat, 2 Oct 2004 08:31:40 -0700 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 6F24DCBDB8B; Sat, 2 Oct 2004 17:30:53 +0200 (CEST) Date: Sat, 2 Oct 2004 17:30:53 +0200 From: Olaf Hering To: Andi Kleen Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] allow CONFIG_NET=n on ppc64 Message-ID: <20041002153053.GA2643@suse.de> References: <20040929200158.GA16366@suse.de> <20040929201524.GA14615@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20040929201524.GA14615@wotan.suse.de> X-DOS: I got your 640K Real Mode Right Here Buddy! X-Homeland-Security: You are not supposed to read this line! You are a terrorist! User-Agent: Mutt und vi sind doch schneller als Notes (und GroupWise) X-archive-position: 9807 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: olh@suse.de Precedence: bulk X-list: netdev On Wed, Sep 29, Andi Kleen wrote: > On Wed, Sep 29, 2004 at 10:01:58PM +0200, Olaf Hering wrote: > > > > The attached minimal config does not compile on ppc64. > > I was able to boot the resulting binary with this patch. > Right fix is to declare compat_sys_socketcall as as cond_syscall() > in sys.c ok. Signed-off-by: Olaf Hering diff -purNX /suse/olh/kernel/kernel_exclude.txt linux-2.6.9-rc3-bk2/include/net/sock.h linux-2.6.9-rc3-bk2.nonet/include/net/sock.h --- linux-2.6.9-rc3-bk2/include/net/sock.h 2004-09-30 05:05:21.000000000 +0200 +++ linux-2.6.9-rc3-bk2.nonet/include/net/sock.h 2004-10-02 17:24:23.666152810 +0200 @@ -1336,6 +1336,13 @@ static inline void sock_valbool_flag(str extern __u32 sysctl_wmem_max; extern __u32 sysctl_rmem_max; +#ifdef CONFIG_NET int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); +#else +static inline int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + return -ENODEV; +} +#endif #endif /* _SOCK_H */ diff -purNX /suse/olh/kernel/kernel_exclude.txt linux-2.6.9-rc3-bk2/kernel/sys.c linux-2.6.9-rc3-bk2.nonet/kernel/sys.c --- linux-2.6.9-rc3-bk2/kernel/sys.c 2004-09-30 05:03:55.000000000 +0200 +++ linux-2.6.9-rc3-bk2.nonet/kernel/sys.c 2004-10-02 17:05:49.589116448 +0200 @@ -282,6 +282,7 @@ cond_syscall(compat_set_mempolicy) cond_syscall(sys_pciconfig_read) cond_syscall(sys_pciconfig_write) cond_syscall(sys_pciconfig_iobase) +cond_syscall(compat_sys_socketcall) static int set_one_prio(struct task_struct *p, int niceval, int error) { -- USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG From laforge@gnumonks.org Sat Oct 2 09:21:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 09:22:20 -0700 (PDT) Received: from ganesha.gnumonks.org (Debian-exim@ganesha.gnumonks.org [213.95.27.120]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92GLbLj015634 for ; Sat, 2 Oct 2004 09:21:38 -0700 Received: from dsl-082-082-095-114.arcor-ip.net ([82.82.95.114] helo=sunbeam.gnumonks.org) by ganesha.gnumonks.org with asmtp (TLSv1:RC4-SHA:128) (Exim 4.30) id 1CDmdO-0001kO-DN; Sat, 02 Oct 2004 18:21:22 +0200 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.34) id 1CDmdM-0008CS-SK; Sat, 02 Oct 2004 18:21:20 +0200 Date: Sat, 2 Oct 2004 18:21:20 +0200 From: Harald Welte To: Linux Netdev List Cc: David Miller , Robert Olsson , Stephen Hemminger Subject: lnstat (rtstat replacement) Message-ID: <20041002162120.GT27499@sunbeam.de.gnumonks.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QHhm1I6mwQR20oIa" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-archive-position: 9808 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@gnumonks.org Precedence: bulk X-list: netdev --QHhm1I6mwQR20oIa Content-Type: multipart/mixed; boundary="IUSVF+LtaR4kWxuH" Content-Disposition: inline --IUSVF+LtaR4kWxuH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! I've finished my work on 'lnstat'. The current development version is available from http://svn.gnumonks.org/cgi-bin/viewcvs.cgi/trunk/lnstat/ where you can select the 'download tarball' option. I've added and tested support for old kernels, where it tries to fall back to rtstat compatibility mode via /proc/net/rt_cache_stat. README attached to this email. Robert: I hope you're fine with the new lnstat tool replacing rtstat. Stephen: Feel free to grab the current version and add it to the next iproute2 release. Please send any changes you integrate back upstream to me, so I can merge them into my repository. Dave: I've also attached a small patch for Documentation/networking. Please add this to the same patchset that includes /proc/net/stat support. Everyone: If you have suggestions/comments/feature requests, feel free to tell me.=20 Thanks! --=20 - Harald Welte http://www.gnumonks.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D Programming is like sex: One mistake and you have to support it your lifeti= me --IUSVF+LtaR4kWxuH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="laforge-neighstat-doc.patch" Content-Transfer-Encoding: quoted-printable Index: linux-2.6.9-rc2-bk9-neigh1/Documentation/networking/statistics.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.9-rc2-bk9-neigh1/Documentation/networking/statistics.txt 2004= -10-02 18:15:23.485872616 +0200 @@ -0,0 +1,40 @@ +Statistics exported via /proc/net/stat - Added in 2.6.9 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +(C) 2004 by Harald Welte + +/proc/net/stat is a generalized replacement for /proc/net/rt_cache_stat. + +In addition to routing cache statistics, it supports any kind of statistics +the linux kernel exports via a file in /proc/net/stat. In a stock 2.6.9 +kernel, this is=20 + per-protocol neighbour cache statistics=20 + (ipv4, ipv6, atm, decnet) + routing cache statistics + (ipv4) + connection tracking statistics + (ipv4) + + +In order to get a convenient reading of those statistics, a tool called +'lnstat' is provided at http://svn.gnumonks.org/trunk/lnstat + +This tool is to be integrated in the next release of the iproute2 program. + + +If you want to add your own kernel statistics to /proc/net/stat, the file = has +to have the following properties: + +0) Field seperator is always one or two spaces. No tabs, etc. + +1) First line consists out of a template of field names. This is usually = the + structure member names of the statistics structure you want to dump + +2) All following lines consists of unsigned hexadecimal values. One line p= er + available CPU. Only as many fields as specified in template line. + +3) Please test if it works with the 'lnstat' tool before submitting a patch + to the kernel. + +Any questions should be directed to netdev@lists.oss.sgi.com or to the aut= hor +of this document. + --IUSVF+LtaR4kWxuH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=README Content-Transfer-Encoding: quoted-printable lnstat - linux networking statistics (C) 2004 Harald Welte ; Sat, 2 Oct 2004 09:52:21 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 821EF47323; Sat, 2 Oct 2004 13:52:03 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id B594D47438 for ; Sat, 2 Oct 2004 13:52:02 -0300 (BRT) Received: (qmail 24342 invoked by uid 0); 2 Oct 2004 17:49:00 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 2 Oct 2004 17:49:00 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id D9FF414639; Sat, 2 Oct 2004 13:55:05 -0300 (BRT) Message-ID: <415EDD0C.9080507@conectiva.com.br> Date: Sat, 02 Oct 2004 13:53:32 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] introduce eth_hdr(skb) X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------050506010401080500020506" X-Bogosity: No, tests=bogofilter, spamicity=0.485458, version=0.16.3 X-archive-position: 9809 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050506010401080500020506 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David, I'm chunking that sk_buff cleaning up big patch into very easily reviewable changesets, starting with the areas that are more quiet these days, please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Now there is just this outstanding changeset there, next ones will deal with skb->mac.raw. This is a freshly cloned tree from Linus, that I checked to be in sync with bk://kernel.bkbits.net/davem/net-2.6 Best Regards, - Arnaldo --------------050506010401080500020506 Content-Type: text/plain; name="eth_hdr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="eth_hdr.patch" =================================================================== ChangeSet@1.2030, 2004-10-02 13:42:59-03:00, acme@conectiva.com.br [SKBUFF] introduce eth_hdr(skb) This is the start of a series of patches to remove protocol specific stuff out of include/linux/skbuff.h and to make the struct sk_buff header pointers private, i.e. they will only be accessible thru foo_hdr(skb) and some other accessor functions. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller drivers/isdn/i4l/isdn_net.c | 2 +- drivers/media/dvb/dvb-core/dvb_net.c | 2 +- drivers/net/bonding/bond_alb.c | 2 +- drivers/net/ioc3-eth.c | 4 ++-- drivers/net/myri_sbus.c | 2 +- drivers/net/plip.c | 2 +- drivers/net/pppoe.c | 4 ++-- drivers/s390/net/qeth_main.c | 2 +- include/linux/if_ether.h | 12 ++++++++++-- include/linux/if_vlan.h | 10 ++++++++-- include/linux/netfilter_bridge/ebt_802_3.h | 9 +++++++++ include/linux/skbuff.h | 1 - net/8021q/vlan_dev.c | 2 +- net/atm/br2684.c | 2 +- net/bridge/br_input.c | 10 +++++----- net/bridge/br_netfilter.c | 18 ++++++++---------- net/bridge/netfilter/ebt_802_3.c | 2 +- net/bridge/netfilter/ebt_among.c | 12 ++++++------ net/bridge/netfilter/ebt_dnat.c | 3 +-- net/bridge/netfilter/ebt_log.c | 12 ++++++------ net/bridge/netfilter/ebt_redirect.c | 7 +++---- net/bridge/netfilter/ebt_snat.c | 3 +-- net/bridge/netfilter/ebtables.c | 2 +- net/core/dv.c | 4 ++-- net/core/netpoll.c | 2 +- net/decnet/dn_neigh.c | 4 ++-- net/ethernet/eth.c | 4 ++-- net/ipv4/netfilter/ipt_mac.c | 2 +- net/ipv6/netfilter/ip6t_eui64.c | 6 +++--- net/ipv6/netfilter/ip6t_mac.c | 2 +- 30 files changed, 83 insertions(+), 66 deletions(-) diff -Nru a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c --- a/drivers/isdn/i4l/isdn_net.c 2004-10-02 13:44:26 -03:00 +++ b/drivers/isdn/i4l/isdn_net.c 2004-10-02 13:44:26 -03:00 @@ -1369,7 +1369,7 @@ skb->mac.raw = skb->data; skb_pull(skb, ETH_HLEN); - eth = skb->mac.ethernet; + eth = eth_hdr(skb); if (*eth->h_dest & 1) { if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0) diff -Nru a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c --- a/drivers/media/dvb/dvb-core/dvb_net.c 2004-10-02 13:44:26 -03:00 +++ b/drivers/media/dvb/dvb-core/dvb_net.c 2004-10-02 13:44:26 -03:00 @@ -142,7 +142,7 @@ skb->mac.raw=skb->data; skb_pull(skb,dev->hard_header_len); - eth= skb->mac.ethernet; + eth = eth_hdr(skb); if (*eth->h_dest & 1) { if(memcmp(eth->h_dest,dev->broadcast, ETH_ALEN)==0) diff -Nru a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c 2004-10-02 13:44:26 -03:00 +++ b/drivers/net/bonding/bond_alb.c 2004-10-02 13:44:26 -03:00 @@ -1285,7 +1285,7 @@ int res = 1; skb->mac.raw = (unsigned char *)skb->data; - eth_data = (struct ethhdr *)skb->data; + eth_data = eth_hdr(skb); /* make sure that the curr_active_slave and the slaves list do * not change during tx diff -Nru a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c --- a/drivers/net/ioc3-eth.c 2004-10-02 13:44:26 -03:00 +++ b/drivers/net/ioc3-eth.c 2004-10-02 13:44:26 -03:00 @@ -506,7 +506,7 @@ static void ioc3_tcpudp_checksum(struct sk_buff *skb, uint32_t hwsum, int len) { - struct ethhdr *eh = skb->mac.ethernet; + struct ethhdr *eh = eth_hdr(skb); uint32_t csum, ehsum; unsigned int proto; struct iphdr *ih; @@ -1333,7 +1333,7 @@ uint32_t csum, ehsum; uint16_t *eh; - /* The MAC header. skb->mac.ethernet seem the logic approach + /* The MAC header. skb->mac seem the logic approach to find the MAC header - except it's a NULL pointer ... */ eh = (uint16_t *) skb->data; diff -Nru a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c --- a/drivers/net/myri_sbus.c 2004-10-02 13:44:26 -03:00 +++ b/drivers/net/myri_sbus.c 2004-10-02 13:44:26 -03:00 @@ -376,7 +376,7 @@ skb->mac.raw = (((unsigned char *)skb->data) + MYRI_PAD_LEN); skb_pull(skb, dev->hard_header_len); - eth = skb->mac.ethernet; + eth = eth_hdr(skb); #ifdef DEBUG_HEADER DHDR(("myri_type_trans: ")); diff -Nru a/drivers/net/plip.c b/drivers/net/plip.c --- a/drivers/net/plip.c 2004-10-02 13:44:26 -03:00 +++ b/drivers/net/plip.c 2004-10-02 13:44:26 -03:00 @@ -547,7 +547,7 @@ skb->mac.raw=skb->data; skb_pull(skb,dev->hard_header_len); - eth= skb->mac.ethernet; + eth = eth_hdr(skb); if(*eth->h_dest&1) { diff -Nru a/drivers/net/pppoe.c b/drivers/net/pppoe.c --- a/drivers/net/pppoe.c 2004-10-02 13:44:26 -03:00 +++ b/drivers/net/pppoe.c 2004-10-02 13:44:26 -03:00 @@ -391,7 +391,7 @@ ph = (struct pppoe_hdr *) skb->nh.raw; - po = get_item((unsigned long) ph->sid, skb->mac.ethernet->h_source); + po = get_item((unsigned long) ph->sid, eth_hdr(skb)->h_source); if (!po) goto drop; @@ -440,7 +440,7 @@ if (ph->code != PADT_CODE) goto abort; - po = get_item((unsigned long) ph->sid, skb->mac.ethernet->h_source); + po = get_item((unsigned long) ph->sid, eth_hdr(skb)->h_source); if (po) { struct sock *sk = po->sk; diff -Nru a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c --- a/drivers/s390/net/qeth_main.c 2004-10-02 13:44:26 -03:00 +++ b/drivers/s390/net/qeth_main.c 2004-10-02 13:44:26 -03:00 @@ -2148,7 +2148,7 @@ skb->mac.raw = skb->data; skb_pull(skb, ETH_ALEN * 2 + sizeof (short)); - eth = skb->mac.ethernet; + eth = eth_hdr(skb); if (*eth->h_dest & 1) { if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0) diff -Nru a/include/linux/if_ether.h b/include/linux/if_ether.h --- a/include/linux/if_ether.h 2004-10-02 13:44:26 -03:00 +++ b/include/linux/if_ether.h 2004-10-02 13:44:26 -03:00 @@ -96,11 +96,19 @@ * This is an Ethernet frame header. */ -struct ethhdr -{ +struct ethhdr { unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ unsigned char h_source[ETH_ALEN]; /* source ether addr */ unsigned short h_proto; /* packet type ID field */ } __attribute__((packed)); + +#ifdef __KERNEL__ +#include + +static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) +{ + return (struct ethhdr *)skb->mac.raw; +} +#endif #endif /* _LINUX_IF_ETHER_H */ diff -Nru a/include/linux/if_vlan.h b/include/linux/if_vlan.h --- a/include/linux/if_vlan.h 2004-10-02 13:44:26 -03:00 +++ b/include/linux/if_vlan.h 2004-10-02 13:44:26 -03:00 @@ -18,7 +18,6 @@ /* externally defined structs */ struct vlan_group; struct net_device; -struct sk_buff; struct packet_type; struct vlan_collection; struct vlan_dev_info; @@ -48,6 +47,13 @@ unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */ }; +#include + +static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) +{ + return (struct vlan_ethhdr *)skb->mac.raw; +} + struct vlan_hdr { unsigned short h_vlan_TCI; /* Encapsulates priority and VLAN ID */ unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */ @@ -180,7 +186,7 @@ * This allows the VLAN to have a different MAC than the underlying * device, and still route correctly. */ - if (!memcmp(skb->mac.ethernet->h_dest, skb->dev->dev_addr, ETH_ALEN)) + if (!memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN)) skb->pkt_type = PACKET_HOST; break; }; diff -Nru a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h --- a/include/linux/netfilter_bridge/ebt_802_3.h 2004-10-02 13:44:26 -03:00 +++ b/include/linux/netfilter_bridge/ebt_802_3.h 2004-10-02 13:44:26 -03:00 @@ -49,6 +49,15 @@ } llc; }; +#ifdef __KERNEL__ +#include + +static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb) +{ + return (struct ebt_802_3_hdr *)skb->mac.raw; +} +#endif + struct ebt_802_3_info { uint8_t sap; diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h --- a/include/linux/skbuff.h 2004-10-02 13:44:26 -03:00 +++ b/include/linux/skbuff.h 2004-10-02 13:44:26 -03:00 @@ -219,7 +219,6 @@ } nh; union { - struct ethhdr *ethernet; unsigned char *raw; } mac; diff -Nru a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c --- a/net/8021q/vlan_dev.c 2004-10-02 13:44:26 -03:00 +++ b/net/8021q/vlan_dev.c 2004-10-02 13:44:26 -03:00 @@ -211,7 +211,7 @@ * This allows the VLAN to have a different MAC than the underlying * device, and still route correctly. */ - if (memcmp(skb->mac.ethernet->h_dest, skb->dev->dev_addr, ETH_ALEN) == 0) { + if (memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN) == 0) { /* It is for our (changed) MAC-address! */ skb->pkt_type = PACKET_HOST; } diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c --- a/net/atm/br2684.c 2004-10-02 13:44:26 -03:00 +++ b/net/atm/br2684.c 2004-10-02 13:44:26 -03:00 @@ -294,7 +294,7 @@ { struct ethhdr *eth; unsigned char *rawp; - eth = skb->mac.ethernet; + eth = eth_hdr(skb); if (*eth->h_dest & 1) { if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0) diff -Nru a/net/bridge/br_input.c b/net/bridge/br_input.c --- a/net/bridge/br_input.c 2004-10-02 13:44:26 -03:00 +++ b/net/bridge/br_input.c 2004-10-02 13:44:26 -03:00 @@ -48,7 +48,7 @@ /* note: already called with rcu_read_lock (preempt_disabled) */ int br_handle_frame_finish(struct sk_buff *skb) { - const unsigned char *dest = skb->mac.ethernet->h_dest; + const unsigned char *dest = eth_hdr(skb)->h_dest; struct net_bridge_port *p = skb->dev->br_port; struct net_bridge *br = p->br; struct net_bridge_fdb_entry *dst; @@ -100,17 +100,17 @@ int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb) { struct sk_buff *skb = *pskb; - const unsigned char *dest = skb->mac.ethernet->h_dest; + const unsigned char *dest = eth_hdr(skb)->h_dest; if (p->state == BR_STATE_DISABLED) goto err; - if (skb->mac.ethernet->h_source[0] & 1) + if (eth_hdr(skb)->h_source[0] & 1) goto err; if (p->state == BR_STATE_LEARNING || p->state == BR_STATE_FORWARDING) - br_fdb_insert(p->br, p, skb->mac.ethernet->h_source, 0); + br_fdb_insert(p->br, p, eth_hdr(skb)->h_source, 0); if (p->br->stp_enabled && !memcmp(dest, bridge_ula, 5) && @@ -127,7 +127,7 @@ if (br_should_route_hook(pskb)) return 0; skb = *pskb; - dest = skb->mac.ethernet->h_dest; + dest = eth_hdr(skb)->h_dest; } if (!memcmp(p->br->dev->dev_addr, dest, ETH_ALEN)) diff -Nru a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c --- a/net/bridge/br_netfilter.c 2004-10-02 13:44:26 -03:00 +++ b/net/bridge/br_netfilter.c 2004-10-02 13:44:26 -03:00 @@ -255,7 +255,7 @@ 1); return 0; } - memcpy(skb->mac.ethernet->h_dest, dev->dev_addr, + memcpy(eth_hdr(skb)->h_dest, dev->dev_addr, ETH_ALEN); skb->pkt_type = PACKET_HOST; } @@ -412,8 +412,7 @@ __u32 len; struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; - struct vlan_ethhdr *hdr = (struct vlan_ethhdr *) - ((*pskb)->mac.ethernet); + struct vlan_ethhdr *hdr = vlan_eth_hdr(*pskb); if (skb->protocol == __constant_htons(ETH_P_IPV6) || IS_VLAN_IPV6) { #ifdef CONFIG_SYSCTL @@ -516,7 +515,7 @@ { struct nf_bridge_info *nf_bridge = skb->nf_bridge; struct net_device *in; - struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); + struct vlan_ethhdr *hdr = vlan_eth_hdr(skb); #ifdef CONFIG_NETFILTER_DEBUG skb->nf_debug ^= (1 << NF_BR_FORWARD); @@ -551,7 +550,7 @@ { struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; - struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); + struct vlan_ethhdr *hdr = vlan_eth_hdr(skb); int pf; if (!skb->nf_bridge) @@ -591,7 +590,7 @@ int (*okfn)(struct sk_buff *)) { struct sk_buff *skb = *pskb; - struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); + struct vlan_ethhdr *hdr = vlan_eth_hdr(skb); struct net_device **d = (struct net_device **)(skb->cb); #ifdef CONFIG_SYSCTL @@ -669,7 +668,7 @@ struct net_device *realindev, *realoutdev; struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; - struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); + struct vlan_ethhdr *hdr = vlan_eth_hdr(skb); int pf; if (!skb->nf_bridge) @@ -753,7 +752,7 @@ { struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge = (*pskb)->nf_bridge; - struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); + struct vlan_ethhdr *hdr = vlan_eth_hdr(skb); struct net_device *realoutdev = bridge_parent(skb->dev); int pf; @@ -848,8 +847,7 @@ #ifdef CONFIG_SYSCTL if (!skb->nf_bridge) { - struct vlan_ethhdr *hdr = - (struct vlan_ethhdr *)(skb->mac.ethernet); + struct vlan_ethhdr *hdr = vlan_eth_hdr(skb); if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) { diff -Nru a/net/bridge/netfilter/ebt_802_3.c b/net/bridge/netfilter/ebt_802_3.c --- a/net/bridge/netfilter/ebt_802_3.c 2004-10-02 13:44:26 -03:00 +++ b/net/bridge/netfilter/ebt_802_3.c 2004-10-02 13:44:26 -03:00 @@ -16,7 +16,7 @@ const struct net_device *out, const void *data, unsigned int datalen) { struct ebt_802_3_info *info = (struct ebt_802_3_info *)data; - struct ebt_802_3_hdr *hdr = (struct ebt_802_3_hdr *)skb->mac.ethernet; + struct ebt_802_3_hdr *hdr = ebt_802_3_hdr(skb); uint16_t type = hdr->llc.ui.ctrl & IS_UI ? hdr->llc.ui.type : hdr->llc.ni.type; if (info->bitmask & EBT_802_3_SAP) { diff -Nru a/net/bridge/netfilter/ebt_among.c b/net/bridge/netfilter/ebt_among.c --- a/net/bridge/netfilter/ebt_among.c 2004-10-02 13:44:26 -03:00 +++ b/net/bridge/netfilter/ebt_among.c 2004-10-02 13:44:26 -03:00 @@ -72,14 +72,14 @@ static int get_ip_dst(const struct sk_buff *skb, uint32_t *addr) { - if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_IP)) { + if (eth_hdr(skb)->h_proto == htons(ETH_P_IP)) { struct iphdr _iph, *ih; ih = skb_header_pointer(skb, 0, sizeof(_iph), &_iph); if (ih == NULL) return -1; *addr = ih->daddr; - } else if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) { + } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { struct arphdr _arph, *ah; uint32_t buf, *bp; @@ -100,14 +100,14 @@ static int get_ip_src(const struct sk_buff *skb, uint32_t *addr) { - if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_IP)) { + if (eth_hdr(skb)->h_proto == htons(ETH_P_IP)) { struct iphdr _iph, *ih; ih = skb_header_pointer(skb, 0, sizeof(_iph), &_iph); if (ih == NULL) return -1; *addr = ih->saddr; - } else if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) { + } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { struct arphdr _arph, *ah; uint32_t buf, *bp; @@ -139,7 +139,7 @@ wh_src = ebt_among_wh_src(info); if (wh_src) { - smac = skb->mac.ethernet->h_source; + smac = eth_hdr(skb)->h_source; if (get_ip_src(skb, &sip)) return EBT_NOMATCH; if (!(info->bitmask & EBT_AMONG_SRC_NEG)) { @@ -154,7 +154,7 @@ } if (wh_dst) { - dmac = skb->mac.ethernet->h_dest; + dmac = eth_hdr(skb)->h_dest; if (get_ip_dst(skb, &dip)) return EBT_NOMATCH; if (!(info->bitmask & EBT_AMONG_DST_NEG)) { diff -Nru a/net/bridge/netfilter/ebt_dnat.c b/net/bridge/netfilter/ebt_dnat.c --- a/net/bridge/netfilter/ebt_dnat.c 2004-10-02 13:44:26 -03:00 +++ b/net/bridge/netfilter/ebt_dnat.c 2004-10-02 13:44:26 -03:00 @@ -30,8 +30,7 @@ kfree_skb(*pskb); *pskb = nskb; } - memcpy(((**pskb).mac.ethernet)->h_dest, info->mac, - ETH_ALEN * sizeof(unsigned char)); + memcpy(eth_hdr(*pskb)->h_dest, info->mac, ETH_ALEN); return info->target; } diff -Nru a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c --- a/net/bridge/netfilter/ebt_log.c 2004-10-02 13:44:26 -03:00 +++ b/net/bridge/netfilter/ebt_log.c 2004-10-02 13:44:26 -03:00 @@ -70,13 +70,13 @@ out ? out->name : ""); printk("MAC source = "); - print_MAC((skb->mac.ethernet)->h_source); + print_MAC(eth_hdr(skb)->h_source); printk("MAC dest = "); - print_MAC((skb->mac.ethernet)->h_dest); + print_MAC(eth_hdr(skb)->h_dest); - printk("proto = 0x%04x", ntohs(((*skb).mac.ethernet)->h_proto)); + printk("proto = 0x%04x", ntohs(eth_hdr(skb)->h_proto)); - if ((info->bitmask & EBT_LOG_IP) && skb->mac.ethernet->h_proto == + if ((info->bitmask & EBT_LOG_IP) && eth_hdr(skb)->h_proto == htons(ETH_P_IP)){ struct iphdr _iph, *ih; @@ -106,8 +106,8 @@ } if ((info->bitmask & EBT_LOG_ARP) && - ((skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) || - (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_RARP)))) { + ((eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) || + (eth_hdr(skb)->h_proto == htons(ETH_P_RARP)))) { struct arphdr _arph, *ah; ah = skb_header_pointer(skb, 0, sizeof(_arph), &_arph); diff -Nru a/net/bridge/netfilter/ebt_redirect.c b/net/bridge/netfilter/ebt_redirect.c --- a/net/bridge/netfilter/ebt_redirect.c 2004-10-02 13:44:26 -03:00 +++ b/net/bridge/netfilter/ebt_redirect.c 2004-10-02 13:44:26 -03:00 @@ -32,11 +32,10 @@ *pskb = nskb; } if (hooknr != NF_BR_BROUTING) - memcpy((**pskb).mac.ethernet->h_dest, - in->br_port->br->dev->dev_addr, ETH_ALEN); + memcpy(eth_hdr(*pskb)->h_dest, + in->br_port->br->dev->dev_addr, ETH_ALEN); else - memcpy((**pskb).mac.ethernet->h_dest, - in->dev_addr, ETH_ALEN); + memcpy(eth_hdr(*pskb)->h_dest, in->dev_addr, ETH_ALEN); (*pskb)->pkt_type = PACKET_HOST; return info->target; } diff -Nru a/net/bridge/netfilter/ebt_snat.c b/net/bridge/netfilter/ebt_snat.c --- a/net/bridge/netfilter/ebt_snat.c 2004-10-02 13:44:26 -03:00 +++ b/net/bridge/netfilter/ebt_snat.c 2004-10-02 13:44:26 -03:00 @@ -30,8 +30,7 @@ kfree_skb(*pskb); *pskb = nskb; } - memcpy(((**pskb).mac.ethernet)->h_source, info->mac, - ETH_ALEN * sizeof(unsigned char)); + memcpy(eth_hdr(*pskb)->h_source, info->mac, ETH_ALEN); return info->target; } diff -Nru a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c --- a/net/bridge/netfilter/ebtables.c 2004-10-02 13:44:26 -03:00 +++ b/net/bridge/netfilter/ebtables.c 2004-10-02 13:44:26 -03:00 @@ -190,7 +190,7 @@ base = private->entries; i = 0; while (i < nentries) { - if (ebt_basic_match(point, (**pskb).mac.ethernet, in, out)) + if (ebt_basic_match(point, eth_hdr(*pskb), in, out)) goto letscontinue; if (EBT_MATCH_ITERATE(point, ebt_do_match, *pskb, in, out) != 0) diff -Nru a/net/core/dv.c b/net/core/dv.c --- a/net/core/dv.c 2004-10-02 13:44:26 -03:00 +++ b/net/core/dv.c 2004-10-02 13:44:26 -03:00 @@ -450,12 +450,12 @@ */ #define ETH_DIVERT_FRAME(skb) \ - memcpy(skb->mac.ethernet, skb->dev->dev_addr, ETH_ALEN); \ + memcpy(eth_hdr(skb), skb->dev->dev_addr, ETH_ALEN); \ skb->pkt_type=PACKET_HOST void divert_frame(struct sk_buff *skb) { - struct ethhdr *eth = skb->mac.ethernet; + struct ethhdr *eth = eth_hdr(skb); struct iphdr *iph; struct tcphdr *tcph; struct udphdr *udph; diff -Nru a/net/core/netpoll.c b/net/core/netpoll.c --- a/net/core/netpoll.c 2004-10-02 13:44:26 -03:00 +++ b/net/core/netpoll.c 2004-10-02 13:44:26 -03:00 @@ -378,7 +378,7 @@ return 1; } - proto = ntohs(skb->mac.ethernet->h_proto); + proto = ntohs(eth_hdr(skb)->h_proto); if (proto != ETH_P_IP) goto out; if (skb->pkt_type == PACKET_OTHERHOST) diff -Nru a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c --- a/net/decnet/dn_neigh.c 2004-10-02 13:44:26 -03:00 +++ b/net/decnet/dn_neigh.c 2004-10-02 13:44:26 -03:00 @@ -399,7 +399,7 @@ neigh->updated = jiffies; if (neigh->dev->type == ARPHRD_ETHER) - memcpy(neigh->ha, &skb->mac.ethernet->h_source, ETH_ALEN); + memcpy(neigh->ha, ð_hdr(skb)->h_source, ETH_ALEN); dn->blksize = dn_ntohs(msg->blksize); dn->priority = msg->priority; @@ -455,7 +455,7 @@ neigh->updated = jiffies; if (neigh->dev->type == ARPHRD_ETHER) - memcpy(neigh->ha, &skb->mac.ethernet->h_source, ETH_ALEN); + memcpy(neigh->ha, ð_hdr(skb)->h_source, ETH_ALEN); dn->flags &= ~(DN_NDFLAG_R1 | DN_NDFLAG_R2); dn->blksize = dn_ntohs(msg->blksize); dn->priority = 0; diff -Nru a/net/ethernet/eth.c b/net/ethernet/eth.c --- a/net/ethernet/eth.c 2004-10-02 13:44:26 -03:00 +++ b/net/ethernet/eth.c 2004-10-02 13:44:26 -03:00 @@ -163,7 +163,7 @@ skb->mac.raw=skb->data; skb_pull(skb,ETH_HLEN); - eth= skb->mac.ethernet; + eth = eth_hdr(skb); skb->input_dev = dev; if(*eth->h_dest&1) @@ -210,7 +210,7 @@ int eth_header_parse(struct sk_buff *skb, unsigned char *haddr) { - struct ethhdr *eth = skb->mac.ethernet; + struct ethhdr *eth = eth_hdr(skb); memcpy(haddr, eth->h_source, ETH_ALEN); return ETH_ALEN; } diff -Nru a/net/ipv4/netfilter/ipt_mac.c b/net/ipv4/netfilter/ipt_mac.c --- a/net/ipv4/netfilter/ipt_mac.c 2004-10-02 13:44:26 -03:00 +++ b/net/ipv4/netfilter/ipt_mac.c 2004-10-02 13:44:26 -03:00 @@ -33,7 +33,7 @@ return (skb->mac.raw >= skb->head && (skb->mac.raw + ETH_HLEN) <= skb->data /* If so, compare... */ - && ((memcmp(skb->mac.ethernet->h_source, info->srcaddr, ETH_ALEN) + && ((memcmp(eth_hdr(skb)->h_source, info->srcaddr, ETH_ALEN) == 0) ^ info->invert)); } diff -Nru a/net/ipv6/netfilter/ip6t_eui64.c b/net/ipv6/netfilter/ip6t_eui64.c --- a/net/ipv6/netfilter/ip6t_eui64.c 2004-10-02 13:44:26 -03:00 +++ b/net/ipv6/netfilter/ip6t_eui64.c 2004-10-02 13:44:26 -03:00 @@ -41,10 +41,10 @@ memset(eui64, 0, sizeof(eui64)); - if (skb->mac.ethernet->h_proto == ntohs(ETH_P_IPV6)) { + if (eth_hdr(skb)->h_proto == ntohs(ETH_P_IPV6)) { if (skb->nh.ipv6h->version == 0x6) { - memcpy(eui64, skb->mac.ethernet->h_source, 3); - memcpy(eui64 + 5, skb->mac.ethernet->h_source + 3, 3); + memcpy(eui64, eth_hdr(skb)->h_source, 3); + memcpy(eui64 + 5, eth_hdr(skb)->h_source + 3, 3); eui64[3]=0xff; eui64[4]=0xfe; eui64[0] |= 0x02; diff -Nru a/net/ipv6/netfilter/ip6t_mac.c b/net/ipv6/netfilter/ip6t_mac.c --- a/net/ipv6/netfilter/ip6t_mac.c 2004-10-02 13:44:26 -03:00 +++ b/net/ipv6/netfilter/ip6t_mac.c 2004-10-02 13:44:26 -03:00 @@ -35,7 +35,7 @@ return (skb->mac.raw >= skb->head && (skb->mac.raw + ETH_HLEN) <= skb->data /* If so, compare... */ - && ((memcmp(skb->mac.ethernet->h_source, info->srcaddr, ETH_ALEN) + && ((memcmp(eth_hdr(skb)->h_source, info->srcaddr, ETH_ALEN) == 0) ^ info->invert)); } --------------050506010401080500020506-- From joe@perches.com Sat Oct 2 10:18:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 10:18:36 -0700 (PDT) Received: from Perches.com (DSL022.labridge.com [206.117.136.22]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92HIVr4017511 for ; Sat, 2 Oct 2004 10:18:31 -0700 Received: from localhost (joe@localhost) by Perches.com (8.9.3/8.9.3) with ESMTP id LAA13113; Sat, 2 Oct 2004 11:01:35 -0700 Date: Sat, 2 Oct 2004 11:01:34 -0700 (PDT) From: Joe Perches To: Arnaldo Carvalho de Melo cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] introduce eth_hdr(skb) In-Reply-To: <415EDD0C.9080507@conectiva.com.br> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 9811 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Content-Length: 216 Lines: 8 - } else if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) { + } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { I believe the __constant_htons conversions to htons are incorrect. From acme@conectiva.com.br Sat Oct 2 10:21:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 10:21:33 -0700 (PDT) Received: from perninha.conectiva.com.br (perninha.conectiva.com.br [200.140.247.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92HLRwA017874 for ; Sat, 2 Oct 2004 10:21:28 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id BBC7C47437; Sat, 2 Oct 2004 14:21:11 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id 54FC9473EC for ; Sat, 2 Oct 2004 14:21:11 -0300 (BRT) Received: (qmail 26948 invoked by uid 0); 2 Oct 2004 18:18:09 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 2 Oct 2004 18:18:09 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 23D3B14639; Sat, 2 Oct 2004 14:24:15 -0300 (BRT) Message-ID: <415EE3E1.7020806@conectiva.com.br> Date: Sat, 02 Oct 2004 14:22:41 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joe Perches Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] introduce eth_hdr(skb) References: In-Reply-To: X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Bogosity: No, tests=bogofilter, spamicity=0.028982, version=0.16.3 X-archive-position: 9812 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 351 Lines: 14 Joe Perches wrote: > > - } else if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) { > + } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { > > I believe the __constant_htons conversions to htons are incorrect. No they aren't, look at the generated code for both variations when receiving a constant :-) - Arnaldo From joe@perches.com Sat Oct 2 11:01:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 11:02:02 -0700 (PDT) Received: from Perches.com (DSL022.labridge.com [206.117.136.22]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92I1vEv018600 for ; Sat, 2 Oct 2004 11:01:57 -0700 Received: from localhost (joe@localhost) by Perches.com (8.9.3/8.9.3) with ESMTP id LAA13225; Sat, 2 Oct 2004 11:40:19 -0700 Date: Sat, 2 Oct 2004 11:40:19 -0700 (PDT) From: Joe Perches To: Arnaldo Carvalho de Melo cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] introduce eth_hdr(skb) In-Reply-To: <415EE3E1.7020806@conectiva.com.br> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 9813 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Content-Length: 543 Lines: 16 On Sat, 2 Oct 2004, Arnaldo Carvalho de Melo wrote: > Joe Perches wrote: > > > > - } else if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) { > > + } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { > > > > I believe the __constant_htons conversions to htons are incorrect. > > No they aren't, look at the generated code for both variations when > receiving a constant :-) Perhaps, but if you are going to change some, shouldn't you instead change all the similar net/bridge uses in a different changset? From acme@conectiva.com.br Sat Oct 2 11:09:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 11:09:22 -0700 (PDT) Received: from perninha.conectiva.com.br (perninha.conectiva.com.br [200.140.247.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92I98QS018978 for ; Sat, 2 Oct 2004 11:09:09 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 8A7A147446; Sat, 2 Oct 2004 15:08:55 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id 42BD247432 for ; Sat, 2 Oct 2004 15:08:55 -0300 (BRT) Received: (qmail 30761 invoked by uid 0); 2 Oct 2004 19:05:53 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 2 Oct 2004 19:05:53 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 2CC9414639; Sat, 2 Oct 2004 15:11:59 -0300 (BRT) Message-ID: <415EEF12.2050105@conectiva.com.br> Date: Sat, 02 Oct 2004 15:10:26 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joe Perches Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] introduce eth_hdr(skb) References: In-Reply-To: X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Bogosity: No, tests=bogofilter, spamicity=0.065946, version=0.16.3 X-archive-position: 9814 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 687 Lines: 24 Joe Perches wrote: > > On Sat, 2 Oct 2004, Arnaldo Carvalho de Melo wrote: > >>Joe Perches wrote: >> >>>- } else if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) { >>>+ } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { >>> >>>I believe the __constant_htons conversions to htons are incorrect. >> >>No they aren't, look at the generated code for both variations when >>receiving a constant :-) > > > Perhaps, but if you are going to change some, shouldn't you instead > change all the similar net/bridge uses in a different changset? I'm touching just the ones that are in lines changed by this changeset, a later patch can finish this. - Arnaldo From manfred@colorfullife.com Sat Oct 2 11:19:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 11:19:55 -0700 (PDT) Received: from dbl.q-ag.de (dbl.q-ag.de [213.172.117.3]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92IJmMq019465 for ; Sat, 2 Oct 2004 11:19:50 -0700 Received: from [127.0.0.2] (dbl [127.0.0.1]) by dbl.q-ag.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i92IJW8L005708; Sat, 2 Oct 2004 20:19:33 +0200 Message-ID: <415EEF0E.3080808@colorfullife.com> Date: Sat, 02 Oct 2004 20:10:22 +0200 From: Manfred Spraul User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Netdev Subject: [PATCH] fix secure tcp sequence number generation Content-Type: multipart/mixed; boundary="------------020503080807000603060306" X-archive-position: 9815 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: manfred@colorfullife.com Precedence: bulk X-list: netdev Content-Length: 5972 Lines: 194 This is a multi-part message in MIME format. --------------020503080807000603060306 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Dave, Ted's recent random.c update broke the periodic rekeying: schedule_work() doesn't provide synchronization. Additionally the first syn values after boot are generated with secret 0 - not good. Attached is a big cleanup. Linus asked me to send to to you for merging: Description: The tcp sequence number generator needs a random seed that is reset every few minutes. Since the sequence numbers should be constantly increasing, for each rekey 2^24 is added to the sequence number. The actual use of the sequence number generator is lockless, synchronization is achieved by having two copies of the control structure. The attached patch: - fixes a race in rekey_seq_generator(): schedule_work doesn't provide synchronization. - Uses schedule_delayed_work() for the rekey: simplifies synchronization and speeds up the hot path. - replaces do_gettimeofday with get_seconds(): get_seconds is faster and usec resolution is not required. - removes tmpdata - not needed with new locking. - Adds a late_initcall for the first initialization after boot. init_call would be too early, I've checked that the late_initcall runs before net/ipv4/ipconfig.c, i.e. the BOOTP/DHCP autoconfiguration. Signed-Off-By: Manfred Spraul --------------020503080807000603060306 Content-Type: text/plain; name="patch-random-cleanup" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-random-cleanup" --- 2.6/drivers/char/random.c 2004-10-02 19:30:18.583688301 +0200 +++ build-2.6/drivers/char/random.c 2004-10-02 19:09:54.288451293 +0200 @@ -2184,7 +2184,7 @@ #undef K3 /* This should not be decreased so low that ISNs wrap too fast. */ -#define REKEY_INTERVAL 300 +#define REKEY_INTERVAL (300*HZ) /* * Bit layout of the tcp sequence numbers (before adding current time): * bit 24-31: increased after every key exchange @@ -2210,49 +2210,55 @@ #define HASH_MASK ( (1<rekey_time = tv.tv_sec; - memcpy(keyptr->secret, tmp.secret, sizeof(keyptr->secret)); + get_random_bytes(keyptr->secret, sizeof(keyptr->secret)); keyptr->count = (ip_cnt&COUNT_MASK)<rekey_time || (time - keyptr->rekey_time) > REKEY_INTERVAL) { - schedule_work(&rekey_work); - } + smp_rmb(); return keyptr; } +static __init int seqgen_init(void) +{ + rekey_seq_generator(NULL); + return 0; +} +late_initcall(seqgen_init); + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, __u16 sport, __u16 dport) @@ -2260,14 +2266,12 @@ struct timeval tv; __u32 seq; __u32 hash[12]; - struct keydata *keyptr; + struct keydata *keyptr = get_keyptr(); /* The procedure is the same as for IPv4, but addresses are longer. * Thus we must use twothirdsMD4Transform. */ - do_gettimeofday(&tv); /* We need the usecs below... */ - keyptr = check_and_rekey(tv.tv_sec); memcpy(hash, saddr, 16); hash[4]=(sport << 16) + dport; @@ -2275,6 +2279,8 @@ seq = twothirdsMD4Transform(daddr, hash) & HASH_MASK; seq += keyptr->count; + + do_gettimeofday(&tv); seq += tv.tv_usec + tv.tv_sec*1000000; return seq; @@ -2288,13 +2294,7 @@ struct timeval tv; __u32 seq; __u32 hash[4]; - struct keydata *keyptr; - - /* - * Pick a random secret every REKEY_INTERVAL seconds. - */ - do_gettimeofday(&tv); /* We need the usecs below... */ - keyptr = check_and_rekey(tv.tv_sec); + struct keydata *keyptr = get_keyptr(); /* * Pick a unique starting offset for each TCP connection endpoints @@ -2317,6 +2317,7 @@ * That's funny, Linux has one built in! Use it! * (Networks are faster now - should this be increased?) */ + do_gettimeofday(&tv); seq += tv.tv_usec + tv.tv_sec*1000000; #if 0 printk("init_seq(%lx, %lx, %d, %d) = %d\n", @@ -2335,7 +2336,7 @@ struct keydata *keyptr; __u32 hash[4]; - keyptr = check_and_rekey(get_seconds()); + keyptr = get_keyptr(); /* * Pick a unique starting offset for each IP destination. --------------020503080807000603060306-- From acme@conectiva.com.br Sat Oct 2 12:30:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 12:30:24 -0700 (PDT) Received: from perninha.conectiva.com.br (perninha.conectiva.com.br [200.140.247.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92JUFcc024049 for ; Sat, 2 Oct 2004 12:30:18 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 7D631472EE; Sat, 2 Oct 2004 16:29:58 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id 34F414730B for ; Sat, 2 Oct 2004 16:29:58 -0300 (BRT) Received: (qmail 4243 invoked by uid 0); 2 Oct 2004 20:26:56 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 2 Oct 2004 20:26:56 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 23ECE14639; Sat, 2 Oct 2004 16:33:00 -0300 (BRT) Message-ID: <415F020F.7010909@conectiva.com.br> Date: Sat, 02 Oct 2004 16:31:27 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [BRIDGE] convert __constant_htons(constant) to htons X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------020908070200080805000100" X-Bogosity: No, tests=bogofilter, spamicity=0.460656, version=0.16.3 X-archive-position: 9816 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 5722 Lines: 156 This is a multi-part message in MIME format. --------------020908070200080805000100 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Now there are two outstanding changesets in this tree. Regards, - Arnaldo --------------020908070200080805000100 Content-Type: text/plain; name="bridge.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bridge.patch" You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.2031, 2004-10-02 16:27:19-03:00, acme@amd64.kerneljanitors.org [BRIDGE] convert __constant_htons(constant) to htons Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller ebt_arp.c | 4 ++-- ebt_arpreply.c | 6 +++--- ebt_ip.c | 2 +- ebt_log.c | 2 +- ebt_vlan.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff -Nru a/net/bridge/netfilter/ebt_arp.c b/net/bridge/netfilter/ebt_arp.c --- a/net/bridge/netfilter/ebt_arp.c 2004-10-02 16:29:01 -03:00 +++ b/net/bridge/netfilter/ebt_arp.c 2004-10-02 16:29:01 -03:00 @@ -108,8 +108,8 @@ if (datalen != EBT_ALIGN(sizeof(struct ebt_arp_info))) return -EINVAL; - if ((e->ethproto != __constant_htons(ETH_P_ARP) && - e->ethproto != __constant_htons(ETH_P_RARP)) || + if ((e->ethproto != htons(ETH_P_ARP) && + e->ethproto != htons(ETH_P_RARP)) || e->invflags & EBT_IPROTO) return -EINVAL; if (info->bitmask & ~EBT_ARP_MASK || info->invflags & ~EBT_ARP_MASK) diff -Nru a/net/bridge/netfilter/ebt_arpreply.c b/net/bridge/netfilter/ebt_arpreply.c --- a/net/bridge/netfilter/ebt_arpreply.c 2004-10-02 16:29:01 -03:00 +++ b/net/bridge/netfilter/ebt_arpreply.c 2004-10-02 16:29:01 -03:00 @@ -29,9 +29,9 @@ if (ap == NULL) return EBT_DROP; - if (ap->ar_op != __constant_htons(ARPOP_REQUEST) || + if (ap->ar_op != htons(ARPOP_REQUEST) || ap->ar_hln != ETH_ALEN || - ap->ar_pro != __constant_htons(ETH_P_IP) || + ap->ar_pro != htons(ETH_P_IP) || ap->ar_pln != 4) return EBT_CONTINUE; @@ -65,7 +65,7 @@ return -EINVAL; if (BASE_CHAIN && info->target == EBT_RETURN) return -EINVAL; - if (e->ethproto != __constant_htons(ETH_P_ARP) || + if (e->ethproto != htons(ETH_P_ARP) || e->invflags & EBT_IPROTO) return -EINVAL; CLEAR_BASE_CHAIN_BIT; diff -Nru a/net/bridge/netfilter/ebt_ip.c b/net/bridge/netfilter/ebt_ip.c --- a/net/bridge/netfilter/ebt_ip.c 2004-10-02 16:29:01 -03:00 +++ b/net/bridge/netfilter/ebt_ip.c 2004-10-02 16:29:01 -03:00 @@ -80,7 +80,7 @@ if (datalen != EBT_ALIGN(sizeof(struct ebt_ip_info))) return -EINVAL; - if (e->ethproto != __constant_htons(ETH_P_IP) || + if (e->ethproto != htons(ETH_P_IP) || e->invflags & EBT_IPROTO) return -EINVAL; if (info->bitmask & ~EBT_IP_MASK || info->invflags & ~EBT_IP_MASK) diff -Nru a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c --- a/net/bridge/netfilter/ebt_log.c 2004-10-02 16:29:01 -03:00 +++ b/net/bridge/netfilter/ebt_log.c 2004-10-02 16:29:01 -03:00 @@ -121,7 +121,7 @@ /* If it's for Ethernet and the lengths are OK, * then log the ARP payload */ - if (ah->ar_hrd == __constant_htons(1) && + if (ah->ar_hrd == htons(1) && ah->ar_hln == ETH_ALEN && ah->ar_pln == sizeof(uint32_t)) { struct arppayload _arpp, *ap; diff -Nru a/net/bridge/netfilter/ebt_vlan.c b/net/bridge/netfilter/ebt_vlan.c --- a/net/bridge/netfilter/ebt_vlan.c 2004-10-02 16:29:01 -03:00 +++ b/net/bridge/netfilter/ebt_vlan.c 2004-10-02 16:29:01 -03:00 @@ -104,7 +104,7 @@ } /* Is it 802.1Q frame checked? */ - if (e->ethproto != __constant_htons(ETH_P_8021Q)) { + if (e->ethproto != htons(ETH_P_8021Q)) { DEBUG_MSG ("passed entry proto %2.4X is not 802.1Q (8100)\n", (unsigned short) ntohs(e->ethproto)); =================================================================== This BitKeeper patch contains the following changesets: 1.2031 ## Wrapped with gzip_uu ## M'XL( 'T!7T$ ^U876_;-A1]MGX%AP)%BD$ROT1*1ATD38S6V(JZ3O,T# 8E MT99F63(DQELP_OA15)IX21K;:OMFV:!HB9?WZ/+UK 8]$:^D\PI\ M*&LUZ,5E(6.5;807ERLOJLR-:5F:&WWYCZI$OQGCF+;N9S%WO,,6,F M0L4IV,BJ'O201^ZOJ-NU'/2FH_?7OY]/'6I*!;R2BHP'#JJK#8B3^HS MH=*\+#SCH:A74EGO^GZHQA!B\_$1)]!G&C%(N8Y1@I"@2"80TX!1I\%V]O@! M_C\+168FQ"CV0^V'(<7.)4 >A@0!2/L(]B$&B TP'Z#0A60 (;"SBE7"J+>4 M52'SOT21&>"U5U8+\*L/7.B\ S_V22Z<&/SQ;CJ^?#_Z$Y@G,H%58#8SO5J) M0LU297HG7W^^,=Z!O63,S/8E M>/MLP$Z?SG I-ED"KCSP,W*[.UJ)(RDIXD=2%5/VHRI*%[)ON/,N5K/HR4C-1K2NY MSF^]N DO@0&F"!%$F:8,<:XI1)3BF!-"6)C$XN4EW==/2Z40F>#;\V7K=B8,0\0P00@S32@,B$;()WZ$!4(\A',8=T7\U<,V M5LH8H0=C-<_^#%C"@E 'B3!P&:."B@3&R7>$]RE:A'WF'XQVDXOB,5RN+0TT M];D448AP,#=P&>T*]\''-E[LD^#PZ.;EXCDJ&"YH:I9?(.D+%,(PX%%7N/"_5/STMD*FNWFY5SMI.5V2L+ 1,G,ZA,-,>?(JCMY+.V0 M[B?M!+CD*.UWTFX5[A-PJ[_OOD;G]UB6#F^ 2V(6RAG;MI?-P8E8NZ>BFI5K M\,NP#<;)^73R:3*;CCY?CZZ^O %:&RMJK9JV!\QQ9[6NR@>ST9ZI5*DQ4$],C#]KLRM5VBSY:=+:+4.>)@>B04!L&39MQN[F==:+V_A5.!V9G MSQ";+R'#-M*YW"N'E"# M?6.GN6_MU6P_H?8-\>&1JC^*JFTINR]5[8ITTF!LRXSVU&O+D]06&FF5&-+= ML159Z7V1INW^X7">'K*WZ:"J6]L:4[!#%!*S5="8^;355?/R.;+UN]G:;A/W M96N[)IWH"KFEJSWM$M? :--G4PO\^_"/7IS*>%G?K(9Q..; Sat, 2 Oct 2004 12:49:14 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 7DE234745E; Sat, 2 Oct 2004 16:48:53 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id 284E6473FF for ; Sat, 2 Oct 2004 16:48:53 -0300 (BRT) Received: (qmail 6253 invoked by uid 0); 2 Oct 2004 20:45:51 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 2 Oct 2004 20:45:51 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id EA7A214639; Sat, 2 Oct 2004 16:51:56 -0300 (BRT) Message-ID: <415F0680.7040200@conectiva.com.br> Date: Sat, 02 Oct 2004 16:50:24 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [SKBUFF] use eth_hdr(skb), skb->mac.raw cases X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------040208030207070501080502" X-Bogosity: No, tests=bogofilter, spamicity=0.496867, version=0.16.3 X-archive-position: 9817 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 7949 Lines: 225 This is a multi-part message in MIME format. --------------040208030207070501080502 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Now there are 3 outstanding changesets in this tree. Regards, - Arnaldo --------------040208030207070501080502 Content-Type: text/plain; name="eth_hdr2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="eth_hdr2.patch" =================================================================== ChangeSet@1.2032, 2004-10-02 16:44:12-03:00, acme@amd64.kerneljanitors.org [SKBUFF] use eth_hdr(skb), skb->mac.raw cases Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller drivers/ieee1394/eth1394.c | 2 +- drivers/ieee1394/eth1394.h | 7 +++++++ drivers/net/hamradio/bpqether.c | 2 +- drivers/net/wireless/orinoco.c | 2 +- drivers/net/wireless/wavelan.c | 5 ++--- drivers/net/wireless/wavelan_cs.c | 4 ++-- include/net/llc_pdu.h | 6 +++--- net/bluetooth/bnep/core.c | 6 +++--- net/llc/llc_input.c | 2 +- net/llc/llc_output.c | 2 +- 10 files changed, 22 insertions(+), 16 deletions(-) diff -Nru a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c --- a/drivers/ieee1394/eth1394.c 2004-10-02 16:44:56 -03:00 +++ b/drivers/ieee1394/eth1394.c 2004-10-02 16:44:56 -03:00 @@ -850,7 +850,7 @@ skb->mac.raw = skb->data; skb_pull (skb, ETH1394_HLEN); - eth = (struct eth1394hdr*)skb->mac.raw; + eth = eth1394_hdr(skb); if (*eth->h_dest & 1) { if (memcmp(eth->h_dest, dev->broadcast, dev->addr_len)==0) diff -Nru a/drivers/ieee1394/eth1394.h b/drivers/ieee1394/eth1394.h --- a/drivers/ieee1394/eth1394.h 2004-10-02 16:44:56 -03:00 +++ b/drivers/ieee1394/eth1394.h 2004-10-02 16:44:56 -03:00 @@ -81,7 +81,14 @@ unsigned short h_proto; /* packet type ID field */ } __attribute__((packed)); +#ifdef __KERNEL__ +#include +static inline struct eth1394hdr *eth1394_hdr(const struct sk_buff *skb) +{ + return (struct eth1394hdr *)skb->mac.raw; +} +#endif typedef enum {ETH1394_GASP, ETH1394_WRREQ} eth1394_tx_type; diff -Nru a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c --- a/drivers/net/hamradio/bpqether.c 2004-10-02 16:44:56 -03:00 +++ b/drivers/net/hamradio/bpqether.c 2004-10-02 16:44:56 -03:00 @@ -193,7 +193,7 @@ bpq = (struct bpqdev *)dev->priv; - eth = (struct ethhdr *)skb->mac.raw; + eth = eth_hdr(skb); if (!(bpq->acpt_addr[0] & 0x01) && memcmp(eth->h_source, bpq->acpt_addr, ETH_ALEN)) diff -Nru a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c --- a/drivers/net/wireless/orinoco.c 2004-10-02 16:44:56 -03:00 +++ b/drivers/net/wireless/orinoco.c 2004-10-02 16:44:56 -03:00 @@ -1009,7 +1009,7 @@ /* Note : gcc will optimise the whole section away if * WIRELESS_SPY is not defined... - Jean II */ if (SPY_NUMBER(priv)) { - orinoco_spy_gather(dev, skb->mac.raw + ETH_ALEN, + orinoco_spy_gather(dev, eth_hdr(skb)->h_source, desc->signal, desc->silence); } } diff -Nru a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c --- a/drivers/net/wireless/wavelan.c 2004-10-02 16:44:56 -03:00 +++ b/drivers/net/wireless/wavelan.c 2004-10-02 16:44:56 -03:00 @@ -2521,7 +2521,7 @@ skb->protocol = eth_type_trans(skb, dev); #ifdef DEBUG_RX_INFO - wv_packet_info(skb->mac.raw, sksize, dev->name, "wv_packet_read"); + wv_packet_info(eth_hdr(skb)->h_dest, sksize, dev->name, "wv_packet_read"); #endif /* DEBUG_RX_INFO */ /* Statistics-gathering and associated stuff. @@ -2557,8 +2557,7 @@ /* Spying stuff */ #ifdef IW_WIRELESS_SPY - wl_spy_gather(dev, skb->mac.raw + WAVELAN_ADDR_SIZE, - stats); + wl_spy_gather(dev, eth_hdr(skb)->h_source, stats); #endif /* IW_WIRELESS_SPY */ #ifdef HISTOGRAM wl_his_gather(dev, stats); diff -Nru a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c --- a/drivers/net/wireless/wavelan_cs.c 2004-10-02 16:44:56 -03:00 +++ b/drivers/net/wireless/wavelan_cs.c 2004-10-02 16:44:56 -03:00 @@ -2943,7 +2943,7 @@ skb->protocol = eth_type_trans(skb, dev); #ifdef DEBUG_RX_INFO - wv_packet_info(skb->mac.raw, sksize, dev->name, "wv_packet_read"); + wv_packet_info(eth_hdr(skb)->h_dest, sksize, dev->name, "wv_packet_read"); #endif /* DEBUG_RX_INFO */ /* Statistics gathering & stuff associated. @@ -2977,7 +2977,7 @@ #endif /* WAVELAN_ROAMING */ #ifdef WIRELESS_SPY - wl_spy_gather(dev, skb->mac.raw + WAVELAN_ADDR_SIZE, stats); + wl_spy_gather(dev, eth_hdr(skb)->h_source, stats); #endif /* WIRELESS_SPY */ #ifdef HISTOGRAM wl_his_gather(dev, stats); diff -Nru a/include/net/llc_pdu.h b/include/net/llc_pdu.h --- a/include/net/llc_pdu.h 2004-10-02 16:44:56 -03:00 +++ b/include/net/llc_pdu.h 2004-10-02 16:44:56 -03:00 @@ -253,7 +253,7 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa) { if (skb->protocol == ntohs(ETH_P_802_2)) - memcpy(sa, ((struct ethhdr *)skb->mac.raw)->h_source, ETH_ALEN); + memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); else if (skb->protocol == ntohs(ETH_P_TR_802_2)) memcpy(sa, ((struct trh_hdr *)skb->mac.raw)->saddr, ETH_ALEN); } @@ -268,7 +268,7 @@ static inline void llc_pdu_decode_da(struct sk_buff *skb, u8 *da) { if (skb->protocol == ntohs(ETH_P_802_2)) - memcpy(da, ((struct ethhdr *)skb->mac.raw)->h_dest, ETH_ALEN); + memcpy(da, eth_hdr(skb)->h_dest, ETH_ALEN); else if (skb->protocol == ntohs(ETH_P_TR_802_2)) memcpy(da, ((struct trh_hdr *)skb->mac.raw)->daddr, ETH_ALEN); } @@ -347,7 +347,7 @@ struct llc_pdu_un *ev_pdu = llc_pdu_un_hdr(ev_skb); int dsize; - dsize = ntohs(((struct ethhdr *)ev_skb->mac.raw)->h_proto) - 3; + dsize = ntohs(eth_hdr(ev_skb)->h_proto) - 3; memcpy(((u8 *)pdu) + 3, ((u8 *)ev_pdu) + 3, dsize); skb_put(skb, dsize); } diff -Nru a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c --- a/net/bluetooth/bnep/core.c 2004-10-02 16:44:56 -03:00 +++ b/net/bluetooth/bnep/core.c 2004-10-02 16:44:56 -03:00 @@ -364,17 +364,17 @@ case BNEP_COMPRESSED_SRC_ONLY: memcpy(__skb_put(nskb, ETH_ALEN), s->eh.h_dest, ETH_ALEN); - memcpy(__skb_put(nskb, ETH_ALEN), skb->mac.raw, ETH_ALEN); + memcpy(__skb_put(nskb, ETH_ALEN), eth_hdr(skb), ETH_ALEN); put_unaligned(s->eh.h_proto, (u16 *) __skb_put(nskb, 2)); break; case BNEP_COMPRESSED_DST_ONLY: - memcpy(__skb_put(nskb, ETH_ALEN), skb->mac.raw, ETH_ALEN); + memcpy(__skb_put(nskb, ETH_ALEN), eth_hdr(skb), ETH_ALEN); memcpy(__skb_put(nskb, ETH_ALEN + 2), s->eh.h_source, ETH_ALEN + 2); break; case BNEP_GENERAL: - memcpy(__skb_put(nskb, ETH_ALEN * 2), skb->mac.raw, ETH_ALEN * 2); + memcpy(__skb_put(nskb, ETH_ALEN * 2), eth_hdr(skb), ETH_ALEN * 2); put_unaligned(s->eh.h_proto, (u16 *) __skb_put(nskb, 2)); break; } diff -Nru a/net/llc/llc_input.c b/net/llc/llc_input.c --- a/net/llc/llc_input.c 2004-10-02 16:44:56 -03:00 +++ b/net/llc/llc_input.c 2004-10-02 16:44:56 -03:00 @@ -111,7 +111,7 @@ skb->h.raw += llc_len; skb_pull(skb, llc_len); if (skb->protocol == htons(ETH_P_802_2)) { - u16 pdulen = ((struct ethhdr *)skb->mac.raw)->h_proto, + u16 pdulen = eth_hdr(skb)->h_proto, data_size = ntohs(pdulen) - llc_len; skb_trim(skb, data_size); diff -Nru a/net/llc/llc_output.c b/net/llc/llc_output.c --- a/net/llc/llc_output.c 2004-10-02 16:44:56 -03:00 +++ b/net/llc/llc_output.c 2004-10-02 16:44:56 -03:00 @@ -61,7 +61,7 @@ struct ethhdr *eth; skb->mac.raw = skb_push(skb, sizeof(*eth)); - eth = (struct ethhdr *)skb->mac.raw; + eth = eth_hdr(skb); eth->h_proto = htons(len); memcpy(eth->h_dest, da, ETH_ALEN); memcpy(eth->h_source, sa, ETH_ALEN); --------------040208030207070501080502-- From romieu@fr.zoreil.com Sat Oct 2 13:28:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 13:28:52 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92KSgkS025209 for ; Sat, 2 Oct 2004 13:28:46 -0700 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.10/8.12.1) with ESMTP id i92KS6vr018653; Sat, 2 Oct 2004 22:28:06 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.10/8.12.10/Submit) id i92KS5FN018652; Sat, 2 Oct 2004 22:28:05 +0200 Date: Sat, 2 Oct 2004 22:28:05 +0200 From: Francois Romieu To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH 2.6.9-rc3] dev_close: use of netif_poll_disable Message-ID: <20041002202805.GA16870@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-archive-position: 9818 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 752 Lines: 23 Use of identical (comment included) netif_poll_disable(). Signed-off-by: Francois Romieu diff -puN net/core/dev.c~dev_close-cleanup net/core/dev.c --- linux-2.6.9-rc3/net/core/dev.c~dev_close-cleanup 2004-10-02 22:14:29.000000000 +0200 +++ linux-2.6.9-rc3-fr/net/core/dev.c 2004-10-02 22:16:02.000000000 +0200 @@ -959,11 +959,8 @@ int dev_close(struct net_device *dev) * engine, but this requires more changes in devices. */ smp_mb__after_clear_bit(); /* Commit netif_running(). */ - while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) { - /* No hurry. */ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); - } + + netif_poll_disable(dev); /* * Call the device specific close. This cannot fail. _ From arthur@unimatrix001.student.utwente.nl Sat Oct 2 14:50:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 14:50:34 -0700 (PDT) Received: from unimatrix001.student.utwente.nl (unimatrix001.student.utwente.nl [130.89.164.134]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i92LoSud026421 for ; Sat, 2 Oct 2004 14:50:29 -0700 Received: from unimatrix001.student.utwente.nl (localhost [127.0.0.1]) by unimatrix001.student.utwente.nl (8.12.8p1-20030924/8.12.8) with ESMTP id i92LoBAQ024096 for ; Sat, 2 Oct 2004 23:50:11 +0200 Received: (from arthur@localhost) by unimatrix001.student.utwente.nl (8.12.8p1-20030924/8.12.8/Submit) id i92LoBpR024095 for netdev@oss.sgi.com; Sat, 2 Oct 2004 23:50:11 +0200 Date: Sat, 2 Oct 2004 23:50:11 +0200 From: Arthur Rinkel To: netdev@oss.sgi.com Subject: i82596 ethernet controller Message-ID: <20041002235011.A24086@unimatrix001.student.utwente.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-archive-position: 9819 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: arthur@unimatrix001.student.utwente.nl Precedence: bulk X-list: netdev Content-Length: 611 Lines: 15 Hi, Recently I've purchased an Intel EtherExpress Pro/10 PCI which is based on an i82596 ethernet controller. Although a driver exists for the controller, no driver exists for the PCI-card; existing drivers only support ISA-based cards for example. I'd like to adapt the existing driver so it'll support the PCI-based card. However, I don't know how this card is mapped into memory, so I can't communicate with it. There is some information available about the i82596, but this concerns the chip only, not the card. Furthermore, Intel offers no longer support for the card. Any help appreciated. Grtz, Arthur From acme@conectiva.com.br Sat Oct 2 20:26:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 02 Oct 2004 20:26:16 -0700 (PDT) Received: from perninha.conectiva.com.br (perninha.conectiva.com.br [200.140.247.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i933QAwu004767 for ; Sat, 2 Oct 2004 20:26:11 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 71A1C47452; Sun, 3 Oct 2004 00:25:57 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id 334EE473FF for ; Sun, 3 Oct 2004 00:25:57 -0300 (BRT) Received: (qmail 10816 invoked by uid 0); 3 Oct 2004 04:22:56 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 3 Oct 2004 04:22:56 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id E255414639; Sun, 3 Oct 2004 00:29:02 -0300 (BRT) Message-ID: <415F71A3.4000701@conectiva.com.br> Date: Sun, 03 Oct 2004 00:27:31 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: PATCH: [SKBUFF] introduce tr_hdr(skb) X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------050708030604090602070200" X-Bogosity: No, tests=bogofilter, spamicity=0.446821, version=0.16.3 X-archive-position: 9820 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 3097 Lines: 109 This is a multi-part message in MIME format. --------------050708030604090602070200 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Now there are three outstanding changesets in this tree. Regards, - Arnaldo --------------050708030604090602070200 Content-Type: text/plain; name="tr_hdr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tr_hdr.patch" =================================================================== ChangeSet@1.2033, 2004-10-03 00:23:07-03:00, acme@conectiva.com.br [SKBUFF] introduce tr_hdr(skb) The token ring code in the kernel is bitrotting (no surprise :) ), it uses skb->data all around... I have an assortment of token ring cards but no MAU, can anybody send me one, please? I promise to make ssh work over LLC over Token Ring networks! Duh... :o) Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/linux/if_tr.h | 9 +++++++++ include/net/llc_pdu.h | 4 ++-- net/llc/llc_output.c | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff -Nru a/include/linux/if_tr.h b/include/linux/if_tr.h --- a/include/linux/if_tr.h 2004-10-03 00:24:29 -03:00 +++ b/include/linux/if_tr.h 2004-10-03 00:24:29 -03:00 @@ -48,6 +48,15 @@ __u16 rseg[8]; /* routing registers */ }; +#ifdef __KERNEL__ +#include + +static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) +{ + return (struct trh_hdr *)skb->mac.raw; +} +#endif + /* This is an Token-Ring LLC structure */ struct trllc { __u8 dsap; /* destination SAP */ diff -Nru a/include/net/llc_pdu.h b/include/net/llc_pdu.h --- a/include/net/llc_pdu.h 2004-10-03 00:24:29 -03:00 +++ b/include/net/llc_pdu.h 2004-10-03 00:24:29 -03:00 @@ -255,7 +255,7 @@ if (skb->protocol == ntohs(ETH_P_802_2)) memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); else if (skb->protocol == ntohs(ETH_P_TR_802_2)) - memcpy(sa, ((struct trh_hdr *)skb->mac.raw)->saddr, ETH_ALEN); + memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); } /** @@ -270,7 +270,7 @@ if (skb->protocol == ntohs(ETH_P_802_2)) memcpy(da, eth_hdr(skb)->h_dest, ETH_ALEN); else if (skb->protocol == ntohs(ETH_P_TR_802_2)) - memcpy(da, ((struct trh_hdr *)skb->mac.raw)->daddr, ETH_ALEN); + memcpy(da, tr_hdr(skb)->daddr, ETH_ALEN); } /** diff -Nru a/net/llc/llc_output.c b/net/llc/llc_output.c --- a/net/llc/llc_output.c 2004-10-03 00:24:29 -03:00 +++ b/net/llc/llc_output.c 2004-10-03 00:24:29 -03:00 @@ -40,7 +40,8 @@ struct net_device *dev = skb->dev; struct trh_hdr *trh; - trh = (struct trh_hdr *)skb_push(skb, sizeof(*trh)); + skb->mac.raw = skb_push(skb, sizeof(*trh)); + trh = tr_hdr(skb); trh->ac = AC; trh->fc = LLC_FRAME; if (sa) @@ -51,7 +52,6 @@ memcpy(trh->daddr, da, dev->addr_len); tr_source_route(skb, trh, dev); } - skb->mac.raw = skb->data; break; } #endif --------------050708030604090602070200-- From acme@conectiva.com.br Sun Oct 3 07:07:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 07:08:02 -0700 (PDT) Received: from perninha.conectiva.com.br (perninha.conectiva.com.br [200.140.247.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93E7te8008844 for ; Sun, 3 Oct 2004 07:07:56 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 8D6AB47562; Sun, 3 Oct 2004 11:07:41 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id 27C4347550 for ; Sun, 3 Oct 2004 11:07:41 -0300 (BRT) Received: (qmail 28086 invoked by uid 0); 3 Oct 2004 15:04:38 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 3 Oct 2004 15:04:38 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id DA25014639; Sun, 3 Oct 2004 11:10:42 -0300 (BRT) Message-ID: <4160080B.408@conectiva.com.br> Date: Sun, 03 Oct 2004 11:09:15 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: PATCH: [SKBUFF] make hdlc_type_trans look like eth_type_trans X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------080601000806040705030207" X-Bogosity: No, tests=bogofilter, spamicity=0.489416, version=0.16.3 X-archive-position: 9823 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 7564 Lines: 237 This is a multi-part message in MIME format. --------------080601000806040705030207 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Now there are five outstanding changesets in this tree: ChangeSet@1.2034, 2004-10-03 11:01:01-03:00, acme@amd64.kerneljanitors.org [SKBUFF] make hdlc_type_trans look like eth_type_trans ChangeSet@1.2033, 2004-10-03 00:23:07-03:00, acme@conectiva.com.br [SKBUFF] introduce tr_hdr(skb) ChangeSet@1.2032, 2004-10-02 16:44:12-03:00, acme@amd64.kerneljanitors.org ChangeSet@1.2031, 2004-10-02 16:27:19-03:00, acme@amd64.kerneljanitors.org [BRIDGE] convert __constant_htons(constant) to htons ChangeSet@1.2030, 2004-10-02 13:42:59-03:00, acme@conectiva.com.br [SKBUFF] introduce eth_hdr(skb) Regards, - Arnaldo --------------080601000806040705030207 Content-Type: text/plain; name="hdlc_type_trans.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hdlc_type_trans.patch" =================================================================== ChangeSet@1.2034, 2004-10-03 11:01:01-03:00, acme@amd64.kerneljanitors.org [SKBUFF] make hdlc_type_trans look like eth_type_trans Moving skb->mac.raw and dev setting from the callers to hdlc_type_trans, also introduce farsync_type_trans, private to the farsync driver, but following the foo_type_trans model. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller drivers/char/pcmcia/synclink_cs.c | 1 drivers/char/synclink.c | 4 --- drivers/char/synclinkmp.c | 4 --- drivers/net/wan/dscc4.c | 2 - drivers/net/wan/farsync.c | 42 ++++++++++++++++++-------------------- drivers/net/wan/hd6457x.c | 2 - drivers/net/wan/pc300_drv.c | 1 drivers/net/wan/wanxl.c | 2 - include/linux/hdlc.h | 8 +++++-- 9 files changed, 28 insertions(+), 38 deletions(-) diff -Nru a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c --- a/drivers/char/pcmcia/synclink_cs.c 2004-10-03 11:02:01 -03:00 +++ b/drivers/char/pcmcia/synclink_cs.c 2004-10-03 11:02:01 -03:00 @@ -4571,7 +4571,6 @@ memcpy(skb_put(skb, size),buf,size); skb->dev = info->netdev; - skb->mac.raw = skb->data; skb->protocol = hdlc_type_trans(skb, skb->dev); stats->rx_packets++; diff -Nru a/drivers/char/synclink.c b/drivers/char/synclink.c --- a/drivers/char/synclink.c 2004-10-03 11:02:01 -03:00 +++ b/drivers/char/synclink.c 2004-10-03 11:02:01 -03:00 @@ -8150,9 +8150,7 @@ memcpy(skb_put(skb, size),buf,size); - skb->dev = info->netdev; - skb->mac.raw = skb->data; - skb->protocol = hdlc_type_trans(skb, skb->dev); + skb->protocol = hdlc_type_trans(skb, info->netdev); stats->rx_packets++; stats->rx_bytes += size; diff -Nru a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c --- a/drivers/char/synclinkmp.c 2004-10-03 11:02:01 -03:00 +++ b/drivers/char/synclinkmp.c 2004-10-03 11:02:01 -03:00 @@ -1968,9 +1968,7 @@ memcpy(skb_put(skb, size),buf,size); - skb->dev = info->netdev; - skb->mac.raw = skb->data; - skb->protocol = hdlc_type_trans(skb, skb->dev); + skb->protocol = hdlc_type_trans(skb, info->netdev); stats->rx_packets++; stats->rx_bytes += size; diff -Nru a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c --- a/drivers/net/wan/dscc4.c 2004-10-03 11:02:02 -03:00 +++ b/drivers/net/wan/dscc4.c 2004-10-03 11:02:02 -03:00 @@ -517,9 +517,7 @@ skb = dev_alloc_skb(len); dpriv->rx_skbuff[dirty] = skb; if (skb) { - skb->dev = dev; skb->protocol = hdlc_type_trans(skb, dev); - skb->mac.raw = skb->data; rx_fd->data = pci_map_single(dpriv->pci_priv->pdev, skb->data, len, PCI_DMA_FROMDEVICE); } else { diff -Nru a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c --- a/drivers/net/wan/farsync.c 2004-10-03 11:02:01 -03:00 +++ b/drivers/net/wan/farsync.c 2004-10-03 11:02:01 -03:00 @@ -857,6 +857,18 @@ dev->trans_start = jiffies; } +/* + * Mark it for our own raw sockets interface + */ +static unsigned short farsync_type_trans(struct sk_buff *skb, + struct net_device *dev) +{ + skb->dev = dev; + skb->mac.raw = skb->data; + skb->pkt_type = PACKET_HOST; + return htons(ETH_P_CUST); +} + /* Rx dma complete interrupt */ static void @@ -881,17 +893,10 @@ /* Push upstream */ dbg(DBG_RX, "Pushing the frame up the stack\n"); - skb->mac.raw = skb->data; - skb->dev = dev; - if (port->mode == FST_RAW) { - /* - * Mark it for our own raw sockets interface - */ - skb->protocol = htons(ETH_P_CUST); - skb->pkt_type = PACKET_HOST; - } else { - skb->protocol = hdlc_type_trans(skb, skb->dev); - } + if (port->mode == FST_RAW) + skb->protocol = farsync_type_trans(skb, dev); + else + skb->protocol = hdlc_type_trans(skb, dev); rx_status = netif_rx(skb); fst_process_rx_status(rx_status, port_to_dev(port)->name); if (rx_status == NET_RX_DROP) @@ -1316,17 +1321,10 @@ /* Push upstream */ dbg(DBG_RX, "Pushing frame up the stack\n"); - skb->mac.raw = skb->data; - skb->dev = dev; - if (port->mode == FST_RAW) { - /* - * Mark it for our own raw sockets interface - */ - skb->protocol = htons(ETH_P_CUST); - skb->pkt_type = PACKET_HOST; - } else { - skb->protocol = hdlc_type_trans(skb, skb->dev); - } + if (port->mode == FST_RAW) + skb->protocol = farsync_type_trans(skb, dev); + else + skb->protocol = hdlc_type_trans(skb, dev); rx_status = netif_rx(skb); fst_process_rx_status(rx_status, port_to_dev(port)->name); if (rx_status == NET_RX_DROP) { diff -Nru a/drivers/net/wan/hd6457x.c b/drivers/net/wan/hd6457x.c --- a/drivers/net/wan/hd6457x.c 2004-10-03 11:02:01 -03:00 +++ b/drivers/net/wan/hd6457x.c 2004-10-03 11:02:01 -03:00 @@ -315,8 +315,6 @@ #endif stats->rx_packets++; stats->rx_bytes += skb->len; - skb->mac.raw = skb->data; - skb->dev = dev; skb->dev->last_rx = jiffies; skb->protocol = hdlc_type_trans(skb, dev); netif_rx(skb); diff -Nru a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c --- a/drivers/net/wan/pc300_drv.c 2004-10-03 11:02:01 -03:00 +++ b/drivers/net/wan/pc300_drv.c 2004-10-03 11:02:02 -03:00 @@ -1959,7 +1959,6 @@ cpc_trace(dev, skb, 'R'); } stats->rx_packets++; - skb->mac.raw = skb->data; skb->protocol = hdlc_type_trans(skb, dev); netif_rx(skb); } diff -Nru a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c --- a/drivers/net/wan/wanxl.c 2004-10-03 11:02:01 -03:00 +++ b/drivers/net/wan/wanxl.c 2004-10-03 11:02:01 -03:00 @@ -224,8 +224,6 @@ #endif stats->rx_packets++; stats->rx_bytes += skb->len; - skb->mac.raw = skb->data; - skb->dev = dev; dev->last_rx = jiffies; skb->protocol = hdlc_type_trans(skb, dev); netif_rx(skb); diff -Nru a/include/linux/hdlc.h b/include/linux/hdlc.h --- a/include/linux/hdlc.h 2004-10-03 11:02:02 -03:00 +++ b/include/linux/hdlc.h 2004-10-03 11:02:02 -03:00 @@ -243,11 +243,15 @@ static __inline__ unsigned short hdlc_type_trans(struct sk_buff *skb, struct net_device *dev) { - hdlc_device *hdlc = dev_to_hdlc(skb->dev); + hdlc_device *hdlc = dev_to_hdlc(dev); + + skb->mac.raw = skb->data; + skb->dev = dev; + if (hdlc->proto.type_trans) return hdlc->proto.type_trans(skb, dev); else - return __constant_htons(ETH_P_HDLC); + return htons(ETH_P_HDLC); } #endif /* __KERNEL */ --------------080601000806040705030207-- From hadi@cyberus.ca Sun Oct 3 12:52:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 12:52:36 -0700 (PDT) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93JqVmf020094 for ; Sun, 3 Oct 2004 12:52:31 -0700 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.20) id 1CECP4-0005WG-Mm for netdev@oss.sgi.com; Sun, 03 Oct 2004 15:52:18 -0400 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CECP1-0007tS-En; Sun, 03 Oct 2004 15:52:15 -0400 Subject: cls patchlet From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: netdev@oss.sgi.com Content-Type: multipart/mixed; boundary="=-aleoHynQzGWpIePjXRde" Organization: jamalopolous Message-Id: <1096833127.1048.333.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Oct 2004 15:52:07 -0400 X-archive-position: 9824 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1284 Lines: 47 --=-aleoHynQzGWpIePjXRde Content-Type: text/plain Content-Transfer-Encoding: 7bit Dave, resets class when tc_classid non-zero. Please apply. cheers, jamal --=-aleoHynQzGWpIePjXRde Content-Disposition: attachment; filename=classfix_p Content-Type: text/plain; name=classfix_p; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- a/net/sched/cls_u32.c 2004-08-14 01:36:33.000000000 -0400 +++ b/net/sched/cls_u32.c 2004-10-01 08:29:48.000000000 -0400 @@ -178,6 +178,7 @@ int pol_res = tcf_action_exec(skb, n->action); if (skb->tc_classid > 0) { res->classid = skb->tc_classid; + res->class = 0; skb->tc_classid = 0; } --- /usr/src/269-rc3-mod/net/sched/cls_fw.c 2004/10/01 12:36:06 1.1 +++ /usr/src/269-rc3-mod/net/sched/cls_fw.c 2004/10/01 14:22:30 @@ -103,6 +103,12 @@ #endif if (f->action) { int pol_res = tcf_action_exec(skb, f->action); + if (skb->tc_classid > 0) { + res->classid = skb->tc_classid; + res->class = 0; + skb->tc_classid = 0; + } + if (pol_res >= 0) return pol_res; } else --=-aleoHynQzGWpIePjXRde-- From hadi@cyberus.ca Sun Oct 3 13:12:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 13:12:55 -0700 (PDT) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93KCprs020739 for ; Sun, 3 Oct 2004 13:12:51 -0700 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.20) id 1CECik-0005zj-D9 for netdev@oss.sgi.com; Sun, 03 Oct 2004 16:12:38 -0400 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CECih-0001Ae-1n; Sun, 03 Oct 2004 16:12:35 -0400 Subject: Resend WAS(Re: cls patchlet From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: netdev@oss.sgi.com In-Reply-To: <1096833127.1048.333.camel@jzny.localdomain> References: <1096833127.1048.333.camel@jzny.localdomain> Content-Type: multipart/mixed; boundary="=-B5wXIDjMz5cnfE0o4eEB" Organization: jamalopolous Message-Id: <1096834352.1046.349.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Oct 2004 16:12:32 -0400 X-archive-position: 9825 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1350 Lines: 50 --=-B5wXIDjMz5cnfE0o4eEB Content-Type: text/plain Content-Transfer-Encoding: 7bit Ignore previous. This is better formated ;-> On Sun, 2004-10-03 at 15:52, jamal wrote: > Dave, > > resets class when tc_classid non-zero. > > Please apply. > > cheers, > jamal --=-B5wXIDjMz5cnfE0o4eEB Content-Disposition: attachment; filename=classfix_p Content-Type: text/plain; name=classfix_p; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- a/net/sched/cls_u32.c 2004-08-14 01:36:33.000000000 -0400 +++ b/net/sched/cls_u32.c 2004-10-01 08:29:48.000000000 -0400 @@ -178,6 +178,7 @@ int pol_res = tcf_action_exec(skb, n->action); if (skb->tc_classid > 0) { res->classid = skb->tc_classid; + res->class = 0; skb->tc_classid = 0; } --- a/net/sched/cls_fw.c 2004/10/01 12:36:06 1.1 +++ b/net/sched/cls_fw.c 2004/10/01 14:22:30 @@ -103,6 +103,12 @@ #endif if (f->action) { int pol_res = tcf_action_exec(skb, f->action); + if (skb->tc_classid > 0) { + res->classid = skb->tc_classid; + res->class = 0; + skb->tc_classid = 0; + } + if (pol_res >= 0) return pol_res; } else --=-B5wXIDjMz5cnfE0o4eEB-- From klassert@mathematik.tu-chemnitz.de Sun Oct 3 13:45:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 13:45:29 -0700 (PDT) Received: from lana.hrz.tu-chemnitz.de (lana.hrz.tu-chemnitz.de [134.109.132.3]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93KjM9f021479 for ; Sun, 3 Oct 2004 13:45:23 -0700 Received: from bayes.mathematik.tu-chemnitz.de ([134.109.41.17]) by lana.hrz.tu-chemnitz.de with esmtp (Exim 4.41) id 1CEDEB-0007Kd-Bt; Sun, 03 Oct 2004 22:45:07 +0200 Received: by bayes.mathematik.tu-chemnitz.de (Postfix, from userid 274) id 2A3C88D6C; Sun, 3 Oct 2004 22:45:07 +0200 (CEST) Date: Sun, 3 Oct 2004 22:45:07 +0200 From: Steffen Klassert To: akpm@osdl.org Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: [PATCH 2.6.9-rc3-mm1] 3c59x: Make use of generic_mii_ioctl Message-ID: <20041003204507.GA29546@bayes.mathematik.tu-chemnitz.de> Mail-Followup-To: akpm@osdl.org, jgarzik@pobox.com, netdev@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Scan-Signature: a9b0c11fa57e65d288d1a9e86fed51cf X-archive-position: 9826 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: klassert@mathematik.tu-chemnitz.de Precedence: bulk X-list: netdev Content-Length: 2670 Lines: 100 With this patch the driver makes use of the MII lib helper function generic_mii_ioctl. Patch is tested with the mii-diag tool and a 3c905-TX, 3c905B-TX NIC. Signed-off-by: Steffen Klassert --- vanilla-2.6.9-rc3-mm1/drivers/net/3c59x.c Sat Oct 2 14:54:46 2004 +++ linux-2.6.9-rc3-mm1/drivers/net/3c59x.c Sun Oct 3 20:22:31 2004 @@ -834,6 +834,7 @@ u16 io_size; /* Size of PCI region (for release_region) */ spinlock_t lock; /* Serialise access to device & its vortex_private */ spinlock_t mdio_lock; /* Serialise access to mdio hardware */ + struct mii_if_info mii; /* MII lib hooks/info */ }; #ifdef CONFIG_PCI @@ -1218,6 +1219,11 @@ spin_lock_init(&vp->lock); spin_lock_init(&vp->mdio_lock); vp->gendev = gendev; + vp->mii.dev = dev; + vp->mii.mdio_read = mdio_read; + vp->mii.mdio_write = mdio_write; + vp->mii.phy_id_mask = 0x1f; + vp->mii.reg_num_mask = 0x1f; /* Makes sure rings are at least 16 byte aligned. */ vp->rx_ring = pci_alloc_consistent(pdev, sizeof(struct boom_rx_desc) * RX_RING_SIZE @@ -1445,6 +1451,7 @@ mdio_write(dev, vp->phys[0], 4, vp->advertising); } } + vp->mii.phy_id = vp->phys[0]; } if (vp->capabilities & CapBusMaster) { @@ -2891,41 +2898,6 @@ }; #ifdef CONFIG_PCI -static int vortex_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -{ - struct vortex_private *vp = netdev_priv(dev); - long ioaddr = dev->base_addr; - struct mii_ioctl_data *data = if_mii(rq); - int phy = vp->phys[0] & 0x1f; - int retval; - - switch(cmd) { - case SIOCGMIIPHY: /* Get address of MII PHY in use. */ - data->phy_id = phy; - - case SIOCGMIIREG: /* Read MII PHY register. */ - EL3WINDOW(4); - data->val_out = mdio_read(dev, data->phy_id & 0x1f, data->reg_num & 0x1f); - retval = 0; - break; - - case SIOCSMIIREG: /* Write MII PHY register. */ - if (!capable(CAP_NET_ADMIN)) { - retval = -EPERM; - } else { - EL3WINDOW(4); - mdio_write(dev, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in); - retval = 0; - } - break; - default: - retval = -EOPNOTSUPP; - break; - } - - return retval; -} - /* * Must power the device up to do MDIO operations */ @@ -2933,8 +2905,9 @@ { int err; struct vortex_private *vp = netdev_priv(dev); + long ioaddr = dev->base_addr; int state = 0; - + if(VORTEX_PCI(vp)) state = VORTEX_PCI(vp)->current_state; @@ -2942,7 +2915,8 @@ if(state != 0) pci_set_power_state(VORTEX_PCI(vp), 0); - err = vortex_do_ioctl(dev, rq, cmd); + EL3WINDOW(4); + err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL);; if(state != 0) pci_set_power_state(VORTEX_PCI(vp), state); From Robert.Olsson@data.slu.se Sun Oct 3 14:07:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:07:34 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93L7Lun022171 for ; Sun, 3 Oct 2004 14:07:22 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id i93L70Y2023634; Sun, 3 Oct 2004 23:07:00 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id 5998190265; Sun, 3 Oct 2004 23:07:00 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16736.27124.307123.345676@robur.slu.se> Date: Sun, 3 Oct 2004 23:07:00 +0200 To: Harald Welte Cc: Linux Netdev List , David Miller , Robert Olsson , Stephen Hemminger Subject: lnstat (rtstat replacement) In-Reply-To: <20041002162120.GT27499@sunbeam.de.gnumonks.org> References: <20041002162120.GT27499@sunbeam.de.gnumonks.org> X-Mailer: VM 7.18 under Emacs 21.3.1 X-archive-position: 9827 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 1495 Lines: 65 Harald Welte writes: > I've finished my work on 'lnstat'. The current development version is > available from > http://svn.gnumonks.org/cgi-bin/viewcvs.cgi/trunk/lnstat/ I will get a useful tool... > Robert: I hope you're fine with the new lnstat tool replacing rtstat. I just tried "compatibility mode". Something like patch below makes it closer to old rtstat. Did the last two fields get switched? Cheers. --ro --- lnstat.c.orig 2004-10-03 21:01:50.518607296 +0200 +++ lnstat.c 2004-10-03 22:38:25.846513976 +0200 @@ -54,7 +54,7 @@ gettimeofday(&lf->last_read, NULL); for (j = 0; j < lf->num_fields; j++) - lf->fields[j].values[i] += strtoul(ptr, &ptr, 16); + lf->fields[j].values[i] = strtoul(ptr, &ptr, 16); } return num_lines; } @@ -79,6 +79,7 @@ struct lnstat_file *lf; char buf[FGETS_BUF_SIZE]; struct timeval tv; + time_t told; gettimeofday(&tv, NULL); @@ -92,15 +93,22 @@ /* skip first line */ fgets(buf, sizeof(buf)-1, lf->fp); } + told = lf->last_read.tv_sec; scan_lines(lf, 1); for (i = 0, lfi = &lf->fields[i]; i < lf->num_fields; i++, lfi = &lf->fields[i]) { if (i == 0) lfi->result = lfi->values[1]; - else + else { + lfi->result = (lfi->values[1]-lfi->values[0]) - / lf->interval.tv_sec; + + / ( lf->last_read.tv_sec -told); + + /* Save current to next diff */ + lfi->values[0] = lfi->values[1]; + } } rewind(lf->fp); From davem@davemloft.net Sun Oct 3 14:11:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:11:44 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LBdPZ022529 for ; Sun, 3 Oct 2004 14:11:39 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEDbZ-0003DO-00; Sun, 03 Oct 2004 14:09:17 -0700 Date: Sun, 3 Oct 2004 14:09:17 -0700 From: "David S. Miller" To: Fernando Gont Cc: netdev@oss.sgi.com Subject: Re: TCP's reaction to soft errors Message-Id: <20041003140917.48cd6069.davem@davemloft.net> In-Reply-To: <4.3.2.7.2.20041003105509.00e33650@pop.gmx.net> References: <4.3.2.7.2.20040915112853.00cf9980@mail.daleclick.com> <4.3.2.7.2.20040915112853.00cf9980@mail.daleclick.com> <4.3.2.7.2.20041003105509.00e33650@pop.gmx.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9828 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 731 Lines: 18 On Sun, 03 Oct 2004 10:57:36 -0300 Fernando Gont wrote: > At 15:13 01/10/2004 -0700, David S. Miller wrote: > > > > The draft proposes to change TCP's reaction to soft errors so that > > > connections that are in the SYN-SENT or SYN-RECEIVED states are aborted > > > upon receipt of an ICMP error message that indicates a soft error. > > > >I have verified that Linux behaves in a way compliant to this > >proposal. No changes are necessary. > > Great! Thanks for your confirmation. > BTW, do you have any record of how long Linux has been behaving this way? > (I'd like to include this information in the draft). Even 2.0.x kernels behave this way. Others are welcome to search back even further :-) From kaber@trash.net Sun Oct 3 14:13:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:13:10 -0700 (PDT) Received: from gw.localnet ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LD4DC022855 for ; Sun, 3 Oct 2004 14:13:05 -0700 Received: from [172.16.1.123] (helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1CEDle-0003m3-00; Sun, 03 Oct 2004 23:19:42 +0200 Message-ID: <41606B47.9040703@trash.net> Date: Sun, 03 Oct 2004 23:12:39 +0200 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH 2.6 0/7]: assorted fixes Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 9829 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1442 Lines: 42 Hi Dave. following are 6 assorted fixes and one small cleanup patch. You can pull all patches from bk://212.42.230.204/net-2.6 I'll send 2.4 versions later. ChangeSet@1.2043.1.7, 2004-10-03 20:44:53+02:00, kaber@coreworks.de [VLAN]: Missing rtnl_unlock in register_vlan_device error path Signed-off-by: Patrick McHardy ChangeSet@1.2043.1.6, 2004-10-03 20:43:32+02:00, kaber@coreworks.de [IPV6]: Fix free_netdev after failed alloc_netdev in sit_init Signed-off-by: Patrick McHardy ChangeSet@1.2043.1.5, 2004-10-03 20:42:17+02:00, kaber@coreworks.de [IPV4]: Fix ipip_fb_tunnel_dev leak in ipip_fini Signed-off-by: Patrick McHardy ChangeSet@1.2043.1.4, 2004-10-03 20:41:00+02:00, kaber@coreworks.de [IPV4]: Fix free_netdev after failed alloc_netdev in ipip_init Signed-off-by: Patrick McHardy ChangeSet@1.2043.1.3, 2004-10-03 20:39:25+02:00, kaber@coreworks.de [IPV4]: Fix free_netdev after failed alloc_netdev in ipgre_init Signed-off-by: Patrick McHardy ChangeSet@1.2043.1.2, 2004-10-03 20:29:51+02:00, kaber@coreworks.de [NET_SCHED]: Remove useless variable in tc_ctl_tfilter Signed-off-by: Patrick McHardy ChangeSet@1.2043.1.1, 2004-10-03 20:25:10+02:00, kaber@coreworks.de [NET_SCHED]: Fix module leak in tc_ctl_tfilter error path Signed-off-by: Patrick McHardy From kaber@trash.net Sun Oct 3 14:13:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:13:19 -0700 (PDT) Received: from gw.localnet ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LDD56022861 for ; Sun, 3 Oct 2004 14:13:13 -0700 Received: from [172.16.1.123] (helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1CEDln-0003mE-00; Sun, 03 Oct 2004 23:19:51 +0200 Message-ID: <41606B50.3080201@trash.net> Date: Sun, 03 Oct 2004 23:12:48 +0200 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH 2.6 1/7]: Fix module leak in tc_ctl_tfilter error path Content-Type: multipart/mixed; boundary="------------000601040605010702000606" X-archive-position: 9830 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1405 Lines: 50 This is a multi-part message in MIME format. --------------000601040605010702000606 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit When tp_ops->init fails we leak a module reference. --------------000601040605010702000606 Content-Type: text/x-patch; name="01.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="01.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/10/03 20:25:10+02:00 kaber@coreworks.de # [NET_SCHED]: Fix module leak in tc_ctl_tfilter error path # # Signed-off-by: Patrick McHardy # # net/sched/cls_api.c # 2004/10/03 20:24:47+02:00 kaber@coreworks.de +6 -2 # [NET_SCHED]: Fix module leak in tc_ctl_tfilter error path # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c 2004-10-03 22:18:04 +02:00 +++ b/net/sched/cls_api.c 2004-10-03 22:18:04 +02:00 @@ -231,8 +231,12 @@ tp->classify = tp_ops->classify; tp->classid = parent; err = -EBUSY; - if (!try_module_get(tp_ops->owner) || - (err = tp_ops->init(tp)) != 0) { + if (!try_module_get(tp_ops->owner)) { + kfree(tp); + goto errout; + } + if ((err = tp_ops->init(tp)) != 0) { + module_put(tp_ops->owner); kfree(tp); goto errout; } --------------000601040605010702000606-- From kaber@trash.net Sun Oct 3 14:13:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:13:28 -0700 (PDT) Received: from gw.localnet ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LDMjl022925 for ; Sun, 3 Oct 2004 14:13:23 -0700 Received: from [172.16.1.123] (helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1CEDlv-0003ma-00; Sun, 03 Oct 2004 23:19:59 +0200 Message-ID: <41606B59.5020502@trash.net> Date: Sun, 03 Oct 2004 23:12:57 +0200 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH 2.6 3/7]: Fix free_netdev after failed alloc_netdev in ipgre_init Content-Type: multipart/mixed; boundary="------------010601070104040304020902" X-archive-position: 9832 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1654 Lines: 68 This is a multi-part message in MIME format. --------------010601070104040304020902 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Passing a NULL-ptr to free_netdev is wrong. --------------010601070104040304020902 Content-Type: text/x-patch; name="03.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="03.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/10/03 20:39:25+02:00 kaber@coreworks.de # [IPV4]: Fix free_netdev after failed alloc_netdev in ipgre_init # # Signed-off-by: Patrick McHardy # # net/ipv4/ip_gre.c # 2004/10/03 20:38:45+02:00 kaber@coreworks.de +6 -5 # [IPV4]: Fix free_netdev after failed alloc_netdev in ipgre_init # # Signed-off-by: Patrick McHardy # diff -Nru a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c --- a/net/ipv4/ip_gre.c 2004-10-03 22:19:31 +02:00 +++ b/net/ipv4/ip_gre.c 2004-10-03 22:19:31 +02:00 @@ -1250,7 +1250,7 @@ static int __init ipgre_init(void) { - int err = -EINVAL; + int err; printk(KERN_INFO "GRE over IPv4 tunneling driver\n"); @@ -1263,18 +1263,19 @@ ipgre_tunnel_setup); if (!ipgre_fb_tunnel_dev) { err = -ENOMEM; - goto fail; + goto err1; } ipgre_fb_tunnel_dev->init = ipgre_fb_tunnel_init; if ((err = register_netdev(ipgre_fb_tunnel_dev))) - goto fail; + goto err2; out: return err; -fail: - inet_del_protocol(&ipgre_protocol, IPPROTO_GRE); +err2: free_netdev(ipgre_fb_tunnel_dev); +err1: + inet_del_protocol(&ipgre_protocol, IPPROTO_GRE); goto out; } --------------010601070104040304020902-- From kaber@trash.net Sun Oct 3 14:13:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:13:25 -0700 (PDT) Received: from gw.localnet ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LDH7l022880 for ; Sun, 3 Oct 2004 14:13:18 -0700 Received: from [172.16.1.123] (helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1CEDls-0003mP-00; Sun, 03 Oct 2004 23:19:56 +0200 Message-ID: <41606B55.8010105@trash.net> Date: Sun, 03 Oct 2004 23:12:53 +0200 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH 2.6 2/7]: Remove useless variable in tc_ctl_tfilter Content-Type: multipart/mixed; boundary="------------030605040500090404080507" X-archive-position: 9831 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 2029 Lines: 71 This is a multi-part message in MIME format. --------------030605040500090404080507 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Remove useless variable that confused me. --------------030605040500090404080507 Content-Type: text/x-patch; name="02.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="02.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/10/03 20:29:51+02:00 kaber@coreworks.de # [NET_SCHED]: Remove useless variable in tc_ctl_tfilter # # Signed-off-by: Patrick McHardy # # net/sched/cls_api.c # 2004/10/03 20:29:23+02:00 kaber@coreworks.de +4 -4 # [NET_SCHED]: Remove useless variable in tc_ctl_tfilter # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c 2004-10-03 22:18:34 +02:00 +++ b/net/sched/cls_api.c 2004-10-03 22:18:34 +02:00 @@ -139,7 +139,7 @@ struct tcf_proto_ops *tp_ops; struct Qdisc_class_ops *cops; unsigned long cl = 0; - unsigned long fh, fh_s; + unsigned long fh; int err; if (prio == 0) { @@ -249,7 +249,7 @@ } else if (tca[TCA_KIND-1] && rtattr_strcmp(tca[TCA_KIND-1], tp->ops->kind)) goto errout; - fh_s = fh = tp->ops->get(tp, t->tcm_handle); + fh = tp->ops->get(tp, t->tcm_handle); if (fh == 0) { if (n->nlmsg_type == RTM_DELTFILTER && t->tcm_handle == 0) { @@ -257,7 +257,7 @@ *back = tp->next; qdisc_unlock_tree(dev); - tfilter_notify(skb, n, tp, fh_s, RTM_DELTFILTER); + tfilter_notify(skb, n, tp, fh, RTM_DELTFILTER); tcf_destroy(tp); err = 0; goto errout; @@ -276,7 +276,7 @@ case RTM_DELTFILTER: err = tp->ops->delete(tp, fh); if (err == 0) - tfilter_notify(skb, n, tp, fh_s, RTM_DELTFILTER); + tfilter_notify(skb, n, tp, fh, RTM_DELTFILTER); goto errout; case RTM_GETTFILTER: err = tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER); --------------030605040500090404080507-- From kaber@trash.net Sun Oct 3 14:13:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:13:37 -0700 (PDT) Received: from gw.localnet ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LDUS5023020 for ; Sun, 3 Oct 2004 14:13:31 -0700 Received: from [172.16.1.123] (helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1CEDm5-0003ml-00; Sun, 03 Oct 2004 23:20:09 +0200 Message-ID: <41606B62.8020303@trash.net> Date: Sun, 03 Oct 2004 23:13:06 +0200 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH 2.6 4/7]: Fix free_netdev after failed alloc_netdev in ipip_init Content-Type: multipart/mixed; boundary="------------010704060704000104070009" X-archive-position: 9833 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1495 Lines: 60 This is a multi-part message in MIME format. --------------010704060704000104070009 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Same problem as in ip_gre: Passing a NULL-ptr to free_netdev is wrong. --------------010704060704000104070009 Content-Type: text/x-patch; name="04.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="04.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/10/03 20:41:00+02:00 kaber@coreworks.de # [IPV4]: Fix free_netdev after failed alloc_netdev in ipip_init # # Signed-off-by: Patrick McHardy # # net/ipv4/ipip.c # 2004/10/03 20:40:18+02:00 kaber@coreworks.de +5 -4 # [IPV4]: Fix free_netdev after failed alloc_netdev in ipip_init # # Signed-off-by: Patrick McHardy # diff -Nru a/net/ipv4/ipip.c b/net/ipv4/ipip.c --- a/net/ipv4/ipip.c 2004-10-03 22:20:28 +02:00 +++ b/net/ipv4/ipip.c 2004-10-03 22:20:28 +02:00 @@ -876,18 +876,19 @@ ipip_tunnel_setup); if (!ipip_fb_tunnel_dev) { err = -ENOMEM; - goto fail; + goto err1; } ipip_fb_tunnel_dev->init = ipip_fb_tunnel_init; if ((err = register_netdev(ipip_fb_tunnel_dev))) - goto fail; + goto err2; out: return err; - fail: - xfrm4_tunnel_deregister(&ipip_handler); + err2: free_netdev(ipip_fb_tunnel_dev); + err1: + xfrm4_tunnel_deregister(&ipip_handler); goto out; } --------------010704060704000104070009-- From kaber@trash.net Sun Oct 3 14:13:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:13:55 -0700 (PDT) Received: from gw.localnet ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LDnVa023448 for ; Sun, 3 Oct 2004 14:13:49 -0700 Received: from [172.16.1.123] (helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1CEDmI-0003mw-00; Sun, 03 Oct 2004 23:20:22 +0200 Message-ID: <41606B6F.5040204@trash.net> Date: Sun, 03 Oct 2004 23:13:19 +0200 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH 2.6 5/7]: Fix ipip_fb_tunnel_dev leak in ipip_fini Content-Type: multipart/mixed; boundary="------------080504090100040504060908" X-archive-position: 9834 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1547 Lines: 53 This is a multi-part message in MIME format. --------------080504090100040504060908 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit ipip_fb_tunnel_dev doesn't have a destructor set and is not freed manually. Set the destructor in ipip_tunnel_setup to fix the leak. --------------080504090100040504060908 Content-Type: text/x-patch; name="05.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="05.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/10/03 20:42:17+02:00 kaber@coreworks.de # [IPV4]: Fix ipip_fb_tunnel_dev leak in ipip_fini # # Signed-off-by: Patrick McHardy # # net/ipv4/ipip.c # 2004/10/03 20:41:38+02:00 kaber@coreworks.de +1 -1 # [IPV4]: Fix ipip_fb_tunnel_dev leak in ipip_fini # # Signed-off-by: Patrick McHardy # diff -Nru a/net/ipv4/ipip.c b/net/ipv4/ipip.c --- a/net/ipv4/ipip.c 2004-10-03 22:20:49 +02:00 +++ b/net/ipv4/ipip.c 2004-10-03 22:20:49 +02:00 @@ -246,7 +246,6 @@ nt = dev->priv; SET_MODULE_OWNER(dev); dev->init = ipip_tunnel_init; - dev->destructor = free_netdev; nt->parms = *parms; if (register_netdevice(dev) < 0) { @@ -784,6 +783,7 @@ dev->get_stats = ipip_tunnel_get_stats; dev->do_ioctl = ipip_tunnel_ioctl; dev->change_mtu = ipip_tunnel_change_mtu; + dev->destructor = free_netdev; dev->type = ARPHRD_TUNNEL; dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); --------------080504090100040504060908-- From kaber@trash.net Sun Oct 3 14:13:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:14:02 -0700 (PDT) Received: from gw.localnet ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LDtax023594 for ; Sun, 3 Oct 2004 14:13:55 -0700 Received: from [172.16.1.123] (helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1CEDmT-0003n7-00; Sun, 03 Oct 2004 23:20:33 +0200 Message-ID: <41606B7A.2080101@trash.net> Date: Sun, 03 Oct 2004 23:13:30 +0200 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH 2.6 6/7]: Fix free_netdev after failed alloc_netdev in sit_init Content-Type: multipart/mixed; boundary="------------080500050102080509080405" X-archive-position: 9835 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1521 Lines: 60 This is a multi-part message in MIME format. --------------080500050102080509080405 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Same problem as in ip_gre.c and ipip.c: Passing a NULL-ptr to free_netdev is wrong. --------------080500050102080509080405 Content-Type: text/x-patch; name="06.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="06.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/10/03 20:43:32+02:00 kaber@coreworks.de # [IPV6]: Fix free_netdev after failed alloc_netdev in sit_init # # Signed-off-by: Patrick McHardy # # net/ipv6/sit.c # 2004/10/03 20:43:09+02:00 kaber@coreworks.de +5 -4 # [IPV6]: Fix free_netdev after failed alloc_netdev in sit_init # # Signed-off-by: Patrick McHardy # diff -Nru a/net/ipv6/sit.c b/net/ipv6/sit.c --- a/net/ipv6/sit.c 2004-10-03 22:21:06 +02:00 +++ b/net/ipv6/sit.c 2004-10-03 22:21:06 +02:00 @@ -814,18 +814,19 @@ ipip6_tunnel_setup); if (!ipip6_fb_tunnel_dev) { err = -ENOMEM; - goto fail; + goto err1; } ipip6_fb_tunnel_dev->init = ipip6_fb_tunnel_init; if ((err = register_netdev(ipip6_fb_tunnel_dev))) - goto fail; + goto err2; out: return err; - fail: - inet_del_protocol(&sit_protocol, IPPROTO_IPV6); + err2: free_netdev(ipip6_fb_tunnel_dev); + err1: + inet_del_protocol(&sit_protocol, IPPROTO_IPV6); goto out; } --------------080500050102080509080405-- From kaber@trash.net Sun Oct 3 14:14:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:14:16 -0700 (PDT) Received: from gw.localnet ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LE9kJ023915 for ; Sun, 3 Oct 2004 14:14:09 -0700 Received: from [172.16.1.123] (helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1CEDmh-0003nI-00; Sun, 03 Oct 2004 23:20:47 +0200 Message-ID: <41606B88.1000003@trash.net> Date: Sun, 03 Oct 2004 23:13:44 +0200 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH 2.6 7/7]: Missing rtnl_unlock in register_vlan_device error path Content-Type: multipart/mixed; boundary="------------070603080609060007050008" X-archive-position: 9836 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1204 Lines: 44 This is a multi-part message in MIME format. --------------070603080609060007050008 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit rtnl_unlock is not called in the out_free_unregister error path. --------------070603080609060007050008 Content-Type: text/x-patch; name="07.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="07.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/10/03 20:44:53+02:00 kaber@coreworks.de # [VLAN]: Missing rtnl_unlock in register_vlan_device error path # # Signed-off-by: Patrick McHardy # # net/8021q/vlan.c # 2004/10/03 20:44:27+02:00 kaber@coreworks.de +1 -1 # [VLAN]: Missing rtnl_unlock in register_vlan_device error path # # Signed-off-by: Patrick McHardy # diff -Nru a/net/8021q/vlan.c b/net/8021q/vlan.c --- a/net/8021q/vlan.c 2004-10-03 22:21:30 +02:00 +++ b/net/8021q/vlan.c 2004-10-03 22:21:30 +02:00 @@ -537,7 +537,7 @@ out_free_unregister: unregister_netdev(new_dev); - goto out_put_dev; + goto out_unlock; out_free_newdev: free_netdev(new_dev); --------------070603080609060007050008-- From tgraf@suug.ch Sun Oct 3 14:31:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:31:24 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LVIf3025583 for ; Sun, 3 Oct 2004 14:31:19 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id BDE948B; Sun, 3 Oct 2004 23:30:42 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id 126CB1C0E8; Sun, 3 Oct 2004 23:31:25 +0200 (CEST) Date: Sun, 3 Oct 2004 23:31:24 +0200 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 0/3] NET: Generic network statistics/estimator Message-ID: <20041003213124.GG14344@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-archive-position: 9837 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 532 Lines: 10 Dave, The following patchset introduces generic network statistics for netlink users. It uses nested TLV which prevents further compatibility problems when introducing new statistics. Backward compatibility to existing TLV types TCA_STATS and TCA_XSTATS is ensured but can be easly removed once it is no longer needed. Therefore prior users of struct tc_stats can be converted to this API and existing userspace applications will not notice a difference while converted applications can use the new extendable statistic interface. From tgraf@suug.ch Sun Oct 3 14:34:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:34:41 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LYY73025944 for ; Sun, 3 Oct 2004 14:34:34 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id AE83D8B; Sun, 3 Oct 2004 23:33:59 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id D5DB51C0E8; Sun, 3 Oct 2004 23:34:42 +0200 (CEST) Date: Sun, 3 Oct 2004 23:34:42 +0200 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 1/3] NET: Generic network statistics API Message-ID: <20041003213442.GH14344@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041003213124.GG14344@postel.suug.ch> X-archive-position: 9838 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 6189 Lines: 240 Generic network statistics API for netlink users. Signed-off-by: Thomas Graf --- linux-2.6.9-rc3.orig/include/net/gen_stats.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc3/include/net/gen_stats.h 2004-10-03 22:18:55.000000000 +0200 @@ -0,0 +1,45 @@ +#ifndef __NET_GEN_STATS_H +#define __NET_GEN_STATS_H + +#include +#include +#include +#include + +struct gnet_dump +{ + spinlock_t * lock; + struct sk_buff * skb; + struct rtattr * tail; + + /* Backward compatability */ + int compat_tc_stats; + int compat_xstats; + struct rtattr * xstats; + struct tc_stats tc_stats; +}; + +extern int gnet_stats_start_copy(struct sk_buff *skb, int type, + spinlock_t *lock, struct gnet_dump *d); + +extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, + int tc_stats_type,int xstats_type, + spinlock_t *lock, struct gnet_dump *d); + +extern int gnet_stats_copy_basic(struct gnet_dump *d, + struct gnet_stats_basic *b); +extern int gnet_stats_copy_rate_est(struct gnet_dump *d, + struct gnet_stats_rate_est *r); +extern int gnet_stats_copy_queue(struct gnet_dump *d, + struct gnet_stats_queue *q); +extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len); + +extern int gnet_stats_finish_copy(struct gnet_dump *d); + +extern int gen_new_estimator(struct gnet_stats_basic *bstats, + struct gnet_stats_rate_est *rate_est, + spinlock_t *stats_lock, struct rtattr *opt); +extern void gen_kill_estimator(struct gnet_stats_basic *bstats, + struct gnet_stats_rate_est *rate_est); + +#endif --- linux-2.6.9-rc3.orig/include/linux/gen_stats.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc3/include/linux/gen_stats.h 2004-10-03 22:58:21.000000000 +0200 @@ -0,0 +1,50 @@ +#ifndef __LINUX_GEN_STATS_H +#define __LINUX_GEN_STATS_H + +#include + +enum { + TCA_STATS_UNSPEC, + TCA_STATS_BASIC, + TCA_STATS_RATE_EST, + TCA_STATS_QUEUE, + TCA_STATS_APP, + __TCA_STATS_MAX, +}; +#define TCA_STATS_MAX (__TCA_STATS_MAX - 1) + +/** + * @bytes: number of seen bytes + * @packets: number of seen packets + */ +struct gnet_stats_basic +{ + __u64 bytes; + __u32 packets; +}; + +/** + * @bps: current byte rate + * @pps: current packet rate + */ +struct gnet_stats_rate_est +{ + __u32 bps; + __u32 pps; +}; + +/** + * @qlen: queue length + * @backlog: backlog size of queue + * @drops: number of dropped packets + * @requeues: number of requeues + */ +struct gnet_stats_queue +{ + __u32 qlen; + __u32 backlog; + __u32 drops; + __u32 requeues; + __u32 overlimits; +}; +#endif /* __LINUX_GEN_STATS_H */ --- linux-2.6.9-rc3.orig/net/core/gen_stats.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc3/net/core/gen_stats.c 2004-10-03 22:22:43.000000000 +0200 @@ -0,0 +1,132 @@ +/* + * net/core/gen_stats.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + * Jamal Hadi Salim + * Alexey Kuznetsov, + * + * See Documentation/networking/gen_stats.txt + */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +static inline int +gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size) +{ + RTA_PUT(d->skb, type, size, buf); + return 0; + +rtattr_failure: + spin_unlock_bh(d->lock); + return -1; +} + +int +gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, + int xstats_type, spinlock_t *lock, struct gnet_dump *d) +{ + spin_lock_bh(lock); + d->lock = lock; + d->tail = (struct rtattr *) skb->tail; + d->skb = skb; + d->compat_tc_stats = tc_stats_type; + d->compat_xstats = xstats_type; + d->xstats = NULL; + + if (d->compat_tc_stats) + memset(&d->tc_stats, 0, sizeof(d->tc_stats)); + + return gnet_stats_copy(d, type, NULL, 0); +} + +int +gnet_stats_start_copy(struct sk_buff *skb, int type, spinlock_t *lock, + struct gnet_dump *d) +{ + return gnet_stats_start_copy_compat(skb, type, 0, 0, lock, d); +} + + +int +gnet_stats_copy_basic(struct gnet_dump *d, struct gnet_stats_basic *b) +{ + if (d->compat_tc_stats) { + d->tc_stats.bytes = b->bytes; + d->tc_stats.packets = b->packets; + } + + return gnet_stats_copy(d, TCA_STATS_BASIC, b, sizeof(*b)); +} + +int +gnet_stats_copy_rate_est(struct gnet_dump *d, struct gnet_stats_rate_est *r) +{ + if (d->compat_tc_stats) { + d->tc_stats.bps = r->bps; + d->tc_stats.pps = r->pps; + } + + return gnet_stats_copy(d, TCA_STATS_RATE_EST, r, sizeof(*r)); +} + +int +gnet_stats_copy_queue(struct gnet_dump *d, struct gnet_stats_queue *q) +{ + if (d->compat_tc_stats) { + d->tc_stats.drops = q->drops; + d->tc_stats.qlen = q->qlen; + d->tc_stats.backlog = q->backlog; + d->tc_stats.overlimits = q->overlimits; + } + + return gnet_stats_copy(d, TCA_STATS_QUEUE, q, sizeof(*q)); +} + +int +gnet_stats_copy_app(struct gnet_dump *d, void *st, int len) +{ + if (d->compat_xstats) + d->xstats = (struct rtattr *) d->skb->tail; + return gnet_stats_copy(d, TCA_STATS_APP, st, len); +} + +int +gnet_stats_finish_copy(struct gnet_dump *d) +{ + d->tail->rta_len = d->skb->tail - (u8 *) d->tail; + + if (d->compat_tc_stats) + if (gnet_stats_copy(d, d->compat_tc_stats, &d->tc_stats, + sizeof(d->tc_stats)) < 0) + return -1; + + if (d->compat_xstats && d->xstats) { + if (gnet_stats_copy(d, d->compat_xstats, RTA_DATA(d->xstats), + RTA_PAYLOAD(d->xstats)) < 0) + return -1; + } + + spin_unlock_bh(d->lock); + return 0; +} + + +EXPORT_SYMBOL(gnet_stats_start_copy); +EXPORT_SYMBOL(gnet_stats_copy_basic); +EXPORT_SYMBOL(gnet_stats_copy_rate_est); +EXPORT_SYMBOL(gnet_stats_copy_queue); +EXPORT_SYMBOL(gnet_stats_copy_app); +EXPORT_SYMBOL(gnet_stats_finish_copy); From tgraf@suug.ch Sun Oct 3 14:39:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:39:52 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93Ldl0T026284 for ; Sun, 3 Oct 2004 14:39:47 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 544A98B; Sun, 3 Oct 2004 23:39:12 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id E8A4C1C0E8; Sun, 3 Oct 2004 23:39:54 +0200 (CEST) Date: Sun, 3 Oct 2004 23:39:54 +0200 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 2/3] NET: Generic rate estimator Message-ID: <20041003213954.GI14344@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041003213124.GG14344@postel.suug.ch> X-archive-position: 9839 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 6605 Lines: 235 Introduces a generic rate estimator based on timers. Patch is based on Jamal's patch and adapted to the new generic network statistics API. Signed-off-by: Thomas Graf --- linux-2.6.9-rc3.orig/include/linux/gen_stats.h 2004-10-03 23:00:15.000000000 +0200 +++ linux-2.6.9-rc3/include/linux/gen_stats.h 2004-10-03 23:00:19.000000000 +0200 @@ -47,4 +47,16 @@ __u32 requeues; __u32 overlimits; }; + +/** + * @interval: sampling period + * @ewma_log: the log of measurement window weight + */ +struct gnet_estimator +{ + signed char interval; + unsigned char ewma_log; +}; + + #endif /* __LINUX_GEN_STATS_H */ --- linux-2.6.9-rc3.orig/net/core/gen_estimator.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc3/net/core/gen_estimator.c 2004-10-03 22:43:03.000000000 +0200 @@ -0,0 +1,208 @@ +/* + * net/sched/gen_estimator.c Simple rate estimator. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Alexey Kuznetsov, + * + * Changes: + * Jamal Hadi Salim - moved it to net/core and reshulfed + * names to make it usable in general net subsystem. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + This code is NOT intended to be used for statistics collection, + its purpose is to provide a base for statistical multiplexing + for controlled load service. + If you need only statistics, run a user level daemon which + periodically reads byte counters. + + Unfortunately, rate estimation is not a very easy task. + F.e. I did not find a simple way to estimate the current peak rate + and even failed to formulate the problem 8)8) + + So I preferred not to built an estimator into the scheduler, + but run this task separately. + Ideally, it should be kernel thread(s), but for now it runs + from timers, which puts apparent top bounds on the number of rated + flows, has minimal overhead on small, but is enough + to handle controlled load service, sets of aggregates. + + We measure rate over A=(1<next) { + u64 nbytes; + u32 npackets; + u32 rate; + + spin_lock(e->stats_lock); + nbytes = e->bstats->bytes; + npackets = e->bstats->packets; + rate = (nbytes - e->last_bytes)<<(7 - idx); + e->last_bytes = nbytes; + e->avbps += ((long)rate - (long)e->avbps) >> e->ewma_log; + e->rate_est->bps = (e->avbps+0xF)>>5; + + rate = (npackets - e->last_packets)<<(12 - idx); + e->last_packets = npackets; + e->avpps += ((long)rate - (long)e->avpps) >> e->ewma_log; + e->rate_est->pps = (e->avpps+0x1FF)>>10; + spin_unlock(e->stats_lock); + } + + mod_timer(&elist[idx].timer, jiffies + ((HZ/4)<interval < -2 || parm->interval > 3) + return -EINVAL; + + est = kmalloc(sizeof(*est), GFP_KERNEL); + if (est == NULL) + return -ENOBUFS; + + memset(est, 0, sizeof(*est)); + est->interval = parm->interval + 2; + est->bstats = bstats; + est->rate_est = rate_est; + est->stats_lock = stats_lock; + est->ewma_log = parm->ewma_log; + est->last_bytes = bstats->bytes; + est->avbps = rate_est->bps<<5; + est->last_packets = bstats->packets; + est->avpps = rate_est->pps<<10; + + est->next = elist[est->interval].list; + if (est->next == NULL) { + init_timer(&elist[est->interval].timer); + elist[est->interval].timer.data = est->interval; + elist[est->interval].timer.expires = jiffies + ((HZ/4)<interval); + elist[est->interval].timer.function = est_timer; + add_timer(&elist[est->interval].timer); + } + write_lock_bh(&est_lock); + elist[est->interval].list = est; + write_unlock_bh(&est_lock); + return 0; +} + +void gen_kill_estimator(struct gnet_stats_basic *bstats, + struct gnet_stats_rate_est *rate_est) +{ + int idx; + struct gen_estimator *est, **pest; + + for (idx=0; idx <= EST_MAX_INTERVAL; idx++) { + int killed = 0; + pest = &elist[idx].list; + while ((est=*pest) != NULL) { + if (est->rate_est != rate_est || est->bstats != bstats) { + pest = &est->next; + continue; + } + + write_lock_bh(&est_lock); + *pest = est->next; + write_unlock_bh(&est_lock); + + kfree(est); + killed++; + } + if (killed && elist[idx].list == NULL) + del_timer(&elist[idx].timer); + } +} + +EXPORT_SYMBOL(gen_new_estimator); +EXPORT_SYMBOL(gen_kill_estimator); From tgraf@suug.ch Sun Oct 3 14:41:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:41:45 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93Lfd75026647 for ; Sun, 3 Oct 2004 14:41:39 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id B3B6A8B; Sun, 3 Oct 2004 23:41:04 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id 151B01C0E8; Sun, 3 Oct 2004 23:41:47 +0200 (CEST) Date: Sun, 3 Oct 2004 23:41:46 +0200 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 3/3] NET: Generic network statistics/estimator documentation Message-ID: <20041003214146.GJ14344@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041003213124.GG14344@postel.suug.ch> X-archive-position: 9840 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 4031 Lines: 125 Documentation of generic network statistics and estimator API. Signed-off-by: Thomas Graf --- linux-2.6.9-rc3.orig/Documentation/networking/gen_stats.txt 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc3/Documentation/networking/gen_stats.txt 2004-10-03 22:33:57.000000000 +0200 @@ -0,0 +1,117 @@ +Generic networking statistics for netlink users +====================================================================== + +Statistic counters are grouped into structs: + +Struct TLV type Description +---------------------------------------------------------------------- +gnet_stats_basic TCA_STATS_BASIC Basic statistics +gnet_stats_rate_est TCA_STATS_RATE_EST Rate estimator +gnet_stats_queue TCA_STATS_QUEUE Queue statistics +none TCA_STATS_APP Application specific + + +Collecting: +----------- + +Declare the statistic structs you need: +struct mystruct { + struct gnet_stats_basic bstats; + struct gnet_stats_queue qstats; + ... +}; + +Update statistics: +mystruct->tstats.packet++; +mystruct->qstats.backlog += skb->pkt_len; + + +Export to userspace (Dump): +--------------------------- + +my_dumping_routine(struct sk_buff *skb, ...) +{ + struct gnet_dump dump; + + if (gnet_stats_start_copy(skb, TCA_STATS2, &mystruct->lock, &dump) < 0) + goto rtattr_failure; + + if (gnet_stats_copy_basic(&dump, &mystruct->bstats) < 0 || + gnet_stats_copy_queue(&dump, &mystruct->qstats) < 0 || + gnet_stats_copy_app(&dump, &xstats, sizeof(xstats)) < 0) + goto rtattr_failure; + + if (gnet_stats_finish_copy(&dump) < 0) + goto rtattr_failure; + ... +} + +TCA_STATS/TCA_XSTATS backward compatibility: +-------------------------------------------- + +Prior users of struct tc_stats and xstats can maintain backward +compatibility by calling the compat wrappers to keep providing the +existing TLV types. + +my_dumping_routine(struct sk_buff *skb, ...) +{ + if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, + TCA_XSTATS, &mystruct->lock, &dump) < 0) + goto rtattr_failure; + ... +} + +A struct tc_stats will be filled out during gnet_stats_copy_* calls +and appended to the skb. TCA_XSTATS is provided if gnet_stats_copy_app +was called. + + +Locking: +-------- + +Locks are taken before writing and released once all statistics have +been written. Locks are always released in case of an error. You +are responsible for making sure that the lock is initialized. + + +Rate Estimator: +-------------- + +0) Prepare an estimator attribute. Most likely this would be in user + space. The value of this TLV should contain a tc_estimator structure. + As usual, such a TLV nees to be 32 bit aligned and therefore the + length needs to be appropriately set etc. The estimator interval + and ewma log need to be converted to the appropriate values. + tc_estimator.c::tc_setup_estimator() is advisable to be used as the + conversion routine. It does a few clever things. It takes a time + interval in microsecs, a time constant also in microsecs and a struct + tc_estimator to be populated. The returned tc_estimator can be + transported to the kernel. Transfer such a structure in a TLV of type + TCA_RATE to your code in the kernel. + +In the kernel when setting up: +1) make sure you have basic stats and rate stats setup first. +2) make sure you have initialized stats lock that is used to setup such + stats. +3) Now initialize a new estimator: + + int ret = gen_new_estimator(my_basicstats,my_rate_est_stats, + mystats_lock, attr_with_tcestimator_struct); + + if ret == 0 + success + else + failed + +From now on, everytime you dump my_rate_est_stats it will contain +uptodate info. + +Once you are done, call gen_kill_estimator(my_basicstats, +my_rate_est_stats) Make sure that my_basicstats and my_rate_est_stats +are still valid (i.e still exist) at the time of making this call. + + +Authors: +-------- +Thomas Graf +Jamal Hadi Salim From tgraf@suug.ch Sun Oct 3 14:46:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:46:57 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LkrlO027009 for ; Sun, 3 Oct 2004 14:46:53 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 4231F8B; Sun, 3 Oct 2004 23:46:18 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id CD03B1C0E8; Sun, 3 Oct 2004 23:47:00 +0200 (CEST) Date: Sun, 3 Oct 2004 23:47:00 +0200 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 0/3] NET: Generic network statistics/estimator Message-ID: <20041003214700.GK14344@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041003213124.GG14344@postel.suug.ch> X-archive-position: 9841 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 310 Lines: 8 > The following patchset introduces generic network statistics for netlink > users. Forgot to mention that Jamal was heavily involved in this work and is the actual initiator of this idea. See previous discussion in: * RFC/PATCH capture qdisc requeue event in stats * [PATCH 2.6] generic network statistics From davem@davemloft.net Sun Oct 3 14:52:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:52:58 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LqrkS027403 for ; Sun, 3 Oct 2004 14:52:53 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEEFN-0003IC-00; Sun, 03 Oct 2004 14:50:25 -0700 Date: Sun, 3 Oct 2004 14:50:24 -0700 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com, ak@suse.de, jheffner@psc.edu Subject: Re: Current 2.6.x TSO state Message-Id: <20041003145024.158b4382.davem@davemloft.net> In-Reply-To: <20041001130609.GA6979@gondor.apana.org.au> References: <20040930213221.06a3f5b3.davem@davemloft.net> <20041001130609.GA6979@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9842 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 337 Lines: 11 On Fri, 1 Oct 2004 23:06:09 +1000 Herbert Xu wrote: > On Thu, Sep 30, 2004 at 09:32:21PM -0700, David S. Miller wrote: > > > > diff4) Obey MSS in tso handling, shrink tcp_skb_cb > > This looks great. But can we please rename tcp_skb_psize to > tcp_skb_mss? Sure, no problem, I've done that in my tree. From davem@davemloft.net Sun Oct 3 14:54:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:54:34 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LsTgD027724 for ; Sun, 3 Oct 2004 14:54:29 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEEGw-0003Ig-00; Sun, 03 Oct 2004 14:52:02 -0700 Date: Sun, 3 Oct 2004 14:52:02 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (1/3) tcp - choose congestion algorithm at initialization Message-Id: <20041003145202.6fe994fb.davem@davemloft.net> In-Reply-To: <20041001155554.51763dc0@zqx3.pdx.osdl.net> References: <20040927111834.48c7baab@zqx3.pdx.osdl.net> <20040927121610.68f942a4.davem@redhat.com> <20041001155554.51763dc0@zqx3.pdx.osdl.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9843 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 274 Lines: 9 On Fri, 1 Oct 2004 15:55:54 -0700 Stephen Hemminger wrote: > Here is the 2.4 version of the change to store congest algorithm > per socket. > > Signed-off-by: Stephen Hemminger Applied, thanks for following up on this Stephen. From davem@davemloft.net Sun Oct 3 14:55:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:55:53 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93Ltm7P028060 for ; Sun, 3 Oct 2004 14:55:49 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEEIH-0003J4-00; Sun, 03 Oct 2004 14:53:25 -0700 Date: Sun, 3 Oct 2004 14:53:25 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: Davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] (2/3) tcp diag info for 2.4 Message-Id: <20041003145325.14540736.davem@davemloft.net> In-Reply-To: <20041001155620.2f11f9f0@zqx3.pdx.osdl.net> References: <20041001155620.2f11f9f0@zqx3.pdx.osdl.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9844 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 274 Lines: 9 On Fri, 1 Oct 2004 15:56:20 -0700 Stephen Hemminger wrote: > This adds vegas style bandwidth info to 2.4. > Also: makes 2.6 and 2.4 version of tcp_diag.h identical. > > Signed-off-by: Stephen Hemminger Applied, thanks Stephen. From davem@davemloft.net Sun Oct 3 14:58:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:58:30 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93LwPVT028395 for ; Sun, 3 Oct 2004 14:58:25 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEEKe-0003Ja-00; Sun, 03 Oct 2004 14:55:52 -0700 Date: Sun, 3 Oct 2004 14:55:52 -0700 From: "David S. Miller" To: Herbert Xu Cc: laforge@gnumonks.org, netdev@oss.sgi.com Subject: Re: [6/6]: jenkins hash for neigh Message-Id: <20041003145552.0b1cc0d8.davem@davemloft.net> In-Reply-To: <20041002075051.GA18037@gondor.apana.org.au> References: <20040925005623.2faf8faf.davem@davemloft.net> <20040927111520.4f495b17.davem@davemloft.net> <20041002075051.GA18037@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9845 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 982 Lines: 28 On Sat, 2 Oct 2004 17:50:51 +1000 Herbert Xu wrote: > On Mon, Sep 27, 2004 at 11:15:20AM -0700, David S. Miller wrote: > > On Mon, 27 Sep 2004 21:48:33 +1000 > > Herbert Xu wrote: > > > > > > - if (tbl->entries > (tbl->hash_mask + 1)) > > > > + if (tbl->entries > (tbl->hash_mask + 1)) { > > > > + write_lock_bh(&tbl->lock); > > > > neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); > > > > + write_unlock_bh(&tbl->lock); > > > > + } > > > > > > The locking should be outside the if block as otherwise you may grow > > > unnecessarily or grow into the same size :) > > > > I'm not going to do that, because then we're grabbing that lock > > twice on every neigh create operation and I was trying hard > > to avoid that overhead. > > Actually, why don't we just move the expansion into the locked section? > > Signed-off-by: Herbert Xu Works for me, patch applied. Thanks Herbert. From davem@davemloft.net Sun Oct 3 14:59:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 14:59:56 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93Lxp8q028720 for ; Sun, 3 Oct 2004 14:59:51 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEEMB-0003Ju-00; Sun, 03 Oct 2004 14:57:27 -0700 Date: Sun, 3 Oct 2004 14:57:27 -0700 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6] [IPV6] SIT: dst leakage in error path. Message-Id: <20041003145727.5a58d236.davem@davemloft.net> In-Reply-To: <20041002.193424.76694251.yoshfuji@linux-ipv6.org> References: <20041002.193138.94763422.yoshfuji@linux-ipv6.org> <20041002.193424.76694251.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i93Lxp8q028720 X-archive-position: 9846 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 477 Lines: 13 On Sat, 02 Oct 2004 19:34:24 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > In article <20041002.193138.94763422.yoshfuji@linux-ipv6.org> (at Sat, 02 Oct 2004 19:31:38 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > > > We failed to put rt in error path. > > > > Signed-off-by: Hideaki YOSHIFUJI > > And this also applies 2.4 (with some fuzz). Applied to both trees, thanks. From davem@davemloft.net Sun Oct 3 15:01:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 15:01:37 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93M1Wjs029068 for ; Sun, 3 Oct 2004 15:01:32 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEENp-0003KA-00; Sun, 03 Oct 2004 14:59:09 -0700 Date: Sun, 3 Oct 2004 14:59:09 -0700 From: "David S. Miller" To: Olaf Hering Cc: ak@suse.de, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] allow CONFIG_NET=n on ppc64 Message-Id: <20041003145909.6dc704dc.davem@davemloft.net> In-Reply-To: <20041002153053.GA2643@suse.de> References: <20040929200158.GA16366@suse.de> <20040929201524.GA14615@wotan.suse.de> <20041002153053.GA2643@suse.de> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9847 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 176 Lines: 6 Olaf, as I requested of you last time, please use attachments for your patches since I can never apply them cleanly when you inline them to the main body text. Thanks a lot. From davem@redhat.com Sun Oct 3 15:03:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 15:03:30 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93M3Opn029397 for ; Sun, 3 Oct 2004 15:03:25 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i93M32OQ030070; Sun, 3 Oct 2004 18:03:02 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i93M32r15406; Sun, 3 Oct 2004 18:03:02 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i93M2j0b009929; Sun, 3 Oct 2004 18:02:45 -0400 Date: Sun, 3 Oct 2004 15:00:52 -0700 From: "David S. Miller" To: Manfred Spraul Cc: netdev@oss.sgi.com Subject: Re: [PATCH] fix secure tcp sequence number generation Message-Id: <20041003150052.4dba0c60.davem@redhat.com> In-Reply-To: <415EEF0E.3080808@colorfullife.com> References: <415EEF0E.3080808@colorfullife.com> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9848 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 438 Lines: 10 On Sat, 02 Oct 2004 20:10:22 +0200 Manfred Spraul wrote: > Ted's recent random.c update broke the periodic rekeying: > schedule_work() doesn't provide synchronization. Additionally the first > syn values after boot are generated with secret 0 - not good. Are you referring to his changes done back in August or some other change? August is the last time I see that Ted made a change to drivers/char/random.c From davem@redhat.com Sun Oct 3 15:05:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 15:05:13 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93M56Ku029745 for ; Sun, 3 Oct 2004 15:05:06 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i93M4do3030240; Sun, 3 Oct 2004 18:04:50 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i93M4dr15620; Sun, 3 Oct 2004 18:04:39 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i93M4MSG010080; Sun, 3 Oct 2004 18:04:23 -0400 Date: Sun, 3 Oct 2004 15:02:29 -0700 From: "David S. Miller" To: Francois Romieu Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6.9-rc3] dev_close: use of netif_poll_disable Message-Id: <20041003150229.0eb4fa67.davem@redhat.com> In-Reply-To: <20041002202805.GA16870@electric-eye.fr.zoreil.com> References: <20041002202805.GA16870@electric-eye.fr.zoreil.com> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9849 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 388 Lines: 12 On Sat, 2 Oct 2004 22:28:05 +0200 Francois Romieu wrote: > Use of identical (comment included) netif_poll_disable(). > > Signed-off-by: Francois Romieu It's not identical. netif_poll_disable() actually sets the __LINK_STATE_RX_SCHED bit when it finally sees it clear. Whereas this code in net/core/dev.c is just waiting for it to clear. From tgraf@suug.ch Sun Oct 3 15:14:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 15:14:48 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93MEhVI030161 for ; Sun, 3 Oct 2004 15:14:44 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 10F378B; Mon, 4 Oct 2004 00:14:08 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id 328211C0E8; Mon, 4 Oct 2004 00:14:52 +0200 (CEST) Date: Mon, 4 Oct 2004 00:14:52 +0200 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] PKT_SCHED: Remove useless line in cbq_dump_class Message-ID: <20041003221452.GL14344@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-archive-position: 9851 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 608 Lines: 15 Remove useless line in cbq_dump_class probably introduced by copy&paste from cbq_dump. Signed-off-by: Thomas Graf --- linux-2.6.9-rc3-bk3.orig/net/sched/sch_cbq.c 2004-10-04 00:03:47.000000000 +0200 +++ linux-2.6.9-rc3-bk3/net/sched/sch_cbq.c 2004-10-04 00:07:32.000000000 +0200 @@ -1675,7 +1675,6 @@ cl->xstats.undertime = 0; if (!PSCHED_IS_PASTPERFECT(cl->undertime)) cl->xstats.undertime = PSCHED_TDIFF(cl->undertime, q->now); - q->link.xstats.avgidle = q->link.avgidle; if (cbq_copy_xstats(skb, &cl->xstats)) { spin_unlock_bh(&sch->dev->queue_lock); goto rtattr_failure; From davem@davemloft.net Sun Oct 3 15:14:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 15:14:46 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93MEeLY030156 for ; Sun, 3 Oct 2004 15:14:41 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEEaW-0003Lt-00; Sun, 03 Oct 2004 15:12:16 -0700 Date: Sun, 3 Oct 2004 15:12:16 -0700 From: "David S. Miller" To: hadi@cyberus.ca Cc: netdev@oss.sgi.com Subject: Re: Resend WAS(Re: cls patchlet Message-Id: <20041003151216.5a56531f.davem@davemloft.net> In-Reply-To: <1096834352.1046.349.camel@jzny.localdomain> References: <1096833127.1048.333.camel@jzny.localdomain> <1096834352.1046.349.camel@jzny.localdomain> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9850 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 3208 Lines: 83 On 03 Oct 2004 16:12:32 -0400 jamal wrote: > Ignore previous. This is better formated ;-> Any particular reason not to remove this work into the common code in tcf_action_exec()? Like so: ===== include/net/pkt_sched.h 1.23 vs edited ===== --- 1.23/include/net/pkt_sched.h 2004-09-28 13:58:51 -07:00 +++ edited/include/net/pkt_sched.h 2004-10-03 14:50:35 -07:00 @@ -376,7 +376,7 @@ struct tc_action_ops extern int tcf_register_action(struct tc_action_ops *a); extern int tcf_unregister_action(struct tc_action_ops *a); extern void tcf_action_destroy(struct tc_action *a, int bind); -extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a); +extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res); extern int tcf_action_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,char *n, int ovr, int bind); extern int tcf_action_init_1(struct rtattr *rta, struct rtattr *est, struct tc_action *a,char *n, int ovr, int bind); extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); ===== net/sched/act_api.c 1.4 vs edited ===== --- 1.4/net/sched/act_api.c 2004-06-29 14:20:44 -07:00 +++ edited/net/sched/act_api.c 2004-10-03 14:51:41 -07:00 @@ -155,7 +155,7 @@ struct tc_action_ops *tc_lookup_action_i return a; } -int tcf_action_exec(struct sk_buff *skb,struct tc_action *act) +int tcf_action_exec(struct sk_buff *skb,struct tc_action *act, struct tcf_result *res) { struct tc_action *a; @@ -164,7 +164,8 @@ int tcf_action_exec(struct sk_buff *skb, if (skb->tc_verd & TC_NCLS) { skb->tc_verd = CLR_TC_NCLS(skb->tc_verd); D2PRINTK("(%p)tcf_action_exec: cleared TC_NCLS in %s out %s\n",skb,skb->input_dev?skb->input_dev->name:"xxx",skb->dev->name); - return TC_ACT_OK; + ret = TC_ACT_OK; + goto exec_done; } while ((a = act) != NULL) { repeat: @@ -186,6 +187,11 @@ repeat: } exec_done: + if (skb->tc_classid > 0) { + res->classid = skb->tc_classid; + res->class = 0; + skb->tc_classid = 0; + } return ret; } ===== net/sched/cls_fw.c 1.8 vs edited ===== --- 1.8/net/sched/cls_fw.c 2004-07-06 14:26:23 -07:00 +++ edited/net/sched/cls_fw.c 2004-10-03 14:52:05 -07:00 @@ -102,7 +102,7 @@ static int fw_classify(struct sk_buff *s } #endif if (f->action) { - int pol_res = tcf_action_exec(skb, f->action); + int pol_res = tcf_action_exec(skb, f->action, res); if (pol_res >= 0) return pol_res; } else ===== net/sched/cls_u32.c 1.16 vs edited ===== --- 1.16/net/sched/cls_u32.c 2004-07-29 15:44:49 -07:00 +++ edited/net/sched/cls_u32.c 2004-10-03 14:52:00 -07:00 @@ -175,12 +175,7 @@ check_terminal: #endif #ifdef CONFIG_NET_CLS_ACT if (n->action) { - int pol_res = tcf_action_exec(skb, n->action); - if (skb->tc_classid > 0) { - res->classid = skb->tc_classid; - skb->tc_classid = 0; - } - + int pol_res = tcf_action_exec(skb, n->action, res); if (pol_res >= 0) return pol_res; } else From hadi@cyberus.ca Sun Oct 3 15:22:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 15:23:02 -0700 (PDT) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93MMtRv030869 for ; Sun, 3 Oct 2004 15:22:58 -0700 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.20) id 1CEEkc-0004D7-Mb for netdev@oss.sgi.com; Sun, 03 Oct 2004 18:22:42 -0400 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CEEka-0005j2-7l; Sun, 03 Oct 2004 18:22:40 -0400 Subject: Re: Resend WAS(Re: cls patchlet From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: netdev@oss.sgi.com In-Reply-To: <20041003151216.5a56531f.davem@davemloft.net> References: <1096833127.1048.333.camel@jzny.localdomain> <1096834352.1046.349.camel@jzny.localdomain> <20041003151216.5a56531f.davem@davemloft.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1096842156.1047.357.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Oct 2004 18:22:37 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 9852 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 391 Lines: 16 On Sun, 2004-10-03 at 18:12, David S. Miller wrote: > On 03 Oct 2004 16:12:32 -0400 > jamal wrote: > > > Ignore previous. This is better formated ;-> > > Any particular reason not to remove this work into the > common code in tcf_action_exec()? Like so: Looks good ;-> Go ahead and push that instead and i will run my regression tests on your changes. cheers, jamal From davem@davemloft.net Sun Oct 3 15:25:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 15:25:11 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93MP6rY031210 for ; Sun, 3 Oct 2004 15:25:06 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEEkd-0003N9-00; Sun, 03 Oct 2004 15:22:43 -0700 Date: Sun, 3 Oct 2004 15:22:43 -0700 From: "David S. Miller" To: hadi@cyberus.ca Cc: netdev@oss.sgi.com Subject: Re: Resend WAS(Re: cls patchlet Message-Id: <20041003152243.0fc2a93d.davem@davemloft.net> In-Reply-To: <1096842156.1047.357.camel@jzny.localdomain> References: <1096833127.1048.333.camel@jzny.localdomain> <1096834352.1046.349.camel@jzny.localdomain> <20041003151216.5a56531f.davem@davemloft.net> <1096842156.1047.357.camel@jzny.localdomain> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9853 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 500 Lines: 17 On 03 Oct 2004 18:22:37 -0400 jamal wrote: > > On Sun, 2004-10-03 at 18:12, David S. Miller wrote: > > On 03 Oct 2004 16:12:32 -0400 > > jamal wrote: > > > > > Ignore previous. This is better formated ;-> > > > > Any particular reason not to remove this work into the > > common code in tcf_action_exec()? Like so: > > Looks good ;-> Go ahead and push that instead and i will run my > regression tests on your changes. Great, thanks for the quick feedback. From davem@davemloft.net Sun Oct 3 15:25:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 15:25:56 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93MPpxR031498 for ; Sun, 3 Oct 2004 15:25:51 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEElH-0003NN-00; Sun, 03 Oct 2004 15:23:23 -0700 Date: Sun, 3 Oct 2004 15:23:23 -0700 From: "David S. Miller" To: Thomas Graf Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: Re: [PATCH 0/3] NET: Generic network statistics/estimator Message-Id: <20041003152323.6de24673.davem@davemloft.net> In-Reply-To: <20041003214700.GK14344@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> <20041003214700.GK14344@postel.suug.ch> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9854 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 462 Lines: 13 On Sun, 3 Oct 2004 23:47:00 +0200 Thomas Graf wrote: > > The following patchset introduces generic network statistics for netlink > > users. > > Forgot to mention that Jamal was heavily involved in this work and > is the actual initiator of this idea. See previous discussion > in: > * RFC/PATCH capture qdisc requeue event in stats > * [PATCH 2.6] generic network statistics Jamal give me a quick public ACK on this work by Thomas then :-) From davem@davemloft.net Sun Oct 3 15:31:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 15:31:56 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93MVqBM031896 for ; Sun, 3 Oct 2004 15:31:52 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEEr6-0003Nq-00; Sun, 03 Oct 2004 15:29:24 -0700 Date: Sun, 3 Oct 2004 15:29:24 -0700 From: "David S. Miller" To: Patrick McHardy Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6 0/7]: assorted fixes Message-Id: <20041003152924.27f97e27.davem@davemloft.net> In-Reply-To: <41606B47.9040703@trash.net> References: <41606B47.9040703@trash.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9855 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 286 Lines: 8 On Sun, 03 Oct 2004 23:12:39 +0200 Patrick McHardy wrote: > following are 6 assorted fixes and one small cleanup patch. > You can pull all patches from bk://212.42.230.204/net-2.6 > I'll send 2.4 versions later. All looks great, so I pulled in your changes, thanks. From hadi@cyberus.ca Sun Oct 3 15:34:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 15:34:51 -0700 (PDT) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93MYlEe032239 for ; Sun, 3 Oct 2004 15:34:47 -0700 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.20) id 1CEEw6-0002RD-8p for netdev@oss.sgi.com; Sun, 03 Oct 2004 18:34:34 -0400 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CEEw3-0006qB-3R; Sun, 03 Oct 2004 18:34:31 -0400 Subject: Re: [PATCH 0/3] NET: Generic network statistics/estimator From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: Thomas Graf , netdev@oss.sgi.com In-Reply-To: <20041003152323.6de24673.davem@davemloft.net> References: <20041003213124.GG14344@postel.suug.ch> <20041003214700.GK14344@postel.suug.ch> <20041003152323.6de24673.davem@davemloft.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1096842865.1046.363.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Oct 2004 18:34:25 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 9856 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 221 Lines: 10 On Sun, 2004-10-03 at 18:23, David S. Miller wrote: > Jamal give me a quick public ACK on this work by Thomas then :-) Done well. We may end up finding issues in the future - cant see any at the moment. cheers, jamal From davem@davemloft.net Sun Oct 3 16:17:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 16:17:09 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93NH4LW000559 for ; Sun, 3 Oct 2004 16:17:05 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEFYq-0003RD-00; Sun, 03 Oct 2004 16:14:36 -0700 Date: Sun, 3 Oct 2004 16:14:36 -0700 From: "David S. Miller" To: Thomas Graf Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2/3] NET: Generic rate estimator Message-Id: <20041003161436.50293f9a.davem@davemloft.net> In-Reply-To: <20041003213954.GI14344@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> <20041003213954.GI14344@postel.suug.ch> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9857 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 902 Lines: 30 On Sun, 3 Oct 2004 23:39:54 +0200 Thomas Graf wrote: > Introduces a generic rate estimator based on timers. Patch is based on > Jamal's patch and adapted to the new generic network statistics API. First, how does this new thing ever get built into the tree? Second: > +#if (HZ%4) != 0 > +#error Bad HZ value. > +#endif This is going to fail to compile on a few platforms, namely m68knommu and v850 which have configurations that result in using a HZ value of 50 and 122 respectively. Otherwise I mostly like all of the new generic stats stuff, although I do have one question: +int +gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, + int xstats_type, spinlock_t *lock, struct gnet_dump *d) +{ ... + return gnet_stats_copy(d, type, NULL, 0); What is this dummy zero-sized RTA_PUT() being done for (via the gnet_stats_copy() call with size==0 arg)? From tgraf@suug.ch Sun Oct 3 16:36:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 16:36:47 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93NafBI004259 for ; Sun, 3 Oct 2004 16:36:42 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id BD41D8B; Mon, 4 Oct 2004 01:36:05 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id 608DD1C0E8; Mon, 4 Oct 2004 01:36:47 +0200 (CEST) Date: Mon, 4 Oct 2004 01:36:47 +0200 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2/3] NET: Generic rate estimator Message-ID: <20041003233647.GN14344@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> <20041003213954.GI14344@postel.suug.ch> <20041003161436.50293f9a.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041003161436.50293f9a.davem@davemloft.net> X-archive-position: 9858 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1787 Lines: 47 * David S. Miller <20041003161436.50293f9a.davem@davemloft.net> 2004-10-03 16:14 > On Sun, 3 Oct 2004 23:39:54 +0200 > Thomas Graf wrote: > > > Introduces a generic rate estimator based on timers. Patch is based on > > Jamal's patch and adapted to the new generic network statistics API. > > First, how does this new thing ever get built into the tree? Once we converted all Qdiscs to use the new splitted up stats structs we can replace all calls to qdisc_new_estimator with gen_new_estimator. I already have a patch in my tree which does this but I want to test it a little longer before submitting it. It also involves a change to struct Qdisc and Qdisc_ops which means that we break all qdiscs not in the tree. Is this acceptable? Benefit would be: No compatibility mess anymore when introducing new stats for both, all qdiscs or just a single one. > > +#if (HZ%4) != 0 > > +#error Bad HZ value. > > +#endif > > This is going to fail to compile on a few platforms, namely m68knommu > and v850 which have configurations that result in using a HZ value > of 50 and 122 respectively. This was taken over from net/sched/estimator.c so I guess there was no person ever using the rate estimator on such an arch ;) Can we simply remove the check? > +int > +gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, > + int xstats_type, spinlock_t *lock, struct gnet_dump *d) > +{ > ... > + return gnet_stats_copy(d, type, NULL, 0); > > What is this dummy zero-sized RTA_PUT() being done for > (via the gnet_stats_copy() call with size==0 arg)? It allocates space for the TLV header in the skb, will result in an empty header. Nested TLVs are appened to it and the header is filled out afterwards once the size of all nested TLVs are known. From kaber@trash.net Sun Oct 3 16:39:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 16:39:06 -0700 (PDT) Received: from gw.localnet ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93Nd11i004596 for ; Sun, 3 Oct 2004 16:39:01 -0700 Received: from [172.16.1.123] (helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1CEG2U-000424-00; Mon, 04 Oct 2004 01:45:14 +0200 Message-ID: <41608D62.4030200@trash.net> Date: Mon, 04 Oct 2004 01:38:10 +0200 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: Re: [PATCH 2.6 0/7]: assorted fixes References: <41606B47.9040703@trash.net> <20041003152924.27f97e27.davem@davemloft.net> In-Reply-To: <20041003152924.27f97e27.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 9859 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 394 Lines: 18 David S. Miller wrote: >On Sun, 03 Oct 2004 23:12:39 +0200 >Patrick McHardy wrote: > > >>following are 6 assorted fixes and one small cleanup patch. >>You can pull all patches from bk://212.42.230.204/net-2.6 >>I'll send 2.4 versions later. >> > >All looks great, so I pulled in your changes, thanks. > Thanks. All bugs were only in 2.6, so no 2.4 patches. Regards Patrick From tgraf@suug.ch Sun Oct 3 16:57:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 16:57:35 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i93NvUFF005252 for ; Sun, 3 Oct 2004 16:57:30 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 621848B; Mon, 4 Oct 2004 01:56:55 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id D99141C0E8; Mon, 4 Oct 2004 01:57:37 +0200 (CEST) Date: Mon, 4 Oct 2004 01:57:37 +0200 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2/3] NET: Generic rate estimator Message-ID: <20041003235737.GO14344@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> <20041003213954.GI14344@postel.suug.ch> <20041003161436.50293f9a.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041003161436.50293f9a.davem@davemloft.net> X-archive-position: 9860 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 658 Lines: 17 * David S. Miller <20041003161436.50293f9a.davem@davemloft.net> 2004-10-03 16:14 > First, how does this new thing ever get built into the tree? I misunderstood you before and didn't realize I missed to diff the Makefile part. Sorry about that. --- linux-2.6.9-rc3.orig/net/core/Makefile 2004-10-04 01:55:37.000000000 +0200 +++ linux-2.6.9-rc3/net/core/Makefile 2004-09-30 21:30:42.000000000 +0200 @@ -2,7 +2,7 @@ # Makefile for the Linux networking core. # -obj-y := sock.o skbuff.o iovec.o datagram.o stream.o scm.o +obj-y := sock.o skbuff.o iovec.o datagram.o stream.o scm.o gen_stats.o gen_estimator.o obj-$(CONFIG_SYSCTL) += sysctl_net_core.o From hadi@cyberus.ca Sun Oct 3 18:16:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 18:16:55 -0700 (PDT) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i941GgpG006886 for ; Sun, 3 Oct 2004 18:16:43 -0700 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CEHSn-00060P-Rd for netdev@oss.sgi.com; Sun, 03 Oct 2004 21:16:29 -0400 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CEHSk-0004Ny-SB; Sun, 03 Oct 2004 21:16:27 -0400 Subject: Re: [PATCH 2/3] NET: Generic rate estimator From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20041003233647.GN14344@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> <20041003213954.GI14344@postel.suug.ch> <20041003161436.50293f9a.davem@davemloft.net> <20041003233647.GN14344@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1096852582.1046.378.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Oct 2004 21:16:22 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 9861 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 751 Lines: 24 On Sun, 2004-10-03 at 19:36, Thomas Graf wrote: > * David S. Miller <20041003161436.50293f9a.davem@davemloft.net> 2004-10-03 16:14 > > > +#if (HZ%4) != 0 > > > +#error Bad HZ value. > > > +#endif > > > > This is going to fail to compile on a few platforms, namely m68knommu > > and v850 which have configurations that result in using a HZ value > > of 50 and 122 respectively. > > This was taken over from net/sched/estimator.c so I guess there was no > person ever using the rate estimator on such an arch ;) > > Can we simply remove the check? The granularity of the timing is dependent on this - 250msec increments. Find a common demonitor for all Hz values which results in something along 200ms range and we should be set. cheers, jamal From acme@conectiva.com.br Sun Oct 3 19:06:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 19:06:29 -0700 (PDT) Received: from perninha.conectiva.com.br (perninha.conectiva.com.br [200.140.247.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i9426JIo008038 for ; Sun, 3 Oct 2004 19:06:21 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 5CE6147573; Sun, 3 Oct 2004 23:06:01 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id D090D47309 for ; Sun, 3 Oct 2004 23:06:00 -0300 (BRT) Received: (qmail 24750 invoked by uid 0); 4 Oct 2004 03:02:59 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 4 Oct 2004 03:02:59 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id D7CDD14639; Sun, 3 Oct 2004 23:09:03 -0300 (BRT) Message-ID: <4160B06C.6020105@conectiva.com.br> Date: Sun, 03 Oct 2004 23:07:40 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: PATCH: [SKBUFF] introduce x25_type_trans X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------040908060501010702090001" X-Bogosity: No, tests=bogofilter, spamicity=0.448589, version=0.16.3 X-archive-position: 9862 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 10010 Lines: 325 This is a multi-part message in MIME format. --------------040908060501010702090001 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Now there are six outstanding changesets in this tree. Regards, - Arnaldo --------------040908060501010702090001 Content-Type: text/plain; name="x25_type_trans.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x25_type_trans.patch" You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.2035, 2004-10-03 23:01:56-03:00, acme@conectiva.com.br [SKBUFF] introduce x25_type_trans Signed-off-by: Arnaldo Carvalho de Melo Signet-off-by: David S. Miller drivers/isdn/i4l/isdn_x25iface.c | 16 ++++------------ drivers/net/wan/cycx_x25.c | 8 +++----- drivers/net/wan/hdlc_x25.c | 14 ++++---------- drivers/net/wan/lapbether.c | 20 +++++--------------- drivers/net/wan/x25_asy.c | 18 +++++------------- include/net/x25device.h | 17 +++++++++++++++++ 6 files changed, 38 insertions(+), 55 deletions(-) diff -Nru a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c --- a/drivers/isdn/i4l/isdn_x25iface.c 2004-10-03 23:02:38 -03:00 +++ b/drivers/isdn/i4l/isdn_x25iface.c 2004-10-03 23:02:38 -03:00 @@ -21,6 +21,7 @@ #include #include #include +#include #include "isdn_x25iface.h" /* for debugging messages not to cause an oops when device pointer is NULL*/ @@ -191,12 +192,9 @@ IX25DEBUG( "isdn_x25iface_receive %s \n", MY_DEVNAME(cprot->net_dev) ); if ( ( (ix25_pdata_t*) (cprot->proto_data) ) -> state == WAN_CONNECTED ){ - skb -> dev = cprot -> net_dev; - skb -> protocol = htons(ETH_P_X25); - skb -> pkt_type = PACKET_HOST; if( skb_push(skb, 1)){ skb -> data[0]=0x00; - skb -> mac.raw = skb -> data; + skb->protocol = x25_type_trans(skb, cprot->net_dev); netif_rx(skb); return 0; } @@ -224,10 +222,7 @@ *state_p = WAN_CONNECTED; if( skb ){ *( skb_put(skb, 1) ) = 0x01; - skb -> mac.raw = skb -> data; - skb -> dev = cprot -> net_dev; - skb -> protocol = htons(ETH_P_X25); - skb -> pkt_type = PACKET_HOST; + skb->protocol = x25_type_trans(skb, cprot->net_dev); netif_rx(skb); return 0; } else { @@ -256,10 +251,7 @@ skb = dev_alloc_skb(1); if( skb ){ *( skb_put(skb, 1) ) = 0x02; - skb -> mac.raw = skb -> data; - skb -> dev = cprot -> net_dev; - skb -> protocol = htons(ETH_P_X25); - skb -> pkt_type = PACKET_HOST; + skb->protocol = x25_type_trans(skb, cprot->net_dev); netif_rx(skb); return 0; } else { diff -Nru a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c --- a/drivers/net/wan/cycx_x25.c 2004-10-03 23:02:38 -03:00 +++ b/drivers/net/wan/cycx_x25.c 2004-10-03 23:02:38 -03:00 @@ -92,6 +92,8 @@ #include /* Cyclom 2X common user API definitions */ #include /* X.25 firmware API definitions */ +#include + /* Defines & Macros */ #define CYCX_X25_MAX_CMD_RETRY 5 #define CYCX_X25_CHAN_MTU 2048 /* unfragmented logical channel MTU */ @@ -1486,11 +1488,7 @@ ptr = skb_put(skb, 1); *ptr = event; - skb->dev = dev; - skb->protocol = htons(ETH_P_X25); - skb->mac.raw = skb->data; - skb->pkt_type = PACKET_HOST; - + skb->protocol = x25_type_trans(skb, dev); netif_rx(skb); dev->last_rx = jiffies; /* timestamp */ } diff -Nru a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c --- a/drivers/net/wan/hdlc_x25.c 2004-10-03 23:02:38 -03:00 +++ b/drivers/net/wan/hdlc_x25.c 2004-10-03 23:02:38 -03:00 @@ -23,6 +23,8 @@ #include #include +#include + /* These functions are callbacks called by LAPB layer */ static void x25_connect_disconnect(struct net_device *dev, int reason, int code) @@ -38,11 +40,7 @@ ptr = skb_put(skb, 1); *ptr = code; - skb->dev = dev; - skb->protocol = htons(ETH_P_X25); - skb->mac.raw = skb->data; - skb->pkt_type = PACKET_HOST; - + skb->protocol = x25_type_trans(skb, dev); netif_rx(skb); } @@ -74,11 +72,7 @@ ptr = skb->data; *ptr = 0; - skb->dev = dev; - skb->protocol = htons(ETH_P_X25); - skb->mac.raw = skb->data; - skb->pkt_type = PACKET_HOST; - + skb->protocol = x25_type_trans(skb, dev); return netif_rx(skb); } diff -Nru a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c --- a/drivers/net/wan/lapbether.c 2004-10-03 23:02:38 -03:00 +++ b/drivers/net/wan/lapbether.c 2004-10-03 23:02:38 -03:00 @@ -43,6 +43,8 @@ #include #include +#include + static char bcast_addr[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; /* If this number is made larger, check that the temporary string buffer @@ -137,11 +139,7 @@ ptr = skb->data; *ptr = 0x00; - skb->dev = dev; - skb->protocol = htons(ETH_P_X25); - skb->mac.raw = skb->data; - skb->pkt_type = PACKET_HOST; - + skb->protocol = x25_type_trans(skb, dev); skb->dev->last_rx = jiffies; return netif_rx(skb); } @@ -233,11 +231,7 @@ ptr = skb_put(skb, 1); *ptr = 0x01; - skb->dev = dev; - skb->protocol = htons(ETH_P_X25); - skb->mac.raw = skb->data; - skb->pkt_type = PACKET_HOST; - + skb->protocol = x25_type_trans(skb, dev); skb->dev->last_rx = jiffies; netif_rx(skb); } @@ -255,11 +249,7 @@ ptr = skb_put(skb, 1); *ptr = 0x02; - skb->dev = dev; - skb->protocol = htons(ETH_P_X25); - skb->mac.raw = skb->data; - skb->pkt_type = PACKET_HOST; - + skb->protocol = x25_type_trans(skb, dev); skb->dev->last_rx = jiffies; netif_rx(skb); } diff -Nru a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c --- a/drivers/net/wan/x25_asy.c 2004-10-03 23:02:38 -03:00 +++ b/drivers/net/wan/x25_asy.c 2004-10-03 23:02:38 -03:00 @@ -34,6 +34,8 @@ #include #include "x25_asy.h" +#include + static struct net_device **x25_asy_devs; static int x25_asy_maxdev = SL_NRUNIT; @@ -209,10 +211,8 @@ return; } skb_push(skb,1); /* LAPB internal control */ - skb->dev = sl->dev; memcpy(skb_put(skb,count), sl->rbuff, count); - skb->mac.raw=skb->data; - skb->protocol=htons(ETH_P_X25); + skb->protocol = x25_type_trans(skb, sl->dev); if((err=lapb_data_received(skb->dev, skb))!=LAPB_OK) { kfree_skb(skb); @@ -419,11 +419,7 @@ ptr = skb_put(skb, 1); *ptr = 0x01; - skb->dev = sl->dev; - skb->protocol = htons(ETH_P_X25); - skb->mac.raw = skb->data; - skb->pkt_type = PACKET_HOST; - + skb->protocol = x25_type_trans(skb, sl->dev); netif_rx(skb); sl->dev->last_rx = jiffies; } @@ -442,11 +438,7 @@ ptr = skb_put(skb, 1); *ptr = 0x02; - skb->dev = sl->dev; - skb->protocol = htons(ETH_P_X25); - skb->mac.raw = skb->data; - skb->pkt_type = PACKET_HOST; - + skb->protocol = x25_type_trans(skb, sl->dev); netif_rx(skb); sl->dev->last_rx = jiffies; } diff -Nru a/include/net/x25device.h b/include/net/x25device.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/net/x25device.h 2004-10-03 23:02:38 -03:00 @@ -0,0 +1,17 @@ +#ifndef _X25DEVICE_H +#define _X25DEVICE_H + +#include +#include +#include + +static inline unsigned short x25_type_trans(struct sk_buff *skb, + struct net_device *dev) +{ + skb->mac.raw = skb->data; + skb->input_dev = skb->dev = dev; + skb->pkt_type = PACKET_HOST; + + return htons(ETH_P_X25); +} +#endif =================================================================== This BitKeeper patch contains the following changesets: 1.2035 ## Wrapped with gzip_uu ## M'XL( #ZO8$$ ^596U/;.!1^1K]",[QL=S>.;KZEA:$%NC!LMPRTG=';HA:?O2FOQ[JW=7;XQ\<_7Y\AM+.#]P(Y#1;4^. M0D=80YVG.ODNTQBF**PLOW@H35!".!6$$EHYPK,%.L#48H3;F(@N)5W",>,] M0GNVTR'PA>!:^CP\^#<'=PAZ@__?E>PCA;^[>4Z',C2#-M%)]AQ*$6G=\9$G9870D02M+L" MMS"/#:>Z<1&F]:T/$,215-I2]Z $.[**,8_Q2GE,DL"/M*.%$M)>;+8YP2)9 M)-QP1, $5(B*.XRX:ZL+<'8O9=HU]I+%]9RN0#E!'#"^$W+F.U*$82C=(%JE MZT*I#Y2TA;<^IK?B$CD.=#G0^6,U.>4^ XXZ2MO*#[C-;!+*-=6=Q1G/R/3KIAO$X/@ MV 2OO9%,PUP.=9%%Y4+H!F&B#&END>/$)2ZWB5=1E[FL<@7G'@^(#'A((D>O MB=Q#L0_6['';:6UA=:VN[JMY9V#F,Y]6@& 8<1(PEVH/ M]Z6CZ4^M"\7+ Z MV"^!W83^O_0ECN)$]Y9U0A'66*!/\(N>@"AUP"?ST5Z('T=[\A317N$W<7FB M]1BBK8$$+\^UW65@G>!ZF1"3E_4XPX\@^(S)E$][N27]0?6OASA]C >$TQ=M!U'::@CW/_,[(/#3\?[A_TCM UOXE0_ M?/D5^C:3XU=)G$ZNNG'4;X+L8'=1VUBJH2X7-19#PRG3\A45I2QC!>M*S(R3 MM*AK"EP,LKR<*SI^*P?6?H2SERYNF.!U/ZE&SQOHKW&][C(=EK0F\/7V]?W+XH7_T M_OP#M**M7)>3/,6#,@,5#S\<]4\-;B]>HG_1MD[#.*K#T?) :R+2$P5]-(WS M;&\L]QKO,5IZRX"=^@S MK%>;Q#GGQ\L1W\25F8W9/2^;"P[&S0X$Q38Z%C:$EAM&YUF9J2P!1L^[&;B5 MX3Y0^,!US3"/MAMVG_#+RMS5>["?K\!1,$F'>U%AE9.1%>HOM_-]6Z\()QYA MU(6LX57"]QRWX7WKQ&UXSYXA[^M]RQ+>+\-](_9S8.?C0\;AY M0-)8A\_*M'=V;Y**\0C&7"@+85)22]E0B.W70ARVN9!%6>6N,%[?O38LU9$< MCD=[61$FYHCCR_<+F?\=#[^MJM6)!QLY#A=L[D N;PX_6I=>''?LY^=2S>YF M12JY WP39P)7695*J/!\DQ6H\/GF>6'!7KT]9UL?(*!BH$>C&&B1S[B[\O@ M-A .H[9/O8J!T&:W %&G)6=MR //DK3FQ&4%:>]!O@EKQ>H"B K2D%:T+($8 M=\Q )DC;@;97#VR"_,]YR>S@K;V/M#P)7'//L*"66GQ(2%S**>0+YL+FP15. M4T0].NM>QWGX\W.>YEQUA?/, -_$=8#=JUR'4<-@>)C<< R1<%T^%TF]E3;. J(!BK-R#,V60P^+<9+/SV@V?_#U(#K8;%9+3C!$01+R#H/VGJ1_J&&@ --------------040908060501010702090001-- From acme@conectiva.com.br Sun Oct 3 20:07:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 20:07:57 -0700 (PDT) Received: from perninha.conectiva.com.br (perninha.conectiva.com.br [200.140.247.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i9437iqQ009121 for ; Sun, 3 Oct 2004 20:07:45 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 2AC9447408; Mon, 4 Oct 2004 00:07:30 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id 927734765A for ; Mon, 4 Oct 2004 00:07:28 -0300 (BRT) Received: (qmail 30228 invoked by uid 0); 4 Oct 2004 04:04:25 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 4 Oct 2004 04:04:25 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id DEE5214639; Mon, 4 Oct 2004 00:10:32 -0300 (BRT) Message-ID: <4160BED5.6040207@conectiva.com.br> Date: Mon, 04 Oct 2004 00:09:09 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: PATCH: [SKBUFF] introduce skb_set_link_header X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------000105060809020209070501" X-Bogosity: No, tests=bogofilter, spamicity=0.499995, version=0.16.3 X-archive-position: 9863 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 45517 Lines: 1311 This is a multi-part message in MIME format. --------------000105060809020209070501 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Now there are seven outstanding changesets in this tree. Best Regards, - Arnaldo --------------000105060809020209070501 Content-Type: text/plain; name="skb_set_link_header.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="skb_set_link_header.patch" =================================================================== ChangeSet@1.2036, 2004-10-04 00:06:25-03:00, acme@conectiva.com.br [SKBUFF] introduce skb_set_link_header Abstracting setting the link layer sk_buff header, there are still some corner cases to handle, will work on those. This should make the code a bit more understandable and also removes a lot of direct accesses to skb->data. In the process found several places where foo_type_trans functions can be introduced, next patches will do that (AX.25, for instance). Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller arch/um/drivers/net_kern.c | 2 +- drivers/ieee1394/eth1394.c | 2 +- drivers/isdn/i4l/isdn_net.c | 4 ++-- drivers/isdn/i4l/isdn_ppp.c | 2 +- drivers/media/dvb/dvb-core/dvb_net.c | 2 +- drivers/message/fusion/mptlan.c | 4 ++-- drivers/net/appletalk/cops.c | 2 +- drivers/net/appletalk/ltpc.c | 2 +- drivers/net/arcnet/arc-rawmode.c | 2 +- drivers/net/arcnet/rfc1051.c | 2 +- drivers/net/arcnet/rfc1201.c | 2 +- drivers/net/bonding/bond_3ad.c | 4 ++-- drivers/net/bonding/bond_alb.c | 4 ++-- drivers/net/hamradio/6pack.c | 2 +- drivers/net/hamradio/baycom_epp.c | 2 +- drivers/net/hamradio/bpqether.c | 2 +- drivers/net/hamradio/dmascc.c | 2 +- drivers/net/hamradio/hdlcdrv.c | 2 +- drivers/net/hamradio/mkiss.c | 2 +- drivers/net/hamradio/scc.c | 2 +- drivers/net/hamradio/yam.c | 2 +- drivers/net/irda/ali-ircc.c | 2 +- drivers/net/irda/au1k_ir.c | 2 +- drivers/net/irda/donauboe.c | 2 +- drivers/net/irda/irda-usb.c | 2 +- drivers/net/irda/nsc-ircc.c | 2 +- drivers/net/irda/sa1100_ir.c | 2 +- drivers/net/irda/smsc-ircc2.c | 2 +- drivers/net/irda/stir4200.c | 2 +- drivers/net/irda/via-ircc.c | 8 ++++---- drivers/net/irda/vlsi_ir.c | 2 +- drivers/net/irda/w83977af_ir.c | 2 +- drivers/net/plip.c | 2 +- drivers/net/ppp_generic.c | 2 +- drivers/net/sb1000.c | 2 +- drivers/net/slip.c | 2 +- drivers/net/tun.c | 2 +- drivers/net/wan/cosa.c | 2 +- drivers/net/wan/dlci.c | 2 +- drivers/net/wan/farsync.c | 2 +- drivers/net/wan/hostess_sv11.c | 4 ++-- drivers/net/wan/lmc/lmc_main.c | 4 ++-- drivers/net/wan/pc300_drv.c | 2 +- drivers/net/wan/pc300_tty.c | 2 +- drivers/net/wan/sdla_chdlc.c | 6 +++--- drivers/net/wan/sdla_fr.c | 6 +++--- drivers/net/wan/sdla_ppp.c | 4 ++-- drivers/net/wan/sdla_x25.c | 12 ++++++------ drivers/net/wan/sealevel.c | 2 +- drivers/net/wan/syncppp.c | 2 +- drivers/net/wan/wanpipe_multppp.c | 6 +++--- drivers/net/wireless/airo.c | 4 ++-- drivers/net/wireless/prism54/islpci_eth.c | 2 +- drivers/net/wireless/strip.c | 2 +- drivers/s390/net/ctcmain.c | 4 ++-- drivers/s390/net/netiucv.c | 4 ++-- drivers/s390/net/qeth_main.c | 6 +++--- include/linux/hdlc.h | 2 +- include/linux/skbuff.h | 5 +++++ net/802/fc.c | 2 +- net/802/fddi.c | 2 +- net/802/hippi.c | 2 +- net/802/tr.c | 2 +- net/atm/clip.c | 2 +- net/bluetooth/bnep/core.c | 2 +- net/bridge/br_device.c | 2 +- net/core/dev.c | 2 +- net/decnet/dn_route.c | 2 +- net/ethernet/eth.c | 4 ++-- net/ipv4/ip_output.c | 2 +- net/ipv4/route.c | 2 +- net/ipv6/ip6_output.c | 2 +- net/ipv6/route.c | 2 +- net/irda/irlap_frame.c | 3 ++- net/irda/wrapper.c | 2 +- net/llc/llc_output.c | 6 ++++-- net/llc/llc_sap.c | 2 +- net/wanrouter/wanmain.c | 2 +- 78 files changed, 113 insertions(+), 105 deletions(-) diff -Nru a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c --- a/arch/um/drivers/net_kern.c 2004-10-04 00:06:58 -03:00 +++ b/arch/um/drivers/net_kern.c 2004-10-04 00:06:58 -03:00 @@ -48,7 +48,7 @@ skb->dev = dev; skb_put(skb, dev->mtu); - skb->mac.raw = skb->data; + skb_set_link_header(skb); pkt_len = (*lp->read)(lp->fd, &skb, lp); if (pkt_len > 0) { diff -Nru a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c --- a/drivers/ieee1394/eth1394.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/ieee1394/eth1394.c 2004-10-04 00:06:58 -03:00 @@ -848,7 +848,7 @@ struct eth1394hdr *eth; unsigned char *rawp; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull (skb, ETH1394_HLEN); eth = eth1394_hdr(skb); diff -Nru a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c --- a/drivers/isdn/i4l/isdn_net.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/isdn/i4l/isdn_net.c 2004-10-04 00:06:58 -03:00 @@ -1367,7 +1367,7 @@ struct ethhdr *eth; unsigned char *rawp; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull(skb, ETH_HLEN); eth = eth_hdr(skb); @@ -1787,7 +1787,7 @@ } skb->dev = ndev; skb->pkt_type = PACKET_HOST; - skb->mac.raw = skb->data; + skb_set_link_header(skb); #ifdef ISDN_DEBUG_NET_DUMP isdn_dumppkt("R:", skb->data, skb->len, 40); #endif diff -Nru a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c --- a/drivers/isdn/i4l/isdn_ppp.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/isdn/i4l/isdn_ppp.c 2004-10-04 00:06:58 -03:00 @@ -1178,7 +1178,7 @@ mlp->huptimer = 0; #endif /* CONFIG_IPPP_FILTER */ skb->dev = dev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); netif_rx(skb); /* net_dev->local->stats.rx_packets++; done in isdn_net.c */ return; diff -Nru a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c --- a/drivers/media/dvb/dvb-core/dvb_net.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/media/dvb/dvb-core/dvb_net.c 2004-10-04 00:06:58 -03:00 @@ -140,7 +140,7 @@ struct ethhdr *eth; unsigned char *rawp; - skb->mac.raw=skb->data; + skb_set_link_header(skb); skb_pull(skb,dev->hard_header_len); eth = eth_hdr(skb); diff -Nru a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c --- a/drivers/message/fusion/mptlan.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/message/fusion/mptlan.c 2004-10-04 00:06:58 -03:00 @@ -773,7 +773,7 @@ /* Set the mac.raw pointer, since this apparently isn't getting * done before we get the skb. Pull the data pointer past the mac data. */ - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull(skb, 12); dma = pci_map_single(mpt_dev->pcidev, skb->data, skb->len, @@ -1564,7 +1564,7 @@ struct mpt_lan_ohdr *fch = (struct mpt_lan_ohdr *)skb->data; struct fcllc *fcllc; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull(skb, sizeof(struct mpt_lan_ohdr)); if (fch->dtype == htons(0xffff)) { diff -Nru a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c --- a/drivers/net/appletalk/cops.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/appletalk/cops.c 2004-10-04 00:06:58 -03:00 @@ -854,7 +854,7 @@ return; } - skb->mac.raw = skb->data; /* Point to entire packet. */ + skb_set_link_header(skb); /* Point to entire packet. */ skb_pull(skb,3); skb->h.raw = skb->data; /* Point to data (Skip header). */ diff -Nru a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c --- a/drivers/net/appletalk/ltpc.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/appletalk/ltpc.c 2004-10-04 00:06:58 -03:00 @@ -770,7 +770,7 @@ skb->data[0] = dnode; skb->data[1] = snode; skb->data[2] = llaptype; - skb->mac.raw = skb->data; /* save pointer to llap header */ + skb_set_link_header(skb); /* save pointer to llap header */ skb_pull(skb,3); /* copy ddp(s,e)hdr + contents */ diff -Nru a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c --- a/drivers/net/arcnet/arc-rawmode.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/arcnet/arc-rawmode.c 2004-10-04 00:06:58 -03:00 @@ -109,7 +109,7 @@ pkt = (struct archdr *) skb->data; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull(skb, ARC_HDR_SIZE); /* up to sizeof(pkt->soft) has already been copied from the card */ diff -Nru a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c --- a/drivers/net/arcnet/rfc1051.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/arcnet/rfc1051.c 2004-10-04 00:06:58 -03:00 @@ -91,7 +91,7 @@ int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; /* Pull off the arcnet header. */ - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull(skb, hdr_size); if (pkt->hard.dest == 0) diff -Nru a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c --- a/drivers/net/arcnet/rfc1201.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/arcnet/rfc1201.c 2004-10-04 00:06:58 -03:00 @@ -94,7 +94,7 @@ int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; /* Pull off the arcnet header. */ - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull(skb, hdr_size); if (pkt->hard.dest == 0) diff -Nru a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c --- a/drivers/net/bonding/bond_3ad.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/bonding/bond_3ad.c 2004-10-04 00:06:58 -03:00 @@ -917,7 +917,7 @@ } skb->dev = slave->dev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->nh.raw = skb->data + ETH_HLEN; skb->protocol = PKT_TYPE_LACPDU; skb->priority = TC_PRIO_CONTROL; @@ -961,7 +961,7 @@ skb_reserve(skb, 16); skb->dev = slave->dev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->nh.raw = skb->data + ETH_HLEN; skb->protocol = PKT_TYPE_LACPDU; diff -Nru a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/bonding/bond_alb.c 2004-10-04 00:06:58 -03:00 @@ -906,7 +906,7 @@ data = skb_put(skb, size); memcpy(data, &pkt, size); - skb->mac.raw = data; + skb_set_link_header(skb); skb->nh.raw = data + ETH_HLEN; skb->protocol = pkt.type; skb->priority = TC_PRIO_CONTROL; @@ -1284,7 +1284,7 @@ u8 *hash_start = NULL; int res = 1; - skb->mac.raw = (unsigned char *)skb->data; + skb_set_link_header(skb); eth_data = eth_hdr(skb); /* make sure that the curr_active_slave and the slaves list do diff -Nru a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c --- a/drivers/net/hamradio/6pack.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/hamradio/6pack.c 2004-10-04 00:06:58 -03:00 @@ -429,7 +429,7 @@ *ptr++ = cmd; /* KISS command */ memcpy(ptr, sp->cooked_buf + 1, count); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_AX25); netif_rx(skb); sp->dev->last_rx = jiffies; diff -Nru a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c --- a/drivers/net/hamradio/baycom_epp.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/hamradio/baycom_epp.c 2004-10-04 00:06:58 -03:00 @@ -624,7 +624,7 @@ *cp++ = 0; /* KISS kludge */ memcpy(cp, bc->hdlcrx.buf, pktlen - 1); skb->protocol = htons(ETH_P_AX25); - skb->mac.raw = skb->data; + skb_set_link_header(skb); netif_rx(skb); dev->last_rx = jiffies; bc->stats.rx_packets++; diff -Nru a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c --- a/drivers/net/hamradio/bpqether.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/hamradio/bpqether.c 2004-10-04 00:06:58 -03:00 @@ -215,7 +215,7 @@ skb->dev = dev; skb->protocol = htons(ETH_P_AX25); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->pkt_type = PACKET_HOST; netif_rx(skb); diff -Nru a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c --- a/drivers/net/hamradio/dmascc.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/hamradio/dmascc.c 2004-10-04 00:06:58 -03:00 @@ -1224,7 +1224,7 @@ memcpy(&data[1], priv->rx_buf[i], cb); skb->dev = priv->dev; skb->protocol = ntohs(ETH_P_AX25); - skb->mac.raw = skb->data; + skb_set_link_header(skb); netif_rx(skb); priv->dev->last_rx = jiffies; priv->stats.rx_packets++; diff -Nru a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c --- a/drivers/net/hamradio/hdlcdrv.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/hamradio/hdlcdrv.c 2004-10-04 00:06:58 -03:00 @@ -179,7 +179,7 @@ *cp++ = 0; /* KISS kludge */ memcpy(cp, s->hdlcrx.buffer, pkt_len - 1); skb->protocol = htons(ETH_P_AX25); - skb->mac.raw = skb->data; + skb_set_link_header(skb); netif_rx(skb); dev->last_rx = jiffies; s->stats.rx_packets++; diff -Nru a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c --- a/drivers/net/hamradio/mkiss.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/hamradio/mkiss.c 2004-10-04 00:06:58 -03:00 @@ -336,7 +336,7 @@ spin_lock_bh(&ax->buflock); memcpy(skb_put(skb,count), ax->rbuff, count); spin_unlock_bh(&ax->buflock); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_AX25); netif_rx(skb); ax->dev->last_rx = jiffies; diff -Nru a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c --- a/drivers/net/hamradio/scc.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/hamradio/scc.c 2004-10-04 00:06:58 -03:00 @@ -1632,7 +1632,7 @@ skb->dev = scc->dev; skb->protocol = htons(ETH_P_AX25); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->pkt_type = PACKET_HOST; netif_rx(skb); diff -Nru a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c --- a/drivers/net/hamradio/yam.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/hamradio/yam.c 2004-10-04 00:06:58 -03:00 @@ -527,7 +527,7 @@ *cp++ = 0; /* KISS kludge */ memcpy(cp, yp->rx_buf, pkt_len - 1); skb->protocol = htons(ETH_P_AX25); - skb->mac.raw = skb->data; + skb_set_link_header(skb); netif_rx(skb); dev->last_rx = jiffies; ++yp->stats.rx_packets; diff -Nru a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c --- a/drivers/net/irda/ali-ircc.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/ali-ircc.c 2004-10-04 00:06:58 -03:00 @@ -1910,7 +1910,7 @@ self->stats.rx_packets++; skb->dev = self->netdev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); netif_rx(skb); self->netdev->last_rx = jiffies; diff -Nru a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c --- a/drivers/net/irda/au1k_ir.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/au1k_ir.c 2004-10-04 00:06:58 -03:00 @@ -607,7 +607,7 @@ skb_put(skb, count-2); memcpy(skb->data, (void *)pDB->vaddr, count-2); skb->dev = dev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); netif_rx(skb); prxd->count_0 = 0; diff -Nru a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c --- a/drivers/net/irda/donauboe.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/donauboe.c 2004-10-04 00:06:58 -03:00 @@ -1298,7 +1298,7 @@ self->stats.rx_packets++; skb->dev = self->netdev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons (ETH_P_IRDA); } else diff -Nru a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c --- a/drivers/net/irda/irda-usb.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/irda-usb.c 2004-10-04 00:06:58 -03:00 @@ -830,7 +830,7 @@ /* Ask the networking layer to queue the packet for the IrDA stack */ dataskb->dev = self->netdev; - dataskb->mac.raw = dataskb->data; + skb_set_link_header(dataskb); dataskb->protocol = htons(ETH_P_IRDA); netif_rx(dataskb); diff -Nru a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c --- a/drivers/net/irda/nsc-ircc.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/nsc-ircc.c 2004-10-04 00:06:58 -03:00 @@ -1732,7 +1732,7 @@ self->stats.rx_packets++; skb->dev = self->netdev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); netif_rx(skb); self->netdev->last_rx = jiffies; diff -Nru a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c --- a/drivers/net/irda/sa1100_ir.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/sa1100_ir.c 2004-10-04 00:06:58 -03:00 @@ -570,7 +570,7 @@ skb_put(skb, len); skb->dev = dev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); si->stats.rx_packets++; si->stats.rx_bytes += len; diff -Nru a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c --- a/drivers/net/irda/smsc-ircc2.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/smsc-ircc2.c 2004-10-04 00:06:58 -03:00 @@ -1344,7 +1344,7 @@ self->stats.rx_bytes += len; skb->dev = self->netdev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); netif_rx(skb); } diff -Nru a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c --- a/drivers/net/irda/stir4200.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/stir4200.c 2004-10-04 00:06:58 -03:00 @@ -368,7 +368,7 @@ skb_put(skb, len); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); skb->dev = stir->netdev; diff -Nru a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c --- a/drivers/net/irda/via-ircc.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/via-ircc.c 2004-10-04 00:06:58 -03:00 @@ -1079,7 +1079,7 @@ self->stats.rx_bytes += len; self->stats.rx_packets++; skb->dev = self->netdev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); netif_rx(skb); return TRUE; @@ -1163,7 +1163,7 @@ self->stats.rx_bytes += len; self->stats.rx_packets++; skb->dev = self->netdev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); netif_rx(skb); @@ -1205,7 +1205,7 @@ self->stats.rx_bytes += len; self->stats.rx_packets++; skb->dev = self->netdev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); netif_rx(skb); if (st_fifo->len < (MAX_RX_WINDOW + 2)) { @@ -1275,7 +1275,7 @@ self->stats.rx_bytes += len; self->stats.rx_packets++; skb->dev = self->netdev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); netif_rx(skb); } //while diff -Nru a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c --- a/drivers/net/irda/vlsi_ir.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/vlsi_ir.c 2004-10-04 00:06:58 -03:00 @@ -596,7 +596,7 @@ rd->skb = NULL; skb->dev = ndev; memcpy(skb_put(skb,len), rd->buf, len); - skb->mac.raw = skb->data; + skb_set_link_header(skb); if (in_interrupt()) netif_rx(skb); else diff -Nru a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c --- a/drivers/net/irda/w83977af_ir.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/irda/w83977af_ir.c 2004-10-04 00:06:58 -03:00 @@ -920,7 +920,7 @@ self->stats.rx_packets++; skb->dev = self->netdev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); netif_rx(skb); self->netdev->last_rx = jiffies; diff -Nru a/drivers/net/plip.c b/drivers/net/plip.c --- a/drivers/net/plip.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/plip.c 2004-10-04 00:06:58 -03:00 @@ -545,7 +545,7 @@ struct ethhdr *eth; unsigned char *rawp; - skb->mac.raw=skb->data; + skb_set_link_header(skb); skb_pull(skb,dev->hard_header_len); eth = eth_hdr(skb); diff -Nru a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c --- a/drivers/net/ppp_generic.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/ppp_generic.c 2004-10-04 00:06:58 -03:00 @@ -1594,7 +1594,7 @@ skb_pull(skb, 2); /* chop off protocol */ skb->dev = ppp->dev; skb->protocol = htons(npindex_to_ethertype[npi]); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->input_dev = ppp->dev; netif_rx(skb); ppp->dev->last_rx = jiffies; diff -Nru a/drivers/net/sb1000.c b/drivers/net/sb1000.c --- a/drivers/net/sb1000.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/sb1000.c 2004-10-04 00:06:58 -03:00 @@ -842,7 +842,7 @@ goto dropped_frame; } skb->dev = dev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = (unsigned short) buffer[NewDatagramHeaderSkip + 16]; insw(ioaddr, skb_put(skb, NewDatagramDataSize), NewDatagramDataSize / 2); diff -Nru a/drivers/net/slip.c b/drivers/net/slip.c --- a/drivers/net/slip.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/slip.c 2004-10-04 00:06:58 -03:00 @@ -374,7 +374,7 @@ } skb->dev = sl->dev; memcpy(skb_put(skb,count), sl->rbuff, count); - skb->mac.raw=skb->data; + skb_set_link_header(skb); skb->protocol=htons(ETH_P_IP); netif_rx(skb); sl->dev->last_rx = jiffies; diff -Nru a/drivers/net/tun.c b/drivers/net/tun.c --- a/drivers/net/tun.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/tun.c 2004-10-04 00:06:58 -03:00 @@ -196,7 +196,7 @@ skb->dev = tun->dev; switch (tun->flags & TUN_TYPE_MASK) { case TUN_TUN_DEV: - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = pi.proto; break; case TUN_TAP_DEV: diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c --- a/drivers/net/wan/cosa.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/cosa.c 2004-10-04 00:06:58 -03:00 @@ -787,7 +787,7 @@ } chan->rx_skb->protocol = htons(ETH_P_WAN_PPP); chan->rx_skb->dev = chan->pppdev.dev; - chan->rx_skb->mac.raw = chan->rx_skb->data; + skb_set_link_header(chan->rx_skb); chan->stats.rx_packets++; chan->stats.rx_bytes += chan->cosa->rxsize; netif_rx(chan->rx_skb); diff -Nru a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c --- a/drivers/net/wan/dlci.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/dlci.c 2004-10-04 00:06:58 -03:00 @@ -177,7 +177,7 @@ if (process) { /* we've set up the protocol, so discard the header */ - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull(skb, header); dlp->stats.rx_bytes += skb->len; netif_rx(skb); diff -Nru a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c --- a/drivers/net/wan/farsync.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/farsync.c 2004-10-04 00:06:58 -03:00 @@ -864,7 +864,7 @@ struct net_device *dev) { skb->dev = dev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->pkt_type = PACKET_HOST; return htons(ETH_P_CUST); } diff -Nru a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c --- a/drivers/net/wan/hostess_sv11.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/hostess_sv11.c 2004-10-04 00:06:58 -03:00 @@ -57,8 +57,8 @@ { /* Drop the CRC - it's not a good idea to try and negotiate it ;) */ skb_trim(skb, skb->len-2); - skb->protocol=__constant_htons(ETH_P_WAN_PPP); - skb->mac.raw=skb->data; + skb->protocol = htons(ETH_P_WAN_PPP); + skb_set_link_header(skb); skb->dev=c->netdevice; /* * Send it to the PPP layer. We don't have time to process diff -Nru a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c --- a/drivers/net/wan/lmc/lmc_main.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/lmc/lmc_main.c 2004-10-04 00:06:58 -03:00 @@ -1673,7 +1673,7 @@ skb_put (skb, len); skb->protocol = lmc_proto_type(sc, skb); skb->protocol = htons(ETH_P_WAN_PPP); - skb->mac.raw = skb->data; + skb_set_link_header(skb); // skb->nh.raw = skb->data; skb->dev = dev; lmc_proto_netif(sc, skb); @@ -1711,7 +1711,7 @@ memcpy(skb_put(nsb, len), skb->data, len); nsb->protocol = lmc_proto_type(sc, skb); - nsb->mac.raw = nsb->data; + skb_set_link_header(nsb); // nsb->nh.raw = nsb->data; nsb->dev = dev; lmc_proto_netif(sc, nsb); diff -Nru a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c --- a/drivers/net/wan/pc300_drv.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/pc300_drv.c 2004-10-04 00:06:58 -03:00 @@ -1754,7 +1754,7 @@ skb->dev = dev; skb->protocol = htons(ETH_P_CUST); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->pkt_type = PACKET_HOST; skb->len = 10 + skb_main->len; diff -Nru a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c --- a/drivers/net/wan/pc300_tty.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/pc300_tty.c 2004-10-04 00:06:58 -03:00 @@ -1026,7 +1026,7 @@ skb_put (skb, 10 + len); skb->dev = dev->dev; skb->protocol = htons(ETH_P_CUST); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->pkt_type = PACKET_HOST; skb->len = 10 + len; diff -Nru a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c --- a/drivers/net/wan/sdla_chdlc.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/sdla_chdlc.c 2004-10-04 00:06:58 -03:00 @@ -2037,7 +2037,7 @@ api_rx_hdr->time_stamp = rxbuf->time_stamp; skb->protocol = htons(PVC_PROT); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->dev = dev; skb->pkt_type = WAN_PACKET_DATA; @@ -2054,7 +2054,7 @@ /* Pass it up the protocol stack */ skb->dev = dev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); netif_rx(skb); dev->last_rx = jiffies; } @@ -3058,7 +3058,7 @@ /* Decapsulate pkt and pass it up the protocol stack */ new_skb->protocol = htons(ETH_P_IP); new_skb->dev = dev; - new_skb->mac.raw = new_skb->data; + skb_set_link_header(new_skb); netif_rx(new_skb); dev->last_rx = jiffies; diff -Nru a/drivers/net/wan/sdla_fr.c b/drivers/net/wan/sdla_fr.c --- a/drivers/net/wan/sdla_fr.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/sdla_fr.c 2004-10-04 00:06:58 -03:00 @@ -2097,7 +2097,7 @@ api_rx_hdr->time_stamp = frbuf->tmstamp; skb->protocol = htons(ETH_P_IP); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->dev = dev; skb->pkt_type = WAN_PACKET_DATA; @@ -2170,7 +2170,7 @@ ++card->wandev.stats.rx_errors; goto rx_done; } - skb->mac.raw = skb->data; + skb_set_link_header(skb); } @@ -3901,7 +3901,7 @@ UDP_PIPE_mgmt_passed_to_stack ++; new_skb->dev = dev; new_skb->protocol = htons(ETH_P_IP); - new_skb->mac.raw = new_skb->data; + skb_set_link_header(new_skb); netif_rx(new_skb); } else { diff -Nru a/drivers/net/wan/sdla_ppp.c b/drivers/net/wan/sdla_ppp.c --- a/drivers/net/wan/sdla_ppp.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/sdla_ppp.c 2004-10-04 00:06:58 -03:00 @@ -1756,7 +1756,7 @@ } else { /* Pass data up the protocol stack */ skb->dev = dev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); ++card->wandev.stats.rx_packets; card->wandev.stats.rx_bytes += skb->len; @@ -2756,7 +2756,7 @@ stack */ new_skb->protocol = htons(ETH_P_IP); new_skb->dev = dev; - new_skb->mac.raw = new_skb->data; + skb_set_link_header(new_skb); netif_rx(new_skb); dev->last_rx = jiffies; diff -Nru a/drivers/net/wan/sdla_x25.c b/drivers/net/wan/sdla_x25.c --- a/drivers/net/wan/sdla_x25.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/sdla_x25.c 2004-10-04 00:06:58 -03:00 @@ -1766,7 +1766,7 @@ ++chan->rx_intr_stat.rx_intr_bfr_not_passed_to_stack; } }else{ - skb->mac.raw = skb->data; + skb_set_link_header(skb); chan->ifstats.rx_bytes += skb->len; ++chan->ifstats.rx_packets; ++chan->rx_intr_stat.rx_intr_bfr_passed_to_stack; @@ -1858,7 +1858,7 @@ new_skb->dev = dev; if (chan->common.usedby == API){ - new_skb->mac.raw = new_skb->data; + skb_set_link_header(new_skb); new_skb->protocol = htons(X25_PROT); new_skb->pkt_type = WAN_PACKET_DATA; }else{ @@ -4658,7 +4658,7 @@ memcpy(skb_put(skb,len),&mbox->cmd,len); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(X25_PROT); skb->pkt_type = WAN_PACKET_ASYNC; @@ -4716,7 +4716,7 @@ memcpy(skb_put(skb,len),&mbox->cmd.command,len); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->pkt_type = WAN_PACKET_CMD; chan->common.func(skb,dev,chan->common.sk); @@ -4826,7 +4826,7 @@ memcpy(api_hdr->data,mbox->data,mbox->cmd.length); } - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->pkt_type = WAN_PACKET_ERR; if (chan->common.func(skb,dev,chan->common.sk) < 0){ @@ -5193,7 +5193,7 @@ else new_skb->protocol = htons(ETH_P_IP); - new_skb->mac.raw = new_skb->data; + skb_set_link_header(new_skb); netif_rx(new_skb); ++chan->pipe_mgmt_stat.UDP_PIPE_mgmt_passed_to_stack; diff -Nru a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c --- a/drivers/net/wan/sealevel.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/sealevel.c 2004-10-04 00:06:58 -03:00 @@ -60,7 +60,7 @@ /* Drop the CRC - it's not a good idea to try and negotiate it ;) */ skb_trim(skb, skb->len-2); skb->protocol=htons(ETH_P_WAN_PPP); - skb->mac.raw=skb->data; + skb_set_link_header(skb); skb->dev=c->netdevice; /* * Send it to the PPP layer. We don't have time to process diff -Nru a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c --- a/drivers/net/wan/syncppp.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/syncppp.c 2004-10-04 00:06:58 -03:00 @@ -228,7 +228,7 @@ unsigned long flags; skb->dev=dev; - skb->mac.raw=skb->data; + skb_set_link_header(skb); if (dev->flags & IFF_RUNNING) { diff -Nru a/drivers/net/wan/wanpipe_multppp.c b/drivers/net/wan/wanpipe_multppp.c --- a/drivers/net/wan/wanpipe_multppp.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wan/wanpipe_multppp.c 2004-10-04 00:06:58 -03:00 @@ -1455,7 +1455,7 @@ }else{ /* Pass it up the protocol stack */ skb->dev = dev; - skb->mac.raw = skb->data; + skb_set_link_header(skb); netif_rx(skb); dev->last_rx = jiffies; } @@ -2056,7 +2056,7 @@ /* Decapsulate pkt and pass it up the protocol stack */ new_skb->protocol = htons(ETH_P_IP); new_skb->dev = dev; - new_skb->mac.raw = new_skb->data; + skb_set_link_header(new_skb); netif_rx(new_skb); dev->last_rx = jiffies; @@ -2344,7 +2344,7 @@ /* Decapsulate pkt and pass it up the protocol stack */ new_skb->protocol = htons(ETH_P_WAN_PPP); new_skb->dev = dev; - new_skb->mac.raw = new_skb->data; + skb_set_link_header(new_skb); netif_rx(new_skb); dev->last_rx = jiffies; diff -Nru a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c --- a/drivers/net/wireless/airo.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wireless/airo.c 2004-10-04 00:06:58 -03:00 @@ -3255,7 +3255,7 @@ OUT4500( apriv, EVACK, EV_RX); if (test_bit(FLAG_802_11, &apriv->flags)) { - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->pkt_type = PACKET_OTHERHOST; skb->dev = apriv->wifidev; skb->protocol = htons(ETH_P_802_2); @@ -3595,7 +3595,7 @@ wireless_spy_update(ai->dev, sa, &wstats); } #endif /* IW_WIRELESS_SPY */ - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->pkt_type = PACKET_OTHERHOST; skb->dev = ai->wifidev; skb->protocol = htons(ETH_P_802_2); diff -Nru a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c --- a/drivers/net/wireless/prism54/islpci_eth.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wireless/prism54/islpci_eth.c 2004-10-04 00:06:58 -03:00 @@ -312,7 +312,7 @@ skb_pull(*skb, sizeof (struct rfmon_header)); (*skb)->protocol = htons(ETH_P_802_2); - (*skb)->mac.raw = (*skb)->data; + skb_set_link_header(*skb); (*skb)->pkt_type = PACKET_OTHERHOST; return 0; diff -Nru a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c --- a/drivers/net/wireless/strip.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/net/wireless/strip.c 2004-10-04 00:06:58 -03:00 @@ -2020,7 +2020,7 @@ packetlen); skb->dev = get_strip_dev(strip_info); skb->protocol = header->protocol; - skb->mac.raw = skb->data; + skb_set_link_header(skb); /* Having put a fake header on the front of the sk_buff for the */ /* benefit of tools like tcpdump, skb_pull now 'consumes' that */ diff -Nru a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c --- a/drivers/s390/net/ctcmain.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/s390/net/ctcmain.c 2004-10-04 00:06:58 -03:00 @@ -699,7 +699,7 @@ return; } skb_put(pskb, header->length); - pskb->mac.raw = pskb->data; + skb_set_link_header(pskb); len -= header->length; skb = dev_alloc_skb(pskb->len); if (!skb) { @@ -717,7 +717,7 @@ return; } memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->dev = pskb->dev; skb->protocol = pskb->protocol; pskb->ip_summed = CHECKSUM_UNNECESSARY; diff -Nru a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c --- a/drivers/s390/net/netiucv.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/s390/net/netiucv.c 2004-10-04 00:06:58 -03:00 @@ -565,7 +565,7 @@ return; } skb_put(pskb, header->next); - pskb->mac.raw = pskb->data; + skb_set_link_header(pskb); skb = dev_alloc_skb(pskb->len); if (!skb) { PRINT_WARN("%s Out of memory in netiucv_unpack_skb\n", @@ -576,7 +576,7 @@ return; } memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->dev = pskb->dev; skb->protocol = pskb->protocol; pskb->ip_summed = CHECKSUM_UNNECESSARY; diff -Nru a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c --- a/drivers/s390/net/qeth_main.c 2004-10-04 00:06:58 -03:00 +++ b/drivers/s390/net/qeth_main.c 2004-10-04 00:06:58 -03:00 @@ -2146,7 +2146,7 @@ return tr_type_trans(skb,dev); #endif /* CONFIG_TR */ - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull(skb, ETH_ALEN * 2 + sizeof (short)); eth = eth_hdr(skb); @@ -2175,7 +2175,7 @@ QETH_DBF_TEXT(trace,5,"skbfake"); skb->mac.raw = skb->data - QETH_FAKE_LL_LEN; /* this is a fake ethernet header */ - fake_hdr = (struct ethhdr *) skb->mac.raw; + fake_hdr = eth_hdr(skb); /* the destination MAC address */ switch (skb->pkt_type){ @@ -2262,7 +2262,7 @@ if (card->options.fake_ll) qeth_rebuild_skb_fake_ll(card, skb, hdr); else - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->ip_summed = card->options.checksum_type; if (card->options.checksum_type == HW_CHECKSUMMING){ if ( (hdr->ext_flags & diff -Nru a/include/linux/hdlc.h b/include/linux/hdlc.h --- a/include/linux/hdlc.h 2004-10-04 00:06:58 -03:00 +++ b/include/linux/hdlc.h 2004-10-04 00:06:58 -03:00 @@ -245,7 +245,7 @@ { hdlc_device *hdlc = dev_to_hdlc(dev); - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->dev = dev; if (hdlc->proto.type_trans) diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h --- a/include/linux/skbuff.h 2004-10-04 00:06:58 -03:00 +++ b/include/linux/skbuff.h 2004-10-04 00:06:58 -03:00 @@ -290,6 +290,11 @@ #include +static inline void skb_set_link_header(struct sk_buff *skb) +{ + skb->mac.raw = skb->data; +} + extern void __kfree_skb(struct sk_buff *skb); extern struct sk_buff *alloc_skb(unsigned int size, int priority); extern void kfree_skbmem(struct sk_buff *skb); diff -Nru a/net/802/fc.c b/net/802/fc.c --- a/net/802/fc.c 2004-10-04 00:06:58 -03:00 +++ b/net/802/fc.c 2004-10-04 00:06:58 -03:00 @@ -102,7 +102,7 @@ struct fch_hdr *fch = (struct fch_hdr *)skb->data; struct fcllc *fcllc; - skb->mac.raw = skb->data; + skb_set_link_header(skb); fcllc = (struct fcllc *)(skb->data + sizeof (struct fch_hdr) + 2); skb_pull(skb, sizeof (struct fch_hdr) + 2); diff -Nru a/net/802/fddi.c b/net/802/fddi.c --- a/net/802/fddi.c 2004-10-04 00:06:58 -03:00 +++ b/net/802/fddi.c 2004-10-04 00:06:58 -03:00 @@ -131,7 +131,7 @@ * to start of packet data. Assume 802.2 SNAP frames for now. */ - skb->mac.raw = skb->data; /* point to frame control (FC) */ + skb_set_link_header(skb); /* point to frame control (FC) */ if(fddi->hdr.llc_8022_1.dsap==0xe0) { diff -Nru a/net/802/hippi.c b/net/802/hippi.c --- a/net/802/hippi.c 2004-10-04 00:06:58 -03:00 +++ b/net/802/hippi.c 2004-10-04 00:06:58 -03:00 @@ -143,7 +143,7 @@ * This is actually wrong ... question is if we really should * set the raw address here. */ - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull(skb, HIPPI_HLEN); /* diff -Nru a/net/802/tr.c b/net/802/tr.c --- a/net/802/tr.c 2004-10-04 00:06:58 -03:00 +++ b/net/802/tr.c 2004-10-04 00:06:58 -03:00 @@ -193,7 +193,7 @@ struct trllc *trllc; unsigned riflen=0; - skb->mac.raw = skb->data; + skb_set_link_header(skb); if(trh->saddr[0] & TR_RII) riflen = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8; diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c 2004-10-04 00:06:58 -03:00 +++ b/net/atm/clip.c 2004-10-04 00:06:58 -03:00 @@ -211,7 +211,7 @@ return; } ATM_SKB(skb)->vcc = vcc; - skb->mac.raw = skb->data; + skb_set_link_header(skb); if (!clip_vcc->encap || skb->len < RFC1483LLC_LEN || memcmp(skb->data, llc_oui,sizeof(llc_oui))) skb->protocol = htons(ETH_P_IP); else { diff -Nru a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c --- a/net/bluetooth/bnep/core.c 2004-10-04 00:06:58 -03:00 +++ b/net/bluetooth/bnep/core.c 2004-10-04 00:06:58 -03:00 @@ -326,7 +326,7 @@ return 0; } - skb->mac.raw = skb->data; + skb_set_link_header(skb); /* Verify and pull out header */ if (!skb_pull(skb, __bnep_rx_hlen[type & BNEP_TYPE_MASK])) diff -Nru a/net/bridge/br_device.c b/net/bridge/br_device.c --- a/net/bridge/br_device.c 2004-10-04 00:06:58 -03:00 +++ b/net/bridge/br_device.c 2004-10-04 00:06:58 -03:00 @@ -37,7 +37,7 @@ br->statistics.tx_packets++; br->statistics.tx_bytes += skb->len; - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_pull(skb, ETH_HLEN); rcu_read_lock(); diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c 2004-10-04 00:06:58 -03:00 +++ b/net/core/dev.c 2004-10-04 00:06:58 -03:00 @@ -1083,7 +1083,7 @@ set by sender, so that the second statement is just protection against buggy protocols. */ - skb2->mac.raw = skb2->data; + skb_set_link_header(skb2); if (skb2->nh.raw < skb2->data || skb2->nh.raw > skb2->tail) { diff -Nru a/net/decnet/dn_route.c b/net/decnet/dn_route.c --- a/net/decnet/dn_route.c 2004-10-04 00:06:58 -03:00 +++ b/net/decnet/dn_route.c 2004-10-04 00:06:58 -03:00 @@ -1555,7 +1555,7 @@ skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); if (skb == NULL) return -ENOBUFS; - skb->mac.raw = skb->data; + skb_set_link_header(skb); cb = DN_SKB_CB(skb); if (rta[RTA_SRC-1]) diff -Nru a/net/ethernet/eth.c b/net/ethernet/eth.c --- a/net/ethernet/eth.c 2004-10-04 00:06:58 -03:00 +++ b/net/ethernet/eth.c 2004-10-04 00:06:58 -03:00 @@ -161,8 +161,8 @@ struct ethhdr *eth; unsigned char *rawp; - skb->mac.raw=skb->data; - skb_pull(skb,ETH_HLEN); + skb_set_link_header(skb); + skb_pull(skb, ETH_HLEN); eth = eth_hdr(skb); skb->input_dev = dev; diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c --- a/net/ipv4/ip_output.c 2004-10-04 00:06:58 -03:00 +++ b/net/ipv4/ip_output.c 2004-10-04 00:06:58 -03:00 @@ -102,7 +102,7 @@ /* dev_loopback_xmit for use with netfilter. */ static int ip_dev_loopback_xmit(struct sk_buff *newskb) { - newskb->mac.raw = newskb->data; + skb_set_link_header(newskb); __skb_pull(newskb, newskb->nh.raw - newskb->data); newskb->pkt_type = PACKET_LOOPBACK; newskb->ip_summed = CHECKSUM_UNNECESSARY; diff -Nru a/net/ipv4/route.c b/net/ipv4/route.c --- a/net/ipv4/route.c 2004-10-04 00:06:58 -03:00 +++ b/net/ipv4/route.c 2004-10-04 00:06:58 -03:00 @@ -2351,7 +2351,7 @@ /* Reserve room for dummy headers, this skb can pass through good chunk of routing engine. */ - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr)); if (rta[RTA_SRC - 1]) diff -Nru a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c --- a/net/ipv6/ip6_output.c 2004-10-04 00:06:58 -03:00 +++ b/net/ipv6/ip6_output.c 2004-10-04 00:06:58 -03:00 @@ -97,7 +97,7 @@ /* dev_loopback_xmit for use with netfilter. */ static int ip6_dev_loopback_xmit(struct sk_buff *newskb) { - newskb->mac.raw = newskb->data; + skb_set_link_header(newskb); __skb_pull(newskb, newskb->nh.raw - newskb->data); newskb->pkt_type = PACKET_LOOPBACK; newskb->ip_summed = CHECKSUM_UNNECESSARY; diff -Nru a/net/ipv6/route.c b/net/ipv6/route.c --- a/net/ipv6/route.c 2004-10-04 00:06:58 -03:00 +++ b/net/ipv6/route.c 2004-10-04 00:06:58 -03:00 @@ -1763,7 +1763,7 @@ /* Reserve room for dummy headers, this skb can pass through good chunk of routing engine. */ - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr)); memset(&fl, 0, sizeof(fl)); diff -Nru a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c --- a/net/irda/irlap_frame.c 2004-10-04 00:06:58 -03:00 +++ b/net/irda/irlap_frame.c 2004-10-04 00:06:58 -03:00 @@ -90,7 +90,8 @@ { /* Some common init stuff */ skb->dev = self->netdev; - skb->h.raw = skb->nh.raw = skb->mac.raw = skb->data; + skb->h.raw = skb->nh.raw = skb->data; + skb_set_link_header(skb); skb->protocol = htons(ETH_P_IRDA); skb->priority = TC_PRIO_BESTEFFORT; diff -Nru a/net/irda/wrapper.c b/net/irda/wrapper.c --- a/net/irda/wrapper.c 2004-10-04 00:06:58 -03:00 +++ b/net/irda/wrapper.c 2004-10-04 00:06:58 -03:00 @@ -252,7 +252,7 @@ /* Feed it to IrLAP layer */ dataskb->dev = dev; - dataskb->mac.raw = dataskb->data; + skb_set_link_header(dataskb); dataskb->protocol = htons(ETH_P_IRDA); netif_rx(dataskb); diff -Nru a/net/llc/llc_output.c b/net/llc/llc_output.c --- a/net/llc/llc_output.c 2004-10-04 00:06:58 -03:00 +++ b/net/llc/llc_output.c 2004-10-04 00:06:58 -03:00 @@ -40,7 +40,8 @@ struct net_device *dev = skb->dev; struct trh_hdr *trh; - skb->mac.raw = skb_push(skb, sizeof(*trh)); + skb_push(skb, sizeof(*trh)); + skb_set_link_header(skb); trh = tr_hdr(skb); trh->ac = AC; trh->fc = LLC_FRAME; @@ -60,7 +61,8 @@ unsigned short len = skb->len; struct ethhdr *eth; - skb->mac.raw = skb_push(skb, sizeof(*eth)); + skb_push(skb, sizeof(*eth)); + skb_set_link_header(skb); eth = eth_hdr(skb); eth->h_proto = htons(len); memcpy(eth->h_dest, da, ETH_ALEN); diff -Nru a/net/llc/llc_sap.c b/net/llc/llc_sap.c --- a/net/llc/llc_sap.c 2004-10-04 00:06:58 -03:00 +++ b/net/llc/llc_sap.c 2004-10-04 00:06:58 -03:00 @@ -35,11 +35,11 @@ struct sk_buff *skb = alloc_skb(128, GFP_ATOMIC); if (skb) { + skb_set_link_header(skb); skb_reserve(skb, 50); skb->nh.raw = skb->h.raw = skb->data; skb->protocol = htons(ETH_P_802_2); skb->dev = dev_base->next; - skb->mac.raw = skb->head; } return skb; } diff -Nru a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c --- a/net/wanrouter/wanmain.c 2004-10-04 00:06:58 -03:00 +++ b/net/wanrouter/wanmain.c 2004-10-04 00:06:58 -03:00 @@ -394,7 +394,7 @@ skb->protocol = ethertype; skb->pkt_type = PACKET_HOST; /* Physically point to point */ skb_pull(skb, cnt); - skb->mac.raw = skb->data; + skb_set_link_header(skb); return ethertype; } --------------000105060809020209070501-- From acme@conectiva.com.br Sun Oct 3 20:30:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 20:31:01 -0700 (PDT) Received: from perninha.conectiva.com.br (perninha.conectiva.com.br [200.140.247.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i943Uqc9012841 for ; Sun, 3 Oct 2004 20:30:53 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id E81404766F; Mon, 4 Oct 2004 00:30:38 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id AA676475A1 for ; Mon, 4 Oct 2004 00:30:38 -0300 (BRT) Received: (qmail 31549 invoked by uid 0); 4 Oct 2004 04:27:38 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 4 Oct 2004 04:27:38 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 7C07514639; Mon, 4 Oct 2004 00:33:45 -0300 (BRT) Message-ID: <4160C446.2030708@conectiva.com.br> Date: Mon, 04 Oct 2004 00:32:22 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: PATCH: [SKBUFF] do some more skb_set_link_header conversions X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------090804030806000307000006" X-Bogosity: No, tests=bogofilter, spamicity=0.050803, version=0.16.3 X-archive-position: 9864 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 2794 Lines: 91 This is a multi-part message in MIME format. --------------090804030806000307000006 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Now there are eight outstanding changesets in this tree. - Arnaldo --------------090804030806000307000006 Content-Type: text/plain; name="skb_set_link_header2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="skb_set_link_header2.patch" =================================================================== ChangeSet@1.2037, 2004-10-04 00:28:19-03:00, acme@conectiva.com.br [SKBUFF] do some more skb_set_link_header conversions Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller drivers/net/wan/cycx_x25.c | 2 +- include/net/x25device.h | 2 +- net/802/fddi.c | 2 +- net/bridge/br_stp_bpdu.c | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff -Nru a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c --- a/drivers/net/wan/cycx_x25.c 2004-10-04 00:30:13 -03:00 +++ b/drivers/net/wan/cycx_x25.c 2004-10-04 00:30:13 -03:00 @@ -837,7 +837,7 @@ ++chan->ifstats.rx_packets; chan->ifstats.rx_bytes += pktlen; - skb->mac.raw = skb->data; + skb_set_link_header(skb); netif_rx(skb); dev->last_rx = jiffies; /* timestamp */ } diff -Nru a/include/net/x25device.h b/include/net/x25device.h --- a/include/net/x25device.h 2004-10-04 00:30:13 -03:00 +++ b/include/net/x25device.h 2004-10-04 00:30:13 -03:00 @@ -8,7 +8,7 @@ static inline unsigned short x25_type_trans(struct sk_buff *skb, struct net_device *dev) { - skb->mac.raw = skb->data; + skb_set_link_header(skb); skb->input_dev = skb->dev = dev; skb->pkt_type = PACKET_HOST; diff -Nru a/net/802/fddi.c b/net/802/fddi.c --- a/net/802/fddi.c 2004-10-04 00:30:13 -03:00 +++ b/net/802/fddi.c 2004-10-04 00:30:13 -03:00 @@ -127,7 +127,7 @@ unsigned short type; /* - * Set mac.raw field to point to FC byte, set data field to point + * Set link header field to point to FC byte, set data field to point * to start of packet data. Assume 802.2 SNAP frames for now. */ diff -Nru a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c --- a/net/bridge/br_stp_bpdu.c 2004-10-04 00:30:13 -03:00 +++ b/net/bridge/br_stp_bpdu.c 2004-10-04 00:30:13 -03:00 @@ -44,7 +44,8 @@ skb->dev = dev; skb->protocol = htons(ETH_P_802_2); - skb->mac.raw = skb_put(skb, size); + skb_set_link_header(skb); + skb_put(skb, size); memcpy(skb->mac.raw, bridge_ula, ETH_ALEN); memcpy(skb->mac.raw+ETH_ALEN, dev->dev_addr, ETH_ALEN); skb->mac.raw[2*ETH_ALEN] = 0; --------------090804030806000307000006-- From manfred@colorfullife.com Sun Oct 3 21:06:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 03 Oct 2004 21:06:41 -0700 (PDT) Received: from dbl.q-ag.de (dbl.q-ag.de [213.172.117.3]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i9446Z0T013628 for ; Sun, 3 Oct 2004 21:06:36 -0700 Received: from [127.0.0.2] (dbl [127.0.0.1]) by dbl.q-ag.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i9446J8L015662; Mon, 4 Oct 2004 06:06:20 +0200 Message-ID: <4160CC3A.4050606@colorfullife.com> Date: Mon, 04 Oct 2004 06:06:18 +0200 From: Manfred Spraul User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: Re: [PATCH] fix secure tcp sequence number generation References: <415EEF0E.3080808@colorfullife.com> <20041003150052.4dba0c60.davem@redhat.com> In-Reply-To: <20041003150052.4dba0c60.davem@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 9865 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: manfred@colorfullife.com Precedence: bulk X-list: netdev Content-Length: 1048 Lines: 32 David S. Miller wrote: >On Sat, 02 Oct 2004 20:10:22 +0200 >Manfred Spraul wrote: > > > >>Ted's recent random.c update broke the periodic rekeying: >>schedule_work() doesn't provide synchronization. Additionally the first >>syn values after boot are generated with secret 0 - not good. >> >> > >Are you referring to his changes done back in August or some >other change? August is the last time I see that Ted made >a change to drivers/char/random.c > > The change to revision 1.49 of random.c, with the comment "dev/random: Fix latency in rekeying sequence number" http://linux.bkbits.net:8080/linux-2.5/diffs/drivers/char/random.c@1.49 There are two problems with that patch: - The first call of check_and_rekey must be synchroneous, otherwise the secret stays 0 for the first ISN values after boot. - schedule_work() doesn't provide synchronization, thus rekey_seq_generator could end up running twice. I tried to fix it and then I noticed that it's possible to simplify the code a lot. -- Manfred From klassert@mathematik.tu-chemnitz.de Mon Oct 4 04:52:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 04:52:24 -0700 (PDT) Received: from john.hrz.tu-chemnitz.de (john.hrz.tu-chemnitz.de [134.109.132.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94BqIM2027777 for ; Mon, 4 Oct 2004 04:52:18 -0700 Received: from bayes.mathematik.tu-chemnitz.de ([134.109.41.17]) by john.hrz.tu-chemnitz.de with esmtp (Exim 4.41) id 1CERNq-0003gc-Lx; Mon, 04 Oct 2004 13:52:02 +0200 Received: by bayes.mathematik.tu-chemnitz.de (Postfix, from userid 274) id 453CC8D6A; Mon, 4 Oct 2004 13:52:01 +0200 (CEST) Date: Mon, 4 Oct 2004 13:52:01 +0200 From: Steffen Klassert To: akpm@osdl.org Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH 2.6.9-rc3-mm1] 3c59x: Make use of generic_mii_ioctl Message-ID: <20041004115201.GA1635@bayes.mathematik.tu-chemnitz.de> Mail-Followup-To: akpm@osdl.org, jgarzik@pobox.com, netdev@oss.sgi.com References: <20041003204507.GA29546@bayes.mathematik.tu-chemnitz.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041003204507.GA29546@bayes.mathematik.tu-chemnitz.de> User-Agent: Mutt/1.4.2.1i X-Scan-Signature: ce20b7edf4650e69c84e96fedf5678d6 X-archive-position: 9866 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: klassert@mathematik.tu-chemnitz.de Precedence: bulk X-list: netdev Content-Length: 2861 Lines: 104 On Sun, Oct 03, 2004 at 10:45:07PM +0200 or thereabouts, Steffen Klassert wrote: > With this patch the driver makes use of the MII lib helper > function generic_mii_ioctl. > Patch is tested with the mii-diag tool and a 3c905-TX, 3c905B-TX NIC. > > Signed-off-by: Steffen Klassert The first patch has a codeline which ends with two semicolon, sorry. Please use this patch instead. --- vanilla-2.6.9-rc3-mm1/drivers/net/3c59x.c Sat Oct 2 14:54:46 2004 +++ linux-2.6.9-rc3-mm1/drivers/net/3c59x.c Mon Oct 4 10:59:19 2004 @@ -834,6 +834,7 @@ u16 io_size; /* Size of PCI region (for release_region) */ spinlock_t lock; /* Serialise access to device & its vortex_private */ spinlock_t mdio_lock; /* Serialise access to mdio hardware */ + struct mii_if_info mii; /* MII lib hooks/info */ }; #ifdef CONFIG_PCI @@ -1218,6 +1219,11 @@ spin_lock_init(&vp->lock); spin_lock_init(&vp->mdio_lock); vp->gendev = gendev; + vp->mii.dev = dev; + vp->mii.mdio_read = mdio_read; + vp->mii.mdio_write = mdio_write; + vp->mii.phy_id_mask = 0x1f; + vp->mii.reg_num_mask = 0x1f; /* Makes sure rings are at least 16 byte aligned. */ vp->rx_ring = pci_alloc_consistent(pdev, sizeof(struct boom_rx_desc) * RX_RING_SIZE @@ -1445,6 +1451,7 @@ mdio_write(dev, vp->phys[0], 4, vp->advertising); } } + vp->mii.phy_id = vp->phys[0]; } if (vp->capabilities & CapBusMaster) { @@ -2891,41 +2898,6 @@ }; #ifdef CONFIG_PCI -static int vortex_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -{ - struct vortex_private *vp = netdev_priv(dev); - long ioaddr = dev->base_addr; - struct mii_ioctl_data *data = if_mii(rq); - int phy = vp->phys[0] & 0x1f; - int retval; - - switch(cmd) { - case SIOCGMIIPHY: /* Get address of MII PHY in use. */ - data->phy_id = phy; - - case SIOCGMIIREG: /* Read MII PHY register. */ - EL3WINDOW(4); - data->val_out = mdio_read(dev, data->phy_id & 0x1f, data->reg_num & 0x1f); - retval = 0; - break; - - case SIOCSMIIREG: /* Write MII PHY register. */ - if (!capable(CAP_NET_ADMIN)) { - retval = -EPERM; - } else { - EL3WINDOW(4); - mdio_write(dev, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in); - retval = 0; - } - break; - default: - retval = -EOPNOTSUPP; - break; - } - - return retval; -} - /* * Must power the device up to do MDIO operations */ @@ -2933,8 +2905,9 @@ { int err; struct vortex_private *vp = netdev_priv(dev); + long ioaddr = dev->base_addr; int state = 0; - + if(VORTEX_PCI(vp)) state = VORTEX_PCI(vp)->current_state; @@ -2942,7 +2915,8 @@ if(state != 0) pci_set_power_state(VORTEX_PCI(vp), 0); - err = vortex_do_ioctl(dev, rq, cmd); + EL3WINDOW(4); + err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL); if(state != 0) pci_set_power_state(VORTEX_PCI(vp), state); From buffer@olografix.org Mon Oct 4 05:38:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 05:38:34 -0700 (PDT) Received: from mail.olografix.org (mail.olografix.org [195.32.69.44]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94CcOmA028987 for ; Mon, 4 Oct 2004 05:38:25 -0700 Received: by mail.olografix.org (Postfix, from userid 102) id E1A391BE77; Mon, 4 Oct 2004 14:37:03 +0200 (CEST) Received: from mintaka.darkstar.net (unknown [194.246.126.32]) by mail.olografix.org (Postfix) with ESMTP id D2FC81BD49; Mon, 4 Oct 2004 14:37:02 +0200 (CEST) Date: Mon, 4 Oct 2004 14:42:32 +0200 From: "Angelo Dell'Aera" To: "David S. Miller" Cc: shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] (1/3) tcp - choose congestion algorithm at initialization Message-Id: <20041004144232.2bfa5a9e.buffer@olografix.org> In-Reply-To: <20040927121610.68f942a4.davem@redhat.com> References: <20040927111834.48c7baab@zqx3.pdx.osdl.net> <20040927121610.68f942a4.davem@redhat.com> Organization: Metro Olografix X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9867 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buffer@olografix.org Precedence: bulk X-list: netdev Content-Length: 1234 Lines: 39 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 27 Sep 2004 12:16:10 -0700 "David S. Miller" wrote: >> The choice of congestion algorithm needs to be made when connection >> is setup to avoid problems when the sysctl values change later and the >> necessary data hasn't been collected. >Looks great, applied. I completely agree with you. Really a cool work. Just a proposal now. If the choice is made when the connection is established we do not need a struct for every supported congestion control algorithm in the struct tcp_opt any more. We could use for example a generic void * and then refer it properly after Stephen's controls such as tcp_is_vegas(), tcp_is_bic(), etc. This should slim the struct tcp_opt because if a connection is using Westwood its tcpbic and vegas structs will never be used. Moreover, I think it would make the code more readable. Regards. - -- Angelo Dell'Aera 'buffer' Antifork Research, Inc. http://buffer.antifork.org Metro Olografix PGP information in e-mail header -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFBYUU4pONIzxnBXKIRArT5AJ0Ztak7xFH9DIEd24kRxCvMMxHrBACghKmE e0CHh6gMpJaW02Y5HVA6u78= =av9u -----END PGP SIGNATURE----- From tgraf@suug.ch Mon Oct 4 05:52:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 05:53:01 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94CqsYP031557 for ; Mon, 4 Oct 2004 05:52:55 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 7C28A8B; Mon, 4 Oct 2004 14:52:18 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id 9676B1C0E8; Mon, 4 Oct 2004 14:53:00 +0200 (CEST) Date: Mon, 4 Oct 2004 14:53:00 +0200 From: Thomas Graf To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 2/3] NET: Generic rate estimator Message-ID: <20041004125300.GA15898@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> <20041003213954.GI14344@postel.suug.ch> <20041003161436.50293f9a.davem@davemloft.net> <20041003233647.GN14344@postel.suug.ch> <1096852582.1046.378.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1096852582.1046.378.camel@jzny.localdomain> X-archive-position: 9868 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 454 Lines: 12 * jamal <1096852582.1046.378.camel@jzny.localdomain> 2004-10-03 21:16 > The granularity of the timing is dependent on this - 250msec increments. > Find a common demonitor for all Hz values which results in something > along 200ms range and we should be set. I don't think this is possible: octave:1> gcd([1000,1024,1200,200,128,100,32,50,122,24]) ans = 2 Why not let userspace provide it? ticks/usec and usec/ticks are exported via /proc/net/psched. From hadi@cyberus.ca Mon Oct 4 06:24:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 06:24:48 -0700 (PDT) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94DOgEN002543 for ; Mon, 4 Oct 2004 06:24:43 -0700 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.20) id 1CESpG-0004gR-6d for netdev@oss.sgi.com; Mon, 04 Oct 2004 09:24:26 -0400 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CESpE-0000yj-Km; Mon, 04 Oct 2004 09:24:24 -0400 Subject: Re: [PATCH 2/3] NET: Generic rate estimator From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20041004125300.GA15898@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> <20041003213954.GI14344@postel.suug.ch> <20041003161436.50293f9a.davem@davemloft.net> <20041003233647.GN14344@postel.suug.ch> <1096852582.1046.378.camel@jzny.localdomain> <20041004125300.GA15898@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1096896256.1072.4.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Oct 2004 09:24:16 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 9869 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 582 Lines: 22 On Mon, 2004-10-04 at 08:53, Thomas Graf wrote: > I don't think this is possible: > > octave:1> gcd([1000,1024,1200,200,128,100,32,50,122,24]) > ans = 2 > > Why not let userspace provide it? ticks/usec and usec/ticks are > exported via /proc/net/psched. Easier to define a compile time constant in the kernel. What you need is to replace the HZ/4 in the creation and execution of the timer with a constant. And that the value of said constant would be preferably in the 250ms range. If you fix this also would be worth fixing the ones in net/sched/estimator.c cheers, jamal From oghm2@cam.ac.uk Mon Oct 4 06:34:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 06:34:20 -0700 (PDT) Received: from ppsw-3.csi.cam.ac.uk (ppsw-3.csi.cam.ac.uk [131.111.8.133]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94DYDsH004944 for ; Mon, 4 Oct 2004 06:34:14 -0700 Received: from oghm2.acad.cai.cam.ac.uk ([131.111.138.48]:60077) by ppsw-3.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.153]:25) with esmtp (Exim 4.34) id 1CESyS-0007Ul-O3 (return-path ) for netdev@oss.sgi.com; Mon, 04 Oct 2004 14:33:56 +0100 Subject: PROBLEM: Kernel oops in skbuff.c From: Olly Madge To: netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1096896836.7327.19.camel@oghm2> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Mon, 04 Oct 2004 14:33:56 +0100 Content-Transfer-Encoding: 7bit X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ X-Cam-AntiVirus: No virus found X-Cam-SpamDetails: Not scanned X-archive-position: 9870 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: oghm2@cam.ac.uk Precedence: bulk X-list: netdev Content-Length: 10118 Lines: 247 Hi, I originally sent this to Alan Cox (as his name was listed at the top of skbuff.c) but he's told me to send it to you instead. My router had a kernel oops after running for 290+ days (exact number is unknown). It was under very minor load at the time, just some IRC traffic. The problem appears to be in networking code. Kernel version is: Linux version 2.4.22euclid1 (root@oghm2) (gcc version 3.3.2 (Debian)) #1 Sun Dec 14 22:09:10 GMT 2003 Output of the oops is below, I had to copy the oops debug information off the screen by hand so it is possible that there are typos. However I did check what I had typed so I believe it to be correct. ksymoops 2.4.5 on i586 2.4.22euclid1. Options used -V (specified) -k /proc/ksyms (specified) -l /proc/modules (default) -o /lib/modules/2.4.22euclid1/ (default) -m /boot/System.map-2.4.22euclid1 (default) Warning: kfree_skbpassed an skb still on a list (from c024d8d6). kernel BUG at skbuff.c:319! invalid operand: 0000 CPU: 0 EIP: 0010:[] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00010282 eax: 00000045 ebx: c138f480 ecx: 00000000 edx: c2706000 esi: 00000400 edi: c138f4c4 ebp: c138f480 esp: c02e5da4 ds: 0018 es: 0018 ss: 0018 Process swapper (pid: 0, stackpage=c02e5000) Stack: c028d200 c024d8d6 c138f480 ffffffff c024d8d6 c138f480 c138f4b4 c1487140 c2177ba0 c138f480 c0d67800 c10ed800 c01ffe7f c138f480 c10ed800 c2177ba0 c28dd4a0 c10ed800 c0d67800 c11f0b60 c0207177 c0d67800 c10ed800 c10ed800 Call Trace: [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Code: 0f 0b 3f 01 1c b8 28 c0 58 5a 8b 5c 24 0c e9 67 fe ff ff 8d >>EIP; c01fbb87 <__kfree_skb+197/1b0> <===== >>ebx; c138f480 <_end+1063094/34fcc14> >>edx; c2706000 <_end+23d9c14/34fcc14> >>edi; c138f4c4 <_end+10630d8/34fcc14> >>ebp; c138f480 <_end+1063094/34fcc14> >>esp; c02e5da4 Trace; c024d8d6 Trace; c024d8d6 Trace; c01ffe7f Trace; c0207177 Trace; c02000cd Trace; c0216072 Trace; c02066b2 Trace; c02141a1 Trace; c0215fb0 Trace; c0212a1d Trace; c02066b2 Trace; c0212963 Trace; c0212a00 Trace; c0211a6b Trace; c02066b2 Trace; c0211718 Trace; c02118c0 Trace; c0200630 Trace; c0200747 Trace; c02008af Trace; c0119a96 Trace; c010831e Trace; c0105300 Trace; c010a5a8 Trace; c0105300 Trace; c0105324 Trace; c0105392 Trace; c0105000 <_stext+0/0> Code; c01fbb87 <__kfree_skb+197/1b0> 00000000 <_EIP>: Code; c01fbb87 <__kfree_skb+197/1b0> <===== 0: 0f 0b ud2a <===== Code; c01fbb89 <__kfree_skb+199/1b0> 2: 3f aas Code; c01fbb8a <__kfree_skb+19a/1b0> 3: 01 1c b8 add %ebx,(%eax,%edi,4) Code; c01fbb8d <__kfree_skb+19d/1b0> 6: 28 c0 sub %al,%al Code; c01fbb8f <__kfree_skb+19f/1b0> 8: 58 pop %eax Code; c01fbb90 <__kfree_skb+1a0/1b0> 9: 5a pop %edx Code; c01fbb91 <__kfree_skb+1a1/1b0> a: 8b 5c 24 0c mov 0xc(%esp,1),%ebx Code; c01fbb95 <__kfree_skb+1a5/1b0> e: e9 67 fe ff ff jmp fffffe7a <_EIP+0xfffffe7a> c01fba01 <__kfree_skb+11/1b0> Code; c01fbb9a <__kfree_skb+1aa/1b0> 13: 8d 00 lea (%eax),%eax <0>Kernel panic: Aiee, killing interrupt handler! Linux distribution is a minimal install of debian stable with the latest security updates applied. I am the only local user of the machine. olly@euclid:~$ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 5 model : 2 model name : Pentium 75 - 200 stepping : 12 cpu MHz : 132.957 fdiv_bug : no hlt_bug : no f00f_bug : yes coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr mce cx8 bogomips : 265.42 olly@euclid:~$ cat /proc/modules sch_ingress 1700 1 (autoclean) cls_u32 4828 5 (autoclean) sch_sfq 3328 3 (autoclean) sch_cbq 12288 1 (autoclean) tun 4096 3 (autoclean) ip_nat_irc 2544 0 (unused) ip_conntrack_irc 3184 1 [ip_nat_irc] ip_nat_ftp 3312 0 (unused) ipt_MASQUERADE 1888 2 iptable_mangle 2072 0 ip_conntrack_ftp 4208 1 [ip_nat_ftp] ipt_REDIRECT 728 0 iptable_nat 21422 3 [ip_nat_irc ip_nat_ftp ipt_MASQUERADE ipt_REDIRECT] ipt_TCPMSS 2328 1 ipt_REJECT 3416 475 ipt_LOG 3320 27 ipt_limit 824 29 ipt_length 472 0 ipt_unclean 6808 2 iptable_filter 1644 1 ipt_state 568 31 ip_tables 14656 14 [ipt_MASQUERADE iptable_mangle ipt_REDIRECT iptable_nat ipt_TCPMSS ipt_REJECT ipt_LOG ipt_limit ipt_length ipt_unclean iptable_filter ipt_state] ip_conntrack 25976 4 [ip_nat_irc ip_conntrack_irc ip_nat_ftp ipt_MASQUERADE ip_conntrack_ftp ipt_REDIRECT iptable_nat ipt_state] olly@euclid:~$ cat /proc/ioports 0000-001f : dma1 0020-003f : pic1 0040-005f : timer 0060-006f : keyboard 0080-008f : dma page reg 00a0-00bf : pic2 00c0-00df : dma2 00f0-00ff : fpu 01f0-01f7 : ide0 02f8-02ff : serial(set) 03c0-03df : vga+ 03f6-03f6 : ide0 0cf8-0cff : PCI conf1 f800-f8ff : National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller f800-f8ff : eth1 fc00-fcff : National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller (#2) fc00-fcff : eth0 olly@euclid:~$ cat /proc/iomem 00000000-0009fbff : System RAM 000a0000-000bffff : Video RAM area 000c0000-000c7fff : Video ROM 000f0000-000fffff : System ROM 00100000-02ffffff : System RAM 00100000-0025f624 : Kernel code 0025f625-002e3ddf : Kernel data fe000000-feffffff : Cirrus Logic GD 5430/40 [Alpine] fffbe000-fffbefff : National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller fffbe000-fffbefff : eth1 fffbf000-fffbffff : National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller (#2) fffbf000-fffbffff : eth0 fffc0000-ffffffff : reserved olly@euclid:~$ sudo lspci -vvv Password: 00:00.0 Host bridge: Intel Corp. 430FX - 82437FX TSC [Triton I] (rev 02) Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- [disabled] [size=16M] 00:11.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller Subsystem: Netgear: Unknown device f311 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- [disabled] [size=64K] Capabilities: [40] Power Management version 2 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME+ 00:13.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller Subsystem: Netgear: Unknown device f311 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- [disabled] [size=64K] Capabilities: [40] Power Management version 2 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=320mA PME(D0+,D1+,D2+,D3hot+,D3cold+) Status: D0 PME-Enable- DSel=0 DScale=0 PME+ This is obviously a reasonably rare problem for it to take so long to occur. I have no idea what actually caused to happen when it did. The machine was running smoothly before for a long time. Olly Madge From tgraf@suug.ch Mon Oct 4 07:15:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 07:15:30 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94EFPxF006075 for ; Mon, 4 Oct 2004 07:15:25 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id DDF4F8B; Mon, 4 Oct 2004 16:14:49 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id BE2171C0E8; Mon, 4 Oct 2004 16:15:32 +0200 (CEST) Date: Mon, 4 Oct 2004 16:15:32 +0200 From: Thomas Graf To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 2/3] NET: Generic rate estimator Message-ID: <20041004141532.GB15898@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> <20041003213954.GI14344@postel.suug.ch> <20041003161436.50293f9a.davem@davemloft.net> <20041003233647.GN14344@postel.suug.ch> <1096852582.1046.378.camel@jzny.localdomain> <20041004125300.GA15898@postel.suug.ch> <1096896256.1072.4.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1096896256.1072.4.camel@jzny.localdomain> X-archive-position: 9871 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 564 Lines: 10 * jamal <1096896256.1072.4.camel@jzny.localdomain> 2004-10-04 09:24 > What you need is to replace the HZ/4 in the creation and execution > of the timer with a constant. And that the value of said constant would > be preferably in the 250ms range. HZ/4 == 250ms works except for HZ=122 (~246ms) and HZ=50 (~240ms). I don't know how you think it is possible to find a constant around 250ms which works for all HZ values. The problem gets even minor if we do (HZ<; Mon, 4 Oct 2004 07:41:54 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 119C54733D; Mon, 4 Oct 2004 11:41:34 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id B4AD24737B for ; Mon, 4 Oct 2004 11:41:33 -0300 (BRT) Received: (qmail 32244 invoked by uid 0); 4 Oct 2004 15:38:34 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 4 Oct 2004 15:38:34 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id C666114639; Mon, 4 Oct 2004 11:44:41 -0300 (BRT) Message-ID: <41616189.60309@conectiva.com.br> Date: Mon, 04 Oct 2004 11:43:21 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" , netdev@oss.sgi.com Subject: PATCH: [SKBUFF] introduce ax25_type_trans X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------060805090508090008030709" X-Bogosity: No, tests=bogofilter, spamicity=0.115026, version=0.16.3 X-archive-position: 9872 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 6348 Lines: 204 This is a multi-part message in MIME format. --------------060805090508090008030709 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Now there are nine outstanding changesets in this tree. Regards, - Arnaldo --------------060805090508090008030709 Content-Type: text/plain; name="ax25_type_trans.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ax25_type_trans.patch" =================================================================== ChangeSet@1.2038, 2004-10-04 11:36:34-03:00, acme@conectiva.com.br [SKBUFF] introduce ax25_type_trans Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller drivers/net/hamradio/6pack.c | 6 +----- drivers/net/hamradio/baycom_epp.c | 4 +--- drivers/net/hamradio/bpqether.c | 6 +----- drivers/net/hamradio/dmascc.c | 4 +--- drivers/net/hamradio/hdlcdrv.c | 4 +--- drivers/net/hamradio/mkiss.c | 4 +--- drivers/net/hamradio/scc.c | 6 +----- drivers/net/hamradio/yam.c | 4 +--- include/net/ax25.h | 9 +++++++++ 9 files changed, 17 insertions(+), 30 deletions(-) diff -Nru a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c --- a/drivers/net/hamradio/6pack.c 2004-10-04 11:40:05 -03:00 +++ b/drivers/net/hamradio/6pack.c 2004-10-04 11:40:05 -03:00 @@ -424,17 +424,13 @@ if ((skb = dev_alloc_skb(count)) == NULL) goto out_mem; - skb->dev = sp->dev; ptr = skb_put(skb, count); *ptr++ = cmd; /* KISS command */ - memcpy(ptr, sp->cooked_buf + 1, count); - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_AX25); + skb->protocol = ax25_type_trans(skb, sp->dev); netif_rx(skb); sp->dev->last_rx = jiffies; sp->stats.rx_packets++; - return; out_mem: diff -Nru a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c --- a/drivers/net/hamradio/baycom_epp.c 2004-10-04 11:40:05 -03:00 +++ b/drivers/net/hamradio/baycom_epp.c 2004-10-04 11:40:05 -03:00 @@ -619,12 +619,10 @@ bc->stats.rx_dropped++; return; } - skb->dev = dev; cp = skb_put(skb, pktlen); *cp++ = 0; /* KISS kludge */ memcpy(cp, bc->hdlcrx.buf, pktlen - 1); - skb->protocol = htons(ETH_P_AX25); - skb_set_link_header(skb); + skb->protocol = ax25_type_trans(skb, dev); netif_rx(skb); dev->last_rx = jiffies; bc->stats.rx_packets++; diff -Nru a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c --- a/drivers/net/hamradio/bpqether.c 2004-10-04 11:40:05 -03:00 +++ b/drivers/net/hamradio/bpqether.c 2004-10-04 11:40:05 -03:00 @@ -213,11 +213,7 @@ ptr = skb_push(skb, 1); *ptr = 0; - skb->dev = dev; - skb->protocol = htons(ETH_P_AX25); - skb_set_link_header(skb); - skb->pkt_type = PACKET_HOST; - + skb->protocol = ax25_type_trans(skb, dev); netif_rx(skb); dev->last_rx = jiffies; unlock: diff -Nru a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c --- a/drivers/net/hamradio/dmascc.c 2004-10-04 11:40:05 -03:00 +++ b/drivers/net/hamradio/dmascc.c 2004-10-04 11:40:05 -03:00 @@ -1222,9 +1222,7 @@ data = skb_put(skb, cb+1); data[0] = 0; memcpy(&data[1], priv->rx_buf[i], cb); - skb->dev = priv->dev; - skb->protocol = ntohs(ETH_P_AX25); - skb_set_link_header(skb); + skb->protocol = ax25_type_trans(skb, priv->dev); netif_rx(skb); priv->dev->last_rx = jiffies; priv->stats.rx_packets++; diff -Nru a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c --- a/drivers/net/hamradio/hdlcdrv.c 2004-10-04 11:40:05 -03:00 +++ b/drivers/net/hamradio/hdlcdrv.c 2004-10-04 11:40:05 -03:00 @@ -174,12 +174,10 @@ s->stats.rx_dropped++; return; } - skb->dev = dev; cp = skb_put(skb, pkt_len); *cp++ = 0; /* KISS kludge */ memcpy(cp, s->hdlcrx.buffer, pkt_len - 1); - skb->protocol = htons(ETH_P_AX25); - skb_set_link_header(skb); + skb->protocol = ax25_type_trans(skb, dev); netif_rx(skb); dev->last_rx = jiffies; s->stats.rx_packets++; diff -Nru a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c --- a/drivers/net/hamradio/mkiss.c 2004-10-04 11:40:05 -03:00 +++ b/drivers/net/hamradio/mkiss.c 2004-10-04 11:40:05 -03:00 @@ -332,12 +332,10 @@ return; } - skb->dev = ax->dev; spin_lock_bh(&ax->buflock); memcpy(skb_put(skb,count), ax->rbuff, count); spin_unlock_bh(&ax->buflock); - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_AX25); + skb->protocol = ax25_type_trans(skb, ax->dev); netif_rx(skb); ax->dev->last_rx = jiffies; ax->rx_packets++; diff -Nru a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c --- a/drivers/net/hamradio/scc.c 2004-10-04 11:40:05 -03:00 +++ b/drivers/net/hamradio/scc.c 2004-10-04 11:40:05 -03:00 @@ -1630,11 +1630,7 @@ scc->dev_stat.rx_packets++; scc->dev_stat.rx_bytes += skb->len; - skb->dev = scc->dev; - skb->protocol = htons(ETH_P_AX25); - skb_set_link_header(skb); - skb->pkt_type = PACKET_HOST; - + skb->protocol = ax25_type_trans(skb, scc->dev); netif_rx(skb); scc->dev->last_rx = jiffies; return; diff -Nru a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c --- a/drivers/net/hamradio/yam.c 2004-10-04 11:40:05 -03:00 +++ b/drivers/net/hamradio/yam.c 2004-10-04 11:40:05 -03:00 @@ -522,12 +522,10 @@ ++yp->stats.rx_dropped; } else { unsigned char *cp; - skb->dev = dev; cp = skb_put(skb, pkt_len); *cp++ = 0; /* KISS kludge */ memcpy(cp, yp->rx_buf, pkt_len - 1); - skb->protocol = htons(ETH_P_AX25); - skb_set_link_header(skb); + skb->protocol = ax25_type_trans(skb, dev); netif_rx(skb); dev->last_rx = jiffies; ++yp->stats.rx_packets; diff -Nru a/include/net/ax25.h b/include/net/ax25.h --- a/include/net/ax25.h 2004-10-04 11:40:05 -03:00 +++ b/include/net/ax25.h 2004-10-04 11:40:05 -03:00 @@ -220,6 +220,15 @@ } } +static inline unsigned short ax25_type_trans(struct sk_buff *skb, + struct net_device *dev) +{ + skb->dev = dev; + skb->pkt_type = PACKET_HOST; + skb_set_link_header(skb); + return htons(ETH_P_AX25); +} + /* af_ax25.c */ extern struct hlist_head ax25_list; extern spinlock_t ax25_list_lock; --------------060805090508090008030709-- From hadi@cyberus.ca Mon Oct 4 08:00:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 08:00:10 -0700 (PDT) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94F041w007449 for ; Mon, 4 Oct 2004 08:00:04 -0700 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.20) id 1CEUJZ-0000M8-U2 for netdev@oss.sgi.com; Mon, 04 Oct 2004 10:59:49 -0400 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CEUJX-00062t-KI; Mon, 04 Oct 2004 10:59:47 -0400 Subject: Re: [PATCH 2/3] NET: Generic rate estimator From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20041004141532.GB15898@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> <20041003213954.GI14344@postel.suug.ch> <20041003161436.50293f9a.davem@davemloft.net> <20041003233647.GN14344@postel.suug.ch> <1096852582.1046.378.camel@jzny.localdomain> <20041004125300.GA15898@postel.suug.ch> <1096896256.1072.4.camel@jzny.localdomain> <20041004141532.GB15898@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1096901984.1073.9.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Oct 2004 10:59:44 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 9873 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 934 Lines: 24 On Mon, 2004-10-04 at 10:15, Thomas Graf wrote: > * jamal <1096896256.1072.4.camel@jzny.localdomain> 2004-10-04 09:24 > > What you need is to replace the HZ/4 in the creation and execution > > of the timer with a constant. And that the value of said constant would > > be preferably in the 250ms range. > > HZ/4 == 250ms works except for HZ=122 (~246ms) and HZ=50 (~240ms). is that bad to let those have a slight different innacurate value? BTW wasnt there a jiffies2ms converter somewhere that we could use? I thought i saw something posted of that nature recently. > I don't > know how you think it is possible to find a constant around 250ms which > works for all HZ values. The problem gets even minor if we do > (HZ< if idx is 0, i.e. interval == -2. There should really be no difference between the two;-> you realize /4 is merely <<2 ? cheers, jamal From acme@conectiva.com.br Mon Oct 4 08:10:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 08:10:19 -0700 (PDT) Received: from perninha.conectiva.com.br (perninha.conectiva.com.br [200.140.247.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94FA83O008021 for ; Mon, 4 Oct 2004 08:10:10 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 0FDED47336; Mon, 4 Oct 2004 12:09:50 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id AD4A147303 for ; Mon, 4 Oct 2004 12:09:49 -0300 (BRT) Received: (qmail 3711 invoked by uid 0); 4 Oct 2004 16:06:50 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 4 Oct 2004 16:06:50 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 9020A14639; Mon, 4 Oct 2004 12:12:57 -0300 (BRT) Message-ID: <41616829.5070600@conectiva.com.br> Date: Mon, 04 Oct 2004 12:11:37 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: PATCH: [SKBUFF] introduce irda_type_trans X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------010203090900020901000700" X-Bogosity: No, tests=bogofilter, spamicity=0.344389, version=0.16.3 X-archive-position: 9874 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 8361 Lines: 258 This is a multi-part message in MIME format. --------------010203090900020901000700 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Now there are ten outstanding changesets in this tree. Regards, - Arnaldo --------------010203090900020901000700 Content-Type: text/plain; name="irda_type_trans.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="irda_type_trans.patch" =================================================================== ChangeSet@1.2039, 2004-10-04 12:09:26-03:00, acme@conectiva.com.br [SKBUFF] introduce irda_type_trans Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller drivers/net/irda/ali-ircc.c | 4 +--- drivers/net/irda/au1k_ir.c | 4 +--- drivers/net/irda/donauboe.c | 4 +--- drivers/net/irda/irda-usb.c | 4 +--- drivers/net/irda/nsc-ircc.c | 4 +--- drivers/net/irda/sa1100_ir.c | 4 +--- drivers/net/irda/smsc-ircc2.c | 4 +--- drivers/net/irda/stir4200.c | 5 +---- drivers/net/irda/via-ircc.c | 16 ++++------------ drivers/net/irda/vlsi_ir.c | 3 +-- drivers/net/irda/w83977af_ir.c | 4 +--- include/net/irda/irda.h | 10 ++++++++++ 12 files changed, 24 insertions(+), 42 deletions(-) diff -Nru a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c --- a/drivers/net/irda/ali-ircc.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/ali-ircc.c 2004-10-04 12:09:47 -03:00 @@ -1909,9 +1909,7 @@ self->stats.rx_bytes += len; self->stats.rx_packets++; - skb->dev = self->netdev; - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, self->netdev); netif_rx(skb); self->netdev->last_rx = jiffies; } diff -Nru a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c --- a/drivers/net/irda/au1k_ir.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/au1k_ir.c 2004-10-04 12:09:47 -03:00 @@ -606,9 +606,7 @@ else skb_put(skb, count-2); memcpy(skb->data, (void *)pDB->vaddr, count-2); - skb->dev = dev; - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, dev); netif_rx(skb); prxd->count_0 = 0; prxd->count_1 = 0; diff -Nru a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c --- a/drivers/net/irda/donauboe.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/donauboe.c 2004-10-04 12:09:47 -03:00 @@ -1297,9 +1297,7 @@ memcpy (skb->data, self->rx_bufs[self->rxs], len); self->stats.rx_packets++; - skb->dev = self->netdev; - skb_set_link_header(skb); - skb->protocol = htons (ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, self->netdev); } else { diff -Nru a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c --- a/drivers/net/irda/irda-usb.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/irda-usb.c 2004-10-04 12:09:47 -03:00 @@ -829,9 +829,7 @@ skb_pull(dataskb, USB_IRDA_HEADER); /* Ask the networking layer to queue the packet for the IrDA stack */ - dataskb->dev = self->netdev; - skb_set_link_header(dataskb); - dataskb->protocol = htons(ETH_P_IRDA); + dataskb->protocol = irda_type_trans(dataskb, self->netdev); netif_rx(dataskb); /* Keep stats up to date */ diff -Nru a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c --- a/drivers/net/irda/nsc-ircc.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/nsc-ircc.c 2004-10-04 12:09:47 -03:00 @@ -1731,9 +1731,7 @@ self->stats.rx_bytes += len; self->stats.rx_packets++; - skb->dev = self->netdev; - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, self->netdev); netif_rx(skb); self->netdev->last_rx = jiffies; } diff -Nru a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c --- a/drivers/net/irda/sa1100_ir.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/sa1100_ir.c 2004-10-04 12:09:47 -03:00 @@ -569,9 +569,7 @@ si->rxskb = NULL; skb_put(skb, len); - skb->dev = dev; - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, dev); si->stats.rx_packets++; si->stats.rx_bytes += len; diff -Nru a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c --- a/drivers/net/irda/smsc-ircc2.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/smsc-ircc2.c 2004-10-04 12:09:47 -03:00 @@ -1343,9 +1343,7 @@ self->stats.rx_packets++; self->stats.rx_bytes += len; - skb->dev = self->netdev; - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, self->netdev); netif_rx(skb); } diff -Nru a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c --- a/drivers/net/irda/stir4200.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/stir4200.c 2004-10-04 12:09:47 -03:00 @@ -368,10 +368,7 @@ skb_put(skb, len); - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); - skb->dev = stir->netdev; - + skb->protocol = irda_type_trans(skb, stir->netdev); netif_rx(skb); stir->stats.rx_packets++; diff -Nru a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c --- a/drivers/net/irda/via-ircc.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/via-ircc.c 2004-10-04 12:09:47 -03:00 @@ -1078,9 +1078,7 @@ self->rx_buff.data += len; self->stats.rx_bytes += len; self->stats.rx_packets++; - skb->dev = self->netdev; - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, self->netdev); netif_rx(skb); return TRUE; } @@ -1162,9 +1160,7 @@ self->rx_buff.data += len; self->stats.rx_bytes += len; self->stats.rx_packets++; - skb->dev = self->netdev; - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, self->netdev); netif_rx(skb); //F01_E @@ -1204,9 +1200,7 @@ self->rx_buff.data += len; self->stats.rx_bytes += len; self->stats.rx_packets++; - skb->dev = self->netdev; - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, self->netdev); netif_rx(skb); if (st_fifo->len < (MAX_RX_WINDOW + 2)) { RXStart(iobase, ON); @@ -1274,9 +1268,7 @@ self->rx_buff.data += len; self->stats.rx_bytes += len; self->stats.rx_packets++; - skb->dev = self->netdev; - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, self->netdev); netif_rx(skb); } //while self->RetryCount = 0; diff -Nru a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c --- a/drivers/net/irda/vlsi_ir.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/vlsi_ir.c 2004-10-04 12:09:47 -03:00 @@ -594,9 +594,8 @@ skb = rd->skb; rd->skb = NULL; - skb->dev = ndev; memcpy(skb_put(skb,len), rd->buf, len); - skb_set_link_header(skb); + skb->protocol = irda_type_trans(skb, ndev); if (in_interrupt()) netif_rx(skb); else diff -Nru a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c --- a/drivers/net/irda/w83977af_ir.c 2004-10-04 12:09:47 -03:00 +++ b/drivers/net/irda/w83977af_ir.c 2004-10-04 12:09:47 -03:00 @@ -919,9 +919,7 @@ self->rx_buff.data += len; self->stats.rx_packets++; - skb->dev = self->netdev; - skb_set_link_header(skb); - skb->protocol = htons(ETH_P_IRDA); + skb->protocol = irda_type_trans(skb, self->netdev); netif_rx(skb); self->netdev->last_rx = jiffies; } diff -Nru a/include/net/irda/irda.h b/include/net/irda/irda.h --- a/include/net/irda/irda.h 2004-10-04 12:09:47 -03:00 +++ b/include/net/irda/irda.h 2004-10-04 12:09:47 -03:00 @@ -111,4 +111,14 @@ #define IAS_IRCOMM_ID 0x2343 #define IAS_IRLPT_ID 0x9876 +#include + +static inline unsigned short irda_type_trans(struct sk_buff *skb, + struct net_device *dev) +{ + skb->dev = dev; + skb_set_link_header(skb); + return htons(ETH_P_IRDA); +} + #endif /* NET_IRDA_H */ --------------010203090900020901000700-- From tgraf@suug.ch Mon Oct 4 08:29:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 08:29:14 -0700 (PDT) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94FT7LP013052 for ; Mon, 4 Oct 2004 08:29:08 -0700 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id E2CE88B; Mon, 4 Oct 2004 17:28:32 +0200 (CEST) Received: by postel.suug.ch (Postfix, from userid 10001) id 7928E1C0E8; Mon, 4 Oct 2004 17:29:15 +0200 (CEST) Date: Mon, 4 Oct 2004 17:29:15 +0200 From: Thomas Graf To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 2/3] NET: Generic rate estimator Message-ID: <20041004152915.GC15898@postel.suug.ch> References: <20041003213124.GG14344@postel.suug.ch> <20041003213954.GI14344@postel.suug.ch> <20041003161436.50293f9a.davem@davemloft.net> <20041003233647.GN14344@postel.suug.ch> <1096852582.1046.378.camel@jzny.localdomain> <20041004125300.GA15898@postel.suug.ch> <1096896256.1072.4.camel@jzny.localdomain> <20041004141532.GB15898@postel.suug.ch> <1096901984.1073.9.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1096901984.1073.9.camel@jzny.localdomain> X-archive-position: 9875 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1324 Lines: 44 * jamal <1096901984.1073.9.camel@jzny.localdomain> 2004-10-04 10:59 > is that bad to let those have a slight different innacurate value? I don't see this as a problem, I think the timers will be more inacurate anyway. > BTW wasnt there a jiffies2ms converter somewhere that we could use? > I thought i saw something posted of that nature recently. #define PSCHED_US2JIFFIE(delay) #define PSCHED_JIFFIE2US(delay) but we don't have half a jiffie ;) The only way to make it accurate in the case of 122 and 50 would be to set timer_expires based on a flip-flop adding HZ/4 and (HZ/4)+1 repeaditly and this only works if HZ%2==0. I would be fine using PSCHED_ because the user can decide accuracy over performance and vice versa. It would make the code dependant on sch_api.c though. > There should really be no difference between the two;-> you realize /4 > is merely <<2 ? Oh yes there is: HZ=50, idx=2 (HZ/4)< 50/4 ans = 12.500 octave:9> dec2bin(12) ans = 1100 octave:10> bin2dec('110000') ans = 48 (HZ< dec2bin(50) ans = 110010 octave:12> bin2dec('11001000') ans = 200 octave:13> 200/4 ans = 50 It avoids carrying on the inaccuracy, of course this only works because (2*HZ)%4==0 is true for all existing HZ values. Or do I misundstand the compiler and it's all in floating points? From acme@conectiva.com.br Mon Oct 4 09:33:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 09:33:52 -0700 (PDT) Received: from perninha.conectiva.com.br (perninha.conectiva.com.br [200.140.247.100]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94GXhVr014299 for ; Mon, 4 Oct 2004 09:33:45 -0700 Received: by perninha.conectiva.com.br (Postfix, from userid 568) id 7763D473B3; Mon, 4 Oct 2004 13:33:27 -0300 (BRT) Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by perninha.conectiva.com.br (Postfix) with SMTP id 03F4D472F5 for ; Mon, 4 Oct 2004 13:33:27 -0300 (BRT) Received: (qmail 13165 invoked by uid 0); 4 Oct 2004 17:30:27 -0000 Received: from mapi8.distro.conectiva (HELO oops.ghostprotocols.net) (10.0.16.10) by burns.conectiva with SMTP; 4 Oct 2004 17:30:27 -0000 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 5CA1E14639; Mon, 4 Oct 2004 13:36:34 -0300 (BRT) Message-ID: <41617BC2.7010004@conectiva.com.br> Date: Mon, 04 Oct 2004 13:35:14 -0300 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [SKBUFF] introduce skb_valid_link_header(skb, hdrlen) X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------020704050702080000070909" X-Bogosity: No, tests=bogofilter, spamicity=0.391096, version=0.16.3 X-archive-position: 9876 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 5081 Lines: 144 This is a multi-part message in MIME format. --------------020704050702080000070909 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please consider pulling from: bk://kernel.bkbits.net/acme/sk_buff-2.6 Nowadays only the netfilter folks use such thing, in an open coded way, but this seems useful for other cases, so I've moved it to skbuff.h, abstracting another direct reference to the skb "wannabe-private" headers. Now there are eleven outstanding changesets in this tree. Best Regards, - Arnaldo --------------020704050702080000070909 Content-Type: text/plain; name="skb_valid_link_header.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="skb_valid_link_header.patch" =================================================================== ChangeSet@1.2040, 2004-10-04 13:21:41-03:00, acme@amd64.kerneljanitors.org [SKBUFF] introduce skb_valid_link_header(skb, hdrlen) Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller drivers/message/fusion/mptlan.c | 2 +- include/linux/skbuff.h | 7 +++++++ net/bridge/br_netfilter.c | 2 +- net/ipv4/netfilter/ipt_mac.c | 5 ++--- net/ipv6/netfilter/ip6t_eui64.c | 10 ++++------ net/ipv6/netfilter/ip6t_mac.c | 5 ++--- 6 files changed, 17 insertions(+), 14 deletions(-) diff -Nru a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c --- a/drivers/message/fusion/mptlan.c 2004-10-04 13:23:51 -03:00 +++ b/drivers/message/fusion/mptlan.c 2004-10-04 13:23:51 -03:00 @@ -770,7 +770,7 @@ pSendReq = (LANSendRequest_t *) mf; - /* Set the mac.raw pointer, since this apparently isn't getting + /* Set the link header pointer, since this apparently isn't getting * done before we get the skb. Pull the data pointer past the mac data. */ skb_set_link_header(skb); diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h --- a/include/linux/skbuff.h 2004-10-04 13:23:51 -03:00 +++ b/include/linux/skbuff.h 2004-10-04 13:23:51 -03:00 @@ -295,6 +295,13 @@ skb->mac.raw = skb->data; } +static inline int skb_valid_link_header(const struct sk_buff *skb, + const int hdrlen) +{ + return skb->mac.raw >= skb->head && + (skb->mac.raw + hdrlen) <= skb->data; +} + extern void __kfree_skb(struct sk_buff *skb); extern struct sk_buff *alloc_skb(unsigned int size, int priority); extern void kfree_skbmem(struct sk_buff *skb); diff -Nru a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c --- a/net/bridge/br_netfilter.c 2004-10-04 13:23:51 -03:00 +++ b/net/bridge/br_netfilter.c 2004-10-04 13:23:51 -03:00 @@ -759,7 +759,7 @@ #ifdef CONFIG_NETFILTER_DEBUG /* Be very paranoid. This probably won't happen anymore, but let's * keep the check just to be sure... */ - if (skb->mac.raw < skb->head || skb->mac.raw + ETH_HLEN > skb->data) { + if (!skb_valid_link_header(skb, ETH_HLEN)) { printk(KERN_CRIT "br_netfilter: Argh!! br_nf_post_routing: " "bad mac.raw pointer."); goto print_error; diff -Nru a/net/ipv4/netfilter/ipt_mac.c b/net/ipv4/netfilter/ipt_mac.c --- a/net/ipv4/netfilter/ipt_mac.c 2004-10-04 13:23:51 -03:00 +++ b/net/ipv4/netfilter/ipt_mac.c 2004-10-04 13:23:51 -03:00 @@ -30,10 +30,9 @@ const struct ipt_mac_info *info = matchinfo; /* Is mac pointer valid? */ - return (skb->mac.raw >= skb->head - && (skb->mac.raw + ETH_HLEN) <= skb->data + return (skb_valid_link_header(skb, ETH_HLEN) && /* If so, compare... */ - && ((memcmp(eth_hdr(skb)->h_source, info->srcaddr, ETH_ALEN) + ((memcmp(eth_hdr(skb)->h_source, info->srcaddr, ETH_ALEN) == 0) ^ info->invert)); } diff -Nru a/net/ipv6/netfilter/ip6t_eui64.c b/net/ipv6/netfilter/ip6t_eui64.c --- a/net/ipv6/netfilter/ip6t_eui64.c 2004-10-04 13:23:51 -03:00 +++ b/net/ipv6/netfilter/ip6t_eui64.c 2004-10-04 13:23:51 -03:00 @@ -32,12 +32,10 @@ unsigned char eui64[8]; int i=0; - if ( !(skb->mac.raw >= skb->head - && (skb->mac.raw + ETH_HLEN) <= skb->data) - && offset != 0) { - *hotdrop = 1; - return 0; - } + if (!skb_valid_link_header(skb, ETH_HLEN) && offset != 0) { + *hotdrop = 1; + return 0; + } memset(eui64, 0, sizeof(eui64)); diff -Nru a/net/ipv6/netfilter/ip6t_mac.c b/net/ipv6/netfilter/ip6t_mac.c --- a/net/ipv6/netfilter/ip6t_mac.c 2004-10-04 13:23:51 -03:00 +++ b/net/ipv6/netfilter/ip6t_mac.c 2004-10-04 13:23:51 -03:00 @@ -32,10 +32,9 @@ const struct ip6t_mac_info *info = matchinfo; /* Is mac pointer valid? */ - return (skb->mac.raw >= skb->head - && (skb->mac.raw + ETH_HLEN) <= skb->data + return (skb_valid_link_header(skb, ETH_HLEN) && /* If so, compare... */ - && ((memcmp(eth_hdr(skb)->h_source, info->srcaddr, ETH_ALEN) + ((memcmp(eth_hdr(skb)->h_source, info->srcaddr, ETH_ALEN) == 0) ^ info->invert)); } --------------020704050702080000070909-- From pranav@nodeinfotech.com Mon Oct 4 11:07:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 11:07:41 -0700 (PDT) Received: from localhost.localdomain (dialpool-210-214-18-141.maa.sify.net [210.214.18.141]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94I7ZRC016125; Mon, 4 Oct 2004 11:07:36 -0700 Received: from pranav ([192.168.10.220]) by localhost.localdomain (8.11.2/8.11.2) with SMTP id i94IHa502628; Mon, 4 Oct 2004 23:47:36 +0530 Reply-To: From: "Pranav" To: "David S. Miller" Cc: , , Subject: HELP NEEDED!!! Date: Mon, 4 Oct 2004 23:37:14 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <20041003145909.6dc704dc.davem@davemloft.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-archive-position: 9877 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pranav@nodeinfotech.com Precedence: bulk X-list: netdev Content-Length: 504 Lines: 19 Hi everyone, I have got a small problem regarding configuring my ethernet card,while loading the eth0 driver the kernel performs auto-probing for the device and configures the eth0 to half-duplex. I used command line arguments while loading modules insmod 8139too io=0x280 irq=10 duplex=2 but still it performs the autoprobing overriding the parameters. Please help me out of this problem,i want to configure my ethernetcard to fullduplex. Waiting for a reply... With Regards, Pranav. From pranav@nodeinfotech.com Mon Oct 4 11:09:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 11:09:25 -0700 (PDT) Received: from localhost.localdomain (dialpool-210-214-18-141.maa.sify.net [210.214.18.141]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94I9JvU016360; Mon, 4 Oct 2004 11:09:20 -0700 Received: from pranav ([192.168.10.220]) by localhost.localdomain (8.11.2/8.11.2) with SMTP id i94IJP502632; Mon, 4 Oct 2004 23:49:25 +0530 Reply-To: From: "Pranav" To: , , Subject: HELP NEEDED!!! Date: Mon, 4 Oct 2004 23:39:04 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-archive-position: 9878 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pranav@nodeinfotech.com Precedence: bulk X-list: netdev Content-Length: 504 Lines: 19 Hi everyone, I have got a small problem regarding configuring my ethernet card,while loading the eth0 driver the kernel performs auto-probing for the device and configures the eth0 to half-duplex. I used command line arguments while loading modules insmod 8139too io=0x280 irq=10 duplex=2 but still it performs the autoprobing overriding the parameters. Please help me out of this problem,i want to configure my ethernetcard to fullduplex. Waiting for a reply... With Regards, Pranav. From jgarzik@pobox.com Mon Oct 4 11:15:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 11:15:51 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94IFkQF016942; Mon, 4 Oct 2004 11:15:46 -0700 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CEXMx-0000d0-OD; Mon, 04 Oct 2004 19:15:31 +0100 Message-ID: <41619336.8080805@pobox.com> Date: Mon, 04 Oct 2004 14:15:18 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pranav@nodeinfotech.com CC: "David S. Miller" , netdev-bounce@oss.sgi.com, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: HELP NEEDED!!! References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 9879 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 505 Lines: 19 Pranav wrote: > Hi everyone, > > I have got a small problem regarding configuring my ethernet > card,while loading the eth0 driver the kernel performs auto-probing for the > device and configures the eth0 to half-duplex. > > I used command line arguments while loading modules > insmod 8139too io=0x280 irq=10 duplex=2 8139too module does not take any arguments like io= or irq=. PCI cards do not need such parameters. You may use ethtool to select half-duplex or full-duplex. Jeff From davem@davemloft.net Mon Oct 4 12:20:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 04 Oct 2004 12:21:00 -0700 (PDT) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i94JKnQw021570 for ; Mon, 4 Oct 2004 12:20:49 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CEYLQ-0004lI-00; Mon, 04 Oct 2004 12:18:00 -0700 Date: Mon, 4 Oct 2004 12:17:59 -0700 From: "David S. Miller" To: Harald Welte Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.4] backport neighbour cache redesign Message-Id: <20041004121759.26798f1d.davem@davemloft.net> In-Reply-To: <20040930154753.GD1860@sunbeam.de.gnumonks.org> References: <20040930154753.GD1860@sunbeam.de.gnumonks.org> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 9880 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 65815 Lines: 2457 Ok I started playing with this, here is what I have currently. Changes: 1) Merge in missing fixes from 2.6.x port. In particular: - missing "recalculate hash rand on hash grow" - missing ARP clip fixes (was initializing neigh table by hand, needed to use net/core/neighbour.c interfaces for that). This one wasn't Harald's fault as this fix was made after he created this 2.4.x backport 2) Missing symbol exports for the new interfaces modules can use, namely: neigh_lookup_nodev neigh_seq_start neigh_seq_next neigh_seq_stop 3) Delete instead of "#if 0" out the now totally unused code inside of net/atm/clip.c We need to test and verify this patch a lot before I can toss such a big thing over to Marcelo, but I definitely intend to send this to him. ===== drivers/net/bonding/bond_main.c 1.86 vs edited ===== --- 1.86/drivers/net/bonding/bond_main.c 2004-01-21 08:55:17 -08:00 +++ edited/drivers/net/bonding/bond_main.c 2004-10-03 15:12:55 -07:00 @@ -3086,8 +3086,6 @@ out: #ifdef CONFIG_PROC_FS -#define SEQ_START_TOKEN ((void *)1) - static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos) { struct bonding *bond = seq->private; ===== fs/proc/root.c 1.8 vs edited ===== --- 1.8/fs/proc/root.c 2003-11-15 08:23:40 -08:00 +++ edited/fs/proc/root.c 2004-10-03 15:12:55 -07:00 @@ -17,7 +17,7 @@ #include #include -struct proc_dir_entry *proc_net, *proc_bus, *proc_root_fs, *proc_root_driver; +struct proc_dir_entry *proc_net, *proc_net_stat, *proc_bus, *proc_root_fs, *proc_root_driver; #ifdef CONFIG_SYSCTL struct proc_dir_entry *proc_sys_root; @@ -38,6 +38,8 @@ void __init proc_root_init(void) } proc_misc_init(); proc_net = proc_mkdir("net", 0); + proc_net_stat = proc_mkdir("net/stat", NULL); + #ifdef CONFIG_SYSVIPC proc_mkdir("sysvipc", 0); #endif @@ -143,5 +145,6 @@ EXPORT_SYMBOL(remove_proc_entry); EXPORT_SYMBOL(proc_root); EXPORT_SYMBOL(proc_root_fs); EXPORT_SYMBOL(proc_net); +EXPORT_SYMBOL(proc_net_stat); EXPORT_SYMBOL(proc_bus); EXPORT_SYMBOL(proc_root_driver); ===== include/linux/proc_fs.h 1.9 vs edited ===== --- 1.9/include/linux/proc_fs.h 2003-09-15 01:39:45 -07:00 +++ edited/include/linux/proc_fs.h 2004-10-03 15:12:55 -07:00 @@ -79,6 +79,7 @@ struct proc_dir_entry { extern struct proc_dir_entry proc_root; extern struct proc_dir_entry *proc_root_fs; extern struct proc_dir_entry *proc_net; +extern struct proc_dir_entry *proc_net_stat; extern struct proc_dir_entry *proc_bus; extern struct proc_dir_entry *proc_root_driver; extern struct proc_dir_entry *proc_root_kcore; @@ -168,6 +169,16 @@ static inline struct proc_dir_entry *pro mode_t mode, get_info_t *get_info) { return create_proc_info_entry(name,mode,proc_net,get_info); +} + +static inline struct proc_dir_entry *proc_net_fops_create(const char *name, + mode_t mode, struct file_operations *fops) +{ + struct proc_dir_entry *res = create_proc_entry(name, mode, proc_net); + + if (res) + res->proc_fops = fops; + return res; } static inline void proc_net_remove(const char *name) ===== include/linux/seq_file.h 1.3 vs edited ===== --- 1.3/include/linux/seq_file.h 2003-08-25 09:34:39 -07:00 +++ edited/include/linux/seq_file.h 2004-10-03 15:12:55 -07:00 @@ -65,5 +65,8 @@ int seq_path(struct seq_file *, struct v int single_open(struct file *, int (*)(struct seq_file *, void *), void *); int single_release(struct inode *, struct file *); int seq_release_private(struct inode *, struct file *); + +#define SEQ_START_TOKEN ((void *)1) + #endif #endif ===== include/net/dn_neigh.h 1.1 vs edited ===== --- 1.1/include/net/dn_neigh.h 2002-02-05 09:39:49 -08:00 +++ edited/include/net/dn_neigh.h 2004-10-03 15:12:55 -07:00 @@ -18,7 +18,6 @@ struct dn_neigh { extern void dn_neigh_init(void); extern void dn_neigh_cleanup(void); -extern struct neighbour *dn_neigh_lookup(struct neigh_table *tbl, void *ptr); extern int dn_neigh_router_hello(struct sk_buff *skb); extern int dn_neigh_endnode_hello(struct sk_buff *skb); extern void dn_neigh_pointopoint_hello(struct sk_buff *skb); ===== include/net/neighbour.h 1.3 vs edited ===== --- 1.3/include/net/neighbour.h 2004-07-15 13:33:03 -07:00 +++ edited/include/net/neighbour.h 2004-10-03 15:12:55 -07:00 @@ -7,6 +7,11 @@ * Authors: * Pedro Roque * Alexey Kuznetsov + * + * Changes: + * + * Harald Welte: + * - Add neighbour cache statistics like rtstat */ /* The following flags & states are exported to user space, @@ -45,6 +50,7 @@ #include #include +#include #define NUD_IN_TIMER (NUD_INCOMPLETE|NUD_DELAY|NUD_PROBE) #define NUD_VALID (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY) @@ -78,12 +84,25 @@ struct neigh_parms struct neigh_statistics { - unsigned long allocs; - unsigned long res_failed; - unsigned long rcv_probes_mcast; - unsigned long rcv_probes_ucast; + unsigned long allocs; /* number of allocated neighs */ + unsigned long destroys; /* number of destroyed neighs */ + unsigned long hash_grows; /* number of hash resizes */ + + unsigned long res_failed; /* nomber of failed resolutions */ + + unsigned long lookups; /* number of lookups */ + unsigned long hits; /* number of hits (among lookups) */ + + unsigned long rcv_probes_mcast; /* number of received mcast ipv6 */ + unsigned long rcv_probes_ucast; /* number of received ucast ipv6 */ + + unsigned long periodic_gc_runs; /* number of periodic GC runs */ + unsigned long forced_gc_runs; /* number of forced GC runs */ }; +#define NEIGH_CACHE_STAT_INC(tbl, field) \ + ((tbl)->stats[smp_processor_id()].field++) + struct neighbour { struct neighbour *next; @@ -128,9 +147,6 @@ struct pneigh_entry u8 key[0]; }; -#define NEIGH_HASHMASK 0x1F -#define PNEIGH_HASHMASK 0xF - /* * neighbour table manipulation */ @@ -164,9 +180,15 @@ struct neigh_table struct neigh_parms *parms_list; kmem_cache_t *kmem_cachep; struct tasklet_struct gc_task; - struct neigh_statistics stats; - struct neighbour *hash_buckets[NEIGH_HASHMASK+1]; - struct pneigh_entry *phash_buckets[PNEIGH_HASHMASK+1]; + struct neigh_statistics stats[NR_CPUS]; + struct neighbour **hash_buckets; + unsigned int hash_mask; + __u32 hash_rnd; + unsigned int hash_chain_gc; + struct pneigh_entry **phash_buckets; +#ifdef CONFIG_PROC_FS + struct proc_dir_entry *pde; +#endif }; extern void neigh_table_init(struct neigh_table *tbl); @@ -174,6 +196,8 @@ extern int neigh_table_clear(struct ne extern struct neighbour * neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev); +extern struct neighbour * neigh_lookup_nodev(struct neigh_table *tbl, + const void *pkey); extern struct neighbour * neigh_create(struct neigh_table *tbl, const void *pkey, struct net_device *dev); @@ -204,6 +228,24 @@ extern int neigh_dump_info(struct sk_buf extern int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); extern void neigh_app_ns(struct neighbour *n); + +extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); +extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); +extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *)); + +struct neigh_seq_state { + struct neigh_table *tbl; + void *(*neigh_sub_iter)(struct neigh_seq_state *state, + struct neighbour *n, loff_t *pos); + unsigned int bucket; + unsigned int flags; +#define NEIGH_SEQ_NEIGH_ONLY 0x00000001 +#define NEIGH_SEQ_IS_PNEIGH 0x00000002 +#define NEIGH_SEQ_SKIP_NOARP 0x00000004 +}; +extern void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *, unsigned int); +extern void *neigh_seq_next(struct seq_file *, void *, loff_t *); +extern void neigh_seq_stop(struct seq_file *, void *); extern int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, int p_id, int pdev_id, char *p_name); ===== net/netsyms.c 1.49 vs edited ===== --- 1.49/net/netsyms.c 2004-08-29 21:11:49 -07:00 +++ edited/net/netsyms.c 2004-10-03 19:14:10 -07:00 @@ -179,9 +179,13 @@ EXPORT_SYMBOL(neigh_connected_output); EXPORT_SYMBOL(neigh_update); EXPORT_SYMBOL(neigh_create); EXPORT_SYMBOL(neigh_lookup); +EXPORT_SYMBOL(neigh_lookup_nodev); EXPORT_SYMBOL(__neigh_event_send); EXPORT_SYMBOL(neigh_event_ns); EXPORT_SYMBOL(neigh_ifdown); +EXPORT_SYMBOL(neigh_seq_start); +EXPORT_SYMBOL(neigh_seq_next); +EXPORT_SYMBOL(neigh_seq_stop); #ifdef CONFIG_ARPD EXPORT_SYMBOL(neigh_app_ns); #endif ===== net/atm/clip.c 1.13 vs edited ===== --- 1.13/net/atm/clip.c 2004-02-04 23:20:52 -08:00 +++ edited/net/atm/clip.c 2004-10-03 15:19:49 -07:00 @@ -1,6 +1,10 @@ /* net/atm/clip.c - RFC1577 Classical IP over ATM */ -/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ +/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA + * + * Changes: + * Harald Welte : + * - backport DaveM's generalized neighbour cache from 2.6.9-rcX */ #include @@ -24,6 +28,7 @@ #include /* for IFF_UP */ #include #include +#include #include /* for struct rtable and routing */ #include /* icmp_send */ #include /* for HZ */ @@ -119,64 +124,49 @@ out: spin_unlock_bh(&entry->neigh->dev->xmit_lock); } - -static void idle_timer_check(unsigned long dummy) +/* The neighbour entry n->lock is held. */ +static int neigh_check_cb(struct neighbour *n) { - int i; + struct atmarp_entry *entry = NEIGH2ENTRY(n); + struct clip_vcc *cv; - /*DPRINTK("idle_timer_check\n");*/ - write_lock(&clip_tbl.lock); - for (i = 0; i <= NEIGH_HASHMASK; i++) { - struct neighbour **np; + for (cv = entry->vccs; cv; cv = cv->next) { + unsigned long exp = cv->last_use + cv->idle_timeout; - for (np = &clip_tbl.hash_buckets[i]; *np;) { - struct neighbour *n = *np; - struct atmarp_entry *entry = NEIGH2ENTRY(n); - struct clip_vcc *clip_vcc; - - write_lock(&n->lock); - - for (clip_vcc = entry->vccs; clip_vcc; - clip_vcc = clip_vcc->next) - if (clip_vcc->idle_timeout && - time_after(jiffies, clip_vcc->last_use+ - clip_vcc->idle_timeout)) { - DPRINTK("releasing vcc %p->%p of " - "entry %p\n",clip_vcc,clip_vcc->vcc, - entry); - vcc_release_async(clip_vcc->vcc, - -ETIMEDOUT); - } - if (entry->vccs || - time_before(jiffies, entry->expires)) { - np = &n->next; - write_unlock(&n->lock); - continue; - } - if (atomic_read(&n->refcnt) > 1) { - struct sk_buff *skb; - - DPRINTK("destruction postponed with ref %d\n", - atomic_read(&n->refcnt)); - while ((skb = skb_dequeue(&n->arp_queue)) != - NULL) - dev_kfree_skb(skb); - np = &n->next; - write_unlock(&n->lock); - continue; - } - *np = n->next; - DPRINTK("expired neigh %p\n",n); - n->dead = 1; - write_unlock(&n->lock); - neigh_release(n); + if (cv->idle_timeout && time_after(jiffies, exp)) { + DPRINTK("releasing vcc %p->%p of entry %p\n", + cv, cv->vcc, entry); + vcc_release_async(cv->vcc, -ETIMEDOUT); } } + + if (entry->vccs || time_before(jiffies, entry->expires)) + return 0; + + if (atomic_read(&n->refcnt) > 1) { + struct sk_buff *skb; + + DPRINTK("destruction postponed with ref %d\n", + atomic_read(&n->refcnt)); + + while ((skb = skb_dequeue(&n->arp_queue)) != NULL) + dev_kfree_skb(skb); + + return 0; + } + + DPRINTK("expired neigh %p\n",n); + return 1; +} + +static void idle_timer_check(unsigned long dummy) +{ + write_lock(&clip_tbl.lock); + __neigh_for_each_release(&clip_tbl, neigh_check_cb); mod_timer(&idle_timer, jiffies+CLIP_CHECK_INTERVAL*HZ); write_unlock(&clip_tbl.lock); } - static int clip_arp_rcv(struct sk_buff *skb) { struct atm_vcc *vcc; @@ -320,15 +310,7 @@ static int clip_constructor(struct neigh static u32 clip_hash(const void *pkey, const struct net_device *dev) { - u32 hash_val; - - hash_val = *(u32*)pkey; - hash_val ^= (hash_val>>16); - hash_val ^= hash_val>>8; - hash_val ^= hash_val>>3; - hash_val = (hash_val^dev->ifindex)&NEIGH_HASHMASK; - - return hash_val; + return jhash_2words(*(u32 *)pkey, dev->ifindex, clip_tbl.hash_rnd); } @@ -768,19 +750,7 @@ static struct atm_clip_ops __atm_clip_op static int __init atm_clip_init(void) { - /* we should use neigh_table_init() */ - clip_tbl.lock = RW_LOCK_UNLOCKED; - clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id, - clip_tbl.entry_size, 0, SLAB_HWCACHE_ALIGN, NULL, NULL); - - if (!clip_tbl.kmem_cachep) - return -ENOMEM; - - /* so neigh_ifdown() doesn't complain */ - clip_tbl.proxy_timer.data = 0; - clip_tbl.proxy_timer.function = 0; - init_timer(&clip_tbl.proxy_timer); - skb_queue_head_init(&clip_tbl.proxy_queue); + neigh_table_init(&clip_tbl); clip_tbl_hook = &clip_tbl; atm_clip_ops_set(&__atm_clip_ops); @@ -794,7 +764,18 @@ static void __exit atm_clip_exit(void) atm_clip_ops_set(NULL); + /* First, stop the idle timer, so it stops banging + * on the table. + */ + if (start_timer == 0) + del_timer(&idle_timer); + + /* Next, purge the table, so that the device + * unregister loop below does not hang due to + * device references remaining in the table. + */ neigh_ifdown(&clip_tbl, NULL); + dev = clip_devs; while (dev) { next = PRIV(dev)->next; @@ -802,9 +783,9 @@ static void __exit atm_clip_exit(void) kfree(dev); dev = next; } - if (start_timer == 0) del_timer(&idle_timer); - kmem_cache_destroy(clip_tbl.kmem_cachep); + /* Now it is safe to fully shutdown whole table. */ + neigh_table_clear(&clip_tbl); clip_tbl_hook = NULL; } ===== net/atm/proc.c 1.11 vs edited ===== --- 1.11/net/atm/proc.c 2003-10-14 14:01:53 -07:00 +++ edited/net/atm/proc.c 2004-10-03 15:30:31 -07:00 @@ -44,11 +44,6 @@ #include "ipcommon.h" #endif -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) -#include "lec.h" -#include "lec_arpc.h" -#endif - static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count, loff_t *pos); static ssize_t proc_spec_atm_read(struct file *file,char *buf,size_t count, @@ -90,74 +85,202 @@ static void dev_info(const struct atm_de #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) +#define SEQ_NO_VCC_TOKEN ((void *) 2) -static int svc_addr(char *buf,struct sockaddr_atmsvc *addr) +static void svc_addr(struct seq_file *seq, struct sockaddr_atmsvc *addr) { static int code[] = { 1,2,10,6,1,0 }; static int e164[] = { 1,8,4,6,1,0 }; - int *fields; - int len,i,j,pos; - len = 0; if (*addr->sas_addr.pub) { - strcpy(buf,addr->sas_addr.pub); - len = strlen(addr->sas_addr.pub); - buf += len; - if (*addr->sas_addr.prv) { - *buf++ = '+'; - len++; - } + seq_printf(seq, "%s", addr->sas_addr.pub); + if (*addr->sas_addr.prv) + seq_putc(seq, '+'); + } else if (!*addr->sas_addr.prv) { + seq_printf(seq, "%s", "(none)"); + return; } - else if (!*addr->sas_addr.prv) { - strcpy(buf,"(none)"); - return strlen(buf); - } if (*addr->sas_addr.prv) { - len += 44; - pos = 0; - fields = *addr->sas_addr.prv == ATM_AFI_E164 ? e164 : code; + unsigned char *prv = addr->sas_addr.prv; + int *fields; + int i, j; + + fields = *prv == ATM_AFI_E164 ? e164 : code; for (i = 0; fields[i]; i++) { - for (j = fields[i]; j; j--) { - sprintf(buf,"%02X",addr->sas_addr.prv[pos++]); - buf += 2; - } - if (fields[i+1]) *buf++ = '.'; + for (j = fields[i]; j; j--) + seq_printf(seq, "%02X", *prv++); + if (fields[i+1]) + seq_putc(seq, '.'); } } - return len; } -static void atmarp_info(struct net_device *dev,struct atmarp_entry *entry, - struct clip_vcc *clip_vcc,char *buf) -{ - unsigned char *ip; - int svc,off,ip_len; - - svc = !clip_vcc || clip_vcc->vcc->sk->family == AF_ATMSVC; - off = sprintf(buf,"%-6s%-4s%-4s%5ld ",dev->name,svc ? "SVC" : "PVC", - !clip_vcc || clip_vcc->encap ? "LLC" : "NULL", - (jiffies-(clip_vcc ? clip_vcc->last_use : entry->neigh->used))/ - HZ); - ip = (unsigned char *) &entry->ip; - ip_len = sprintf(buf+off,"%d.%d.%d.%d",ip[0],ip[1],ip[2],ip[3]); - off += ip_len; - while (ip_len++ < 16) buf[off++] = ' '; - if (!clip_vcc) +static void atmarp_info(struct seq_file *seq, struct net_device *dev,struct + atmarp_entry *entry, struct clip_vcc *clip_vcc) { + unsigned long exp; + char buf[17]; + int svc, llc, off; + + svc = ((clip_vcc == SEQ_NO_VCC_TOKEN) || + (clip_vcc->vcc->sk->family == AF_ATMSVC)); + + llc = ((clip_vcc == SEQ_NO_VCC_TOKEN) || + (clip_vcc->encap)); + + if (clip_vcc == SEQ_NO_VCC_TOKEN) + exp = entry->neigh->used; + else + exp = clip_vcc->last_use; + + exp = (jiffies - exp) / HZ; + + seq_printf(seq, "%-6s%-4s%-4s%5ld ", + dev->name, + svc ? "SVC" : "PVC", + llc ? "LLC" : "NULL", + exp); + + off = snprintf(buf, sizeof(buf)-1, "%d.%d.%d.%d", NIPQUAD(entry->ip)); + while (off < 16) + buf[off++] = ' '; + buf[off] = '\0'; + seq_printf(seq, "%s", buf); + + if (clip_vcc == SEQ_NO_VCC_TOKEN) { if (time_before(jiffies, entry->expires)) - strcpy(buf+off,"(resolving)\n"); - else sprintf(buf+off,"(expired, ref %d)\n", - atomic_read(&entry->neigh->refcnt)); - else if (!svc) - sprintf(buf+off,"%d.%d.%d\n",clip_vcc->vcc->dev->number, - clip_vcc->vcc->vpi,clip_vcc->vcc->vci); - else { - off += svc_addr(buf+off,&clip_vcc->vcc->remote); - strcpy(buf+off,"\n"); + seq_printf(seq, "(resolving)\n"); + else + seq_printf(seq, "(expired, ref %d)\n", + atomic_read(&entry->neigh->refcnt)); + } else if (!svc) { + seq_printf(seq, "%d.%d.%d\n", + clip_vcc->vcc->dev->number, + clip_vcc->vcc->vpi, + clip_vcc->vcc->vci); + } else { + svc_addr(seq, &clip_vcc->vcc->remote); + seq_putc(seq, '\n'); + } +} + +struct clip_seq_state { + /* This member must be first. */ + struct neigh_seq_state ns; + + /* Local to clip specific iteration. */ + struct clip_vcc *vcc; +}; + +static struct clip_vcc *clip_seq_next_vcc(struct atmarp_entry *e, + struct clip_vcc *curr) +{ + if (!curr) { + curr = e->vccs; + if (!curr) + return SEQ_NO_VCC_TOKEN; + return curr; + } + + if (curr == SEQ_NO_VCC_TOKEN) + return NULL; + + curr = curr->next; + + return curr; +} + +static void *clip_seq_vcc_walk(struct clip_seq_state *state, + struct atmarp_entry *e, loff_t *pos) +{ + struct clip_vcc *vcc = state->vcc; + + vcc = clip_seq_next_vcc(e, vcc); + if (vcc && pos != NULL) { + while (*pos) { + vcc = clip_seq_next_vcc(e, vcc); + if (!vcc) + break; + --(*pos); } + } + state->vcc = vcc; + + return vcc; +} + +static void *clip_seq_sub_iter(struct neigh_seq_state *_state, + struct neighbour *n, loff_t *pos) +{ + struct clip_seq_state *state = (struct clip_seq_state *) _state; + + return clip_seq_vcc_walk(state, NEIGH2ENTRY(n), pos); +} + +static void *clip_seq_start(struct seq_file *seq, loff_t *pos) +{ + return neigh_seq_start(seq, pos, clip_tbl_hook, NEIGH_SEQ_NEIGH_ONLY); +} + +static int clip_seq_show(struct seq_file *seq, void *v) +{ + static char atm_arp_banner[] = + "IPitf TypeEncp Idle IP address ATM address\n"; + + if (v == SEQ_START_TOKEN) { + seq_puts(seq, atm_arp_banner); + } else { + struct clip_seq_state *state = seq->private; + struct neighbour *n = v; + struct clip_vcc *vcc = state->vcc; + + atmarp_info(seq, n->dev, NEIGH2ENTRY(n), vcc); + } + return 0; } +static struct seq_operations arp_seq_ops = { + .start = clip_seq_start, + .next = neigh_seq_next, + .stop = neigh_seq_stop, + .show = clip_seq_show, +}; +static int arp_seq_open(struct inode *inode, struct file *file) +{ + struct clip_seq_state *state; + struct seq_file *seq; + int rc = -EAGAIN; + + state = kmalloc(sizeof(*state), GFP_KERNEL); + if (!state) { + rc = -ENOMEM; + goto out_kfree; + } + memset(state, 0, sizeof(*state)); + state->ns.neigh_sub_iter = clip_seq_sub_iter; + + rc = seq_open(file, &arp_seq_ops); + if (rc) + goto out_kfree; + + seq = file->private_data; + seq->private = state; +out: + return rc; + +out_kfree: + kfree(state); + goto out; +} + +static struct file_operations arp_seq_fops = { + .open = arp_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release_private, + .owner = THIS_MODULE, +}; #endif @@ -250,57 +373,6 @@ static void svc_info(struct atm_vcc *vcc } -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - -static char* -lec_arp_get_status_string(unsigned char status) -{ - switch(status) { - case ESI_UNKNOWN: - return "ESI_UNKNOWN "; - case ESI_ARP_PENDING: - return "ESI_ARP_PENDING "; - case ESI_VC_PENDING: - return "ESI_VC_PENDING "; - case ESI_FLUSH_PENDING: - return "ESI_FLUSH_PENDING "; - case ESI_FORWARD_DIRECT: - return "ESI_FORWARD_DIRECT"; - default: - return " "; - } -} - -static void -lec_info(struct lec_arp_table *entry, char *buf) -{ - int j, offset=0; - - for(j=0;jmac_addr[j]); - } - offset+=sprintf(buf+offset, " "); - for(j=0;jatm_addr[j]); - } - offset+=sprintf(buf+offset, " %s %4.4x", - lec_arp_get_status_string(entry->status), - entry->flags&0xffff); - if (entry->vcc) { - offset+=sprintf(buf+offset, "%3d %3d ", entry->vcc->vpi, - entry->vcc->vci); - } else - offset+=sprintf(buf+offset, " "); - if (entry->recv_vcc) { - offset+=sprintf(buf+offset, " %3d %3d", - entry->recv_vcc->vpi, entry->recv_vcc->vci); - } - - sprintf(buf+offset,"\n"); -} - -#endif - static int atm_devices_info(loff_t pos,char *buf) { struct atm_dev *dev; @@ -416,129 +488,6 @@ static int atm_svc_info(loff_t pos,char return 0; } -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) -static int atm_arp_info(loff_t pos,char *buf) -{ - struct neighbour *n; - int i,count; - - if (!pos) { - return sprintf(buf,"IPitf TypeEncp Idle IP address " - "ATM address\n"); - } - if (!try_atm_clip_ops()) - return 0; - count = pos; - read_lock_bh(&clip_tbl_hook->lock); - for (i = 0; i <= NEIGH_HASHMASK; i++) - for (n = clip_tbl_hook->hash_buckets[i]; n; n = n->next) { - struct atmarp_entry *entry = NEIGH2ENTRY(n); - struct clip_vcc *vcc; - - if (!entry->vccs) { - if (--count) continue; - atmarp_info(n->dev,entry,NULL,buf); - read_unlock_bh(&clip_tbl_hook->lock); - if (atm_clip_ops->owner) - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); - return strlen(buf); - } - for (vcc = entry->vccs; vcc; - vcc = vcc->next) { - if (--count) continue; - atmarp_info(n->dev,entry,vcc,buf); - read_unlock_bh(&clip_tbl_hook->lock); - if (atm_clip_ops->owner) - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); - return strlen(buf); - } - } - read_unlock_bh(&clip_tbl_hook->lock); - if (atm_clip_ops->owner) - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); - return 0; -} -#endif - -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) -static int atm_lec_info(loff_t pos,char *buf) -{ - unsigned long flags; - struct lec_priv *priv; - struct lec_arp_table *entry; - int i, count, d, e; - struct net_device *dev; - - if (!pos) { - return sprintf(buf,"Itf MAC ATM destination" - " Status Flags " - "VPI/VCI Recv VPI/VCI\n"); - } - if (!try_atm_lane_ops()) - return 0; /* the lane module is not there yet */ - - count = pos; - for(d = 0; d < MAX_LEC_ITF; d++) { - dev = atm_lane_ops->get_lec(d); - if (!dev || !(priv = (struct lec_priv *) dev->priv)) - continue; - spin_lock_irqsave(&priv->lec_arp_lock, flags); - for(i = 0; i < LEC_ARP_TABLE_SIZE; i++) { - for(entry = priv->lec_arp_tables[i]; entry; entry = entry->next) { - if (--count) - continue; - e = sprintf(buf,"%s ", dev->name); - lec_info(entry, buf+e); - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - dev_put(dev); - if (atm_lane_ops->owner) - __MOD_DEC_USE_COUNT(atm_lane_ops->owner); - return strlen(buf); - } - } - for(entry = priv->lec_arp_empty_ones; entry; entry = entry->next) { - if (--count) - continue; - e = sprintf(buf,"%s ", dev->name); - lec_info(entry, buf+e); - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - dev_put(dev); - if (atm_lane_ops->owner) - __MOD_DEC_USE_COUNT(atm_lane_ops->owner); - return strlen(buf); - } - for(entry = priv->lec_no_forward; entry; entry=entry->next) { - if (--count) - continue; - e = sprintf(buf,"%s ", dev->name); - lec_info(entry, buf+e); - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - dev_put(dev); - if (atm_lane_ops->owner) - __MOD_DEC_USE_COUNT(atm_lane_ops->owner); - return strlen(buf); - } - for(entry = priv->mcast_fwds; entry; entry = entry->next) { - if (--count) - continue; - e = sprintf(buf,"%s ", dev->name); - lec_info(entry, buf+e); - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - dev_put(dev); - if (atm_lane_ops->owner) - __MOD_DEC_USE_COUNT(atm_lane_ops->owner); - return strlen(buf); - } - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - dev_put(dev); - } - if (atm_lane_ops->owner) - __MOD_DEC_USE_COUNT(atm_lane_ops->owner); - return 0; -} -#endif - - static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count, loff_t *pos) { @@ -666,7 +615,10 @@ int atm_proc_init(void) CREATE_ENTRY(svc); CREATE_ENTRY(vc); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - CREATE_ENTRY(arp); + arp = create_proc_entry("arp", S_IRUGO, atm_proc_root); + if (!arp) + goto cleanup; + arp->proc_fops = &arp_seq_fops; #endif #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) CREATE_ENTRY(lec); ===== net/core/neighbour.c 1.12 vs edited ===== --- 1.12/net/core/neighbour.c 2004-07-15 13:33:03 -07:00 +++ edited/net/core/neighbour.c 2004-10-03 15:43:21 -07:00 @@ -12,6 +12,8 @@ * * Fixes: * Vitaly E. Lavrov releasing NULL neighbor in neigh_add. + * Harald Welte Add neighbour cache statistics like rtstat + * Harald Welte port neighbour cache rework from 2.6.9-rcX */ #include @@ -20,6 +22,7 @@ #include #include #include +#include #ifdef CONFIG_SYSCTL #include #endif @@ -27,6 +30,7 @@ #include #include #include +#include #define NEIGH_DEBUG 1 @@ -45,6 +49,8 @@ #define NEIGH_PRINTK2 NEIGH_PRINTK #endif +#define PNEIGH_HASHMASK 0xF + static void neigh_timer_handler(unsigned long arg); #ifdef CONFIG_ARPD static void neigh_app_notify(struct neighbour *n); @@ -54,6 +60,7 @@ void neigh_changeaddr(struct neigh_table static int neigh_glbl_allocs; static struct neigh_table *neigh_tables; +static struct file_operations neigh_stat_seq_fops; /* Neighbour hash table buckets are protected with rwlock tbl->lock. @@ -111,27 +118,21 @@ static int neigh_forced_gc(struct neigh_ int shrunk = 0; int i; - for (i=0; i<=NEIGH_HASHMASK; i++) { + NEIGH_CACHE_STAT_INC(tbl, forced_gc_runs); + + write_lock_bh(&tbl->lock); + for (i = 0; i <= tbl->hash_mask; i++) { struct neighbour *n, **np; np = &tbl->hash_buckets[i]; - write_lock_bh(&tbl->lock); while ((n = *np) != NULL) { /* Neighbour record may be discarded if: - - nobody refers to it. - - it is not permanent - - (NEW and probably wrong) - INCOMPLETE entries are kept at least for - n->parms->retrans_time, otherwise we could - flood network with resolution requests. - It is not clear, what is better table overflow - or flooding. + * - nobody refers to it. + * - it is not permanent */ write_lock(&n->lock); if (atomic_read(&n->refcnt) == 1 && - !(n->nud_state&NUD_PERMANENT) && - (n->nud_state != NUD_INCOMPLETE || - jiffies - n->used > n->parms->retrans_time)) { + !(n->nud_state&NUD_PERMANENT)) { *np = n->next; n->dead = 1; shrunk = 1; @@ -142,10 +143,12 @@ static int neigh_forced_gc(struct neigh_ write_unlock(&n->lock); np = &n->next; } - write_unlock_bh(&tbl->lock); } tbl->last_flush = jiffies; + + write_unlock_bh(&tbl->lock); + return shrunk; } @@ -176,7 +179,7 @@ void neigh_changeaddr(struct neigh_table write_lock_bh(&tbl->lock); - for (i=0; i <= NEIGH_HASHMASK; i++) { + for (i=0; i <= tbl->hash_mask; i++) { struct neighbour *n, **np; np = &tbl->hash_buckets[i]; @@ -203,7 +206,7 @@ int neigh_ifdown(struct neigh_table *tbl write_lock_bh(&tbl->lock); - for (i=0; i<=NEIGH_HASHMASK; i++) { + for (i = 0; i <= tbl->hash_mask; i++) { struct neighbour *n, **np; np = &tbl->hash_buckets[i]; @@ -277,7 +280,7 @@ static struct neighbour *neigh_alloc(str init_timer(&n->timer); n->timer.function = neigh_timer_handler; n->timer.data = (unsigned long)n; - tbl->stats.allocs++; + NEIGH_CACHE_STAT_INC(tbl, allocs); neigh_glbl_allocs++; tbl->entries++; n->tbl = tbl; @@ -286,20 +289,104 @@ static struct neighbour *neigh_alloc(str return n; } +static struct neighbour **neigh_hash_alloc(unsigned int entries) +{ + unsigned long size = entries * sizeof(struct neighbour *); + struct neighbour **ret; + + if (size <= PAGE_SIZE) { + ret = kmalloc(size, GFP_ATOMIC); + } else { + ret = (struct neighbour **) + __get_free_pages(GFP_ATOMIC, get_order(size)); + } + if (ret) + memset(ret, 0, size); + + return ret; +} + +static void neigh_hash_free(struct neighbour **hash, unsigned int entries) +{ + unsigned long size = entries * sizeof(struct neighbour *); + + if (size <= PAGE_SIZE) + kfree(hash); + else + free_pages((unsigned long)hash, get_order(size)); +} + +static void neigh_hash_grow(struct neigh_table *tbl, unsigned long new_entries) +{ + struct neighbour **new_hash, **old_hash; + unsigned int i, new_hash_mask, old_entries; + + NEIGH_CACHE_STAT_INC(tbl, hash_grows); + + BUG_ON(new_entries & (new_entries - 1)); + new_hash = neigh_hash_alloc(new_entries); + if (!new_hash) + return; + + old_entries = tbl->hash_mask + 1; + new_hash_mask = new_entries - 1; + old_hash = tbl->hash_buckets; + + get_random_bytes(&tbl->hash_rnd, sizeof(tbl->hash_rnd)); + for (i = 0; i < old_entries; i++) { + struct neighbour *n, *next; + + for (n = old_hash[i]; n; n = next) { + unsigned int hash_val = tbl->hash(n->primary_key, n->dev); + + hash_val &= new_hash_mask; + next = n->next; + + n->next = new_hash[hash_val]; + new_hash[hash_val] = n; + } + } + tbl->hash_buckets = new_hash; + tbl->hash_mask = new_hash_mask; + + neigh_hash_free(old_hash, old_entries); +} + struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev) { struct neighbour *n; - u32 hash_val; int key_len = tbl->key_len; + u32 hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; - hash_val = tbl->hash(pkey, dev); + NEIGH_CACHE_STAT_INC(tbl, lookups); read_lock_bh(&tbl->lock); for (n = tbl->hash_buckets[hash_val]; n; n = n->next) { if (dev == n->dev && memcmp(n->primary_key, pkey, key_len) == 0) { neigh_hold(n); + NEIGH_CACHE_STAT_INC(tbl, hits); + break; + } + } + read_unlock_bh(&tbl->lock); + return n; +} + +struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, const void *pkey) +{ + struct neighbour *n; + int key_len = tbl->key_len; + u32 hash_val = tbl->hash(pkey, NULL) & tbl->hash_mask; + + NEIGH_CACHE_STAT_INC(tbl, lookups); + + read_lock_bh(&tbl->lock); + for (n = tbl->hash_buckets[hash_val]; n; n = n->next) { + if (!memcmp(n->primary_key, pkey, key_len)) { + neigh_hold(n); + NEIGH_CACHE_STAT_INC(tbl, hits); break; } } @@ -338,9 +425,11 @@ struct neighbour * neigh_create(struct n n->confirmed = jiffies - (n->parms->base_reachable_time<<1); - hash_val = tbl->hash(pkey, dev); + hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; write_lock_bh(&tbl->lock); + if (tbl->entries > (tbl->hash_mask + 1)) + neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); for (n1 = tbl->hash_buckets[hash_val]; n1; n1 = n1->next) { if (dev == n1->dev && memcmp(n1->primary_key, pkey, key_len) == 0) { @@ -418,9 +507,9 @@ int pneigh_delete(struct neigh_table *tb hash_val ^= hash_val>>4; hash_val &= PNEIGH_HASHMASK; + write_lock_bh(&tbl->lock); for (np = &tbl->phash_buckets[hash_val]; (n=*np) != NULL; np = &n->next) { if (memcmp(n->key, pkey, key_len) == 0 && n->dev == dev) { - write_lock_bh(&tbl->lock); *np = n->next; write_unlock_bh(&tbl->lock); if (tbl->pdestructor) @@ -429,6 +518,7 @@ int pneigh_delete(struct neigh_table *tb return 0; } } + write_unlock_bh(&tbl->lock); return -ENOENT; } @@ -462,6 +552,8 @@ void neigh_destroy(struct neighbour *nei { struct hh_cache *hh; + NEIGH_CACHE_STAT_INC(neigh->tbl, destroys); + if (!neigh->dead) { printk("Destroying alive neighbour %p\n", neigh); dump_stack(); @@ -566,9 +658,10 @@ static void neigh_sync(struct neighbour static void SMP_TIMER_NAME(neigh_periodic_timer)(unsigned long arg) { struct neigh_table *tbl = (struct neigh_table*)arg; - unsigned long now = jiffies; - int i; + struct neighbour *n, **np; + unsigned long expire, now = jiffies; + NEIGH_CACHE_STAT_INC(tbl, periodic_gc_runs); write_lock(&tbl->lock); @@ -583,46 +676,49 @@ static void SMP_TIMER_NAME(neigh_periodi p->reachable_time = neigh_rand_reach_time(p->base_reachable_time); } - for (i=0; i <= NEIGH_HASHMASK; i++) { - struct neighbour *n, **np; - - np = &tbl->hash_buckets[i]; - while ((n = *np) != NULL) { - unsigned state; - - write_lock(&n->lock); + np = &tbl->hash_buckets[tbl->hash_chain_gc]; + tbl->hash_chain_gc = ((tbl->hash_chain_gc + 1) & tbl->hash_mask); - state = n->nud_state; - if (state&(NUD_PERMANENT|NUD_IN_TIMER)) { - write_unlock(&n->lock); - goto next_elt; - } + while ((n = *np) != NULL) { + unsigned int state; - if ((long)(n->used - n->confirmed) < 0) - n->used = n->confirmed; + write_lock(&n->lock); + + state = n->nud_state; + if (state & (NUD_PERMANENT | NUD_IN_TIMER)) { + write_unlock(&n->lock); + goto next_elt; + } - if (atomic_read(&n->refcnt) == 1 && - (state == NUD_FAILED || now - n->used > n->parms->gc_staletime)) { - *np = n->next; - n->dead = 1; - write_unlock(&n->lock); - neigh_release(n); - continue; - } + if (time_before(n->used, n->confirmed)) + n->used = n->confirmed; - if (n->nud_state&NUD_REACHABLE && - now - n->confirmed > n->parms->reachable_time) { - n->nud_state = NUD_STALE; - neigh_suspect(n); - } + if (atomic_read(&n->refcnt) == 1 && + (state == NUD_FAILED || + time_after(now, n->used + n->parms->gc_staletime))) { + *np = n->next; + n->dead = 1; write_unlock(&n->lock); + neigh_release(n); + continue; + } + write_unlock(&n->lock); next_elt: - np = &n->next; - } + np = &n->next; } + + /* Cycle through all hash buckets every base_reachable_time/2 ticks. + * ARP entry timeouts range from 1/2 base_reachable_time to 3/2 + * base_reachable_time. + */ + expire = tbl->parms.base_reachable_time >> 1; + expire /= (tbl->hash_mask + 1); + if (!expire) + expire = 1; + + mod_timer(&tbl->gc_timer, now + expire); - mod_timer(&tbl->gc_timer, now + tbl->gc_interval); write_unlock(&tbl->lock); } @@ -680,7 +776,7 @@ static void neigh_timer_handler(unsigned neigh->nud_state = NUD_FAILED; notify = 1; - neigh->tbl->stats.res_failed++; + NEIGH_CACHE_STAT_INC(neigh->tbl, res_failed); NEIGH_PRINTK2("neigh %p is failed.\n", neigh); /* It is very thin place. report_unreachable is very complicated @@ -1132,6 +1228,7 @@ void neigh_parms_release(struct neigh_ta void neigh_table_init(struct neigh_table *tbl) { unsigned long now = jiffies; + unsigned long phsize; tbl->parms.reachable_time = neigh_rand_reach_time(tbl->parms.base_reachable_time); @@ -1141,6 +1238,30 @@ void neigh_table_init(struct neigh_table 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!tbl->kmem_cachep) + panic("cannot create neighbour cache"); + +#ifdef CONFIG_PROC_FS + tbl->pde = create_proc_entry(tbl->id, 0, proc_net_stat); + if (!tbl->pde) + panic("cannot create neighbour proc dir entry"); + tbl->pde->proc_fops = &neigh_stat_seq_fops; + tbl->pde->data = tbl; +#endif + + tbl->hash_mask = 1; + tbl->hash_buckets = neigh_hash_alloc(tbl->hash_mask + 1); + + phsize = (PNEIGH_HASHMASK + 1) * sizeof(struct pneigh_entry *); + tbl->phash_buckets = kmalloc(phsize, GFP_KERNEL); + + if (!tbl->hash_buckets || !tbl->phash_buckets) + panic("cannot allocate neighbour cache hashes"); + + memset(tbl->phash_buckets, 0, phsize); + + get_random_bytes(&tbl->hash_rnd, sizeof(tbl->hash_rnd)); + #ifdef CONFIG_SMP tasklet_init(&tbl->gc_task, SMP_TIMER_NAME(neigh_periodic_timer), (unsigned long)tbl); #endif @@ -1148,7 +1269,7 @@ void neigh_table_init(struct neigh_table tbl->lock = RW_LOCK_UNLOCKED; tbl->gc_timer.data = (unsigned long)tbl; tbl->gc_timer.function = neigh_periodic_timer; - tbl->gc_timer.expires = now + tbl->gc_interval + tbl->parms.reachable_time; + tbl->gc_timer.expires = now + 1; add_timer(&tbl->gc_timer); init_timer(&tbl->proxy_timer); @@ -1184,6 +1305,13 @@ int neigh_table_clear(struct neigh_table } } write_unlock(&neigh_tbl_lock); + + neigh_hash_free(tbl->hash_buckets, tbl->hash_mask + 1); + tbl->hash_buckets = NULL; + + kfree(tbl->phash_buckets); + tbl->phash_buckets = NULL; + #ifdef CONFIG_SYSCTL neigh_sysctl_unregister(&tbl->parms); #endif @@ -1364,7 +1492,7 @@ static int neigh_dump_table(struct neigh s_h = cb->args[1]; s_idx = idx = cb->args[2]; - for (h=0; h <= NEIGH_HASHMASK; h++) { + for (h=0; h <= tbl->hash_mask; h++) { if (h < s_h) continue; if (h > s_h) s_idx = 0; @@ -1414,6 +1542,359 @@ int neigh_dump_info(struct sk_buff *skb, return skb->len; } + +void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie) +{ + int chain; + + read_lock_bh(&tbl->lock); + for (chain = 0; chain <= tbl->hash_mask; chain++) { + struct neighbour *n; + + for (n = tbl->hash_buckets[chain]; n; n = n->next) + cb(n, cookie); + } + read_unlock_bh(&tbl->lock); +} + +/* The tbl->lock must be held as a writer and BH disabled. */ +void __neigh_for_each_release(struct neigh_table *tbl, + int (*cb)(struct neighbour *)) +{ + int chain; + + for (chain = 0; chain <= tbl->hash_mask; chain++) { + struct neighbour *n, **np; + + np = &tbl->hash_buckets[chain]; + while ((n = *np) != NULL) { + int release; + + write_lock(&n->lock); + release = cb(n); + if (release) { + *np = n->next; + n->dead = 1; + } else + np = &n->next; + write_unlock(&n->lock); + if (release) + neigh_release(n); + } + } +} + +#ifdef CONFIG_PROC_FS + +static struct neighbour *neigh_get_first(struct seq_file *seq) +{ + struct neigh_seq_state *state = seq->private; + struct neigh_table *tbl = state->tbl; + struct neighbour *n = NULL; + int bucket = state->bucket; + + state->flags &= ~NEIGH_SEQ_IS_PNEIGH; + for (bucket = 0; bucket <= tbl->hash_mask; bucket++) { + n = tbl->hash_buckets[bucket]; + + while (n) { + if (state->neigh_sub_iter) { + loff_t fakep = 0; + void *v; + + v = state->neigh_sub_iter(state, n, &fakep); + if (!v) + goto next; + } + if (!(state->flags & NEIGH_SEQ_SKIP_NOARP)) + break; + if (n->nud_state & ~NUD_NOARP) + break; + next: + n = n->next; + } + + if (n) + break; + } + state->bucket = bucket; + + return n; +} + +static struct neighbour *neigh_get_next(struct seq_file *seq, + struct neighbour *n, + loff_t *pos) +{ + struct neigh_seq_state *state = seq->private; + struct neigh_table *tbl = state->tbl; + + if (state->neigh_sub_iter) { + void *v = state->neigh_sub_iter(state, n, pos); + if (v) + return n; + } + n = n->next; + + while (1) { + while (n) { + if (state->neigh_sub_iter) { + void *v = state->neigh_sub_iter(state, n, pos); + if (v) + return n; + goto next; + } + if (!(state->flags & NEIGH_SEQ_SKIP_NOARP)) + break; + + if (n->nud_state & ~NUD_NOARP) + break; + next: + n = n->next; + } + + if (n) + break; + + if (++state->bucket > tbl->hash_mask) + break; + + n = tbl->hash_buckets[state->bucket]; + } + + if (n && pos) + --(*pos); + return n; +} + +static struct neighbour *neigh_get_idx(struct seq_file *seq, loff_t *pos) +{ + struct neighbour *n = neigh_get_first(seq); + + if (n) { + while (*pos) { + n = neigh_get_next(seq, n, pos); + if (!n) + break; + } + } + return *pos ? NULL : n; +} + +static struct pneigh_entry *pneigh_get_first(struct seq_file *seq) +{ + struct neigh_seq_state *state = seq->private; + struct neigh_table *tbl = state->tbl; + struct pneigh_entry *pn = NULL; + int bucket = state->bucket; + + state->flags |= NEIGH_SEQ_IS_PNEIGH; + for (bucket = 0; bucket <= PNEIGH_HASHMASK; bucket++) { + pn = tbl->phash_buckets[bucket]; + if (pn) + break; + } + state->bucket = bucket; + + return pn; +} + +static struct pneigh_entry *pneigh_get_next(struct seq_file *seq, + struct pneigh_entry *pn, + loff_t *pos) +{ + struct neigh_seq_state *state = seq->private; + struct neigh_table *tbl = state->tbl; + + pn = pn->next; + while (!pn) { + if (++state->bucket > PNEIGH_HASHMASK) + break; + pn = tbl->phash_buckets[state->bucket]; + if (pn) + break; + } + + if (pn && pos) + --(*pos); + + return pn; +} + +static struct pneigh_entry *pneigh_get_idx(struct seq_file *seq, loff_t *pos) +{ + struct pneigh_entry *pn = pneigh_get_first(seq); + + if (pn) { + while (*pos) { + pn = pneigh_get_next(seq, pn, pos); + if (!pn) + break; + } + } + return *pos ? NULL : pn; +} + +static void *neigh_get_idx_any(struct seq_file *seq, loff_t *pos) +{ + struct neigh_seq_state *state = seq->private; + void *rc; + + rc = neigh_get_idx(seq, pos); + if (!rc && !(state->flags & NEIGH_SEQ_NEIGH_ONLY)) + rc = pneigh_get_idx(seq, pos); + + return rc; +} + +void *neigh_seq_start(struct seq_file *seq, loff_t *pos, struct neigh_table *tbl, unsigned int neigh_seq_flags) +{ + struct neigh_seq_state *state = seq->private; + loff_t pos_minus_one; + + state->tbl = tbl; + state->bucket = 0; + state->flags = (neigh_seq_flags & ~NEIGH_SEQ_IS_PNEIGH); + + read_lock_bh(&tbl->lock); + + pos_minus_one = *pos - 1; + return *pos ? neigh_get_idx_any(seq, &pos_minus_one) : SEQ_START_TOKEN; +} + +void *neigh_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct neigh_seq_state *state; + void *rc; + + if (v == SEQ_START_TOKEN) { + rc = neigh_get_idx(seq, pos); + goto out; + } + + state = seq->private; + if (!(state->flags & NEIGH_SEQ_IS_PNEIGH)) { + rc = neigh_get_next(seq, v, NULL); + if (rc) + goto out; + if (!(state->flags & NEIGH_SEQ_NEIGH_ONLY)) + rc = pneigh_get_first(seq); + } else { + BUG_ON(state->flags & NEIGH_SEQ_NEIGH_ONLY); + rc = pneigh_get_next(seq, v, NULL); + } +out: + ++(*pos); + return rc; +} + +void neigh_seq_stop(struct seq_file *seq, void *v) +{ + struct neigh_seq_state *state = seq->private; + struct neigh_table *tbl = state->tbl; + + read_unlock_bh(&tbl->lock); +} + +/* statistics via seq_file */ + +static void *neigh_stat_seq_start(struct seq_file *seq, loff_t *pos) +{ + struct proc_dir_entry *pde = seq->private; + struct neigh_table *tbl = pde->data; + int lcpu; + + if (*pos == 0) + return SEQ_START_TOKEN; + + for (lcpu = *pos-1; lcpu < smp_num_cpus; ++lcpu) { + int i = cpu_logical_map(lcpu); + *pos = lcpu+1; + return &tbl->stats[i]; + } + return NULL; +} + +static void *neigh_stat_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct proc_dir_entry *pde = seq->private; + struct neigh_table *tbl = pde->data; + int lcpu; + + for (lcpu = *pos; lcpu < smp_num_cpus; ++lcpu) { + int i = cpu_logical_map(lcpu); + *pos = lcpu+1; + return &tbl->stats[i]; + } + return NULL; +} + +static void neigh_stat_seq_stop(struct seq_file *seq, void *v) +{ + +} + +static int neigh_stat_seq_show(struct seq_file *seq, void *v) +{ + struct proc_dir_entry *pde = seq->private; + struct neigh_table *tbl = pde->data; + struct neigh_statistics *st = v; + + if (v == SEQ_START_TOKEN) { + seq_printf(seq, "entries allocs destroys hash_grows lookups hits res_failed rcv_probes_mcast rcv_probes_ucast periodic_gc_runs forced_gc_runs forced_gc_goal_miss\n"); + return 0; + } + + seq_printf(seq, "%08x %08lx %08lx %08lx %08lx %08lx %08lx " + "%08lx %08lx %08lx %08lx\n", + tbl->entries, + + st->allocs, + st->destroys, + st->hash_grows, + + st->lookups, + st->hits, + + st->res_failed, + + st->rcv_probes_mcast, + st->rcv_probes_ucast, + + st->periodic_gc_runs, + st->forced_gc_runs + ); + + return 0; +} + +static struct seq_operations neigh_stat_seq_ops = { + .start = neigh_stat_seq_start, + .next = neigh_stat_seq_next, + .stop = neigh_stat_seq_stop, + .show = neigh_stat_seq_show, +}; + +static int neigh_stat_seq_open(struct inode *inode, struct file *file) +{ + int ret = seq_open(file, &neigh_stat_seq_ops); + + if (!ret) { + struct seq_file *sf = file->private_data; + sf->private = PDE(inode); + } + return ret; +}; + +static struct file_operations neigh_stat_seq_fops = { + .owner = THIS_MODULE, + .open = neigh_stat_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +#endif /* CONFIG_PROC_FS */ #ifdef CONFIG_ARPD void neigh_app_ns(struct neighbour *n) ===== net/decnet/dn_neigh.c 1.3 vs edited ===== --- 1.3/net/decnet/dn_neigh.c 2004-01-25 21:21:33 -08:00 +++ edited/net/decnet/dn_neigh.c 2004-10-03 15:12:55 -07:00 @@ -20,6 +20,7 @@ * Steve Whitehouse : Fixed neighbour states (for now anyway). * Steve Whitehouse : Made error_report functions dummies. This * is not the right place to return skbs. + * Harald Welte : Port to DaveM's generalized ncache from 2.6.x * */ @@ -33,6 +34,8 @@ #include #include #include +#include +#include #include #include #include @@ -118,13 +121,7 @@ struct neigh_table dn_neigh_table = { static u32 dn_neigh_hash(const void *pkey, const struct net_device *dev) { - u32 hash_val; - - hash_val = *(dn_address *)pkey; - hash_val ^= (hash_val >> 10); - hash_val ^= (hash_val >> 3); - - return hash_val & NEIGH_HASHMASK; + return jhash_2words(*(dn_address *)pkey, 0, dn_neigh_table.hash_rnd); } static int dn_neigh_construct(struct neighbour *neigh) @@ -322,33 +319,6 @@ static int dn_phase3_output(struct sk_bu } /* - * Unfortunately, the neighbour code uses the device in its hash - * function, so we don't get any advantage from it. This function - * basically does a neigh_lookup(), but without comparing the device - * field. This is required for the On-Ethernet cache - */ -struct neighbour *dn_neigh_lookup(struct neigh_table *tbl, void *ptr) -{ - struct neighbour *neigh; - u32 hash_val; - - hash_val = tbl->hash(ptr, NULL); - - read_lock_bh(&tbl->lock); - for(neigh = tbl->hash_buckets[hash_val]; neigh != NULL; neigh = neigh->next) { - if (memcmp(neigh->primary_key, ptr, tbl->key_len) == 0) { - atomic_inc(&neigh->refcnt); - read_unlock_bh(&tbl->lock); - return neigh; - } - } - read_unlock_bh(&tbl->lock); - - return NULL; -} - - -/* * Any traffic on a pointopoint link causes the timer to be reset * for the entry in the neighbour table. */ @@ -484,113 +454,146 @@ static char *dn_find_slot(char *base, in return (*min < priority) ? (min - 6) : NULL; } -int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n) +struct elist_cb_state { + struct net_device *dev; + unsigned char *ptr; + unsigned char *rs; + int t, n; +}; + +static void neigh_elist_cb(struct neighbour *neigh, void *_info) { - int t = 0; - int i; - struct neighbour *neigh; + struct elist_cb_state *s = _info; + struct dn_dev *dn_db; struct dn_neigh *dn; - struct neigh_table *tbl = &dn_neigh_table; - unsigned char *rs = ptr; - struct dn_dev *dn_db = (struct dn_dev *)dev->dn_ptr; - read_lock_bh(&tbl->lock); + if (neigh->dev != s->dev) + return; - for(i = 0; i < NEIGH_HASHMASK; i++) { - for(neigh = tbl->hash_buckets[i]; neigh != NULL; neigh = neigh->next) { - if (neigh->dev != dev) - continue; - dn = (struct dn_neigh *)neigh; - if (!(dn->flags & (DN_NDFLAG_R1|DN_NDFLAG_R2))) - continue; - if (dn_db->parms.forwarding == 1 && (dn->flags & DN_NDFLAG_R2)) - continue; - if (t == n) - rs = dn_find_slot(ptr, n, dn->priority); - else - t++; - if (rs == NULL) - continue; - dn_dn2eth(rs, dn->addr); - rs += 6; - *rs = neigh->nud_state & NUD_CONNECTED ? 0x80 : 0x0; - *rs |= dn->priority; - rs++; - } - } + dn = (struct dn_neigh *) neigh; + if (!(dn->flags & (DN_NDFLAG_R1|DN_NDFLAG_R2))) + return; + + dn_db = (struct dn_dev *) s->dev->dn_ptr; + if (dn_db->parms.forwarding == 1 && (dn->flags & DN_NDFLAG_R2)) + return; - read_unlock_bh(&tbl->lock); + if (s->t == s->n) + s->rs = dn_find_slot(s->ptr, s->n, dn->priority); + else + s->t++; + if (s->rs == NULL) + return; + + dn_dn2eth(s->rs, dn->addr); + s->rs += 6; + *(s->rs) = neigh->nud_state & NUD_CONNECTED ? 0x80 : 0x0; + *(s->rs) |= dn->priority; + s->rs++; +} + +int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n) +{ + struct elist_cb_state state; + + state.dev = dev; + state.t = 0; + state.n = n; + state.ptr = ptr; + state.rs = ptr; + + neigh_for_each(&dn_neigh_table, neigh_elist_cb, &state); - return t; + return state.t; } + #endif /* CONFIG_DECNET_ROUTER */ #ifdef CONFIG_PROC_FS -static int dn_neigh_get_info(char *buffer, char **start, off_t offset, int length) + +static inline void dn_neigh_format_entry(struct seq_file *seq, + struct neighbour *n) { - int len = 0; - off_t pos = 0; - off_t begin = 0; - struct neighbour *n; - int i; + struct dn_neigh *dn = (struct dn_neigh *) n; char buf[DN_ASCBUF_LEN]; - len += sprintf(buffer + len, "Addr Flags State Use Blksize Dev\n"); - - for(i=0;i <= NEIGH_HASHMASK; i++) { - read_lock_bh(&dn_neigh_table.lock); - n = dn_neigh_table.hash_buckets[i]; - for(; n != NULL; n = n->next) { - struct dn_neigh *dn = (struct dn_neigh *)n; - - read_lock(&n->lock); - len += sprintf(buffer+len, "%-7s %s%s%s %02x %02d %07ld %-8s\n", - dn_addr2asc(dn_ntohs(dn->addr), buf), - (dn->flags&DN_NDFLAG_R1) ? "1" : "-", - (dn->flags&DN_NDFLAG_R2) ? "2" : "-", - (dn->flags&DN_NDFLAG_P3) ? "3" : "-", - dn->n.nud_state, - atomic_read(&dn->n.refcnt), - dn->blksize, - (dn->n.dev) ? dn->n.dev->name : "?"); - read_unlock(&n->lock); - - pos = begin + len; - - if (pos < offset) { - len = 0; - begin = pos; - } - - if (pos > offset + length) { - read_unlock_bh(&dn_neigh_table.lock); - goto done; - } - } - read_unlock_bh(&dn_neigh_table.lock); + read_lock(&n->lock); + seq_printf(seq, "%-7s %s%s%s %02x %02d %07ld %-8s\n", + dn_addr2asc(dn_ntohs(dn->addr), buf), + (dn->flags&DN_NDFLAG_R1) ? "1" : "-", + (dn->flags&DN_NDFLAG_R2) ? "2" : "-", + (dn->flags&DN_NDFLAG_P3) ? "3" : "-", + dn->n.nud_state, + atomic_read(&dn->n.refcnt), + dn->blksize, + (dn->n.dev) ? dn->n.dev->name : "?"); + read_unlock(&n->lock); +} + +static int dn_neigh_seq_show(struct seq_file *seq, void *v) +{ + if (v == SEQ_START_TOKEN) { + seq_puts(seq, "Addr Flags State Use Blksize Dev\n"); + } else { + dn_neigh_format_entry(seq, v); } -done: + return 0; +} - *start = buffer + (offset - begin); - len -= offset - begin; +static void *dn_neigh_seq_start(struct seq_file *seq, loff_t *pos) +{ + return neigh_seq_start(seq, pos, &dn_neigh_table, + NEIGH_SEQ_NEIGH_ONLY); +} - if (len > length) len = length; +static struct seq_operations dn_neigh_seq_ops = { + .start = dn_neigh_seq_start, + .next = neigh_seq_next, + .stop = neigh_seq_stop, + .show = dn_neigh_seq_show, +}; - return len; -} +static int dn_neigh_seq_open(struct inode *inode, struct file *file) +{ + struct seq_file *seq; + int rc = -ENOMEM; + struct neigh_seq_state *s = kmalloc(sizeof(*s), GFP_KERNEL); + + if (!s) + goto out; + + memset(s, 0, sizeof(*s)); + rc = seq_open(file, &dn_neigh_seq_ops); + if (rc) + goto out_kfree; + + seq = file->private_data; + seq->private = s; + memset(s, 0, sizeof(*s)); +out: + return rc; +out_kfree: + kfree(s); + goto out; +} + +static struct file_operations dn_neigh_seq_fops = { + .owner = THIS_MODULE, + .open = dn_neigh_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release_private, +}; #endif void __init dn_neigh_init(void) { neigh_table_init(&dn_neigh_table); - -#ifdef CONFIG_PROC_FS - proc_net_create("decnet_neigh",0,dn_neigh_get_info); -#endif /* CONFIG_PROC_FS */ + proc_net_fops_create("decnet_neigh", S_IRUGO, &dn_neigh_seq_fops); } void __exit dn_neigh_cleanup(void) ===== net/decnet/dn_route.c 1.6 vs edited ===== --- 1.6/net/decnet/dn_route.c 2002-08-12 13:43:21 -07:00 +++ edited/net/decnet/dn_route.c 2004-10-03 15:12:55 -07:00 @@ -761,7 +761,7 @@ static int dn_route_output_slow(struct d /* Look in On-Ethernet cache first */ if (!(flags & MSG_TRYHARD)) { - if ((neigh = dn_neigh_lookup(&dn_neigh_table, &dst)) != NULL) + if ((neigh = neigh_lookup_nodev(&dn_neigh_table, &dst)) != NULL) goto got_route; } ===== net/ipv4/arp.c 1.16 vs edited ===== --- 1.16/net/ipv4/arp.c 2004-02-19 10:13:39 -08:00 +++ edited/net/ipv4/arp.c 2004-10-03 15:12:55 -07:00 @@ -70,6 +70,7 @@ * arp_xmit so intermediate drivers like * bonding can change the skb before * sending (e.g. insert 8021q tag). + * Harald Welte : convert to make use of jenkins hash */ #include @@ -92,6 +93,7 @@ #include #include #include +#include #ifdef CONFIG_SYSCTL #include #endif @@ -218,15 +220,7 @@ int arp_mc_map(u32 addr, u8 *haddr, stru static u32 arp_hash(const void *pkey, const struct net_device *dev) { - u32 hash_val; - - hash_val = *(u32*)pkey; - hash_val ^= (hash_val>>16); - hash_val ^= hash_val>>8; - hash_val ^= hash_val>>3; - hash_val = (hash_val^dev->ifindex)&NEIGH_HASHMASK; - - return hash_val; + return jhash_2words(*(u32 *)pkey, dev->ifindex, arp_tbl.hash_rnd); } static int arp_constructor(struct neighbour *neigh) @@ -1185,129 +1179,155 @@ out: return err; } +#ifdef CONFIG_PROC_FS +#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) + +/* ------------------------------------------------------------------------ */ /* - * Write the contents of the ARP cache to a PROCfs file. + * ax25 -> ASCII conversion */ -#ifndef CONFIG_PROC_FS -static int arp_get_info(char *buffer, char **start, off_t offset, int length) { return 0; } -#else -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) -static char *ax2asc2(ax25_address *a, char *buf); -#endif +static char *ax2asc2(ax25_address *a, char *buf) +{ + char c, *s; + int n; + + for (n = 0, s = buf; n < 6; n++) { + c = (a->ax25_call[n] >> 1) & 0x7F; + + if (c != ' ') *s++ = c; + } + + *s++ = '-'; + + if ((n = ((a->ax25_call[6] >> 1) & 0x0F)) > 9) { + *s++ = '1'; + n -= 10; + } + + *s++ = n + '0'; + *s++ = '\0'; + + if (*buf == '\0' || *buf == '-') + return "*"; + + return buf; + +} +#endif /* CONFIG_AX25 */ + #define HBUFFERLEN 30 -static int arp_get_info(char *buffer, char **start, off_t offset, int length) +static void arp_format_neigh_entry(struct seq_file *seq, + struct neighbour *n) { - int len=0; - off_t pos=0; - int size; char hbuffer[HBUFFERLEN]; - int i,j,k; const char hexbuf[] = "0123456789ABCDEF"; + int k, j; + char tbuf[16]; + struct net_device *dev = n->dev; + int hatype = dev->type; - size = sprintf(buffer,"IP address HW type Flags HW address Mask Device\n"); - - pos+=size; - len+=size; + read_lock(&n->lock); - for(i=0; i<=NEIGH_HASHMASK; i++) { - struct neighbour *n; - read_lock_bh(&arp_tbl.lock); - for (n=arp_tbl.hash_buckets[i]; n; n=n->next) { - struct net_device *dev = n->dev; - int hatype = dev->type; - - /* Do not confuse users "arp -a" with magic entries */ - if (!(n->nud_state&~NUD_NOARP)) - continue; - - read_lock(&n->lock); - -/* - * Convert hardware address to XX:XX:XX:XX ... form. - */ + /* Convert hardware address to XX:XX:XX:XX ... form. */ #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) - if (hatype == ARPHRD_AX25 || hatype == ARPHRD_NETROM) - ax2asc2((ax25_address *)n->ha, hbuffer); - else { -#endif - for (k=0,j=0;kaddr_len;j++) { - hbuffer[k++]=hexbuf[(n->ha[j]>>4)&15 ]; - hbuffer[k++]=hexbuf[n->ha[j]&15 ]; - hbuffer[k++]=':'; - } - hbuffer[--k]=0; - + if (hatype == ARPHRD_AX25 || hatype == ARPHRD_NETROM) + ax2asc2((ax25_address *)n->ha, hbuffer); + else { +#endif + for (k=0,j=0;kaddr_len;j++) { + hbuffer[k++]=hexbuf[(n->ha[j]>>4)&15 ]; + hbuffer[k++]=hexbuf[n->ha[j]&15 ]; + hbuffer[k++]=':'; + } + hbuffer[--k]=0; #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) - } + } #endif + sprintf(tbuf, "%u.%u.%u.%u", NIPQUAD(*(u32*)n->primary_key)); + seq_printf(seq, "%-16s 0x%-10x0x%-10x%s * %s\n", + tbuf, hatype, arp_state_to_flags(n), hbuffer, dev->name); + read_unlock(&n->lock); +} - { - char tbuf[16]; - sprintf(tbuf, "%u.%u.%u.%u", NIPQUAD(*(u32*)n->primary_key)); - size = sprintf(buffer+len, "%-16s 0x%-10x0x%-10x%s" - " * %s\n", - tbuf, - ha