From davem@pizda.ninka.net Wed Oct 1 00:09:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 00:10:05 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9179NFx029468 for ; Wed, 1 Oct 2003 00:09:23 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA05395; Wed, 1 Oct 2003 00:05:24 -0700 Date: Wed, 1 Oct 2003 00:05:24 -0700 From: "David S. Miller" To: "Chad N. Tindel" Cc: fubar@us.ibm.com, shmulik.hen@intel.com, jgarzik@pobox.com, chad@tindel.net, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] Re: [bonding] compatibilty issues Message-Id: <20031001000524.7e0d851e.davem@redhat.com> In-Reply-To: <20030930213650.GA71877@calma.pair.com> References: <200309301442.31991.shmulik.hen@intel.com> <200309301639.h8UGdqCq026858@death.ibm.com> <20030930213650.GA71877@calma.pair.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 422 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 On Tue, 30 Sep 2003 17:36:50 -0400 "Chad N. Tindel" wrote: > My recommendations are more towards the middle than either end. I would > like to see us get rid of the _OLD ioctls in the 2.6 kernel specifically > because it uses the SIOCDEVPRIVATE ioctls. ... > I would like to see them stay in 2.4 for the rest of the 2.4 tree > specifically so that people who want to run on 3 year old systems > can continue to do so without us breaking their world. I think this is fine, personally. I defer to Jeff for final judgment, he should be allowed to chime in at least once more. From davem@pizda.ninka.net Wed Oct 1 00:12:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 00:12:42 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h917C4Fx029964 for ; Wed, 1 Oct 2003 00:12:04 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA05410; Wed, 1 Oct 2003 00:07:04 -0700 Date: Wed, 1 Oct 2003 00:07:04 -0700 From: "David S. Miller" To: jt@hpl.hp.com Cc: jt@bougret.hpl.hp.com, shemminger@osdl.org, netdev@oss.sgi.com, irda-users@lists.sourceforge.net Subject: Re: [PATCH] (0/16) intro to IRDA patches for 2.6.0-test6 Message-Id: <20031001000704.252e4737.davem@redhat.com> In-Reply-To: <20030930230049.GA22339@bougret.hpl.hp.com> References: <20030930152530.1e279c29.shemminger@osdl.org> <20030930230049.GA22339@bougret.hpl.hp.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 423 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 On Tue, 30 Sep 2003 16:00:49 -0700 Jean Tourrilhes wrote: > On Tue, Sep 30, 2003 at 03:25:30PM -0700, Stephen Hemminger wrote: > > David, please apply after Jean gives his approval. ... > Please go ahead, I'll test them in parallel. > Thanks ! Great, I'm applying Stephen's patches now. From linux-netdev@gmane.org Wed Oct 1 01:02:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 01:03:20 -0700 (PDT) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9182MFx004243 for ; Wed, 1 Oct 2003 01:02:43 -0700 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1A4bwC-00015B-00 for ; Wed, 01 Oct 2003 10:02:20 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: netdev@oss.sgi.com Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A4bwB-000151-00 for ; Wed, 01 Oct 2003 10:02:19 +0200 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1A4bwA-0008AU-00 for ; Wed, 01 Oct 2003 10:02:18 +0200 From: Florian Zwoch Subject: Re: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction Date: Wed, 01 Oct 2003 10:02:18 +0200 Lines: 59 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030909 Thunderbird/0.2 X-Accept-Language: en-us, en In-Reply-To: Cc: linux-kernel@vger.kernel.org X-archive-position: 424 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: zwoch@backendmedia.com Precedence: bulk X-list: netdev issue seems to partly solved. the e1000 driver seems to be ok! i reconfigured my kernel and intentionally left out netfilter options. after that my network performance was back to normal. netfilter was only compiled in the kernel. it was not used with any rules! so my wild guess would be that something with the netfilter code (i am not 100% sure it was netfilter.. _maybe_ it was some small odd kernel option i accidently enabled/disabled) is broken since test3 (again uncertified. but i firstly noticed this switching from test3 to test4). Florian Zwoch wrote: > hi, > this has been discussed very roughly before. but unfortunately no real > solution has been brought up so far (or i have not read it yet). > > problem in short: the 82540EM intel gigabit adapter became very slow as > of 2.6.0-test4. maybe earlier versions were als affected aswell, but i > noticed this behaviour on test4 and later. the 'slowness' of the adapter > only affects a certain data direction. i performed the following tests > to show you what is wrong. > > dummy data file was 34257856 bytes (34.3MB). > test machines were a pentium4 with the intel adapter, and a pentium2 266 > with a lowcost realtek card (runs linux 2.4). > > SCP: > e1000 -> 8139too 28.6KB/s > e1000 <- 8139too 4.6MB/s > > SMB: > e1000 -> 8139too 3.0MB/s > e1000 <- 8139too 3.3MB/s > > FTP > e1000 -> 8139too 54KB/s > e1000 <- 8139too 9.4MB/s > > as you can see reveiving data is no problem at all (maybe another > protocol can create some problems in this case?). but sending data is > awesome slow! exception is the samba protocol. why is that? i thought > that samba may use udp instead of tcp. but iptraf did not show any udp > packets going around so i guess i was wrong. > > the problem gets worse while trying to test things over the internet. > scp stalls incredibly often on my 256kbit/s upstream. so does ftp and > irc dcc protocol. irc dcc ends up with sending 0.3KB/s on a megabyte > sized file. > > before people again trying to tell me that some duplex settings could be > messed up - then tell me why this should happen. when i boot into 2.4 > kernel with that test machine the nic works without problems. so IF > duplex stuff is the reason for the hickups something must be wrong with > the duplex detection code in the new driver/kernel? > > i tried vanilla 2.6.0-test5, 2.6.0-test5-mm2 and mm3 + 2.6.0-test5-bk4. > none of these gave any difference regarding network performance. From scott.feldman@intel.com Wed Oct 1 01:19:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 01:20:23 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h918JmFx005756 for ; Wed, 1 Oct 2003 01:19:49 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h918HK423372 for ; Wed, 1 Oct 2003 08:17:20 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h918EGj09441 for ; Wed, 1 Oct 2003 08:14:16 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003100101194211202 ; Wed, 01 Oct 2003 01:19:42 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 1 Oct 2003 01:19:41 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: Fw: Badness in local_bh_enable at kernel/softirq.c:119 Date: Wed, 1 Oct 2003 01:19:41 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Fw: Badness in local_bh_enable at kernel/softirq.c:119 Thread-Index: AcOH6PnqvodJajp4QQ2HBr81WTDsWgABV2CQ From: "Feldman, Scott" To: "David S. Miller" Cc: , , , "cramerj" X-OriginalArrivalTime: 01 Oct 2003 08:19:41.0980 (UTC) FILETIME=[C39815C0:01C387F4] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h918JmFx005756 X-archive-position: 425 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev > Why do you even need to use IRQ locking here? > > Your e1000 netdev->hard_start_xmit method doesn't need to do > anything special, why does this timer code? I suppose you > need to synchronize with e1000_clean_tx_irq() in the non-NAPI > case right? If so, that's not being accomplished by what > your code is doing. If nobody else takes that xmit_lock in > an IRQ disabling manner, the e1000 timer code doing so > doesn't make any difference. > > I have an idea for attacking the problem, once you figure out > what kind of locking you really need. Do whatever you need > to do to synchronize on the hardware side, but instead of > directly freeing the SKB, add each one to a list. A pointer > to the head of this list is stored on the stack of the timer > routine, and passed down into the TX purger. > > Then at the top level you can drop all your locks, re-enable > hw IRQs and whatever else you need to do, then pass the SKBs > in the list off to dev_kfree_skb_irq() (this is the > appropriate routine to call to free an SKB from a timer > handler, which runs in soft interrupt context). Chris can jump in here anytime. :-) Synchronizing on the hardware side is stumping me. We have the list of skbs you describe, but I'm concerned about unmapping the skb buffers if hardware is right in the middle of some DMA on one of the buffers. Some archs really don't like hardware accessing unmapped buffers. Here's what I'm thinking: when link down is detected in the timer, just trick hardware into thinking link is still up (ILOS - Invert Loss of Signal). No locking, no disabling of interrupts. Hardware will do the natural thing by completing the outstanding sends and also provide the interrupts so we can clean/return skbs as normal (e1000_clean_tx_irq). Something like: if lost link if outstanding Tx work set ILOS // h/w thinks link is up, DMA continues mdelay(10) clear ILOS // h/w thinks link is down The mdelay(10) is terrible, but we've already got that in the current tx_flush routine. Chris, what am I missing? I didn't included the ANE business for clarity. -scott From davem@pizda.ninka.net Wed Oct 1 01:41:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 01:41:44 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h918fAFx007693 for ; Wed, 1 Oct 2003 01:41:10 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA05942; Wed, 1 Oct 2003 01:37:10 -0700 Date: Wed, 1 Oct 2003 01:37:10 -0700 From: "David S. Miller" To: "Feldman, Scott" Cc: jgarzik@pobox.com, akpm@osdl.org, netdev@oss.sgi.com, cramerj@intel.com Subject: Re: Fw: Badness in local_bh_enable at kernel/softirq.c:119 Message-Id: <20031001013710.425038fd.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 426 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 On Wed, 1 Oct 2003 01:19:41 -0700 "Feldman, Scott" wrote: > Synchronizing on the hardware side is stumping me. We have the list of > skbs you describe, but I'm concerned about unmapping the skb buffers if > hardware is right in the middle of some DMA on one of the buffers. > Some archs really don't like hardware accessing unmapped buffers. Good point, if the e1000 accesses the DMA buffer after the unmap it will cause many arch's to signal PCI errors since the IOMMU will no longer have a valid translation for those DMA requests. > Here's what I'm thinking: when link down is detected in the timer, just > trick hardware into thinking link is still up (ILOS - Invert Loss of > Signal). No locking, no disabling of interrupts. Hardware will do the > natural thing by completing the outstanding sends and also provide the > interrupts so we can clean/return skbs as normal (e1000_clean_tx_irq). If you can make that work, it's the simplest fix. From shmulik.hen@intel.com Wed Oct 1 01:49:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 01:49:54 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h918nHFx009002 for ; Wed, 1 Oct 2003 01:49:18 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h918kn428879 for ; Wed, 1 Oct 2003 08:46:49 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h918hjj15997 for ; Wed, 1 Oct 2003 08:43:45 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003100101490517770 ; Wed, 01 Oct 2003 01:49:07 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "David S. Miller" , "Chad N. Tindel" , , Subject: Re: [Bonding-devel] Re: [bonding] compatibilty issues Date: Wed, 1 Oct 2003 11:49:04 +0300 User-Agent: KMail/1.4.3 Cc: , References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310011149.04612.shmulik.hen@intel.com> X-archive-position: 427 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev On Wednesday 01 October 2003 10:05 am, David S. Miller wrote: > On Tue, 30 Sep 2003 17:36:50 -0400 > > "Chad N. Tindel" wrote: > > My recommendations are more towards the middle than either end. > > I would like to see us get rid of the _OLD ioctls in the 2.6 > > kernel specifically because it uses the SIOCDEVPRIVATE ioctls. > > ... > > > I would like to see them stay in 2.4 for the rest of the 2.4 tree > > specifically so that people who want to run on 3 year old systems > > can continue to do so without us breaking their world. > > I think this is fine, personally. > > I defer to Jeff for final judgment, he should be allowed to chime > in at least once more. > So here is what I did in the meantime: * Created a version for 2.4 that puts back all old compatibility stuff that was removed either during the propagation set or the cleanup set. * Created a version for 2.6 that puts back just the compatibility stuff that was removed in the propagation set (BOND_SETHWADDR, since we got a complaint from a RH9 user). * Removed the mention of the multicast param from the read-me. * Raised the ABI version to 2 so the new ifenslave keeps propagating IP settings to slaves for older drivers, and doesn't do that for new ones that contain Willy Tarreau's panic fix. As for not putting new stuff in 2.4.x kernels, here is where we stand; We believe new distributions based on 2.4.x kernels will keep showing for at least a year, probably longer, and that customers would like to see more bonding features in those distributions, so our intention is to keep getting new stuff into 2.4. We understand the drive to put new stuff into 2.6 and backport to 2.4 from time to time, but we'll really need to keep doing stuff the current way for a while. The cleanup stuff came up as a necessity before developing the next set of features, and those are all based on a cleaned-up bonding, so delaying the acceptance of the cleanup into 2.4 also delays our features acceptance. I'm waiting for the final word from everyone. I'll need to test the two new versions, but then I can release them accordingly. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From andi@averellmail.firstfloor.org Wed Oct 1 05:12:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 05:13:09 -0700 (PDT) Received: from zero.aec.at (Fogarty.Weffing@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91CCXFx030504 for ; Wed, 1 Oct 2003 05:12:34 -0700 Received: from fred.muc.de (Atka.Mip@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id h91CCPS09724; Wed, 1 Oct 2003 14:12:26 +0200 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id C6DD15BBEE; Wed, 1 Oct 2003 14:12:26 +0200 (CEST) Date: Wed, 1 Oct 2003 14:12:26 +0200 From: Andi Kleen To: netdev@oss.sgi.com Cc: mingo@redhat.com Subject: [PATCH] Fix ppro csum_partial for 1 byte unaligned buffers Message-ID: <20031001121226.GA11676@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 429 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Content-Length: 2003 Lines: 78 When using sendfile it can happen that csum_partial is called for memory areas that are not aligned to a 2 byte boundary. The ppro optimized i386 checksum code handled this slowly, but read upto 3 bytes over the end of the buffer. When the skb contents are mapped from highmem this can be fatal because the end of the buffer can be unmapped. This patch fixes this in a simple non intrusive way by handling the possible fault and recovering from it by using a tolerant byte-by-byte copy. It does not attempt to align one byte unaligned buffers, because that's rather complicated and probably not worth the effort. Other architectures may want to audit their csum_partial if it handles this case correctly. Bug is in 2.4 and 2.6 -Andi diff -u linux/arch/i386/lib/checksum.S-o linux/arch/i386/lib/checksum.S --- linux/arch/i386/lib/checksum.S-o 2003-03-07 16:48:01.000000000 +0100 +++ linux/arch/i386/lib/checksum.S 2003-10-01 14:01:31.000000000 +0200 @@ -48,6 +48,9 @@ * least a twofold speedup on 486 and Pentium if it is 4-byte aligned. * Fortunately, it is easy to convert 2-byte alignment to 4-byte * alignment for the unrolled loop. + * + * Danger, Will Robinson: with sendfile 2 byte alignment is not guaranteed. + * */ csum_partial: pushl %esi @@ -237,18 +240,37 @@ movl $0xffffff,%ebx # by the shll and shrl instructions shll $3,%ecx shrl %cl,%ebx - andl -128(%esi),%ebx # esi is 4-aligned so should be ok +.Ltail: + andl -128(%esi),%ebx +.Ttail_finished addl %ebx,%eax adcl $0,%eax 80: testl $1, 12(%esp) jz 90f roll $8, %eax -90: +90: popl %ebx popl %esi ret - + + .section __ex_table,"a" + .long .Ltail,tail_recover + .long .Ltail_byte3,.Ltail_byte1 + .long .Ltail_byte2,.Ltail_finished + .previous + +tail_recover: + xorl %ebx,%ebx +.Ltail_byte3: + movb -126(%esi),%bl + shl $16,%ebx +.Ltail_byte1: + movb -128(%esi),%bl +.Ltail_byte2: + movb -127(%esi),%bh + jmp .Ltailfinished + #endif /* From chas@cmf.nrl.navy.mil Wed Oct 1 05:17:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 05:17:54 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91CHKFx030849 for ; Wed, 1 Oct 2003 05:17:21 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h91BYPkT003172 for ; Wed, 1 Oct 2003 07:34:25 -0400 (EDT) Message-Id: <200310011134.h91BYPkT003172@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Subject: [RFC] add rtnl semaphore to linux-atm Reply-To: chas3@users.sourceforge.net Date: Wed, 01 Oct 2003 07:34:25 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 430 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 9239 Lines: 360 i am thinking about doing the following to fix the race during ATM_ITF_ANY operation. rtnl is held across registration/unregistration. this means that you can get read-only access to the device list by holding rtnl or a read_lock on atm_dev_lock similar to the scheme used by netdevice (or so i think). (the register_atmdevice/unregister just make it easier to see where one might call netdevice instead in the future) ===== drivers/atm/atmtcp.c 1.20 vs edited ===== --- 1.20/drivers/atm/atmtcp.c Tue Sep 23 19:22:15 2003 +++ edited/drivers/atm/atmtcp.c Mon Sep 29 21:34:36 2003 @@ -378,7 +378,7 @@ struct atm_dev *dev; dev = NULL; - if (itf != -1) dev = atm_dev_lookup(itf); + if (itf != -1) dev = atm_dev_get_by_index(itf); if (dev) { if (dev->ops != &atmtcp_v_dev_ops) { atm_dev_put(dev); @@ -415,7 +415,7 @@ struct atm_dev *dev; struct atmtcp_dev_data *dev_data; - dev = atm_dev_lookup(itf); + dev = atm_dev_get_by_index(itf); if (!dev) return -ENODEV; if (dev->ops != &atmtcp_v_dev_ops) { atm_dev_put(dev); ===== include/linux/atmdev.h 1.32 vs edited ===== --- 1.32/include/linux/atmdev.h Tue Sep 23 18:19:10 2003 +++ edited/include/linux/atmdev.h Mon Sep 29 21:59:18 2003 @@ -388,7 +388,7 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, int number,unsigned long *flags); /* number == -1: pick first available */ -struct atm_dev *atm_dev_lookup(int number); +struct atm_dev *atm_dev_get_by_index(int ifindex); void atm_dev_deregister(struct atm_dev *dev); void shutdown_atm_dev(struct atm_dev *dev); void vcc_insert_socket(struct sock *sk); @@ -435,11 +435,12 @@ { atomic_dec(&dev->refcnt); - if ((atomic_read(&dev->refcnt) == 1) && + if ((atomic_read(&dev->refcnt) == 0) && test_bit(ATM_DF_CLOSE,&dev->flags)) shutdown_atm_dev(dev); } +#define __atm_dev_put(dev) atomic_dec(&(dev)->refcnt) int atm_charge(struct atm_vcc *vcc,int truesize); struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, ===== net/atm/common.c 1.54 vs edited ===== --- 1.54/net/atm/common.c Tue Sep 23 13:38:28 2003 +++ edited/net/atm/common.c Mon Sep 29 22:24:27 2003 @@ -426,7 +426,7 @@ vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) return -EINVAL; if (itf != ATM_ITF_ANY) { - dev = atm_dev_lookup(itf); + dev = atm_dev_get_by_index(itf); if (!dev) return -ENODEV; error = __vcc_connect(vcc, dev, vpi, vci); @@ -435,21 +435,19 @@ return error; } } else { - struct list_head *p, *next; + struct list_head *p; dev = NULL; - spin_lock(&atm_dev_lock); - list_for_each_safe(p, next, &atm_devs) { + rtnl_lock(); + list_for_each(p, &atm_devs) { dev = list_entry(p, struct atm_dev, dev_list); atm_dev_hold(dev); - spin_unlock(&atm_dev_lock); if (!__vcc_connect(vcc, dev, vpi, vci)) break; - atm_dev_put(dev); + __atm_dev_put(dev); dev = NULL; - spin_lock(&atm_dev_lock); } - spin_unlock(&atm_dev_lock); + rtnl_unlock(); if (!dev) return -ENODEV; } ===== net/atm/resources.c 1.21 vs edited ===== --- 1.21/net/atm/resources.c Thu Sep 11 06:41:52 2003 +++ edited/net/atm/resources.c Tue Sep 30 07:10:43 2003 @@ -24,7 +24,7 @@ LIST_HEAD(atm_devs); -spinlock_t atm_dev_lock = SPIN_LOCK_UNLOCKED; +static rwlock_t atm_dev_lock = RW_LOCK_UNLOCKED; static struct atm_dev *__alloc_atm_dev(const char *type) { @@ -47,7 +47,7 @@ kfree(dev); } -static struct atm_dev *__atm_dev_lookup(int number) +static struct atm_dev *__atm_dev_get_by_index(int number) { struct atm_dev *dev; struct list_head *p; @@ -55,27 +55,65 @@ list_for_each(p, &atm_devs) { dev = list_entry(p, struct atm_dev, dev_list); if ((dev->ops) && (dev->number == number)) { - atm_dev_hold(dev); return dev; } } return NULL; } -struct atm_dev *atm_dev_lookup(int number) +struct atm_dev *atm_dev_get_by_index(int number) { struct atm_dev *dev; - spin_lock(&atm_dev_lock); - dev = __atm_dev_lookup(number); - spin_unlock(&atm_dev_lock); + read_lock(&atm_dev_lock); + dev = __atm_dev_get_by_index(number); + if (dev) + atm_dev_hold(dev); + read_unlock(&atm_dev_lock); return dev; } +static int register_atmdevice(struct atm_dev *dev) +{ + write_lock_irq(&atm_dev_lock); + list_add_tail(&dev->dev_list, &atm_devs); + atm_dev_hold(dev); + write_unlock_irq(&atm_dev_lock); + + if (atm_proc_dev_register(dev) < 0) { + printk(KERN_ERR "atm_dev_register: " + "atm_proc_dev_register failed for dev %s\n", + dev->type); + write_lock_irq(&atm_dev_lock); + list_del(&dev->dev_list); + write_unlock_irq(&atm_dev_lock); + return -EIO; + } + + return 0; +} + +static int atm_dev_alloc_index(struct atm_dev *dev, int number) +{ + if (number != -1) { + if ((__atm_dev_get_by_index(number))) + return -EBUSY; + } else { + number = 0; + while ((__atm_dev_get_by_index(number))) { + number++; + } + } + dev->number = number; + + return 0; +} + struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, int number, unsigned long *flags) { - struct atm_dev *dev, *inuse; + struct atm_dev *dev; + int err; dev = __alloc_atm_dev(type); if (!dev) { @@ -83,60 +121,51 @@ type); return NULL; } - spin_lock(&atm_dev_lock); - if (number != -1) { - if ((inuse = __atm_dev_lookup(number))) { - atm_dev_put(inuse); - spin_unlock(&atm_dev_lock); - __free_atm_dev(dev); - return NULL; - } - dev->number = number; - } else { - dev->number = 0; - while ((inuse = __atm_dev_lookup(dev->number))) { - atm_dev_put(inuse); - dev->number++; - } - } dev->ops = ops; if (flags) dev->flags = *flags; - else - memset(&dev->flags, 0, sizeof(dev->flags)); - memset(&dev->stats, 0, sizeof(dev->stats)); - atomic_set(&dev->refcnt, 1); - list_add_tail(&dev->dev_list, &atm_devs); - spin_unlock(&atm_dev_lock); - if (atm_proc_dev_register(dev) < 0) { - printk(KERN_ERR "atm_dev_register: " - "atm_proc_dev_register failed for dev %s\n", - type); - spin_lock(&atm_dev_lock); - list_del(&dev->dev_list); - spin_unlock(&atm_dev_lock); + rtnl_lock(); + + err = atm_dev_alloc_index(dev, number); + if (err < 0) + goto out; + + err = register_atmdevice(dev); + +out: + rtnl_unlock(); + + if (err < 0) { __free_atm_dev(dev); - return NULL; + dev = NULL; } - + return dev; } +static void unregister_atmdevice(struct atm_dev *dev) +{ + atm_proc_dev_deregister(dev); + + write_lock_irq(&atm_dev_lock); + list_del(&dev->dev_list); + write_unlock_irq(&atm_dev_lock); + + atm_dev_put(dev); +} void atm_dev_deregister(struct atm_dev *dev) { unsigned long warning_time; - atm_proc_dev_deregister(dev); - - spin_lock(&atm_dev_lock); - list_del(&dev->dev_list); - spin_unlock(&atm_dev_lock); + rtnl_lock(); + unregister_atmdevice(dev); + rtnl_unlock(); warning_time = jiffies; - while (atomic_read(&dev->refcnt) != 1) { + while (atomic_read(&dev->refcnt) != 0) { current->state = TASK_INTERRUPTIBLE; schedule_timeout(HZ / 4); current->state = TASK_RUNNING; @@ -153,7 +182,7 @@ void shutdown_atm_dev(struct atm_dev *dev) { - if (atomic_read(&dev->refcnt) > 1) { + if (atomic_read(&dev->refcnt) > 0) { set_bit(ATM_DF_CLOSE, &dev->flags); return; } @@ -217,23 +246,23 @@ return -EFAULT; if (get_user(len, &((struct atm_iobuf *) arg)->length)) return -EFAULT; - spin_lock(&atm_dev_lock); + read_lock(&atm_dev_lock); list_for_each(p, &atm_devs) size += sizeof(int); if (size > len) { - spin_unlock(&atm_dev_lock); + read_unlock(&atm_dev_lock); return -E2BIG; } tmp_buf = tmp_bufp = kmalloc(size, GFP_ATOMIC); if (!tmp_buf) { - spin_unlock(&atm_dev_lock); + read_unlock(&atm_dev_lock); return -ENOMEM; } list_for_each(p, &atm_devs) { dev = list_entry(p, struct atm_dev, dev_list); *tmp_bufp++ = dev->number; } - spin_unlock(&atm_dev_lock); + read_unlock(&atm_dev_lock); error = (copy_to_user(buf, tmp_buf, size) || put_user(size, &((struct atm_iobuf *) arg)->length)) ? -EFAULT : 0; @@ -248,7 +277,7 @@ if (get_user(number, &((struct atmif_sioc *) arg)->number)) return -EFAULT; - if (!(dev = atm_dev_lookup(number))) + if (!(dev = atm_dev_get_by_index(number))) return -ENODEV; switch (cmd) { @@ -411,13 +440,13 @@ void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos) { - spin_lock(&atm_dev_lock); + read_lock(&atm_dev_lock); return *pos ? dev_get_idx(*pos) : (void *) 1; } void atm_dev_seq_stop(struct seq_file *seq, void *v) { - spin_unlock(&atm_dev_lock); + read_unlock(&atm_dev_lock); } void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -430,5 +459,5 @@ EXPORT_SYMBOL(atm_dev_register); EXPORT_SYMBOL(atm_dev_deregister); -EXPORT_SYMBOL(atm_dev_lookup); +EXPORT_SYMBOL(atm_dev_get_by_index); EXPORT_SYMBOL(shutdown_atm_dev); ===== net/atm/resources.h 1.13 vs edited ===== --- 1.13/net/atm/resources.h Mon Sep 8 13:27:12 2003 +++ edited/net/atm/resources.h Mon Sep 29 22:03:48 2003 @@ -11,7 +11,6 @@ extern struct list_head atm_devs; -extern spinlock_t atm_dev_lock; int atm_dev_ioctl(unsigned int cmd, unsigned long arg); From davem@pizda.ninka.net Wed Oct 1 05:46:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 05:47:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91CkRFx031412 for ; Wed, 1 Oct 2003 05:46:27 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id FAA07095; Wed, 1 Oct 2003 05:42:26 -0700 Date: Wed, 1 Oct 2003 05:42:26 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-Id: <20031001054226.126cea7b.davem@redhat.com> In-Reply-To: <200310011134.h91BYPkT003172@ginger.cmf.nrl.navy.mil> References: <200310011134.h91BYPkT003172@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 431 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: 596 Lines: 15 On Wed, 01 Oct 2003 07:34:25 -0400 chas williams wrote: > i am thinking about doing the following to fix the race > during ATM_ITF_ANY operation. rtnl is held across > registration/unregistration. this means that you can get > read-only access to the device list by holding rtnl > or a read_lock on atm_dev_lock similar to the scheme > used by netdevice (or so i think). This looks like it would work. Although, unless VCC connect can potentially sleep, it might be better to keep exporting the rwlock and take it as a reader instead of grabbing the rtnl semaphore. From chas@cmf.nrl.navy.mil Wed Oct 1 06:07:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 06:08:26 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91D7nFx031941 for ; Wed, 1 Oct 2003 06:07:50 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h91D7jkT004153; Wed, 1 Oct 2003 09:07:45 -0400 (EDT) Message-Id: <200310011307.h91D7jkT004153@ginger.cmf.nrl.navy.mil> To: "David S. Miller" cc: netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm In-Reply-To: Message from "David S. Miller" of "Wed, 01 Oct 2003 05:42:26 PDT." <20031001054226.126cea7b.davem@redhat.com> Date: Wed, 01 Oct 2003 09:07:45 -0400 From: chas williams X-Spam-Score: () hits=-0.9 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 432 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 409 Lines: 8 In message <20031001054226.126cea7b.davem@redhat.com>,"David S. Miller" writes: >Although, unless VCC connect can potentially sleep, it might >be better to keep exporting the rwlock and take it as a reader >instead of grabbing the rtnl semaphore. i had initially written it that way but remembered at one point i was going to use the rtnl semaphore to handle this problem. any opinions on what is 'better'? From davem@pizda.ninka.net Wed Oct 1 06:18:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 06:19:05 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91DIVFx032309 for ; Wed, 1 Oct 2003 06:18:31 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id GAA07219; Wed, 1 Oct 2003 06:14:26 -0700 Date: Wed, 1 Oct 2003 06:14:26 -0700 From: "David S. Miller" To: chas williams Cc: netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-Id: <20031001061426.0b67a235.davem@redhat.com> In-Reply-To: <200310011307.h91D7jkT004153@ginger.cmf.nrl.navy.mil> References: <20031001054226.126cea7b.davem@redhat.com> <200310011307.h91D7jkT004153@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 433 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: 779 Lines: 18 On Wed, 01 Oct 2003 09:07:45 -0400 chas williams wrote: > i had initially written it that way but remembered at one point i > was going to use the rtnl semaphore to handle this problem. any > opinions on what is 'better'? Blocking all network configuration operations (even ones not for your subsystem) is a little bit anti-social in SMP cases. If you take the rwlock as a reader, you only interfere with a very minute class of network configuration code paths (those that need to take the rwlock in question as a writer). For example, if you use the rwlock-as-reader approach, someone doing IPV4 routing table updates (ie. routing daemon changing a couple thousand routes after a BGP flap) won't be perturbed while the ATM operation is in progress. From vinay.nallamothu@gsecone.com Wed Oct 1 07:07:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 07:08:20 -0700 (PDT) Received: from gateway.gsecone.com ([61.95.227.64]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91E7eFx004290 for ; Wed, 1 Oct 2003 07:07:41 -0700 Received: from vinay.gsecone.com (vinay.gsecone.com [192.168.1.15]) by gateway.gsecone.com (8.12.8/8.12.8) with ESMTP id h91EAJBU010227; Wed, 1 Oct 2003 19:40:19 +0530 Subject: [PATCH 2.6.0-test6][ROSE] timer cleanups (and couple of fixes) From: Vinay K Nallamothu To: netdev@oss.sgi.com Cc: LKML Content-Type: text/plain Organization: Global Security One Message-Id: <1065017300.7194.318.camel@lima.royalchallenge.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 01 Oct 2003 19:38:20 +0530 Content-Transfer-Encoding: 7bit X-archive-position: 434 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vinay.nallamothu@gsecone.com Precedence: bulk X-list: netdev Content-Length: 9219 Lines: 318 1. Use mod_timer 2. Use del_timer_sync in rose_loopback_clear 3. Use static timer initializer 4. set skb->destructor = NULL wherever skb->sk = NULL before kfree_skb(skb) I am not clear why skb->sk is set to NULL in the exit path in rose_loopback_clear. Isn't it sufficient to purge the entire queue? Let me know if this is the right fix. af_rose.c | 10 +++------ rose_link.c | 21 +++++++++--------- rose_loopback.c | 30 +++++++-------------------- rose_route.c | 7 ++---- rose_timer.c | 62 ++++++++++++++++++-------------------------------------- 5 files changed, 46 insertions(+), 84 deletions(-) diff -urN -X dontdiff linux-2.6.0-test6/net/rose/af_rose.c linux-2.6.0-test6-nvk/net/rose/af_rose.c --- linux-2.6.0-test6/net/rose/af_rose.c 2003-10-01 14:03:23.000000000 +0530 +++ linux-2.6.0-test6-nvk/net/rose/af_rose.c 2003-10-01 18:49:28.000000000 +0530 @@ -64,6 +64,7 @@ ax25_address rose_callsign; +void rose_init_timers(struct sock *sk); /* * Convert a ROSE address into text. */ @@ -353,10 +354,8 @@ if (atomic_read(&sk->sk_wmem_alloc) || atomic_read(&sk->sk_rmem_alloc)) { /* Defer: outstanding buffers */ - init_timer(&sk->sk_timer); sk->sk_timer.expires = jiffies + 10 * HZ; sk->sk_timer.function = rose_destroy_timer; - sk->sk_timer.data = (unsigned long)sk; add_timer(&sk->sk_timer); } else sk_free(sk); @@ -529,8 +528,7 @@ sock->ops = &rose_proto_ops; sk->sk_protocol = protocol; - init_timer(&rose->timer); - init_timer(&rose->idletimer); + rose_init_timers(sk); rose->t1 = sysctl_rose_call_request_timeout; rose->t2 = sysctl_rose_reset_request_timeout; @@ -576,8 +574,7 @@ sk->sk_sleep = osk->sk_sleep; sk->sk_zapped = osk->sk_zapped; - init_timer(&rose->timer); - init_timer(&rose->idletimer); + rose_init_timers(sk); orose = rose_sk(osk); rose->t1 = orose->t1; @@ -883,6 +880,7 @@ /* Now attach up the new socket */ skb->sk = NULL; + skb->destructor = NULL; kfree_skb(skb); sk->sk_ack_backlog--; newsock->sk = newsk; diff -urN -X dontdiff linux-2.6.0-test6/net/rose/rose_link.c linux-2.6.0-test6-nvk/net/rose/rose_link.c --- linux-2.6.0-test6/net/rose/rose_link.c 2003-09-09 11:12:05.000000000 +0530 +++ linux-2.6.0-test6-nvk/net/rose/rose_link.c 2003-10-01 17:41:54.000000000 +0530 @@ -31,26 +31,25 @@ static void rose_ftimer_expiry(unsigned long); static void rose_t0timer_expiry(unsigned long); -void rose_start_ftimer(struct rose_neigh *neigh) +void rose_neigh_init_timers(struct rose_neigh *neigh) { - del_timer(&neigh->ftimer); + init_timer(&neigh->t0timer); + neigh->t0timer.data = (unsigned long)neigh; + neigh->t0timer.function = &rose_t0timer_expiry; + init_timer(&neigh->ftimer); neigh->ftimer.data = (unsigned long)neigh; neigh->ftimer.function = &rose_ftimer_expiry; - neigh->ftimer.expires = jiffies + sysctl_rose_link_fail_timeout; +} - add_timer(&neigh->ftimer); +void rose_start_ftimer(struct rose_neigh *neigh) +{ + mod_timer(&neigh->ftimer, jiffies + sysctl_rose_link_fail_timeout); } void rose_start_t0timer(struct rose_neigh *neigh) { - del_timer(&neigh->t0timer); - - neigh->t0timer.data = (unsigned long)neigh; - neigh->t0timer.function = &rose_t0timer_expiry; - neigh->t0timer.expires = jiffies + sysctl_rose_restart_request_timeout; - - add_timer(&neigh->t0timer); + mod_timer(&neigh->t0timer, jiffies + sysctl_rose_restart_request_timeout); } void rose_stop_ftimer(struct rose_neigh *neigh) diff -urN -X dontdiff linux-2.6.0-test6/net/rose/rose_loopback.c linux-2.6.0-test6-nvk/net/rose/rose_loopback.c --- linux-2.6.0-test6/net/rose/rose_loopback.c 2003-09-09 11:12:05.000000000 +0530 +++ linux-2.6.0-test6-nvk/net/rose/rose_loopback.c 2003-10-01 19:29:42.000000000 +0530 @@ -14,19 +14,17 @@ #include #include -static struct sk_buff_head loopback_queue; -static struct timer_list loopback_timer; +static void rose_loopback_timer(unsigned long); -static void rose_set_loopback_timer(void); +static struct sk_buff_head loopback_queue; +static struct timer_list loopback_timer = TIMER_INITIALIZER(rose_loopback_timer, 0, 0); -void rose_loopback_init(void) +void __init rose_loopback_init(void) { skb_queue_head_init(&loopback_queue); - - init_timer(&loopback_timer); } -static int rose_loopback_running(void) +static inline int rose_loopback_running(void) { return timer_pending(&loopback_timer); } @@ -43,25 +41,12 @@ skb_queue_tail(&loopback_queue, skbn); if (!rose_loopback_running()) - rose_set_loopback_timer(); + mod_timer(&loopback_timer, jiffies + 10); } return 1; } -static void rose_loopback_timer(unsigned long); - -static void rose_set_loopback_timer(void) -{ - del_timer(&loopback_timer); - - loopback_timer.data = 0; - loopback_timer.function = &rose_loopback_timer; - loopback_timer.expires = jiffies + 10; - - add_timer(&loopback_timer); -} - static void rose_loopback_timer(unsigned long param) { struct sk_buff *skb; @@ -102,10 +87,11 @@ { struct sk_buff *skb; - del_timer(&loopback_timer); + del_timer_sync(&loopback_timer); while ((skb = skb_dequeue(&loopback_queue)) != NULL) { skb->sk = NULL; + skb->destructor = NULL; kfree_skb(skb); } } diff -urN -X dontdiff linux-2.6.0-test6/net/rose/rose_route.c linux-2.6.0-test6-nvk/net/rose/rose_route.c --- linux-2.6.0-test6/net/rose/rose_route.c 2003-10-01 14:03:23.000000000 +0530 +++ linux-2.6.0-test6-nvk/net/rose/rose_route.c 2003-10-01 17:41:54.000000000 +0530 @@ -49,6 +49,7 @@ struct rose_neigh *rose_loopback_neigh; static void rose_remove_neigh(struct rose_neigh *); +void rose_neigh_init_timers(struct rose_neigh *); /* * Add a new route to a node, and in the process add the node and the @@ -106,8 +107,7 @@ skb_queue_head_init(&rose_neigh->queue); - init_timer(&rose_neigh->ftimer); - init_timer(&rose_neigh->t0timer); + rose_neigh_init_timers(rose_neigh); if (rose_route->ndigis != 0) { if ((rose_neigh->digipeat = kmalloc(sizeof(ax25_digi), GFP_KERNEL)) == NULL) { @@ -389,8 +389,7 @@ skb_queue_head_init(&rose_loopback_neigh->queue); - init_timer(&rose_loopback_neigh->ftimer); - init_timer(&rose_loopback_neigh->t0timer); + rose_neigh_init_timers(rose_loopback_neigh); spin_lock_bh(&rose_neigh_list_lock); rose_loopback_neigh->next = rose_neigh_list; diff -urN -X dontdiff linux-2.6.0-test6/net/rose/rose_timer.c linux-2.6.0-test6-nvk/net/rose/rose_timer.c --- linux-2.6.0-test6/net/rose/rose_timer.c 2003-09-09 11:12:05.000000000 +0530 +++ linux-2.6.0-test6-nvk/net/rose/rose_timer.c 2003-10-01 17:41:54.000000000 +0530 @@ -33,82 +33,62 @@ static void rose_timer_expiry(unsigned long); static void rose_idletimer_expiry(unsigned long); -void rose_start_heartbeat(struct sock *sk) +void rose_init_timers(struct sock *sk) { - del_timer(&sk->sk_timer); + rose_cb *rose = rose_sk(sk); + + init_timer(&rose->timer); + rose->timer.data = (unsigned long)sk; + rose->timer.function = &rose_timer_expiry; + init_timer(&rose->idletimer); + rose->idletimer.data = (unsigned long)sk; + rose->idletimer.function = &rose_idletimer_expiry; + + /* initialized by sock_init_data */ sk->sk_timer.data = (unsigned long)sk; sk->sk_timer.function = &rose_heartbeat_expiry; - sk->sk_timer.expires = jiffies + 5 * HZ; +} - add_timer(&sk->sk_timer); +void rose_start_heartbeat(struct sock *sk) +{ + mod_timer(&sk->sk_timer, jiffies + 5 * HZ); } void rose_start_t1timer(struct sock *sk) { rose_cb *rose = rose_sk(sk); - del_timer(&rose->timer); - - rose->timer.data = (unsigned long)sk; - rose->timer.function = &rose_timer_expiry; - rose->timer.expires = jiffies + rose->t1; - - add_timer(&rose->timer); + mod_timer(&rose->timer, jiffies + rose->t1); } void rose_start_t2timer(struct sock *sk) { rose_cb *rose = rose_sk(sk); - del_timer(&rose->timer); - - rose->timer.data = (unsigned long)sk; - rose->timer.function = &rose_timer_expiry; - rose->timer.expires = jiffies + rose->t2; - - add_timer(&rose->timer); + mod_timer(&rose->timer, jiffies + rose->t2); } void rose_start_t3timer(struct sock *sk) { rose_cb *rose = rose_sk(sk); - del_timer(&rose->timer); - - rose->timer.data = (unsigned long)sk; - rose->timer.function = &rose_timer_expiry; - rose->timer.expires = jiffies + rose->t3; - - add_timer(&rose->timer); + mod_timer(&rose->timer, jiffies + rose->t3); } void rose_start_hbtimer(struct sock *sk) { rose_cb *rose = rose_sk(sk); - del_timer(&rose->timer); - - rose->timer.data = (unsigned long)sk; - rose->timer.function = &rose_timer_expiry; - rose->timer.expires = jiffies + rose->hb; - - add_timer(&rose->timer); + mod_timer(&rose->timer, jiffies + rose->hb); } void rose_start_idletimer(struct sock *sk) { rose_cb *rose = rose_sk(sk); - del_timer(&rose->idletimer); - - if (rose->idle > 0) { - rose->idletimer.data = (unsigned long)sk; - rose->idletimer.function = &rose_idletimer_expiry; - rose->idletimer.expires = jiffies + rose->idle; - - add_timer(&rose->idletimer); - } + if (rose->idle > 0) + mod_timer(&rose->idletimer, jiffies + rose->idle); } void rose_stop_heartbeat(struct sock *sk) From vinay.nallamothu@gsecone.com Wed Oct 1 07:26:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 07:26:43 -0700 (PDT) Received: from gateway.gsecone.com ([61.95.227.64]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91EPoFx005789 for ; Wed, 1 Oct 2003 07:26:02 -0700 Received: from vinay.gsecone.com (vinay.gsecone.com [192.168.1.15]) by gateway.gsecone.com (8.12.8/8.12.8) with ESMTP id h91ESQBU010427; Wed, 1 Oct 2003 19:58:26 +0530 Subject: [PATCH 2.6.0-test6][X25] timer cleanup From: Vinay K Nallamothu To: netdev@oss.sgi.com Cc: LKML Content-Type: text/plain Organization: Global Security One Message-Id: <1065018387.7194.336.camel@lima.royalchallenge.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 01 Oct 2003 19:56:27 +0530 Content-Transfer-Encoding: 7bit X-archive-position: 435 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vinay.nallamothu@gsecone.com Precedence: bulk X-list: netdev Content-Length: 4995 Lines: 182 Replace del_timer, mod_timer sequences with mod_timer. af_x25.c | 8 ++++---- x25_link.c | 16 ++++++---------- x25_timer.c | 47 +++++++++++++++-------------------------------- 3 files changed, 25 insertions(+), 46 deletions(-) diff -urN linux-2.6.0-test5/net/x25/af_x25.c linux-2.6.0-test5-nvk/net/x25/af_x25.c --- linux-2.6.0-test5/net/x25/af_x25.c 2003-09-09 11:12:07.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/x25/af_x25.c 2003-09-22 17:20:20.000000000 +0530 @@ -345,10 +345,8 @@ if (atomic_read(&sk->sk_wmem_alloc) || atomic_read(&sk->sk_rmem_alloc)) { /* Defer: outstanding buffers */ - init_timer(&sk->sk_timer); sk->sk_timer.expires = jiffies + 10 * HZ; sk->sk_timer.function = x25_destroy_timer; - sk->sk_timer.data = (unsigned long)sk; add_timer(&sk->sk_timer); } else { /* drop last reference so sock_put will free */ @@ -463,6 +461,8 @@ goto out; } +void x25_init_timers(struct sock *sk); + static int x25_create(struct socket *sock, int protocol) { struct sock *sk; @@ -481,7 +481,7 @@ sock_init_data(sock, sk); sk_set_owner(sk, THIS_MODULE); - init_timer(&x25->timer); + x25_init_timers(sk); sock->ops = &x25_proto_ops; sk->sk_protocol = protocol; @@ -537,7 +537,7 @@ x25->facilities = ox25->facilities; x25->qbitincl = ox25->qbitincl; - init_timer(&x25->timer); + x25_init_timers(sk); out: return sk; } diff -urN linux-2.6.0-test5/net/x25/x25_link.c linux-2.6.0-test5-nvk/net/x25/x25_link.c --- linux-2.6.0-test5/net/x25/x25_link.c 2003-09-09 11:12:07.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/x25/x25_link.c 2003-09-22 19:32:14.000000000 +0530 @@ -51,15 +51,9 @@ /* * Linux set/reset timer routines */ -static void x25_start_t20timer(struct x25_neigh *nb) +static inline void x25_start_t20timer(struct x25_neigh *nb) { - del_timer(&nb->t20timer); - - nb->t20timer.data = (unsigned long)nb; - nb->t20timer.function = &x25_t20timer_expiry; - nb->t20timer.expires = jiffies + nb->t20; - - add_timer(&nb->t20timer); + mod_timer(&nb->t20timer, jiffies + nb->t20); } static void x25_t20timer_expiry(unsigned long param) @@ -71,12 +65,12 @@ x25_start_t20timer(nb); } -static void x25_stop_t20timer(struct x25_neigh *nb) +static inline void x25_stop_t20timer(struct x25_neigh *nb) { del_timer(&nb->t20timer); } -static int x25_t20timer_pending(struct x25_neigh *nb) +static inline int x25_t20timer_pending(struct x25_neigh *nb) { return timer_pending(&nb->t20timer); } @@ -291,6 +285,8 @@ skb_queue_head_init(&nb->queue); init_timer(&nb->t20timer); + nb->t20timer.data = (unsigned long)nb; + nb->t20timer.function = &x25_t20timer_expiry; dev_hold(dev); nb->dev = dev; diff -urN linux-2.6.0-test5/net/x25/x25_timer.c linux-2.6.0-test5-nvk/net/x25/x25_timer.c --- linux-2.6.0-test5/net/x25/x25_timer.c 2003-09-09 11:12:07.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/x25/x25_timer.c 2003-09-22 17:23:46.000000000 +0530 @@ -43,15 +43,22 @@ static void x25_heartbeat_expiry(unsigned long); static void x25_timer_expiry(unsigned long); -void x25_start_heartbeat(struct sock *sk) +void x25_init_timers(struct sock *sk) { - del_timer(&sk->sk_timer); + struct x25_opt *x25 = x25_sk(sk); + init_timer(&x25->timer); + x25->timer.data = (unsigned long)sk; + x25->timer.function = &x25_timer_expiry; + + /* initialized by sock_init_data */ sk->sk_timer.data = (unsigned long)sk; sk->sk_timer.function = &x25_heartbeat_expiry; - sk->sk_timer.expires = jiffies + 5 * HZ; +} - add_timer(&sk->sk_timer); +void x25_start_heartbeat(struct sock *sk) +{ + mod_timer(&sk->sk_timer, jiffies + 5 * HZ); } void x25_stop_heartbeat(struct sock *sk) @@ -63,52 +70,28 @@ { struct x25_opt *x25 = x25_sk(sk); - del_timer(&x25->timer); - - x25->timer.data = (unsigned long)sk; - x25->timer.function = &x25_timer_expiry; - x25->timer.expires = jiffies + x25->t2; - - add_timer(&x25->timer); + mod_timer(&x25->timer, jiffies + x25->t2); } void x25_start_t21timer(struct sock *sk) { struct x25_opt *x25 = x25_sk(sk); - del_timer(&x25->timer); - - x25->timer.data = (unsigned long)sk; - x25->timer.function = &x25_timer_expiry; - x25->timer.expires = jiffies + x25->t21; - - add_timer(&x25->timer); + mod_timer(&x25->timer, jiffies + x25->t21); } void x25_start_t22timer(struct sock *sk) { struct x25_opt *x25 = x25_sk(sk); - del_timer(&x25->timer); - - x25->timer.data = (unsigned long)sk; - x25->timer.function = &x25_timer_expiry; - x25->timer.expires = jiffies + x25->t22; - - add_timer(&x25->timer); + mod_timer(&x25->timer, jiffies + x25->t22); } void x25_start_t23timer(struct sock *sk) { struct x25_opt *x25 = x25_sk(sk); - del_timer(&x25->timer); - - x25->timer.data = (unsigned long)sk; - x25->timer.function = &x25_timer_expiry; - x25->timer.expires = jiffies + x25->t23; - - add_timer(&x25->timer); + mod_timer(&x25->timer, jiffies + x25->t23); } void x25_stop_timer(struct sock *sk) From rddunlap@osdl.org Wed Oct 1 07:49:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 07:49:37 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91EmxFx007998 for ; Wed, 1 Oct 2003 07:49:00 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h91Emh121348; Wed, 1 Oct 2003 07:48:43 -0700 Date: Wed, 1 Oct 2003 07:40:36 -0700 From: "Randy.Dunlap" To: "Feldman, Scott" Cc: davem@redhat.com, jgarzik@pobox.com, akpm@osdl.org, netdev@oss.sgi.com, cramerj@intel.com Subject: Re: Fw: Badness in local_bh_enable at kernel/softirq.c:119 Message-Id: <20031001074036.466ded68.rddunlap@osdl.org> In-Reply-To: References: Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 436 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1286 Lines: 36 On Wed, 1 Oct 2003 01:19:41 -0700 "Feldman, Scott" wrote: | Chris can jump in here anytime. :-) | | Synchronizing on the hardware side is stumping me. We have the list of | skbs you describe, but I'm concerned about unmapping the skb buffers if | hardware is right in the middle of some DMA on one of the buffers. | Some archs really don't like hardware accessing unmapped buffers. | | Here's what I'm thinking: when link down is detected in the timer, just | trick hardware into thinking link is still up (ILOS - Invert Loss of | Signal). No locking, no disabling of interrupts. Hardware will do the | natural thing by completing the outstanding sends and also provide the | interrupts so we can clean/return skbs as normal (e1000_clean_tx_irq). | Something like: | | | if lost link | if outstanding Tx work | set ILOS // h/w thinks link is | up, DMA continues | mdelay(10) | clear ILOS // h/w thinks link is | down | | The mdelay(10) is terrible, but we've already got that in the current | tx_flush routine. | | Chris, what am I missing? I didn't included the ANE business for | clarity. What happens if the link comes back up (live) during the mdelay period? Tiny race? Just a delay until it's corrected? -- ~Randy From ctindel@calma.pair.com Wed Oct 1 11:26:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 11:26:51 -0700 (PDT) Received: from calma.pair.com (calma.pair.com [209.68.1.95]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91IQAFx002935 for ; Wed, 1 Oct 2003 11:26:11 -0700 Received: (qmail 25601 invoked by uid 3059); 1 Oct 2003 18:26:10 -0000 Date: Wed, 1 Oct 2003 14:26:10 -0400 From: "Chad N. Tindel" To: Shmulik Hen Cc: "David S. Miller" , "Chad N. Tindel" , fubar@us.ibm.com, jgarzik@pobox.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] Re: [bonding] compatibilty issues Message-ID: <20031001182610.GA25218@calma.pair.com> Mail-Followup-To: Shmulik Hen , "David S. Miller" , "Chad N. Tindel" , fubar@us.ibm.com, jgarzik@pobox.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com References: <200310011149.04612.shmulik.hen@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200310011149.04612.shmulik.hen@intel.com> User-Agent: Mutt/1.4i X-archive-position: 437 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chad@tindel.net Precedence: bulk X-list: netdev Content-Length: 659 Lines: 15 > So here is what I did in the meantime: > * Created a version for 2.4 that puts back all old compatibility stuff > that was removed either during the propagation set or the cleanup > set. > * Created a version for 2.6 that puts back just the compatibility > stuff that was removed in the propagation set (BOND_SETHWADDR, since > we got a complaint from a RH9 user). > * Removed the mention of the multicast param from the read-me. > * Raised the ABI version to 2 so the new ifenslave keeps propagating > IP settings to slaves for older drivers, and doesn't do that for new > ones that contain Willy Tarreau's panic fix. I like this. Chad From bwindle@fint.org Wed Oct 1 11:41:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 11:41:47 -0700 (PDT) Received: from mta01-srv.alltel.net (mta01.alltel.net [166.102.165.143]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91IfDFx004256 for ; Wed, 1 Oct 2003 11:41:14 -0700 Received: from morpheus ([151.213.164.243]) by mta01-srv.alltel.net with ESMTP id <20031001184113.DJKQ25097.mta01-srv.alltel.net@morpheus> for ; Wed, 1 Oct 2003 13:41:13 -0500 Received: from bwindle (helo=localhost) by morpheus with local-esmtp (Exim 3.36 #1 (Debian)) id 1A4luP-0000eA-00 for ; Wed, 01 Oct 2003 14:41:09 -0400 Date: Wed, 1 Oct 2003 14:41:09 -0400 (EDT) From: Burton Windle X-X-Sender: bwindle@morpheus To: netdev@oss.sgi.com Subject: [RFC] Silencing needless printk in socket.c Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 438 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bwindle@fint.org Precedence: bulk X-list: netdev Content-Length: 592 Lines: 18 Would anyone object to a patch that wraps the printk in linux/net/socket.c:1897 in a 'if debug'? This first appeared around 2.6.0-test5; the output may be helpful to a developer, but I don't think it is needed in the normal dmesg. dual266:/home/kernel/linux/net# dmesg | grep NET NET: Registered protocol family 16 NET: Registered protocol family 2 NET: Registered protocol family 1 NET: Registered protocol family 17 -- Burton Windle burton@fint.org Linux: the "grim reaper of innocent orphaned children." from /usr/src/linux-2.4.18/init/main.c:461 From fubar@us.ibm.com Wed Oct 1 12:26:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 12:26:49 -0700 (PDT) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91JQGFx010335 for ; Wed, 1 Oct 2003 12:26:16 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h91JPZjZ291204; Wed, 1 Oct 2003 15:25:35 -0400 Received: from death.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h91JPWuX151268; Wed, 1 Oct 2003 13:25:34 -0600 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h91JPJXZ001948; Wed, 1 Oct 2003 12:25:22 -0700 Message-Id: <200310011925.h91JPJXZ001948@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: Shmulik Hen , "David S. Miller" , "Chad N. Tindel" , jgarzik@pobox.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] Re: [bonding] compatibilty issues In-Reply-To: Message from "Chad N. Tindel" of "Wed, 01 Oct 2003 14:26:10 EDT." <20031001182610.GA25218@calma.pair.com> Date: Wed, 01 Oct 2003 12:25:19 -0700 From: Jay Vosburgh X-archive-position: 439 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1249 Lines: 29 >> So here is what I did in the meantime: >> * Created a version for 2.4 that puts back all old compatibility stuff >> that was removed either during the propagation set or the cleanup >> set. >> * Created a version for 2.6 that puts back just the compatibility >> stuff that was removed in the propagation set (BOND_SETHWADDR, since >> we got a complaint from a RH9 user). >> * Removed the mention of the multicast param from the read-me. >> * Raised the ABI version to 2 so the new ifenslave keeps propagating >> IP settings to slaves for older drivers, and doesn't do that for new >> ones that contain Willy Tarreau's panic fix. > >I like this. Same here, but I'd like to have a list somewhere of what each of the ABI versions is for and how they're supposed to behave. It's starting to look like we're going to be adding these on a semi-regular basis, so we need to keep track of what each one does and why. I also don't have any major heartburn about leaving the OLD thingies in 2.4. I'd like to remove them, but part of my reason for wanting to nuke them was to keep 2.4 and 2.6 identical, but we're not doing that, so it's not as big a concern. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From g.liakhovetski@gmx.de Wed Oct 1 12:57:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 12:58:29 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91JvuFx010882 for ; Wed, 1 Oct 2003 12:57:56 -0700 Received: (qmail 13076 invoked by uid 65534); 1 Oct 2003 19:57:48 -0000 Received: from Ba1de.pppool.de (EHLO poirot.grange) (213.7.161.222) by mail.gmx.net (mp007) with SMTP; 01 Oct 2003 21:57:48 +0200 X-Authenticated: #20450766 Received: from lyakh (helo=localhost) by poirot.grange with local-esmtp (Exim 3.35 #1 (Debian)) id 1A4mwp-0001M7-00; Wed, 01 Oct 2003 21:47:43 +0200 Date: Wed, 1 Oct 2003 21:47:43 +0200 (CEST) From: Guennadi Liakhovetski Reply-To: Guennadi Liakhovetski To: David Woodhouse cc: "David S. Miller" , , , , , , Subject: Re: RFC: [2.6 patch] disallow modular IPv6 In-Reply-To: <1064903505.6154.157.camel@imladris.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 440 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: g.liakhovetski@gmx.de Precedence: bulk X-list: netdev Content-Length: 1697 Lines: 39 On Tue, 30 Sep 2003, David Woodhouse wrote: > On Mon, 2003-09-29 at 22:17 -0700, David S. Miller wrote: > > On Mon, 29 Sep 2003 10:02:55 +0100 > > David Woodhouse wrote: > > > > > The underlying point being that your static kernel should not change if > > > you change an option from 'n' to 'm'. It should only affect the kernel > > > image if you change options to/from 'y'. > > > > I totally disagree, what ipv6 is doing is perfectly fine. > > Your right. Well, maybe you are right, but I certainly liked the feature, that I could just add a module to a currently running kernel's configuration, compile and insmod it. But, if this is how it is (going to be) now - that one shouldn't rely on this, do you agree, that such attempts should be stopped by the build system? If so, I think, a script, trying to find possible problems could be of help? It wouldn't be trivial, but maybe there's already framework available, that can be taught to do this? Ideally, you would want to check: for each tristate CONFIG_ find from the respective Makefile(s) which source (*.[Sc])-files are involved with obj-$(CONFIG_x). Find depending source-files from "depends on x" in respective Kconfig recursively. If CONFIG_x appears in any other source-files - it is already a (likely) problem. Now headers. Well, if we want to check infinitely deep inclusions - it would require a fat cluster / SMP, I guess:-) So, is there a piece of software among all automatic checkers, that could be relatively easily taught to do this and would it make sense to run such a check on each -pre and -rc version? Actually, is anybody checking for recursive includes? Guennadi --- Guennadi Liakhovetski From akpm@osdl.org Wed Oct 1 15:57:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 15:57:35 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91Muf25018824 for ; Wed, 1 Oct 2003 15:57:02 -0700 Received: from akpm-1.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h91MuW104645; Wed, 1 Oct 2003 15:56:32 -0700 Date: Wed, 1 Oct 2003 15:56:23 -0700 From: Andrew Morton To: Vinay K Nallamothu Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2.6.0-test6][X25] timer cleanup Message-Id: <20031001155623.06b89258.akpm@osdl.org> In-Reply-To: <1065018387.7194.336.camel@lima.royalchallenge.com> References: <1065018387.7194.336.camel@lima.royalchallenge.com> X-Mailer: Sylpheed version 0.9.4 (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: 441 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 134 Lines: 5 Vinay K Nallamothu wrote: > > Replace del_timer, mod_timer sequences with mod_timer. was this tested? From mashirle@us.ibm.com Wed Oct 1 16:37:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 16:38:20 -0700 (PDT) Received: from linux2.suntekindustrial.com (wbar1.sjo1-4-4-004-065.sjo1.dsl-verizon.net [4.4.4.65]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h91Nbe25022416 for ; Wed, 1 Oct 2003 16:37:47 -0700 Received: from ibm-mxl (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated bits=0) by linux2.suntekindustrial.com (8.12.8/8.12.8) with ESMTP id h91NlDo7002302; Wed, 1 Oct 2003 16:47:14 -0700 Content-Type: text/plain; charset="us-ascii" From: Shirley Ma Organization: IBM Linux To: davem@redhat.com, kuznet@ms2.inr.ac.ru Subject: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable Date: Wed, 1 Oct 2003 16:37:26 -0700 User-Agent: KMail/1.4.3 Cc: netdev@oss.sgi.com MIME-Version: 1.0 Message-Id: <200310011637.27013.mashirle@us.ibm.com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h91Nbe25022416 X-archive-position: 442 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 10657 Lines: 355 I've sent my explanation of IPv6 MIBs implementation a couple of weeks back. This patch implements the IPv6 MIBs ipv6AddressTable. The implementation is based on the new last call draft of IPv6 MIBs, see link blow. It's going to be a RFC. http://www.ietf.org/internet-drafts/draft-ietf-ipv6-rfc2011-update-04.txt The patch has been tested against Linux-2.6.0-test5-bk12. I have made sure this applies cleanly to Linux 2.6.0-test6-bk3. Below is the patch. Please give me your comments. Thanks Shirley Ma IBM Linux Technology Center ======================= diff -urN linux-2.6.0-test5/include/linux/rtnetlink.h linux-2.6.0-test5-ipv6mib4/include/linux/rtnetlink.h --- linux-2.6.0-test5/include/linux/rtnetlink.h 2003-09-25 17:17:02.000000000 -0700 +++ linux-2.6.0-test5-ipv6mib4/include/linux/rtnetlink.h 2003-10-01 11:00:03.000000000 -0700 @@ -352,8 +352,10 @@ struct ifa_cacheinfo { - __s32 ifa_prefered; - __s32 ifa_valid; + __u32 ifa_prefered; + __u32 ifa_valid; + unsigned long cstamp; /* created time */ + unsigned long tstamp; /* updated time */ }; diff -urN linux-2.6.0-test5/include/linux/time.h linux-2.6.0-test5-ipv6mib4/include/linux/time.h --- linux-2.6.0-test5/include/linux/time.h 2003-09-08 12:50:08.000000000 -0700 +++ linux-2.6.0-test5-ipv6mib4/include/linux/time.h 2003-10-01 11:40:42.000000000 -0700 @@ -55,6 +55,7 @@ * at _least_ "jiffies" - so "jiffies+1" had better still * be positive. */ +#define MAX_JIFFIES (~0) #define MAX_JIFFY_OFFSET ((~0UL >> 1)-1) /* Parameters used to convert the timespec values */ diff -urN linux-2.6.0-test5/include/net/if_inet6.h linux-2.6.0-test5-ipv6mib4/include/net/if_inet6.h --- linux-2.6.0-test5/include/net/if_inet6.h 2003-09-25 17:17:02.000000000 -0700 +++ linux-2.6.0-test5-ipv6mib4/include/net/if_inet6.h 2003-10-01 11:23:27.000000000 -0700 @@ -34,7 +34,8 @@ __u32 valid_lft; __u32 prefered_lft; - unsigned long tstamp; + unsigned long cstamp; /* created timestamp */ + unsigned long tstamp; /* updated timestamp */ atomic_t refcnt; spinlock_t lock; @@ -111,6 +112,8 @@ atomic_t mca_refcnt; spinlock_t mca_lock; unsigned char mca_crcount; + unsigned long mca_cstamp; + unsigned long mca_tstamp; }; /* Anycast stuff */ @@ -130,6 +133,8 @@ int aca_users; atomic_t aca_refcnt; spinlock_t aca_lock; + unsigned long aca_cstamp; + unsigned long aca_tstamp; }; #define IFA_HOST IPV6_ADDR_LOOPBACK diff -urN linux-2.6.0-test5/net/ipv6/addrconf.c linux-2.6.0-test5-ipv6mib4/net/ipv6/addrconf.c --- linux-2.6.0-test5/net/ipv6/addrconf.c 2003-09-25 17:17:03.000000000 -0700 +++ linux-2.6.0-test5-ipv6mib4/net/ipv6/addrconf.c 2003-10-01 11:28:41.000000000 -0700 @@ -92,6 +92,8 @@ #define ADBG(x) #endif +#define INFINITY_LIFE_TIME 0xFFFFFFFF + #ifdef CONFIG_SYSCTL static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p); static void addrconf_sysctl_unregister(struct ipv6_devconf *p); @@ -505,6 +507,7 @@ ifa->scope = scope; ifa->prefix_len = pfxlen; ifa->flags = flags | IFA_F_TENTATIVE; + ifa->cstamp = ifa->tstamp = jiffies; read_lock(&addrconf_lock); if (idev->dead) { @@ -707,6 +710,7 @@ ift->ifpub = ifp; ift->valid_lft = tmp_valid_lft; ift->prefered_lft = tmp_prefered_lft; + ift->cstamp = ifp->cstamp; ift->tstamp = ifp->tstamp; spin_unlock_bh(&ift->lock); addrconf_dad_start(ift, 0); @@ -1412,6 +1416,7 @@ } update_lft = create = 1; + ifp->cstamp = jiffies; addrconf_dad_start(ifp, RTF_ADDRCONF|RTF_PREFIX_RT); } @@ -2447,14 +2452,103 @@ if (!(ifa->flags&IFA_F_PERMANENT)) { ci.ifa_prefered = ifa->prefered_lft; ci.ifa_valid = ifa->valid_lft; - if (ci.ifa_prefered != 0xFFFFFFFF) { + if (ci.ifa_prefered != INFINITY_LIFE_TIME) { long tval = (jiffies - ifa->tstamp)/HZ; ci.ifa_prefered -= tval; - if (ci.ifa_valid != 0xFFFFFFFF) + if (ci.ifa_valid != INFINITY_LIFE_TIME) ci.ifa_valid -= tval; } - RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + } else { + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; } + if (ifa->cstamp < INITIAL_JIFFIES) + ci.cstamp = (ifa->cstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ; + else + ci.cstamp = (ifa->cstamp - INITIAL_JIFFIES) / HZ; + if (ifa->tstamp < INITIAL_JIFFIES) + ci.tstamp = (ifa->tstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ; + else + ci.tstamp = (ifa->tstamp - INITIAL_JIFFIES) / HZ; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifmca->mca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifmca->idev->dev->ifindex; + RTA_PUT(skb, IFA_ADDRESS, 16, &ifmca->mca_addr); + if (ifmca->mca_cstamp < INITIAL_JIFFIES) + ci.cstamp = (ifmca->mca_cstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ; + else + ci.cstamp = (ifmca->mca_cstamp - INITIAL_JIFFIES) / HZ; + if (ifmca->mca_tstamp < INITIAL_JIFFIES) + ci.tstamp = (ifmca->mca_tstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ; + else + ci.tstamp = (ifmca->mca_tstamp - INITIAL_JIFFIES) / HZ; + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifacaddr(struct sk_buff *skb, struct ifacaddr6 *ifaca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifaca->aca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifaca->aca_idev->dev->ifindex; + RTA_PUT(skb, IFA_ADDRESS, 16, &ifaca->aca_addr); + if (ifaca->aca_cstamp < INITIAL_JIFFIES) + ci.cstamp = (ifaca->aca_cstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ; + else + ci.cstamp = (ifaca->aca_cstamp - INITIAL_JIFFIES) / HZ; + if (ifaca->aca_tstamp < INITIAL_JIFFIES) + ci.tstamp = (ifaca->aca_tstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ; + else + ci.tstamp = (ifaca->aca_tstamp - INITIAL_JIFFIES) / HZ; + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); nlh->nlmsg_len = skb->tail - b; return skb->len; @@ -2468,33 +2562,83 @@ { int idx, ip_idx; int s_idx, s_ip_idx; - struct inet6_ifaddr *ifa; - + struct net_device *dev; + struct inet6_dev *idev; + struct inet6_ifaddr *ifa; + struct ifmcaddr6 *ifmca; + struct ifacaddr6 *ifaca; + s_idx = cb->args[0]; s_ip_idx = ip_idx = cb->args[1]; - - for (idx=0; idx < IN6_ADDR_HSIZE; idx++) { + read_lock(&dev_base_lock); + + for (dev = dev_base, idx = 0; dev; dev = dev->next, idx++) { if (idx < s_idx) continue; if (idx > s_idx) s_ip_idx = 0; - read_lock_bh(&addrconf_hash_lock); - for (ifa=inet6_addr_lst[idx], ip_idx = 0; ifa; - ifa = ifa->lst_next, ip_idx++) { + if ((idev = in6_dev_get(dev)) == NULL) + continue; + read_lock_bh(&idev->lock); + /* unicast address */ + for (ifa = idev->addr_list, ip_idx = 0; ifa; + ifa = ifa->if_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if (inet6_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR) <= 0) { + read_unlock(&addrconf_lock); + in6_dev_put(idev); + goto done; + } + } + /* temp addr */ +#ifdef CONFIG_IPV6_PRIVACY + for (ifa = idev->tempaddr_list; ifa; + ifa = ifua->tmp_next, ip_idx++) { if (ip_idx < s_ip_idx) continue; if (inet6_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR) <= 0) { - read_unlock_bh(&addrconf_hash_lock); + cb->nlh->nlmsg_seq, RTM_NEWADDR) <= 0) { + read_unlock(&addrconf_lock); + in6_dev_put(idev); + goto done; + } + } +#endif + /* multicast address */ + for (ifmca = idev->mc_list; ifmca; + ifmca = ifmca->next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if (inet6_fill_ifmcaddr(skb, ifmca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR) <= 0) { + read_unlock(&addrconf_lock); + in6_dev_put(idev); + goto done; + } + } + /* anycast address */ + for (ifaca = idev->ac_list; ifaca; + ifaca = ifaca->aca_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if (inet6_fill_ifacaddr(skb, ifaca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR) <=0) { + read_unlock(&addrconf_lock); + in6_dev_put(idev); goto done; } } - read_unlock_bh(&addrconf_hash_lock); + read_unlock(&addrconf_lock); + in6_dev_put(idev); } done: + read_unlock(&dev_base_lock); cb->args[0] = idx; cb->args[1] = ip_idx; - return skb->len; } diff -urN linux-2.6.0-test5/net/ipv6/anycast.c linux-2.6.0-test5-ipv6mib4/net/ipv6/anycast.c --- linux-2.6.0-test5/net/ipv6/anycast.c 2003-09-25 17:17:03.000000000 -0700 +++ linux-2.6.0-test5-ipv6mib4/net/ipv6/anycast.c 2003-10-01 11:23:04.000000000 -0700 @@ -343,6 +343,8 @@ ipv6_addr_copy(&aca->aca_addr, addr); aca->aca_idev = idev; aca->aca_users = 1; + /* aca_tstamp should be updated later, once it's updated */ + aca->aca_cstamp = aca->aca_tstamp = jiffies; atomic_set(&aca->aca_refcnt, 2); aca->aca_lock = SPIN_LOCK_UNLOCKED; diff -urN linux-2.6.0-test5/net/ipv6/mcast.c linux-2.6.0-test5-ipv6mib4/net/ipv6/mcast.c --- linux-2.6.0-test5/net/ipv6/mcast.c 2003-09-25 17:17:03.000000000 -0700 +++ linux-2.6.0-test5-ipv6mib4/net/ipv6/mcast.c 2003-09-30 18:40:29.000000000 -0700 @@ -830,6 +830,8 @@ ipv6_addr_copy(&mc->mca_addr, addr); mc->idev = idev; mc->mca_users = 1; + /* mca_stamp should be updated later, once it's updated */ + mc->mca_cstamp = mc->mca_tstamp = jiffies; atomic_set(&mc->mca_refcnt, 2); mc->mca_lock = SPIN_LOCK_UNLOCKED; From shmulik.hen@intel.com Wed Oct 1 23:38:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 01 Oct 2003 23:38:43 -0700 (PDT) Received: from caduceus.jf.intel.com (fmr06.intel.com [134.134.136.7]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h926c425007239 for ; Wed, 1 Oct 2003 23:38:04 -0700 Received: from petasus.jf.intel.com (petasus.jf.intel.com [10.7.209.6]) by caduceus.jf.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h926c0qU019463 for ; Thu, 2 Oct 2003 06:38:00 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.jf.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h926WSg06951 for ; Thu, 2 Oct 2003 06:32:28 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003100123375217636 ; Wed, 01 Oct 2003 23:37:54 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "Jay Vosburgh" , "David S. Miller" , "Chad N. Tindel" , , , Subject: Re: [Bonding-devel] Re: [bonding] compatibilty issues Date: Thu, 2 Oct 2003 09:37:51 +0300 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310020937.51781.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 443 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 1119 Lines: 26 On Wednesday 01 October 2003 10:25 pm, Jay Vosburgh wrote: > Same here, but I'd like to have a list somewhere of what each > of the ABI versions is for and how they're supposed to behave. > It's starting to look like we're going to be adding these on a > semi-regular basis, so we need to keep track of what each one does > and why. > Where should such a list go ? Currently, 0 or none is for doing everything the old way. 1 is for not setting slaves HW addr via ifenslave and leaving them in down state so the driver gets them with their unique address, sets them according to the mode and brings them up. The driver also restores the original address upon release. This is all done for supporting the 802.3ad, TLB, ALB modes. 2 will be for ifenslave lite that doesn't propagate the bond's IP settings to the slaves. I'm guessing that 3 will be used to designate the new support for hot operations that Amir is working on. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From vinay.nallamothu@gsecone.com Thu Oct 2 00:02:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 00:03:29 -0700 (PDT) Received: from gateway.gsecone.com ([61.95.227.64]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9272r25009029 for ; Thu, 2 Oct 2003 00:02:54 -0700 Received: from vinay.gsecone.com (vinay.gsecone.com [192.168.1.15]) by gateway.gsecone.com (8.12.8/8.12.8) with ESMTP id h9275MBU015070; Thu, 2 Oct 2003 12:35:24 +0530 Subject: Re: [PATCH 2.6.0-test6][X25] timer cleanup From: Vinay K Nallamothu To: Andrew Morton Cc: netdev@oss.sgi.com, LKML In-Reply-To: <20031001155623.06b89258.akpm@osdl.org> References: <1065018387.7194.336.camel@lima.royalchallenge.com> <20031001155623.06b89258.akpm@osdl.org> Content-Type: text/plain Organization: Global Security One Message-Id: <1065078208.4340.3.camel@lima.royalchallenge.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 02 Oct 2003 12:33:28 +0530 Content-Transfer-Encoding: 7bit X-archive-position: 444 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vinay.nallamothu@gsecone.com Precedence: bulk X-list: netdev Content-Length: 218 Lines: 8 On Thu, 2003-10-02 at 04:26, Andrew Morton wrote: > Vinay K Nallamothu wrote: > > > > Replace del_timer, mod_timer sequences with mod_timer. > > was this tested? No. But compiles fine. From shmulik.hen@intel.com Thu Oct 2 00:57:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 00:58:32 -0700 (PDT) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h927vw25015703 for ; Thu, 2 Oct 2003 00:57:59 -0700 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by hermes.fm.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h927rQfw024445 for ; Thu, 2 Oct 2003 07:53:26 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by talaria.fm.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h927vM125645 for ; Thu, 2 Oct 2003 07:57:22 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003100200574817781 ; Thu, 02 Oct 2003 00:57:49 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: Subject: Re: [Bonding-devel] Re: [bonding] compatibilty issues Date: Thu, 2 Oct 2003 10:57:46 +0300 User-Agent: KMail/1.4.3 References: In-Reply-To: Cc: , MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310021057.46995.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 445 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 1348 Lines: 34 I wrote: > * Created a version for 2.4 that puts back all old compatibility > stuff that was removed either during the propagation set or the > cleanup set. > * Created a version for 2.6 that puts back just the compatibility > stuff that was removed in the propagation set (BOND_SETHWADDR, > since we got a complaint from a RH9 user). Jeff, I'm going to need a ruling from you: We understood from David that support of old ioctl definitions (i.e. those mapped to SIOCDEVPRIVATE) needs to be removed in the 2.6 kernel. This will break compatibility with old versions of ifenslave (at least 2 years old, but still included in recent distributions like Red Hat 9). If removing those private ioctls is a necessity for 2.6, then breaking compatibility with the old ifenslave versions is inevitable, so we might as well remove all compatibility stuff from the 2.6 bonding module (not just the private ioctls). Of course, we'll keep ifenslave fully compatible with all versions of bonding, so the user only needs to upgrade the tool once. Given the above, how do you feel about removing old backward compatibility stuff from bonding in 2.6 ? -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From davem@pizda.ninka.net Thu Oct 2 01:40:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 01:41:09 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h928eZ25018795 for ; Thu, 2 Oct 2003 01:40:35 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10215; Thu, 2 Oct 2003 01:36:20 -0700 Date: Thu, 2 Oct 2003 01:36:20 -0700 From: "David S. Miller" To: Vinay K Nallamothu Cc: akpm@osdl.org, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2.6.0-test6][X25] timer cleanup Message-Id: <20031002013620.6d8b6f10.davem@redhat.com> In-Reply-To: <1065078208.4340.3.camel@lima.royalchallenge.com> References: <1065018387.7194.336.camel@lima.royalchallenge.com> <20031001155623.06b89258.akpm@osdl.org> <1065078208.4340.3.camel@lima.royalchallenge.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 446 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: 446 Lines: 15 On Thu, 02 Oct 2003 12:33:28 +0530 Vinay K Nallamothu wrote: > On Thu, 2003-10-02 at 04:26, Andrew Morton wrote: > > Vinay K Nallamothu wrote: > > > > > > Replace del_timer, mod_timer sequences with mod_timer. > > > > was this tested? > No. But compiles fine. Please find a way to at least minimally test the protocols you are changing then, or find someone else who can. Thanks. From davem@pizda.ninka.net Thu Oct 2 01:41:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 01:41:49 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h928fF25018863 for ; Thu, 2 Oct 2003 01:41:16 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10232; Thu, 2 Oct 2003 01:37:04 -0700 Date: Thu, 2 Oct 2003 01:37:03 -0700 From: "David S. Miller" To: Vinay K Nallamothu Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2.6.0-test6][ROSE] timer cleanups (and couple of fixes) Message-Id: <20031002013703.5072c707.davem@redhat.com> In-Reply-To: <1065017300.7194.318.camel@lima.royalchallenge.com> References: <1065017300.7194.318.camel@lima.royalchallenge.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 447 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: 204 Lines: 5 I'm going to assume this one is not even minimally tested either just like your X25 timer changes, and likewise I want you to find a method to get the changes tested before I add the changes to my tree. From davem@pizda.ninka.net Thu Oct 2 01:52:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 01:53:22 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h928ql25027606 for ; Thu, 2 Oct 2003 01:52:48 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10281; Thu, 2 Oct 2003 01:48:38 -0700 Date: Thu, 2 Oct 2003 01:48:38 -0700 From: "David S. Miller" To: Burton Windle Cc: netdev@oss.sgi.com Subject: Re: [RFC] Silencing needless printk in socket.c Message-Id: <20031002014838.0c790cda.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 448 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: 849 Lines: 21 On Wed, 1 Oct 2003 14:41:09 -0400 (EDT) Burton Windle wrote: > Would anyone object to a patch that wraps the printk in > linux/net/socket.c:1897 in a 'if debug'? > > This first appeared around 2.6.0-test5; the output may be helpful to a > developer, but I don't think it is needed in the normal dmesg. Yes it is needed, and since in the same changes that _ADDED_ this new printk I _REMOVED_ all the numerous per-protocol printks that were printed out. Less stuff is printed out now than before, and now this is the only indication that a particular protocol family got registered or unregistered successfully. We're not removing this. This is especially the case beause people like you didn't complain at all when we used to get 4 or 5 lines of printk messages for each of these protocols when they started up or shut down. From Robert.Olsson@data.slu.se Thu Oct 2 09:33:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 09:34:34 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92GXs25025049 for ; Thu, 2 Oct 2003 09:33:55 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.9.3+/8.9.3) with ESMTP id RAA23142; Thu, 2 Oct 2003 17:31:29 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id DDFBAEC22F; Thu, 2 Oct 2003 17:31:30 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16252.17618.866515.952549@robur.slu.se> Date: Thu, 2 Oct 2003 17:31:30 +0200 To: Jeff Garzik Cc: Robert Olsson , Andrew Morton , netdev@oss.sgi.com, dfages@arkoon.net Subject: Re: Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP In-Reply-To: <3F78A691.1040406@pobox.com> References: <20030929123734.5bd97a47.akpm@osdl.org> <16248.41796.797321.700866@robur.slu.se> <3F78A691.1040406@pobox.com> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 449 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: 27030 Lines: 773 Jeff Garzik writes: > > If someone had a NAPI patch for tulip, we could remove HW_FLOWCONTROL > option altogether :) Hello! Here is something for 2.6.0-test6: * ifdef's to keep current non-NAPI tulip intact * Port based on Alexey's orig NAPI tulip design (Only RX handled by dev->poll) * tulip HW_FLOW removed * NAPI and HW-mitigation options in Kconfig Cheers --ro --- drivers/net/tulip.orig/Kconfig 2003-09-28 02:50:39.000000000 +0200 +++ drivers/net/tulip/Kconfig 2003-09-30 14:34:39.000000000 +0200 @@ -68,6 +68,26 @@ obscure bugs if your mainboard has memory controller timing issues. If in doubt, say N. +config TULIP_NAPI + bool "Use NAPI RX polling " + depends on TULIP + ---help--- + This is of useful for servers and routers dealing with high network loads. + + See . + + If in doubt, say N. + +config TULIP_NAPI_HW_MITIGATION + bool "Use Interrupt Mitigation " + depends on TULIP_NAPI + ---help--- + Use HW to reduce RX interrupts. Not strict necessary since NAPI reduces + RX interrupts but itself. Although this reduces RX interrupts even at + low levels traffic at the cost of a small latency. + + If in doubt, say Y. + config DE4X5 tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA" depends on NET_TULIP && (PCI || EISA) --- drivers/net/tulip.orig/tulip.h 2003-09-28 02:51:02.000000000 +0200 +++ drivers/net/tulip/tulip.h 2003-09-30 14:22:08.000000000 +0200 @@ -126,6 +126,7 @@ CFDD_Snooze = (1 << 30), }; +#define RxPollInt (RxIntr|RxNoBuf|RxDied|RxJabber) /* The bits in the CSR5 status registers, mostly interrupt sources. */ enum status_bits { @@ -251,9 +252,9 @@ Making the Tx ring too large decreases the effectiveness of channel bonding and packet priority. There are no ill effects from too-large receive rings. */ -#define TX_RING_SIZE 16 -#define RX_RING_SIZE 32 +#define TX_RING_SIZE 32 +#define RX_RING_SIZE 128 #define MEDIA_MASK 31 #define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */ @@ -343,17 +344,15 @@ int flags; struct net_device_stats stats; struct timer_list timer; /* Media selection timer. */ + struct timer_list oom_timer; /* Out of memory timer. */ u32 mc_filter[2]; spinlock_t lock; spinlock_t mii_lock; unsigned int cur_rx, cur_tx; /* The next free ring entry */ unsigned int dirty_rx, dirty_tx; /* The ring entries to be free()ed. */ -#ifdef CONFIG_NET_HW_FLOWCONTROL -#define RX_A_NBF_STOP 0xffffff3f /* To disable RX and RX-NOBUF ints. */ - int fc_bit; - int mit_sel; - int mit_change; /* Signal for Interrupt Mitigtion */ +#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION + int mit_on; #endif unsigned int full_duplex:1; /* Full-duplex operation requested. */ unsigned int full_duplex_lock:1; @@ -415,6 +414,10 @@ extern int tulip_rx_copybreak; irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs); int tulip_refill_rx(struct net_device *dev); +#ifdef CONFIG_TULIP_NAPI +int tulip_poll(struct net_device *dev, int *budget); +#endif + /* media.c */ int tulip_mdio_read(struct net_device *dev, int phy_id, int location); @@ -438,6 +441,7 @@ extern const char * const medianame[]; extern const char tulip_media_cap[]; extern struct tulip_chip_table tulip_tbl[]; +void oom_timer(unsigned long data); extern u8 t21040_csr13[]; #ifndef USE_IO_OPS --- drivers/net/tulip.orig/tulip_core.c 2003-09-28 02:50:29.000000000 +0200 +++ drivers/net/tulip/tulip_core.c 2003-09-30 14:29:11.000000000 +0200 @@ -14,11 +14,17 @@ */ +#include + #define DRV_NAME "tulip" +#ifdef CONFIG_TULIP_NAPI +#define DRV_VERSION "1.1.13-NAPI" /* Keep at least for test */ +#else #define DRV_VERSION "1.1.13" +#endif #define DRV_RELDATE "May 11, 2002" -#include + #include #include "tulip.h" #include @@ -465,29 +471,16 @@ to an alternate media type. */ tp->timer.expires = RUN_AT(next_tick); add_timer(&tp->timer); -} - -#ifdef CONFIG_NET_HW_FLOWCONTROL -/* Enable receiver */ -void tulip_xon(struct net_device *dev) -{ - struct tulip_private *tp = (struct tulip_private *)dev->priv; - - clear_bit(tp->fc_bit, &netdev_fc_xoff); - if (netif_running(dev)){ - - tulip_refill_rx(dev); - outl(tulip_tbl[tp->chip_id].valid_intrs, dev->base_addr+CSR7); - } -} +#ifdef CONFIG_TULIP_NAPI + init_timer(&tp->oom_timer); + tp->oom_timer.data = (unsigned long)dev; + tp->oom_timer.function = oom_timer; #endif +} static int tulip_open(struct net_device *dev) { -#ifdef CONFIG_NET_HW_FLOWCONTROL - struct tulip_private *tp = (struct tulip_private *)dev->priv; -#endif int retval; if ((retval = request_irq(dev->irq, &tulip_interrupt, SA_SHIRQ, dev->name, dev))) @@ -497,10 +490,6 @@ tulip_up (dev); -#ifdef CONFIG_NET_HW_FLOWCONTROL - tp->fc_bit = netdev_register_fc(dev, tulip_xon); -#endif - netif_start_queue (dev); return 0; @@ -581,10 +570,7 @@ #endif /* Stop and restart the chip's Tx processes . */ -#ifdef CONFIG_NET_HW_FLOWCONTROL - if (tp->fc_bit && test_bit(tp->fc_bit,&netdev_fc_xoff)) - printk("BUG tx_timeout restarting rx when fc on\n"); -#endif + tulip_restart_rxtx(tp); /* Trigger an immediate transmit demand. */ outl(0, ioaddr + CSR1); @@ -741,7 +727,9 @@ unsigned long flags; del_timer_sync (&tp->timer); - +#ifdef CONFIG_TULIP_NAPI + del_timer_sync (&tp->oom_timer); +#endif spin_lock_irqsave (&tp->lock, flags); /* Disable interrupts by clearing the interrupt mask. */ @@ -780,13 +768,6 @@ netif_stop_queue (dev); -#ifdef CONFIG_NET_HW_FLOWCONTROL - if (tp->fc_bit) { - int bit = tp->fc_bit; - tp->fc_bit = 0; - netdev_unregister_fc(bit); - } -#endif tulip_down (dev); if (tulip_debug > 1) @@ -1627,6 +1608,10 @@ dev->hard_start_xmit = tulip_start_xmit; dev->tx_timeout = tulip_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; +#ifdef CONFIG_TULIP_NAPI + dev->poll = tulip_poll; + dev->weight = 16; +#endif dev->stop = tulip_close; dev->get_stats = tulip_get_stats; dev->do_ioctl = private_ioctl; --- drivers/net/tulip.orig/interrupt.c 2003-09-28 02:50:14.000000000 +0200 +++ drivers/net/tulip/interrupt.c 2003-09-30 17:47:12.000000000 +0200 @@ -19,13 +19,13 @@ #include #include - int tulip_rx_copybreak; unsigned int tulip_max_interrupt_work; -#ifdef CONFIG_NET_HW_FLOWCONTROL - +#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION #define MIT_SIZE 15 +#define MIT_TABLE 15 /* We use 0 or max */ + unsigned int mit_table[MIT_SIZE+1] = { /* CRS11 21143 hardware Mitigation Control Interrupt @@ -99,16 +99,25 @@ return refilled; } +#ifdef CONFIG_TULIP_NAPI -static int tulip_rx(struct net_device *dev) +void oom_timer(unsigned long data) +{ + struct net_device *dev = (struct net_device *)data; + netif_rx_schedule(dev); +} + +int tulip_poll(struct net_device *dev, int *budget) { struct tulip_private *tp = (struct tulip_private *)dev->priv; int entry = tp->cur_rx % RX_RING_SIZE; - int rx_work_limit = tp->dirty_rx + RX_RING_SIZE - tp->cur_rx; + int rx_work_limit = *budget; int received = 0; -#ifdef CONFIG_NET_HW_FLOWCONTROL - int drop = 0, mit_sel = 0; + if (rx_work_limit > dev->quota) + rx_work_limit = dev->quota; + +#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION /* that one buffer is needed for mit activation; or might be a bug in the ring buffer code; check later -- JHS*/ @@ -119,6 +128,237 @@ if (tulip_debug > 4) printk(KERN_DEBUG " In tulip_rx(), entry %d %8.8x.\n", entry, tp->rx_ring[entry].status); + + do { + /* Acknowledge current RX interrupt sources. */ + outl((RxIntr | RxNoBuf), dev->base_addr + CSR5); + + + /* If we own the next entry, it is a new packet. Send it up. */ + while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) { + s32 status = le32_to_cpu(tp->rx_ring[entry].status); + + + if (tp->dirty_rx + RX_RING_SIZE == tp->cur_rx) + break; + + if (tulip_debug > 5) + printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n", + dev->name, entry, status); + if (--rx_work_limit < 0) + goto not_done; + + if ((status & 0x38008300) != 0x0300) { + if ((status & 0x38000300) != 0x0300) { + /* Ingore earlier buffers. */ + if ((status & 0xffff) != 0x7fff) { + if (tulip_debug > 1) + printk(KERN_WARNING "%s: Oversized Ethernet frame " + "spanned multiple buffers, status %8.8x!\n", + dev->name, status); + tp->stats.rx_length_errors++; + } + } else if (status & RxDescFatalErr) { + /* There was a fatal error. */ + if (tulip_debug > 2) + printk(KERN_DEBUG "%s: Receive error, Rx status %8.8x.\n", + dev->name, status); + tp->stats.rx_errors++; /* end of a packet.*/ + if (status & 0x0890) tp->stats.rx_length_errors++; + if (status & 0x0004) tp->stats.rx_frame_errors++; + if (status & 0x0002) tp->stats.rx_crc_errors++; + if (status & 0x0001) tp->stats.rx_fifo_errors++; + } + } else { + /* Omit the four octet CRC from the length. */ + short pkt_len = ((status >> 16) & 0x7ff) - 4; + struct sk_buff *skb; + +#ifndef final_version + if (pkt_len > 1518) { + printk(KERN_WARNING "%s: Bogus packet size of %d (%#x).\n", + dev->name, pkt_len, pkt_len); + pkt_len = 1518; + tp->stats.rx_length_errors++; + } +#endif + /* Check if the packet is long enough to accept without copying + to a minimally-sized skbuff. */ + if (pkt_len < tulip_rx_copybreak + && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { + skb->dev = dev; + skb_reserve(skb, 2); /* 16 byte align the IP header */ + pci_dma_sync_single(tp->pdev, + tp->rx_buffers[entry].mapping, + pkt_len, PCI_DMA_FROMDEVICE); +#if ! defined(__alpha__) + eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->tail, + pkt_len, 0); + skb_put(skb, pkt_len); +#else + memcpy(skb_put(skb, pkt_len), + tp->rx_buffers[entry].skb->tail, + pkt_len); +#endif + } else { /* Pass up the skb already on the Rx ring. */ + char *temp = skb_put(skb = tp->rx_buffers[entry].skb, + pkt_len); + +#ifndef final_version + if (tp->rx_buffers[entry].mapping != + le32_to_cpu(tp->rx_ring[entry].buffer1)) { + printk(KERN_ERR "%s: Internal fault: The skbuff addresses " + "do not match in tulip_rx: %08x vs. %08x %p / %p.\n", + dev->name, + le32_to_cpu(tp->rx_ring[entry].buffer1), + tp->rx_buffers[entry].mapping, + skb->head, temp); + } +#endif + + pci_unmap_single(tp->pdev, tp->rx_buffers[entry].mapping, + PKT_BUF_SZ, PCI_DMA_FROMDEVICE); + + tp->rx_buffers[entry].skb = NULL; + tp->rx_buffers[entry].mapping = 0; + } + skb->protocol = eth_type_trans(skb, dev); + + netif_receive_skb(skb); + + dev->last_rx = jiffies; + tp->stats.rx_packets++; + tp->stats.rx_bytes += pkt_len; + } + received++; + + entry = (++tp->cur_rx) % RX_RING_SIZE; + if (tp->cur_rx - tp->dirty_rx > RX_RING_SIZE/4) + tulip_refill_rx(dev); + + } + + /* New ack strategy... irq does not ack Rx any longer + hopefully this helps */ + + /* Really bad things can happen here... If new packet arrives + * and an irq arrives (tx or just due to occasionally unset + * mask), it will be acked by irq handler, but new thread + * is not scheduled. It is major hole in design. + * No idea how to fix this if "playing with fire" will fail + * tomorrow (night 011029). If it will not fail, we won + * finally: amount of IO did not increase at all. */ + } while ((inl(dev->base_addr + CSR5) & RxIntr)); + + /* done: */ + + #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION + + /* We use this simplistic scheme for IM. It's proven by + real life installations. We can have IM enabled + continuesly but this would cause unnecessary latency. + Unfortunely we can't use all the NET_RX_* feedback here. + This would turn on IM for devices that is not contributing + to backlog congestion with unnecessary latency. + + We monitor the the device RX-ring and have: + + HW Interrupt Mitigation either ON or OFF. + + ON: More then 1 pkt received (per intr.) OR we are dropping + OFF: Only 1 pkt received + + Note. We only use min and max (0, 15) settings from mit_table */ + + + if( tp->flags & HAS_INTR_MITIGATION) { + if( received > 1 ) { + if( ! tp->mit_on ) { + tp->mit_on = 1; + outl(mit_table[MIT_TABLE], dev->base_addr + CSR11); + } + } + else { + if( tp->mit_on ) { + tp->mit_on = 0; + outl(0, dev->base_addr + CSR11); + } + } + } + +#endif /* CONFIG_TULIP_NAPI_HW_MITIGATION */ + + dev->quota -= received; + *budget -= received; + + tulip_refill_rx(dev); + + /* If RX ring is not full we are out of memory. */ + if (tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb == NULL) goto oom; + + /* Remove us from polling list and enable RX intr. */ + + netif_rx_complete(dev); + outl(tulip_tbl[tp->chip_id].valid_intrs, dev->base_addr+CSR7); + + /* The last op happens after poll completion. Which means the following: + * 1. it can race with disabling irqs in irq handler + * 2. it can race with dise/enabling irqs in other poll threads + * 3. if an irq raised after beginning loop, it will be immediately + * triggered here. + * + * Summarizing: the logic results in some redundant irqs both + * due to races in masking and due to too late acking of already + * processed irqs. But it must not result in losing events. + */ + + return 0; + + not_done: + if (!received) { + + received = dev->quota; /* Not to happen */ + } + dev->quota -= received; + *budget -= received; + + if (tp->cur_rx - tp->dirty_rx > RX_RING_SIZE/2 || + tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb == NULL) + tulip_refill_rx(dev); + + if (tp->rx_buffers[tp->dirty_rx % RX_RING_SIZE].skb == NULL) goto oom; + + return 1; + + + oom: /* Executed with RX ints disabled */ + + + /* Start timer, stop polling, but do not enable rx interrupts. */ + mod_timer(&tp->oom_timer, jiffies+1); + + /* Think: timer_pending() was an explicit signature of bug. + * Timer can be pending now but fired and completed + * before we did netif_rx_complete(). See? We would lose it. */ + + /* remove ourselves from the polling list */ + netif_rx_complete(dev); + + return 0; +} + +#else /* CONFIG_TULIP_NAPI */ + +static int tulip_rx(struct net_device *dev) +{ + struct tulip_private *tp = (struct tulip_private *)dev->priv; + int entry = tp->cur_rx % RX_RING_SIZE; + int rx_work_limit = tp->dirty_rx + RX_RING_SIZE - tp->cur_rx; + int received = 0; + + if (tulip_debug > 4) + printk(KERN_DEBUG " In tulip_rx(), entry %d %8.8x.\n", entry, + tp->rx_ring[entry].status); /* If we own the next entry, it is a new packet. Send it up. */ while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) { s32 status = le32_to_cpu(tp->rx_ring[entry].status); @@ -163,11 +403,6 @@ } #endif -#ifdef CONFIG_NET_HW_FLOWCONTROL - drop = atomic_read(&netdev_dropping); - if (drop) - goto throttle; -#endif /* Check if the packet is long enough to accept without copying to a minimally-sized skbuff. */ if (pkt_len < tulip_rx_copybreak @@ -209,44 +444,9 @@ tp->rx_buffers[entry].mapping = 0; } skb->protocol = eth_type_trans(skb, dev); -#ifdef CONFIG_NET_HW_FLOWCONTROL - mit_sel = -#endif - netif_rx(skb); -#ifdef CONFIG_NET_HW_FLOWCONTROL - switch (mit_sel) { - case NET_RX_SUCCESS: - case NET_RX_CN_LOW: - case NET_RX_CN_MOD: - break; - - case NET_RX_CN_HIGH: - rx_work_limit -= NET_RX_CN_HIGH; /* additional*/ - break; - case NET_RX_DROP: - rx_work_limit = -1; - break; - default: - printk("unknown feedback return code %d\n", mit_sel); - break; - } + netif_rx(skb); - drop = atomic_read(&netdev_dropping); - if (drop) { -throttle: - rx_work_limit = -1; - mit_sel = NET_RX_DROP; - - if (tp->fc_bit) { - long ioaddr = dev->base_addr; - - /* disable Rx & RxNoBuf ints. */ - outl(tulip_tbl[tp->chip_id].valid_intrs&RX_A_NBF_STOP, ioaddr + CSR7); - set_bit(tp->fc_bit, &netdev_fc_xoff); - } - } -#endif dev->last_rx = jiffies; tp->stats.rx_packets++; tp->stats.rx_bytes += pkt_len; @@ -254,42 +454,9 @@ received++; entry = (++tp->cur_rx) % RX_RING_SIZE; } -#ifdef CONFIG_NET_HW_FLOWCONTROL - - /* We use this simplistic scheme for IM. It's proven by - real life installations. We can have IM enabled - continuesly but this would cause unnecessary latency. - Unfortunely we can't use all the NET_RX_* feedback here. - This would turn on IM for devices that is not contributing - to backlog congestion with unnecessary latency. - - We monitor the device RX-ring and have: - - HW Interrupt Mitigation either ON or OFF. - - ON: More then 1 pkt received (per intr.) OR we are dropping - OFF: Only 1 pkt received - - Note. We only use min and max (0, 15) settings from mit_table */ - - - if( tp->flags & HAS_INTR_MITIGATION) { - if((received > 1 || mit_sel == NET_RX_DROP) - && tp->mit_sel != 15 ) { - tp->mit_sel = 15; - tp->mit_change = 1; /* Force IM change */ - } - if((received <= 1 && mit_sel != NET_RX_DROP) && tp->mit_sel != 0 ) { - tp->mit_sel = 0; - tp->mit_change = 1; /* Force IM change */ - } - } - - return RX_RING_SIZE+1; /* maxrx+1 */ -#else return received; -#endif } +#endif /* CONFIG_TULIP_NAPI */ static inline unsigned int phy_interrupt (struct net_device *dev) { @@ -323,7 +490,6 @@ struct tulip_private *tp = (struct tulip_private *)dev->priv; long ioaddr = dev->base_addr; int csr5; - int entry; int missed; int rx = 0; int tx = 0; @@ -331,6 +497,11 @@ int maxrx = RX_RING_SIZE; int maxtx = TX_RING_SIZE; int maxoi = TX_RING_SIZE; +#ifdef CONFIG_TULIP_NAPI + int rxd = 0; +#else + int entry; +#endif unsigned int work_count = tulip_max_interrupt_work; unsigned int handled = 0; @@ -346,22 +517,41 @@ tp->nir++; do { + +#ifdef CONFIG_TULIP_NAPI + + if (!rxd && (csr5 & (RxIntr | RxNoBuf))) { + rxd++; + /* Mask RX intrs and add the device to poll list. */ + outl(tulip_tbl[tp->chip_id].valid_intrs&~RxPollInt, ioaddr + CSR7); + netif_rx_schedule(dev); + + if (!(csr5&~(AbnormalIntr|NormalIntr|RxPollInt|TPLnkPass))) + break; + } + + /* Acknowledge the interrupt sources we handle here ASAP + the poll function does Rx and RxNoBuf acking */ + + outl(csr5 & 0x0001ff3f, ioaddr + CSR5); + +#else /* Acknowledge all of the current interrupt sources ASAP. */ outl(csr5 & 0x0001ffff, ioaddr + CSR5); - if (tulip_debug > 4) - printk(KERN_DEBUG "%s: interrupt csr5=%#8.8x new csr5=%#8.8x.\n", - dev->name, csr5, inl(dev->base_addr + CSR5)); if (csr5 & (RxIntr | RxNoBuf)) { -#ifdef CONFIG_NET_HW_FLOWCONTROL - if ((!tp->fc_bit) || - (!test_bit(tp->fc_bit, &netdev_fc_xoff))) -#endif rx += tulip_rx(dev); tulip_refill_rx(dev); } +#endif /* CONFIG_TULIP_NAPI */ + + if (tulip_debug > 4) + printk(KERN_DEBUG "%s: interrupt csr5=%#8.8x new csr5=%#8.8x.\n", + dev->name, csr5, inl(dev->base_addr + CSR5)); + + if (csr5 & (TxNoBuf | TxDied | TxIntr | TimerInt)) { unsigned int dirty_tx; @@ -462,15 +652,8 @@ } if (csr5 & RxDied) { /* Missed a Rx frame. */ tp->stats.rx_missed_errors += inl(ioaddr + CSR8) & 0xffff; -#ifdef CONFIG_NET_HW_FLOWCONTROL - if (tp->fc_bit && !test_bit(tp->fc_bit, &netdev_fc_xoff)) { - tp->stats.rx_errors++; - tulip_start_rxtx(tp); - } -#else tp->stats.rx_errors++; tulip_start_rxtx(tp); -#endif } /* * NB: t21142_lnk_change() does a del_timer_sync(), so be careful if this @@ -504,10 +687,6 @@ if (tulip_debug > 2) printk(KERN_ERR "%s: Re-enabling interrupts, %8.8x.\n", dev->name, csr5); -#ifdef CONFIG_NET_HW_FLOWCONTROL - if (tp->fc_bit && (test_bit(tp->fc_bit, &netdev_fc_xoff))) - if (net_ratelimit()) printk("BUG!! enabling interrupt when FC off (timerintr.) \n"); -#endif outl(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7); tp->ttimer = 0; oi++; @@ -520,16 +699,9 @@ /* Acknowledge all interrupt sources. */ outl(0x8001ffff, ioaddr + CSR5); if (tp->flags & HAS_INTR_MITIGATION) { -#ifdef CONFIG_NET_HW_FLOWCONTROL - if(tp->mit_change) { - outl(mit_table[tp->mit_sel], ioaddr + CSR11); - tp->mit_change = 0; - } -#else /* Josip Loncaric at ICASE did extensive experimentation to develop a good interrupt mitigation setting.*/ outl(0x8b240000, ioaddr + CSR11); -#endif } else if (tp->chip_id == LC82C168) { /* the LC82C168 doesn't have a hw timer.*/ outl(0x00, ioaddr + CSR7); @@ -537,10 +709,8 @@ } else { /* Mask all interrupting sources, set timer to re-enable. */ -#ifndef CONFIG_NET_HW_FLOWCONTROL outl(((~csr5) & 0x0001ebef) | AbnormalIntr | TimerInt, ioaddr + CSR7); outl(0x0012, ioaddr + CSR11); -#endif } break; } @@ -550,6 +720,21 @@ break; csr5 = inl(ioaddr + CSR5); + +#ifdef CONFIG_TULIP_NAPI + if (rxd) + csr5 &= ~RxPollInt; + } while ((csr5 & (TxNoBuf | + TxDied | + TxIntr | + TimerInt | + /* Abnormal intr. */ + RxDied | + TxFIFOUnderflow | + TxJabber | + TPLnkFail | + SytemError )) != 0); +#else } while ((csr5 & (NormalIntr|AbnormalIntr)) != 0); tulip_refill_rx(dev); @@ -574,6 +759,7 @@ } } } +#endif /* CONFIG_TULIP_NAPI */ if ((missed = inl(ioaddr + CSR8) & 0x1ffff)) { tp->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed; From modica@sgi.com Thu Oct 2 09:55:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 09:55:42 -0700 (PDT) Received: from tolkor.sgi.com (tolkor.SGI.COM [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92Gt525027294 for ; Thu, 2 Oct 2003 09:55:06 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h92HCQHc011164 for ; Thu, 2 Oct 2003 12:12:26 -0500 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h92Gsxcc11891621 for ; Thu, 2 Oct 2003 11:54:59 -0500 (CDT) Received: from sgi.com (eagdhcp-232-154.americas.sgi.com [128.162.232.154]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h92GsxRn308943498 for ; Thu, 2 Oct 2003 11:54:59 -0500 (CDT) Message-ID: <3F7C5863.1080403@sgi.com> Date: Thu, 02 Oct 2003 11:54:59 -0500 From: Steve Modica Organization: SGI User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: mod_timer improvement Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 450 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev This improves mod_timer scaling quite drastically. It's already in the 2.6 kernel. I've been testing with 8 cpus, 8 threads and 8 cards and mod_timer ends up taking up more time than tg_poll without this change. *** /hosts/bonnie.engr.sgi.com//proj/sgilinux/lbs/isms/linux/linux/kernel/timer.c 2003/08/11 20:16:19 1.23 --- /hosts/bonnie.engr.sgi.com//proj/sgilinux/lbs/isms/linux/linux/kernel/timer.c 2003/10/01 21:09:20 1.24 *************** *** 207,212 **** --- 207,220 ---- int ret; unsigned long flags; + /* + * This is a common optimization triggered by the + * networking code - if the timer is re-modified + * to be the same thing then just return: + */ + if (timer->expires == expires && timer_pending(timer)) + return 1; + spin_lock_irqsave(&timerlist_lock, flags); timer->expires = expires; ret = detach_timer(timer); -- Steve Modica work: 651-683-3224 mobile: 651-261-3201 MTS-Technical Lead "Give a man a fish, and he will eat for a day, hit him with a fish and he leaves you alone" - me From modica@sgi.com Thu Oct 2 10:15:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 10:15:54 -0700 (PDT) Received: from rj.sgi.com (mtvcafw.SGI.COM [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92HFK25028936 for ; Thu, 2 Oct 2003 10:15:20 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by rj.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h92FInOO020206 for ; Thu, 2 Oct 2003 08:18:49 -0700 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h92HFEcc11874929 for ; Thu, 2 Oct 2003 12:15:14 -0500 (CDT) Received: from sgi.com (eagdhcp-232-154.americas.sgi.com [128.162.232.154]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h92HFERn310812056 for ; Thu, 2 Oct 2003 12:15:15 -0500 (CDT) Message-ID: <3F7C5D22.7010103@sgi.com> Date: Thu, 02 Oct 2003 12:15:14 -0500 From: Steve Modica Organization: SGI User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: mod_timer improvement References: <3F7C5863.1080403@sgi.com> In-Reply-To: <3F7C5863.1080403@sgi.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 451 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev D'OH! Sorry about the formatting. I think this is better: @@ -207,6 +207,14 @@ int ret; unsigned long flags; + /* + * This is a common optimization triggered by the + * networking code - if the timer is re-modified + * to be the same thing then just return: + */ + if (timer->expires == expires && timer_pending(timer)) + return 1; + spin_lock_irqsave(&timerlist_lock, flags); timer->expires = expires; ret = detach_timer(timer); -- Steve Modica work: 651-683-3224 mobile: 651-261-3201 MTS-Technical Lead "Give a man a fish, and he will eat for a day, hit him with a fish and he leaves you alone" - me From shemminger@osdl.org Thu Oct 2 10:24:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 10:25:29 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92HOu25029827 for ; Thu, 2 Oct 2003 10:24:57 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92HOj126072; Thu, 2 Oct 2003 10:24:45 -0700 Date: Thu, 2 Oct 2003 10:24:20 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] skbuff more likely/unlikely Message-Id: <20031002102420.6e1cece9.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 452 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 A couple more places where we can help by hinting the compiler for 2.6.0-test6. If we are pulling off header, is is likely there; and skb alloc's succeed in the normal case. Thought I saw an earlier similar patch, but here is my take on it. diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h --- a/include/linux/skbuff.h Thu Oct 2 10:01:36 2003 +++ b/include/linux/skbuff.h Thu Oct 2 10:01:36 2003 @@ -885,7 +885,7 @@ */ static inline unsigned char *skb_pull(struct sk_buff *skb, unsigned int len) { - return (len > skb->len) ? NULL : __skb_pull(skb, len); + return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); } extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); @@ -901,7 +901,7 @@ static inline unsigned char *pskb_pull(struct sk_buff *skb, unsigned int len) { - return (len > skb->len) ? NULL : __pskb_pull(skb, len); + return unlikely(len > skb->len) ? NULL : __pskb_pull(skb, len); } static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len) @@ -1052,7 +1052,7 @@ int gfp_mask) { struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); - if (skb) + if (likely(skb)) skb_reserve(skb, 16); return skb; } From shemminger@osdl.org Thu Oct 2 10:47:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 10:47:36 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92Hl225032662 for ; Thu, 2 Oct 2003 10:47:03 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92HLw125704; Thu, 2 Oct 2003 10:21:58 -0700 Date: Thu, 2 Oct 2003 10:21:33 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] consolidate skb delivery Message-Id: <20031002102133.7285b5ee.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 453 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 Several places all have the same code for delivering skb's to protocols. Consolidate into one inline function and give preference to new protocols. diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Thu Oct 2 10:01:13 2003 +++ b/net/core/dev.c Thu Oct 2 10:01:13 2003 @@ -1489,6 +1489,18 @@ } } +static __inline__ int deliver_skb(struct sk_buff *skb, + struct packet_type *pt_prev, int last) +{ + if (unlikely(!pt_prev->data)) + return deliver_to_old_ones(pt_prev, skb, last); + else { + atomic_inc(&skb->users); + return pt_prev->func(skb, skb->dev, pt_prev); + } +} + + #if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE) int (*br_handle_frame_hook)(struct sk_buff *skb); @@ -1496,15 +1508,8 @@ struct packet_type *pt_prev) { int ret = NET_RX_DROP; - - if (pt_prev) { - if (!pt_prev->data) - ret = deliver_to_old_ones(pt_prev, skb, 0); - else { - atomic_inc(&skb->users); - ret = pt_prev->func(skb, skb->dev, pt_prev); - } - } + if (pt_prev) + ret = deliver_skb(skb, pt_prev, 0); return ret; } @@ -1552,16 +1557,8 @@ rcu_read_lock(); list_for_each_entry_rcu(ptype, &ptype_all, list) { if (!ptype->dev || ptype->dev == skb->dev) { - if (pt_prev) { - if (!pt_prev->data) { - ret = deliver_to_old_ones(pt_prev, - skb, 0); - } else { - atomic_inc(&skb->users); - ret = pt_prev->func(skb, skb->dev, - pt_prev); - } - } + if (pt_prev) + ret = deliver_skb(skb, pt_prev, 0); pt_prev = ptype; } } @@ -1574,27 +1571,15 @@ list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type)&15], list) { if (ptype->type == type && (!ptype->dev || ptype->dev == skb->dev)) { - if (pt_prev) { - if (!pt_prev->data) { - ret = deliver_to_old_ones(pt_prev, - skb, 0); - } else { - atomic_inc(&skb->users); - ret = pt_prev->func(skb, skb->dev, - pt_prev); - } - } + if (pt_prev) + ret = deliver_skb(skb, pt_prev, 0); pt_prev = ptype; } } - if (pt_prev) { - if (!pt_prev->data) { - ret = deliver_to_old_ones(pt_prev, skb, 1); - } else { - ret = pt_prev->func(skb, skb->dev, pt_prev); - } - } else { + if (pt_prev) + ret = deliver_skb(skb, pt_prev, 1); + else { kfree_skb(skb); /* Jamal, now you will not able to escape explaining * me how you were going to use this. :-) From modica@sgi.com Thu Oct 2 11:20:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 11:21:04 -0700 (PDT) Received: from rj.sgi.com (mtvcafw.SGI.COM [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92IKT25003783 for ; Thu, 2 Oct 2003 11:20:29 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by rj.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h92GNwOO025913 for ; Thu, 2 Oct 2003 09:23:59 -0700 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h92IKNcc11906680 for ; Thu, 2 Oct 2003 13:20:23 -0500 (CDT) Received: from sgi.com (eagdhcp-232-154.americas.sgi.com [128.162.232.154]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h92IKNRn305041557 for ; Thu, 2 Oct 2003 13:20:23 -0500 (CDT) Message-ID: <3F7C6C67.4010300@sgi.com> Date: Thu, 02 Oct 2003 13:20:23 -0500 From: Steve Modica Organization: SGI User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: mod_timer improvement Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 454 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev Sorry about the screwed up formatting! I'm kinda new at this :) *** linux/linux/kernel/timer.c 2003/08/11 20:16:19 1.23 --- linux/linux/kernel/timer.c 2003/10/01 21:09:20 1.24 *************** int mod_timer(struct timer_list *timer, *** 207,212 **** --- 207,220 ---- int ret; unsigned long flags; + /* + * This is a common optimization triggered by the + * networking code - if the timer is re-modified + * to be the same thing then just return: + */ + if (timer->expires == expires && timer_pending(timer)) + return 1; + spin_lock_irqsave(&timerlist_lock, flags); timer->expires = expires; ret = detach_timer(timer); -- Steve Modica work: 651-683-3224 mobile: 651-261-3201 MTS-Technical Lead "Give a man a fish, and he will eat for a day, hit him with a fish and he leaves you alone" - me From modica@sgi.com Thu Oct 2 11:32:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 11:33:06 -0700 (PDT) Received: from tolkor.sgi.com (tolkor.SGI.COM [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92IWW25004970 for ; Thu, 2 Oct 2003 11:32:33 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h92InsHc013427 for ; Thu, 2 Oct 2003 13:49:54 -0500 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h92IWRcc11904246 for ; Thu, 2 Oct 2003 13:32:27 -0500 (CDT) Received: from sgi.com (eagdhcp-232-154.americas.sgi.com [128.162.232.154]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h92IWRRn301871341 for ; Thu, 2 Oct 2003 13:32:27 -0500 (CDT) Message-ID: <3F7C6F3B.6070502@sgi.com> Date: Thu, 02 Oct 2003 13:32:27 -0500 From: Steve Modica Organization: SGI User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: do_gettimeofday Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 455 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev We've been doing some experiments here with large numbers of adapters on a 64p Linux system. When running 8 threads and 8 cpus, the do_gettimeofday code starts to use a lot of time. It turns out that if a driver does not timestamp an incoming packet, the upper layer will stamp it for you in PSCHED_GET_TIME(stamp). What happens then is multiple cpus start fighting over the cacheline for the system clock and things get bad. One possible solution to this is to have the driver do the stamp using xtime. A number of ATM drivers do this now. In testing, it helps a lot. Here's a sample diff for the tg3.c driver: =========================================================================== Index: linux/linux/drivers/net/tg3.c =========================================================================== --- /usr/tmp/TmpDir.8948-0/linux/linux/drivers/net/tg3.c_1.23 Thu Oct 2 13:30:21 2003 +++ linux/linux/drivers/net/tg3.c Wed Oct 1 14:27:54 2003 @@ -2019,6 +2019,7 @@ skb->ip_summed = CHECKSUM_NONE; skb->protocol = eth_type_trans(skb, tp->dev); + skb->stamp = xtime; #if TG3_VLAN_TAG_USED if (tp->vlgrp != NULL && desc->type_flags & RXD_FLAG_VLAN) { It's been suggested that we make this tuneable so it's easy to enable and disable. There was concern as to whether xtime would be accurate enough for all possible uses of ->stamp. Does anyone have any comments on this? Regards! Steve -- Steve Modica work: 651-683-3224 mobile: 651-261-3201 MTS-Technical Lead "Give a man a fish, and he will eat for a day, hit him with a fish and he leaves you alone" - me From ak@suse.de Thu Oct 2 12:25:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 12:26:27 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92JPr25011660 for ; Thu, 2 Oct 2003 12:25:53 -0700 Received: from Hermes.suse.de (Hermes.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 07488169A49A; Thu, 2 Oct 2003 21:25:47 +0200 (CEST) Date: Thu, 2 Oct 2003 21:25:46 +0200 From: Andi Kleen To: Stephen Hemminger Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] consolidate skb delivery Message-ID: <20031002192546.GA29673@wotan.suse.de> References: <20031002102133.7285b5ee.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031002102133.7285b5ee.shemminger@osdl.org> X-archive-position: 456 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 > +static __inline__ int deliver_skb(struct sk_buff *skb, > + struct packet_type *pt_prev, int last) > +{ > + if (unlikely(!pt_prev->data)) > + return deliver_to_old_ones(pt_prev, skb, last); Are there even any old style protocols left? If not you could just make it BUG() -Andi From akpm@osdl.org Thu Oct 2 12:33:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 12:33:42 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92JX725012429 for ; Thu, 2 Oct 2003 12:33:08 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h92JWs120542; Thu, 2 Oct 2003 12:32:54 -0700 Date: Thu, 2 Oct 2003 12:34:19 -0700 From: Andrew Morton To: Jeff Garzik Cc: Robert.Olsson@data.slu.se, netdev@oss.sgi.com, dfages@arkoon.net Subject: Re: Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP Message-Id: <20031002123419.31cdb98d.akpm@osdl.org> In-Reply-To: <3F7C64BC.7030701@pobox.com> References: <20030929123734.5bd97a47.akpm@osdl.org> <16248.41796.797321.700866@robur.slu.se> <3F78A691.1040406@pobox.com> <16252.17618.866515.952549@robur.slu.se> <3F7C64BC.7030701@pobox.com> X-Mailer: Sylpheed version 0.9.4 (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: 457 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Jeff Garzik wrote: > > Andrew, would you be willing to merge this into -mm for some > simultaneous netwide testing? Sure. From shemminger@osdl.org Thu Oct 2 12:44:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 12:44:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92JiP25013467 for ; Thu, 2 Oct 2003 12:44:25 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92JiA122478; Thu, 2 Oct 2003 12:44:10 -0700 Date: Thu, 2 Oct 2003 12:43:45 -0700 From: Stephen Hemminger To: Andi Kleen Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] consolidate skb delivery Message-Id: <20031002124345.7b34bf24.shemminger@osdl.org> In-Reply-To: <20031002192546.GA29673@wotan.suse.de> References: <20031002102133.7285b5ee.shemminger@osdl.org> <20031002192546.GA29673@wotan.suse.de> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 458 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 On Thu, 2 Oct 2003 21:25:46 +0200 Andi Kleen wrote: > > +static __inline__ int deliver_skb(struct sk_buff *skb, > > + struct packet_type *pt_prev, int last) > > +{ > > + if (unlikely(!pt_prev->data)) > > + return deliver_to_old_ones(pt_prev, skb, last); > > Are there even any old style protocols left? If not you could just make > it BUG() > bpqether,lapbether,ipconfig, and econet are still old style. From ak@suse.de Thu Oct 2 12:51:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 12:51:49 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92Jp525014579 for ; Thu, 2 Oct 2003 12:51:05 -0700 Received: from Hermes.suse.de (Hermes.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 E1A6B169A51B; Thu, 2 Oct 2003 21:29:42 +0200 (CEST) Date: Thu, 2 Oct 2003 21:29:42 +0200 From: Andi Kleen To: Steve Modica Cc: netdev@oss.sgi.com Subject: Re: do_gettimeofday Message-ID: <20031002192942.GB29673@wotan.suse.de> References: <3F7C6F3B.6070502@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F7C6F3B.6070502@sgi.com> X-archive-position: 459 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, Oct 02, 2003 at 01:32:27PM -0500, Steve Modica wrote: > We've been doing some experiments here with large numbers of adapters on a > 64p Linux system. > When running 8 threads and 8 cpus, the do_gettimeofday code starts to use a > lot of time. That's a known problem. The funny thing is that the only users of this time stamp is SO_TIMESTAMP, which is rarely used (except tcpdump) and something in DECnet. IMHO the right fix is to add a global counter that counts all all sockets that use SO_TIMESTAMP and when it's zero never call it. Decnet could be probably fixed to just use jiffies like TCP does. Drawback is that when you enable SO_TIMESTAMP there is a small time window when the packets are not time stamped yet. The socket layer can just fill in the current time though. -Andi From shemminger@osdl.org Thu Oct 2 12:57:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 12:58:10 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92JvX25015727 for ; Thu, 2 Oct 2003 12:57:36 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92Juo125121; Thu, 2 Oct 2003 12:56:50 -0700 Date: Thu, 2 Oct 2003 12:56:25 -0700 From: Stephen Hemminger To: Steve Modica Cc: netdev@oss.sgi.com Subject: Re: do_gettimeofday Message-Id: <20031002125625.72b8c0a7.shemminger@osdl.org> In-Reply-To: <3F7C6F3B.6070502@sgi.com> References: <3F7C6F3B.6070502@sgi.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 460 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 On Thu, 02 Oct 2003 13:32:27 -0500 Steve Modica wrote: > We've been doing some experiments here with large numbers of adapters on a 64p Linux system. > > When running 8 threads and 8 cpus, the do_gettimeofday code starts to use a lot of time. > > It turns out that if a driver does not timestamp an incoming packet, the upper layer will stamp it for you in > PSCHED_GET_TIME(stamp). What happens then is multiple cpus start fighting over the cacheline for the system clock and things get bad. > > One possible solution to this is to have the driver do the stamp using xtime. A number of ATM drivers do this now. In testing, it helps a lot. > > Here's a sample diff for the tg3.c driver: > > =========================================================================== > Index: linux/linux/drivers/net/tg3.c > =========================================================================== > > --- /usr/tmp/TmpDir.8948-0/linux/linux/drivers/net/tg3.c_1.23 Thu Oct 2 13:30:21 2003 > +++ linux/linux/drivers/net/tg3.c Wed Oct 1 14:27:54 2003 > @@ -2019,6 +2019,7 @@ > skb->ip_summed = CHECKSUM_NONE; > > skb->protocol = eth_type_trans(skb, tp->dev); > + skb->stamp = xtime; > #if TG3_VLAN_TAG_USED > if (tp->vlgrp != NULL && > desc->type_flags & RXD_FLAG_VLAN) { > > > It's been suggested that we make this tuneable so it's easy to enable and disable. There was concern as to whether xtime would be accurate enough for all possible uses of ->stamp. > > Does anyone have any comments on this? Two problems: a. xtime is limited to HZ resolution which is insufficient for more advanced packet schedulers and rtt estimation. b. unlocked access to xtime is unsafe because it is not atomic! ATM is busted if it does this. gettimeofday on 2.6 should be cheap for many systems because of the lockless seqlock. Unfortunately, some architectures (not sure about ia64) have problems with TSC synchronization which make life messy. It might be possible to introduce a per-cpu monotonic clock that is lockless for use in network code, but that is a moderately painful undertaking which is beyond the scope of getting 2.6.0 out. From mitch@sfgoth.com Thu Oct 2 13:37:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 13:38:20 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92Kbj25018608 for ; Thu, 2 Oct 2003 13:37:45 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h92Kka16032033; Thu, 2 Oct 2003 13:46:36 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h92Kkawr032032; Thu, 2 Oct 2003 13:46:36 -0700 (PDT) (envelope-from mitch) Date: Thu, 2 Oct 2003 13:46:36 -0700 From: Mitchell Blank Jr To: Stephen Hemminger Cc: Steve Modica , netdev@oss.sgi.com Subject: Re: do_gettimeofday Message-ID: <20031002204636.GB30579@gaz.sfgoth.com> References: <3F7C6F3B.6070502@sgi.com> <20031002125625.72b8c0a7.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031002125625.72b8c0a7.shemminger@osdl.org> User-Agent: Mutt/1.4.1i X-archive-position: 461 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev Stephen Hemminger wrote: > Two problems: > a. xtime is limited to HZ resolution which is insufficient for more advanced > packet schedulers and rtt estimation. > b. unlocked access to xtime is unsafe because it is not atomic! > > ATM is busted if it does this. It got fixed in 2.5 (when skb->stamp got changed to nanosecond resolution so it broke the compile to do it the old way) You can use LXR to see all of the xtime users as of 2.6.0-test2: http://lxr.linux.no/ident?v=2.6.0-test2&i=xtime The reason that ATM _had_ been using xtime was not for performance. When the ATM code was originally written (during the 1.X kernels) all network drivers used xtime directly. At some point the network drivers were mass-updated to use do_gettimeofday() but ATM had not been merged into the main tree yet so it missed the conversion. -Mitch From laforge@netfilter.org Thu Oct 2 13:59:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 14:00:30 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92Kxs25020235 for ; Thu, 2 Oct 2003 13:59:55 -0700 Received: from uucp by coruscant.gnumonks.org with local-bsmtp (Exim 4.22) id 1A3vP0-0002YT-Nu for netdev@oss.sgi.com; Mon, 29 Sep 2003 12:37:14 +0200 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 1A3tcE-0000JZ-00; Mon, 29 Sep 2003 10:42:46 +0200 Date: Mon, 29 Sep 2003 10:42:46 +0200 From: Harald Welte To: Pekka Savola Cc: Andras Kis-Szabo , Yasuyuki Kozakai , Netfilter Devel , Netdev , usagi-core@linux-ipv6.org Subject: Re: [Patch]: IPv6 Connection Tracking Message-ID: <20030929084246.GE654@obroa-skai.de.gnumonks.org> Mail-Followup-To: Harald Welte , Pekka Savola , Andras Kis-Szabo , Yasuyuki Kozakai , Netfilter Devel , Netdev , usagi-core@linux-ipv6.org References: <1064515680.995.41.camel@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SFyWQ0h3ruR435lw" Content-Disposition: inline In-Reply-To: X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.4.23-pre5 X-Date: Today is Boomtime, the 53rd day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-archive-position: 462 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 --SFyWQ0h3ruR435lw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 25, 2003 at 09:57:47PM +0300, Pekka Savola wrote: > First, a meta-comment: >=20 > What I fear is that in the end, nothing gets done because having the goal > set to perfection. If there is no energy to drive through the > L3-independent connecting tracking, the end result is that the user > does not have this feature=20 well, that's the reason why I'd like to see it in=20 > (remember ip6tables REJECT target? That must have been sitting in > netfilter for some 2+ years, and not having been integrated in the > mainline kernel and the users still do not have the feature!). Mh, nobody has bugged me about that in all those 2 years. At least I don't remember somebody asking me for kernel inclusion...=20 Since ipv4 REJECT has now changed > So, my personal take is: > - if a L3-independent conn tracking can be done *quickly*, fine, I've started to write a small paper about the envisioned desgign. It doesn't look all that complicated, if somebody can concentrate on this job. I personally (as indicated before) do not have the time to work on that issue. But I'm happy to give advise. > - if not, just merge the current one, start working on L3 independent=20 > conn tracking, and add it when available. I understand your point. However, I fear to be the one responsible of keeping ip6_conntrack in sync with ip_conntrack. If there is a volunteer (maybe Yasuyuki?) who would really commit himself to look at which changes go into ip_conntack, and sending me patches to sync ip6_conntrack, I'd be more inclined to submit ip6_conntrack to the mainline kernel. =20 > .. but I'm not the one who's answering the support emails, so in all=20 > fairness, I should be silent now.. ;) --=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 --SFyWQ0h3ruR435lw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/d/CGXaXGVTD0i/8RAuZsAJ9+gG8tUawwy3u+4BTicBOkZdrZrgCfd7g2 k4SWLLMxIJc463EcS4hSfBM= =SWcD -----END PGP SIGNATURE----- --SFyWQ0h3ruR435lw-- From tytso@thunk.org Thu Oct 2 15:08:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:08:37 -0700 (PDT) Received: from thunker.thunk.org (thunk.org [140.239.227.29]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92M8125024011 for ; Thu, 2 Oct 2003 15:08:02 -0700 Received: from h-68-164-15-244.chcgilgm.dynamic.covad.net ([68.164.15.244] helo=thunk.org) authenticated as tytso by thunker.thunk.org with asmtp (tls_cipher TLSv1:RC4-SHA:128) (Exim 3.35 #1 (Debian)) id 1A4LPM-0007IY-00; Tue, 30 Sep 2003 10:23:20 -0400 Received: from tytso by thunk.org with local (Exim 4.22) id 1A4LNy-0007Ql-MZ; Tue, 30 Sep 2003 10:21:54 -0400 Date: Tue, 30 Sep 2003 10:21:54 -0400 From: "Theodore Ts'o" To: David Woodhouse Cc: "David S. Miller" , bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030930142154.GA28501@thunk.org> Mail-Followup-To: Theodore Ts'o , David Woodhouse , "David S. Miller" , bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1064910398.21551.41.camel@hades.cambridge.redhat.com> User-Agent: Mutt/1.5.4i X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . X-archive-position: 463 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tytso@mit.edu Precedence: bulk X-list: netdev On Tue, Sep 30, 2003 at 09:26:38AM +0100, David Woodhouse wrote: > > The suggestions I see do nothing to enhance the kernel tree as it currently > > stands. If you wish to prevent the kernel image from changing due to > > out-of-tree modules being built, fine, but don't impose this restriction > > upon in-kernel modules. > > It's a matter of taste. As I said, it's your right to disagree. > > Some time during 2.7 I'm sure one of the many people who agree with > Adrian and myself will send patches to Linus and he'll get to arbitrate. FWIW, I agree with Dave. Most of the time, enabling a device driver won't cause the core kernel to change, sure. However, there will be cases (such as enabling wireless ethernet drivers as modules, for example) where in order to support those modules, some new core kernel infrastructure will need to be enabled. Now, there are a couple of ways ways you can handle this. One is that the core infrastructure could have its own CONFIG_infrastructure boolean, and if that symbol is 'no', then you won't be able to build those modules until you recompile the base kernel with CONFIG_infrastructure. Another is that you can make enabling any one of the device driver modules "automatically" enable inclusion of the base core infrastructure. It then all boils down to tradeoffs and aesthetics. By making CONFIG_infrastructure explicit, it makes it more clear what is going on --- but if it is defaulted on, or if you require that whatever is under the CONFIG_infrastructure ifdef is always compiled in, then that way leads to kernel boot. But if it is defaulted off, then the user will be forced to recompile the kernel anyway, before he/she can enable the kernel module in question. Including CONFIG_infrastructure explicitly also makes the kernel build process more complex, and can also make life more confusing to the user --- the question about whether or not you can build a particular device driver won't even appear until the user enables CONFIG_infrastructure, and the user may have a really hard time figuring out that CONFIG_infrastructure is the way to make a particular device driver appear. For that reason, I tend to prefer the approach of simply enabling a device driver, and then letting that force a change in the base kernel to include any necessary base infrastructure in the kernel if necessary. It's simpler from a configuration perspective. And if the user types "make modules" after making such a change, ideally the build system should warn the user that it will be necessary to rebuild the base kernel before it can build the module. - Ted From shemminger@osdl.org Thu Oct 2 15:21:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:21:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MLQ25025901 for ; Thu, 2 Oct 2003 15:21:26 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MKu122999; Thu, 2 Oct 2003 15:20:56 -0700 Date: Thu, 2 Oct 2003 15:20:31 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (2/11) tekram dongle module conversion Message-Id: <20031002152031.779022e5.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 465 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 diff -Nru a/drivers/net/irda/tekram.c b/drivers/net/irda/tekram.c --- a/drivers/net/irda/tekram.c Thu Oct 2 15:10:26 2003 +++ b/drivers/net/irda/tekram.c Thu Oct 2 15:10:26 2003 @@ -44,12 +44,12 @@ #define TEKRAM_PW 0x10 /* Pulse select bit */ static struct dongle_reg dongle = { - Q_NULL, - IRDA_TEKRAM_DONGLE, - tekram_open, - tekram_close, - tekram_reset, - tekram_change_speed, + .type = IRDA_TEKRAM_DONGLE, + .open = tekram_open, + .close = tekram_close, + .reset = tekram_reset, + .change_speed = tekram_change_speed, + .owner = THIS_MODULE, }; int __init tekram_init(void) @@ -69,8 +69,6 @@ qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */ irda_qos_bits_to_value(qos); - - MOD_INC_USE_COUNT; } static void tekram_close(dongle_t *self) @@ -84,8 +82,6 @@ irda_task_delete(self->reset_task); if (self->speed_task) irda_task_delete(self->speed_task); - - MOD_DEC_USE_COUNT; } /* From shemminger@osdl.org Thu Oct 2 15:21:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:21:57 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MLO25025900 for ; Thu, 2 Oct 2003 15:21:24 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MKr122995; Thu, 2 Oct 2003 15:20:53 -0700 Date: Thu, 2 Oct 2003 15:20:26 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (1/11) Irda dongle module owner support Message-Id: <20031002152026.4bfd2c67.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 464 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 IRDA dongle interface needed to be converted to have an owner field to avoid races on module unload. Eliminated the use of hashbin locking because the dongle control code needed to do it's own locking to avoid races. This also closed the race between find and insert. The find/insert hashbin race may be a general problem with all the IRDA hashbin stuff. IMHO the hashbin stuff should be replaced, it is full of dead incomplete code and done better by the list macros. diff -Nru a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h --- a/include/net/irda/irda_device.h Thu Oct 2 14:51:18 2003 +++ b/include/net/irda/irda_device.h Thu Oct 2 14:51:18 2003 @@ -128,6 +128,7 @@ void (*close)(dongle_t *dongle); int (*reset)(struct irda_task *task); int (*change_speed)(struct irda_task *task); + struct module *owner; }; /* diff -Nru a/net/irda/irda_device.c b/net/irda/irda_device.c --- a/net/irda/irda_device.c Thu Oct 2 14:51:18 2003 +++ b/net/irda/irda_device.c Thu Oct 2 14:51:18 2003 @@ -58,6 +58,7 @@ static void __irda_task_delete(struct irda_task *task); static hashbin_t *dongles = NULL; +static spinlock_t dongle_lock = SPIN_LOCK_UNLOCKED; static hashbin_t *tasks = NULL; const char *infrared_mode[] = { @@ -85,7 +86,7 @@ int __init irda_device_init( void) { - dongles = hashbin_new(HB_LOCK); + dongles = hashbin_new(HB_NOLOCK); if (dongles == NULL) { printk(KERN_WARNING "IrDA: Can't allocate dongles hashbin!\n"); return -ENOMEM; @@ -424,25 +425,35 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type) { struct dongle_reg *reg; - dongle_t *dongle; + dongle_t *dongle = NULL; ASSERT(dev != NULL, return NULL;); + ASSERT(!in_interrupt(), return NULL;); + + spin_lock(&dongle_lock); + reg = hashbin_find(dongles, type, NULL); #ifdef CONFIG_KMOD - ASSERT(!in_interrupt(), return NULL;); /* Try to load the module needed */ - request_module("irda-dongle-%d", type); + if (!reg && capable(CAP_SYS_MODULE)) { + spin_unlock(&dongle_lock); + + request_module("irda-dongle-%d", type); + + spin_lock(&dongle_lock); + reg = hashbin_find(dongles, type, NULL); + } #endif - if (!(reg = hashbin_lock_find(dongles, type, NULL))) { - ERROR("IrDA: Unable to find requested dongle\n"); - return NULL; + if (!reg || !try_module_get(reg->owner) ) { + ERROR("IrDA: Unable to find requested dongle type %x\n", type); + goto out; } /* Allocate dongle info for this instance */ dongle = kmalloc(sizeof(dongle_t), GFP_KERNEL); if (!dongle) - return NULL; + goto out; memset(dongle, 0, sizeof(dongle_t)); @@ -450,6 +461,8 @@ dongle->issue = reg; dongle->dev = dev; + out: + spin_unlock(&dongle_lock); return dongle; } @@ -461,7 +474,7 @@ ASSERT(dongle != NULL, return -1;); dongle->issue->close(dongle); - + module_put(dongle->issue->owner); kfree(dongle); return 0; @@ -472,14 +485,16 @@ */ int irda_device_register_dongle(struct dongle_reg *new) { + spin_lock(&dongle_lock); /* Check if this dongle has been registered before */ - if (hashbin_lock_find(dongles, new->type, NULL)) { - MESSAGE("%s: Dongle already registered\n", __FUNCTION__); - return 0; - } - - /* Insert IrDA dongle into hashbin */ - hashbin_insert(dongles, (irda_queue_t *) new, new->type, NULL); + if (hashbin_find(dongles, new->type, NULL)) { + MESSAGE("%s: Dongle type %x already registered\n", + __FUNCTION__, new->type); + } else { + /* Insert IrDA dongle into hashbin */ + hashbin_insert(dongles, (irda_queue_t *) new, new->type, NULL); + } + spin_unlock(&dongle_lock); return 0; } @@ -494,11 +509,11 @@ { struct dongle *node; + spin_lock(&dongle_lock); node = hashbin_remove(dongles, dongle->type, NULL); - if (!node) { + if (!node) ERROR("%s: dongle not found!\n", __FUNCTION__); - return; - } + spin_unlock(&dongle_lock); } /* From shemminger@osdl.org Thu Oct 2 15:29:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:29:54 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MTM25026618 for ; Thu, 2 Oct 2003 15:29:22 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MSq124964; Thu, 2 Oct 2003 15:28:52 -0700 Date: Thu, 2 Oct 2003 15:27:41 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (3/11) act200l dongle -- module owner Message-Id: <20031002152741.656610bd.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 466 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 Convert act200l dongle to use module owner. diff -Nru a/drivers/net/irda/act200l.c b/drivers/net/irda/act200l.c --- a/drivers/net/irda/act200l.c Thu Oct 2 15:10:29 2003 +++ b/drivers/net/irda/act200l.c Thu Oct 2 15:10:29 2003 @@ -84,12 +84,12 @@ #define ACT200L_OSCL 0x04 /* oscillator in low power, medium accuracy mode */ static struct dongle_reg dongle = { - Q_NULL, - IRDA_ACT200L_DONGLE, - act200l_open, - act200l_close, - act200l_reset, - act200l_change_speed, + .type = IRDA_ACT200L_DONGLE, + .open = act200l_open, + .close = act200l_close, + .reset = act200l_reset, + .change_speed = act200l_change_speed, + .owner = THIS_MODULE, }; int __init act200l_init(void) @@ -112,8 +112,6 @@ /* Set the speeds we can accept */ qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; qos->min_turn_time.bits = 0x03; - - MOD_INC_USE_COUNT; } static void act200l_close(dongle_t *self) @@ -122,8 +120,6 @@ /* Power off the dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* From shemminger@osdl.org Thu Oct 2 15:29:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:30:05 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MTW25026628 for ; Thu, 2 Oct 2003 15:29:32 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MSr124976; Thu, 2 Oct 2003 15:28:53 -0700 Date: Thu, 2 Oct 2003 15:25:57 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (6/11) esi dongle - module owner Message-Id: <20031002152557.59dec7ce.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 468 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 Convert ESI dongle to use module owner diff -Nru a/drivers/net/irda/esi.c b/drivers/net/irda/esi.c --- a/drivers/net/irda/esi.c Thu Oct 2 15:10:36 2003 +++ b/drivers/net/irda/esi.c Thu Oct 2 15:10:36 2003 @@ -44,12 +44,12 @@ static int esi_reset(struct irda_task *task); static struct dongle_reg dongle = { - Q_NULL, - IRDA_ESI_DONGLE, - esi_open, - esi_close, - esi_reset, - esi_change_speed, + .type = IRDA_ESI_DONGLE, + .open = esi_open, + .close = esi_close, + .reset = esi_reset, + .change_speed = esi_change_speed, + .owner = THIS_MODULE, }; int __init esi_init(void) @@ -66,16 +66,12 @@ { qos->baud_rate.bits &= IR_9600|IR_19200|IR_115200; qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */ - - MOD_INC_USE_COUNT; } static void esi_close(dongle_t *dongle) { /* Power off dongle */ dongle->set_dtr_rts(dongle->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* From shemminger@osdl.org Thu Oct 2 15:29:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:30:01 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MTS25026625 for ; Thu, 2 Oct 2003 15:29:28 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MSr124972; Thu, 2 Oct 2003 15:28:53 -0700 Date: Thu, 2 Oct 2003 15:28:12 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (5/11) ep7211_ir dongle -- module owner Message-Id: <20031002152812.2bddb04d.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 467 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 Convert ep7211_ir dongle to use module owner. diff -Nru a/drivers/net/irda/ep7211_ir.c b/drivers/net/irda/ep7211_ir.c --- a/drivers/net/irda/ep7211_ir.c Thu Oct 2 15:10:34 2003 +++ b/drivers/net/irda/ep7211_ir.c Thu Oct 2 15:10:34 2003 @@ -24,12 +24,12 @@ static int ep7211_ir_reset(struct irda_task *task); static struct dongle_reg dongle = { - Q_NULL, - IRDA_EP7211_IR, - ep7211_ir_open, - ep7211_ir_close, - ep7211_ir_reset, - ep7211_ir_change_speed, + .type = IRDA_EP7211_IR, + .open = ep7211_ir_open, + .close = ep7211_ir_close, + .reset = ep7211_ir_reset, + .change_speed = ep7211_ir_change_speed, + .owner = THIS_MODULE, }; static void ep7211_ir_open(dongle_t *self, struct qos_info *qos) @@ -47,8 +47,6 @@ UART (interrupt #14). */ restore_flags(flags); - - MOD_INC_USE_COUNT; } static void ep7211_ir_close(dongle_t *self) @@ -66,8 +64,6 @@ reset them back to their original state. */ restore_flags(flags); - - MOD_DEC_USE_COUNT; } /* From shemminger@osdl.org Thu Oct 2 15:29:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:30:19 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MTk25026644 for ; Thu, 2 Oct 2003 15:29:46 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MSr124968; Thu, 2 Oct 2003 15:28:53 -0700 Date: Thu, 2 Oct 2003 15:28:00 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH} (4/11) actisys donge -- module owner Message-Id: <20031002152800.6bbbc0f6.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 469 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 Convert actisys to use owner field. diff -Nru a/drivers/net/irda/actisys.c b/drivers/net/irda/actisys.c --- a/drivers/net/irda/actisys.c Thu Oct 2 15:10:31 2003 +++ b/drivers/net/irda/actisys.c Thu Oct 2 15:10:31 2003 @@ -64,21 +64,21 @@ #define MAX_SPEEDS 5 static struct dongle_reg dongle = { - Q_NULL, - IRDA_ACTISYS_DONGLE, - actisys_open, - actisys_close, - actisys_reset, - actisys_change_speed, + .type = IRDA_ACTISYS_DONGLE, + .open = actisys_open, + .close = actisys_close, + .reset = actisys_reset, + .change_speed = actisys_change_speed, + .owner = THIS_MODULE, }; static struct dongle_reg dongle_plus = { - Q_NULL, - IRDA_ACTISYS_PLUS_DONGLE, - actisys_open, - actisys_close, - actisys_reset, - actisys_change_speed, + .type = IRDA_ACTISYS_PLUS_DONGLE, + .open = actisys_open, + .close = actisys_close, + .reset = actisys_reset, + .change_speed = actisys_change_speed, + .owner = THIS_MODULE, }; /* @@ -128,16 +128,12 @@ qos->baud_rate.bits &= ~IR_38400; qos->min_turn_time.bits = 0x7f; /* Needs 0.01 ms */ - - MOD_INC_USE_COUNT; } static void actisys_close(dongle_t *self) { /* Power off the dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* From shemminger@osdl.org Thu Oct 2 15:30:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:30:43 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MU525026696 for ; Thu, 2 Oct 2003 15:30:07 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MSs124980; Thu, 2 Oct 2003 15:28:54 -0700 Date: Thu, 2 Oct 2003 15:27:01 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (8/11) litelink dongle -- module owner Message-Id: <20031002152701.118303b1.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 470 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 Convert litelink dongle to use module owner diff -Nru a/drivers/net/irda/litelink.c b/drivers/net/irda/litelink.c --- a/drivers/net/irda/litelink.c Thu Oct 2 15:10:41 2003 +++ b/drivers/net/irda/litelink.c Thu Oct 2 15:10:41 2003 @@ -48,12 +48,12 @@ static __u32 baud_rates[] = { 115200, 57600, 38400, 19200, 9600 }; static struct dongle_reg dongle = { - Q_NULL, - IRDA_LITELINK_DONGLE, - litelink_open, - litelink_close, - litelink_reset, - litelink_change_speed, + .type = IRDA_LITELINK_DONGLE, + .open = litelink_open, + .close = litelink_close, + .reset = litelink_reset, + .change_speed = litelink_change_speed, + .owner = THIS_MODULE, }; int __init litelink_init(void) @@ -70,16 +70,12 @@ { qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; qos->min_turn_time.bits = 0x7f; /* Needs 0.01 ms */ - - MOD_INC_USE_COUNT; } static void litelink_close(dongle_t *self) { /* Power off dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* From shemminger@osdl.org Thu Oct 2 15:33:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:33:41 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MWl25028267 for ; Thu, 2 Oct 2003 15:33:08 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MWF125856; Thu, 2 Oct 2003 15:32:15 -0700 Date: Thu, 2 Oct 2003 15:31:48 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (7/11) girbil dongle -- module owner Message-Id: <20031002153148.18da36da.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 471 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 Convert girbil dongle to use module owner instead of MOD_INC/DEC diff -Nru a/drivers/net/irda/girbil.c b/drivers/net/irda/girbil.c --- a/drivers/net/irda/girbil.c Thu Oct 2 15:10:39 2003 +++ b/drivers/net/irda/girbil.c Thu Oct 2 15:10:39 2003 @@ -63,12 +63,12 @@ #define GIRBIL_LOAD 0x51 /* Load the new baud rate value */ static struct dongle_reg dongle = { - Q_NULL, - IRDA_GIRBIL_DONGLE, - girbil_open, - girbil_close, - girbil_reset, - girbil_change_speed, + .type = IRDA_GIRBIL_DONGLE, + .open = girbil_open, + .close = girbil_close, + .reset = girbil_reset, + .change_speed = girbil_change_speed, + .owner = THIS_MODULE, }; int __init girbil_init(void) @@ -85,16 +85,12 @@ { qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; qos->min_turn_time.bits = 0x03; - - MOD_INC_USE_COUNT; } static void girbil_close(dongle_t *self) { /* Power off dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* From shemminger@osdl.org Thu Oct 2 15:36:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:36:46 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MaD25028674 for ; Thu, 2 Oct 2003 15:36:13 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MZe127299; Thu, 2 Oct 2003 15:35:40 -0700 Date: Thu, 2 Oct 2003 15:35:15 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (11/11) old_belkin dongle module conversion Message-Id: <20031002153515.7897b1ca.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 473 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 Change old_belkin dongle to new module owner support. diff -Nru a/drivers/net/irda/old_belkin.c b/drivers/net/irda/old_belkin.c --- a/drivers/net/irda/old_belkin.c Thu Oct 2 15:10:48 2003 +++ b/drivers/net/irda/old_belkin.c Thu Oct 2 15:10:48 2003 @@ -74,12 +74,12 @@ /* static __u32 baud_rates[] = { 9600 }; */ static struct dongle_reg dongle = { - Q_NULL, - IRDA_OLD_BELKIN_DONGLE, - old_belkin_open, - old_belkin_close, - old_belkin_reset, - old_belkin_change_speed, + .type = IRDA_OLD_BELKIN_DONGLE, + .open = old_belkin_open, + .close = old_belkin_close, + .reset = old_belkin_reset, + .change_speed = old_belkin_change_speed, + .owner = THIS_MODULE, }; int __init old_belkin_init(void) @@ -98,16 +98,12 @@ qos->baud_rate.bits &= IR_9600; /* Needs at least 10 ms (totally wild guess, can do probably better) */ qos->min_turn_time.bits = 0x01; - - MOD_INC_USE_COUNT; } static void old_belkin_close(dongle_t *self) { /* Power off dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* From shemminger@osdl.org Thu Oct 2 15:36:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:36:43 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MaA25028672 for ; Thu, 2 Oct 2003 15:36:10 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MZd127281; Thu, 2 Oct 2003 15:35:39 -0700 Date: Thu, 2 Oct 2003 15:35:14 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (10/11) mcp2120 dongle -- module owner Message-Id: <20031002153514.14e5d917.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 472 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 Convert mcp2120 dongle to use module owner instead of MOD_INC/DEC diff -Nru a/drivers/net/irda/mcp2120.c b/drivers/net/irda/mcp2120.c --- a/drivers/net/irda/mcp2120.c Thu Oct 2 15:10:46 2003 +++ b/drivers/net/irda/mcp2120.c Thu Oct 2 15:10:46 2003 @@ -40,12 +40,12 @@ #define MCP2120_COMMIT 0x11 static struct dongle_reg dongle = { - Q_NULL, - IRDA_MCP2120_DONGLE, - mcp2120_open, - mcp2120_close, - mcp2120_reset, - mcp2120_change_speed, + .type = IRDA_MCP2120_DONGLE, + .open = mcp2120_open, + .close = mcp2120_close, + .reset = mcp2120_reset, + .change_speed = mcp2120_change_speed, + .owner = THIS_MODULE, }; int __init mcp2120_init(void) @@ -62,8 +62,6 @@ { qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; qos->min_turn_time.bits = 0x01; - - MOD_INC_USE_COUNT; } static void mcp2120_close(dongle_t *self) @@ -72,8 +70,6 @@ /* reset and inhibit mcp2120 */ self->set_dtr_rts(self->dev, TRUE, TRUE); //self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* From shemminger@osdl.org Thu Oct 2 15:36:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 15:36:51 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92MaI25028681 for ; Thu, 2 Oct 2003 15:36:18 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h92MZb127270; Thu, 2 Oct 2003 15:35:37 -0700 Date: Thu, 2 Oct 2003 15:35:10 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (9/11) ma600 dongle -- module owner Message-Id: <20031002153510.6bdd33bc.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 474 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 Yet another conversion of dongle from MOD_INC/DEC to module owner field. diff -Nru a/drivers/net/irda/ma600.c b/drivers/net/irda/ma600.c --- a/drivers/net/irda/ma600.c Thu Oct 2 15:10:43 2003 +++ b/drivers/net/irda/ma600.c Thu Oct 2 15:10:43 2003 @@ -74,12 +74,12 @@ #define MA600_2400 0x08 static struct dongle_reg dongle = { - Q_NULL, - IRDA_MA600_DONGLE, - ma600_open, - ma600_close, - ma600_reset, - ma600_change_speed, + .type = IRDA_MA600_DONGLE, + .open = ma600_open, + .close = ma600_close, + .reset = ma600_reset, + .change_speed = ma600_change_speed, + .owner = THIS_MODULE, }; int __init ma600_init(void) @@ -115,8 +115,6 @@ self->set_dtr_rts(self->dev, TRUE, TRUE); // should wait 1 second - - MOD_INC_USE_COUNT; } static void ma600_close(dongle_t *self) @@ -125,8 +123,6 @@ /* Power off dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } static __u8 get_control_byte(__u32 speed) From jt@bougret.hpl.hp.com Thu Oct 2 16:33:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 16:34:11 -0700 (PDT) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92NXa25001786 for ; Thu, 2 Oct 2003 16:33:36 -0700 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel11.hp.com (Postfix) with ESMTP id E9D771C026E8; Thu, 2 Oct 2003 16:33:35 -0700 (PDT) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_28810)/8.9.3 HPLabs Timeshare Server) with ESMTP id QAA00739; Thu, 2 Oct 2003 16:33:35 -0700 (PDT) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1A5Cwx-00026j-00; Thu, 02 Oct 2003 16:33:35 -0700 Date: Thu, 2 Oct 2003 16:33:35 -0700 To: Stephen Hemminger Cc: "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] (1/11) Irda dongle module owner support Message-ID: <20031002233335.GA7945@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20031002152026.4bfd2c67.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031002152026.4bfd2c67.shemminger@osdl.org> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-archive-position: 475 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@bougret.hpl.hp.com Precedence: bulk X-list: netdev On Thu, Oct 02, 2003 at 03:20:26PM -0700, Stephen Hemminger wrote: > > IRDA dongle interface needed to be converted to have an owner field > to avoid races on module unload. Yep, this code was broken. At this point, we were supposed to use the new dongle stuff of Martin, wich I think is correct, but it didn't happened. > Eliminated the use of hashbin locking because the dongle control > code needed to do it's own locking to avoid races. This also closed > the race between find and insert. Yep, that's the right approach. > The find/insert hashbin race may be a general problem with all the IRDA > hashbin stuff. This is clearly commented in the hashbin code (big block of comments). Note that this problem is not a problem of hashbin themselves, because there is only so much you can do there, but more about how you use hashbins. This is why over the last year a lot of critical IrDA code has migrated to HB_NOLOCK or/and use external locking, and therefore the situation is not as bad as it looks. Do a "grep hb_spinlock *" to confirm this (or check my web page) ;-) For the reason mentionned above, the dongle code and the task code were not upgraded. > IMHO the hashbin stuff should be replaced, it is full > of dead incomplete code and done better by the list macros. I somehow agree with that (check my comments on hashbin.c). However, as the majority of locking issues have been addressed during 2.5.X, it's not as critical, and as long as it works... > +static spinlock_t dongle_lock = SPIN_LOCK_UNLOCKED; The usual IrDA convention is to reuse &dongle->hb_spinlock rather than adding a new variable. Less bloat. > + spin_lock(&dongle_lock); I wonder if you need to lock BH as well. I'm not sure if all the dongles call are guaranteed to come from user space. You don't want to introduce nasty deadlocks ;-) > - ASSERT(!in_interrupt(), return NULL;); Hum... My recollections is that calling request_module with interrupt disable was guaranteed to crash. But that was with the "old" module code. I would prefer if you leave this stuff in, it helps debugging. Have fun... Jean From sri@us.ibm.com Thu Oct 2 16:46:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 16:46:53 -0700 (PDT) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h92NkE25002743 for ; Thu, 2 Oct 2003 16:46:21 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h92Nk8E6372324; Thu, 2 Oct 2003 19:46:08 -0400 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h92Nk77C120164; Thu, 2 Oct 2003 17:46:07 -0600 Date: Thu, 2 Oct 2003 16:46:06 -0700 (PDT) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [BK PATCH] 2.6 SCTP updates. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 476 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Hi Dave, Please do a bk pull http://linux-lksctp.bkbits.net/lksctp-2.5 to get the following udpates to SCTP on top of linux 2.6.0-test6 The changesets include fixes for a couple of arch specific issues with ppc64 and parisc64, few ADDIP extension related patches and a bug fix. # This patch includes the following deltas: # ChangeSet 1.1375 -> 1.1377 # net/sctp/associola.c 1.59 -> 1.61 # net/sctp/sm_statefuns.c 1.63 -> 1.64 # net/sctp/endpointola.c 1.28 -> 1.29 # net/sctp/sm_make_chunk.c 1.61 -> 1.64 # include/net/sctp/sctp.h 1.50 -> 1.52 # net/sctp/sysctl.c 1.13 -> 1.14 # include/net/sctp/sm.h 1.29 -> 1.31 # include/linux/sctp.h 1.8 -> 1.9 # net/sctp/sm_sideeffect.c 1.48 -> 1.49 # net/sctp/bind_addr.c 1.21 -> 1.22 # include/net/sctp/command.h 1.14 -> 1.15 # include/net/sctp/structs.h 1.73 -> 1.75 # net/sctp/socket.c 1.96 -> 1.99 # # The following is the BitKeeper ChangeSet Log # #ChangeSet@1.1377, 2003-10-02 11:36:34-07:00, sri@us.ibm.com # [SCTP] Fix bugs in conversions between msecs and jiffies. # #ChangeSet@1.1376, 2003-09-29 12:04:57-07:00, sri@us.ibm.com # Merge us.ibm.com:/home/sridhar/BK/linux-2.6.0-test6 # into us.ibm.com:/home/sridhar/BK/lksctp-2.6.0-test6 # #ChangeSet@1.1217.15.5, 2003-09-29 10:23:40-07:00, sri@us.ibm.com # [SCTP] Convert tv_add from static inline to a macro to fix an obscure # assembler problem with parisc64. # #ChangeSet@1.1217.15.4, 2003-09-22 14:29:35-07:00, sri@us.ibm.com # [SCTP] ADDIP: Support for the creation of ASCONF_ACK chunk (Kevin). # #ChangeSet@1.1217.15.3, 2003-09-18 14:44:14-07:00, sri@us.ibm.com # [SCTP] ADDIP: Handle ERROR chunk in response to an ASCONF chunk. # # Disable sending any further ASCONF chunks and stop its T-4 timer if # the peer responds to an ASCONF with an ERROR chunk. # #ChangeSet@1.1217.15.2, 2003-09-18 14:39:59-07:00, sri@us.ibm.com # [SCTP] ADDIP: Support to send ASCONF chunk with ADD/DEL IP params. # #ChangeSet@1.1217.15.1, 2003-09-09 11:03:31-07:00, sri@us.ibm.com # [SCTP] PPC64 port: Don't overload the optval arg of ADDRS_NUM socket # options with different types for input and output. Instead use it only # as an input arg and return the no. of addresses in the return value. Thanks Sridhar From ja@ssi.bg Thu Oct 2 17:10:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 17:11:10 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h930AU25003850 for ; Thu, 2 Oct 2003 17:10:35 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h9300R104299; Fri, 3 Oct 2003 03:00:28 +0300 Date: Fri, 3 Oct 2003 03:00:27 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com Subject: tunnel xmit and h.raw Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 477 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Hello, Is the following change needed? May be yes for all kernels where the nearest skb_shared checks are actual. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1356 -> 1.1357 # net/ipv4/ip_gre.c 1.30 -> 1.31 # net/ipv6/sit.c 1.28 -> 1.29 # net/ipv4/ipip.c 1.32 -> 1.33 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/03 ja@ssi.bg 1.1357 # [IPV4/IPV6]: tunnel xmit must load skb->h.raw after all reallocations # -------------------------------------------- # diff -Nru a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c --- a/net/ipv4/ip_gre.c Fri Oct 3 02:43:29 2003 +++ b/net/ipv4/ip_gre.c Fri Oct 3 02:43:29 2003 @@ -803,8 +803,6 @@ tunnel->err_count = 0; } - skb->h.raw = skb->nh.raw; - max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen; if (skb_headroom(skb) < max_headroom || skb_cloned(skb) || skb_shared(skb)) { @@ -823,6 +821,7 @@ old_iph = skb->nh.iph; } + skb->h.raw = skb->nh.raw; skb->nh.raw = skb_push(skb, gre_hlen); memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); dst_release(skb->dst); diff -Nru a/net/ipv4/ipip.c b/net/ipv4/ipip.c --- a/net/ipv4/ipip.c Fri Oct 3 02:43:29 2003 +++ b/net/ipv4/ipip.c Fri Oct 3 02:43:29 2003 @@ -596,8 +596,6 @@ tunnel->err_count = 0; } - skb->h.raw = skb->nh.raw; - /* * Okay, now see if we can stuff it in the buffer as-is. */ @@ -619,6 +617,7 @@ old_iph = skb->nh.iph; } + skb->h.raw = skb->nh.raw; skb->nh.raw = skb_push(skb, sizeof(struct iphdr)); memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); dst_release(skb->dst); diff -Nru a/net/ipv6/sit.c b/net/ipv6/sit.c --- a/net/ipv6/sit.c Fri Oct 3 02:43:29 2003 +++ b/net/ipv6/sit.c Fri Oct 3 02:43:29 2003 @@ -530,8 +530,6 @@ tunnel->err_count = 0; } - skb->h.raw = skb->nh.raw; - /* * Okay, now see if we can stuff it in the buffer as-is. */ @@ -553,6 +551,7 @@ iph6 = skb->nh.ipv6h; } + skb->h.raw = skb->nh.raw; skb->nh.raw = skb_push(skb, sizeof(struct iphdr)); memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); dst_release(skb->dst); Regards -- Julian Anastasov From scott.feldman@intel.com Thu Oct 2 17:38:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 17:39:11 -0700 (PDT) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h930ca25004549 for ; Thu, 2 Oct 2003 17:38:37 -0700 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by caduceus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h930cnY2007397 for ; Fri, 3 Oct 2003 00:38:49 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.fm.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h930UON17236 for ; Fri, 3 Oct 2003 00:30:24 GMT Received: from [134.134.3.171] ([134.134.3.171]) by fmsmsxvs043.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003100217382822489 ; Thu, 02 Oct 2003 17:38:28 -0700 Date: Thu, 2 Oct 2003 18:06:27 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 2.6] hang on ZEROCOPY/TSO when hitting no-Tx-resources condition Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 478 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev * Critical bug fix: under heavy Tx stress using ZEROCOPY or TSO, if we ran out of Tx descriptors, we didn't calculate for the context descritor used as the first of the ZEROCOPY/TSO send, nor do we clean up the context desriptor bits in the case where the send isn't going to fit, where we need to undo the mappings. This bug was introduced with the 5.2.16 patch set which included a workaround for a hang on 82544 over PCI-X. This workaround cause the check for no-Tx- rosource logic to change, and this bug slipped in. ------------ diff -Naurp net-drivers-2.5/drivers/net/e1000/e1000_main.c net-drivers-2.5/drivers/net/e1000.mod/e1000_main.c --- net-drivers-2.5/drivers/net/e1000/e1000_main.c 2003-10-02 17:34:04.000000000 -0700 +++ net-drivers-2.5/drivers/net/e1000.mod/e1000_main.c 2003-10-02 17:38:35.000000000 -0700 @@ -30,7 +30,7 @@ /* Change Log * - * 5.2.18 9/13/03 + * 5.2.20 9/30/03 * o Bug fix: SERDES devices might be connected to a back-plane * switch that doesn't support auto-neg, so add the capability * to force 1000/Full. @@ -39,6 +39,9 @@ * Jumbo Frames or with the reduced FIFO in 82547. * o Better propagation of error codes. [Janice Girouard * (janiceg@us.ibm.com)]. + * o Bug fix: hang under heavy Tx stress when running out of Tx + * descriptors; wasn't clearing context descriptor when backing + * out of send because of no-resource condition. * * 5.2.16 8/8/03 * o Added support for new controllers: 82545GM, 82546GB, 82541/7_B1 @@ -61,7 +64,7 @@ char e1000_driver_name[] = "e1000"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; -char e1000_driver_version[] = "5.2.19-k1"; +char e1000_driver_version[] = "5.2.20-k1"; char e1000_copyright[] = "Copyright (c) 1999-2003 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -1501,6 +1504,7 @@ e1000_tx_map(struct e1000_adapter *adapt unsigned int first) { struct e1000_desc_ring *tx_ring = &adapter->tx_ring; + struct e1000_tx_desc *tx_desc; struct e1000_buffer *buffer_info; unsigned int len = skb->len, max_per_txd = E1000_MAX_DATA_PER_TXD; unsigned int offset = 0, size, count = 0, i; @@ -1596,17 +1600,29 @@ e1000_tx_map(struct e1000_adapter *adapt } } - if(E1000_DESC_UNUSED(&adapter->tx_ring) < count) { + if(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2) { /* There aren't enough descriptors available to queue up - * this send, so undo the mapping and abort the send. - * We could have done the check before we mapped the skb, - * but because of all the workarounds (above), it's too - * difficult to predict how many we're going to need.*/ - i = first; + * this send (need: count + 1 context desc + 1 desc gap + * to keep tail from touching head), so undo the mapping + * and abort the send. We could have done the check before + * we mapped the skb, but because of all the workarounds + * (above), it's too difficult to predict how many we're + * going to need.*/ + i = adapter->tx_ring.next_to_use; + + if(i == first) { + /* Cleanup after e1000_tx_[csum|tso] scribbling + * on descriptors. */ + tx_desc = E1000_TX_DESC(*tx_ring, first); + tx_desc->buffer_addr = 0; + tx_desc->lower.data = 0; + tx_desc->upper.data = 0; + } while(count--) { buffer_info = &tx_ring->buffer_info[i]; + if(buffer_info->dma) { pci_unmap_page(adapter->pdev, buffer_info->dma, @@ -1614,9 +1630,12 @@ e1000_tx_map(struct e1000_adapter *adapt PCI_DMA_TODEVICE); buffer_info->dma = 0; } + if(++i == tx_ring->count) i = 0; } + adapter->tx_ring.next_to_use = first; + return 0; } From scott.feldman@intel.com Thu Oct 2 17:54:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 17:55:15 -0700 (PDT) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h930sf25005036 for ; Thu, 2 Oct 2003 17:54:41 -0700 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by caduceus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h930ssY2025871 for ; Fri, 3 Oct 2003 00:54:54 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.fm.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h930kTS25810 for ; Fri, 3 Oct 2003 00:46:29 GMT Received: from [134.134.3.171] ([134.134.3.171]) by fmsmsxvs043.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003100217543423606 ; Thu, 02 Oct 2003 17:54:34 -0700 Date: Thu, 2 Oct 2003 18:22:33 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 2.4] hang on ZEROCOPY/TSO when hitting no-Tx-resources condition Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 479 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev * Critical bug fix: under heavy Tx stress using ZEROCOPY or TSO, if we run out of Tx descriptors, we don't calculate for the context descriptor used as the first of the ZEROCOPY/TSO send, nor do we clean up the context descriptor bits in the case where the send isn't going to fit and we need to undo the mappings. This bug was introduced with the 5.2.16 patch set which included a workaround for a hang on 82544 over PCI-X. This workaround caused the check for no-Tx- resource logic to change, and this bug slipped in. ------------- diff -Naurp net-drivers-2.4/drivers/net/e1000/e1000_main.c net-drivers-2.4/drivers/net/e1000.mod/e1000_main.c --- net-drivers-2.4/drivers/net/e1000/e1000_main.c 2003-10-02 18:08:45.000000000 -0700 +++ net-drivers-2.4/drivers/net/e1000.mod/e1000_main.c 2003-10-02 18:12:48.000000000 -0700 @@ -59,7 +59,7 @@ char e1000_driver_name[] = "e1000"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; -char e1000_driver_version[] = "5.2.16-k1"; +char e1000_driver_version[] = "5.2.16-k2"; char e1000_copyright[] = "Copyright (c) 1999-2003 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -1532,6 +1532,7 @@ e1000_tx_map(struct e1000_adapter *adapt unsigned int first) { struct e1000_desc_ring *tx_ring = &adapter->tx_ring; + struct e1000_tx_desc *tx_desc; struct e1000_buffer *buffer_info; unsigned int len = skb->len, max_per_txd = E1000_MAX_DATA_PER_TXD; unsigned int offset = 0, size, count = 0, i; @@ -1622,17 +1623,29 @@ e1000_tx_map(struct e1000_adapter *adapt } } - if(E1000_DESC_UNUSED(&adapter->tx_ring) < count) { + if(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2) { /* There aren't enough descriptors available to queue up - * this send, so undo the mapping and abort the send. - * We could have done the check before we mapped the skb, - * but because of all the workarounds (above), it's too - * difficult to predict how many we're going to need.*/ - i = first; + * this send (need: count + 1 context desc + 1 desc gap + * to keep tail from touching head), so undo the mapping + * and abort the send. We could have done the check before + * we mapped the skb, but because of all the workarounds + * (above), it's too difficult to predict how many we're + * going to need.*/ + i = adapter->tx_ring.next_to_use; + + if(i == first) { + /* Cleanup after e1000_tx_[csum|tso] scribbling + * on descriptors. */ + tx_desc = E1000_TX_DESC(*tx_ring, first); + tx_desc->buffer_addr = 0; + tx_desc->lower.data = 0; + tx_desc->upper.data = 0; + } while(count--) { buffer_info = &tx_ring->buffer_info[i]; + if(buffer_info->dma) { pci_unmap_page(adapter->pdev, buffer_info->dma, @@ -1640,9 +1653,12 @@ e1000_tx_map(struct e1000_adapter *adapt PCI_DMA_TODEVICE); buffer_info->dma = 0; } + if(++i == tx_ring->count) i = 0; } + adapter->tx_ring.next_to_use = first; + return 0; } From oxymoron@waste.org Thu Oct 2 18:41:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 18:41:56 -0700 (PDT) Received: from waste.org (waste.org [209.173.204.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h931fI25005946 for ; Thu, 2 Oct 2003 18:41:19 -0700 Received: from waste.org (localhost [127.0.0.1]) by waste.org (8.12.3/8.12.3/Debian-6.6) with ESMTP id h931f4RT024444; Thu, 2 Oct 2003 20:41:04 -0500 Received: (from oxymoron@localhost) by waste.org (8.12.3/8.12.3/Debian-6.6) id h931f4Ck024442; Thu, 2 Oct 2003 20:41:04 -0500 Date: Thu, 2 Oct 2003 20:41:04 -0500 From: Matt Mackall To: netdev@oss.sgi.com Cc: Andrew Morton , Jeff Garzik Subject: [RFC] [PATCH 1/3] netpoll api Message-ID: <20031003014104.GR1897@waste.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Virus-Scanned: by amavisd-new X-archive-position: 480 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mpm@selenic.com Precedence: bulk X-list: netdev This patch implements a new netpoll API, which allows sending and receiving packets in context where interrupts may be disabled. It provides a common API for implementing features like netconsole, netdump/LKCD, and kgdb-over-ethernet and manages to isolate them almost completely from the details of the network layer. The second patch is an example of implementing the poll_controller hook needed to get a card to work with netpoll. Numerous other examples are in -mm and recent Red Hat kernels. The final patch is a reimplementation of netconsole against the netpoll api. 8< This patch provides interface for polling NICs with interrupts disabled, for both send and receive. It also provides an option parser for configuring network parameters for subsystems that use the polling interface. This functionality should be common between netconsole, netdump, kgdb-over-ethernet, etc. arch/i386/kernel/irq.c | 0 ml-mpm/include/linux/netdevice.h | 16 ml-mpm/include/linux/netpoll.h | 38 ++ ml-mpm/net/Kconfig | 11 ml-mpm/net/core/Makefile | 1 ml-mpm/net/core/dev.c | 15 ml-mpm/net/core/netpoll.c | 636 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 717 insertions(+) diff -puN /dev/null net/core/netpoll.c --- /dev/null 2003-09-12 12:14:37.000000000 -0500 +++ ml-mpm/net/core/netpoll.c 2003-10-02 16:48:38.000000000 -0500 @@ -0,0 +1,636 @@ +/* + * Common framework for low-level network console, dump, and debugger code + * + * Sep 8 2003 Matt Mackall + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * We maintain a small pool of fully-sized skbs, to make sure the + * message gets out even in extreme OOM situations. + */ + +#define MAX_SKBS 32 +#define MAX_UDP_CHUNK 1460 + +static spinlock_t skb_list_lock = SPIN_LOCK_UNLOCKED; +static int nr_skbs; +static struct sk_buff *skbs; + +static spinlock_t rx_list_lock = SPIN_LOCK_UNLOCKED; +static LIST_HEAD(rx_list); + +static int trapped; + +#define MAX_SKB_SIZE \ + (MAX_UDP_CHUNK + sizeof(struct udphdr) + \ + sizeof(struct iphdr) + sizeof(struct ethhdr)) + +static int checksum_udp(struct sk_buff *skb, struct udphdr *uh, + unsigned short ulen, u32 saddr, u32 daddr) +{ + if (uh->check == 0) + return 0; + + if (skb->ip_summed == CHECKSUM_HW) + return csum_tcpudp_magic( + saddr, daddr, ulen, IPPROTO_UDP, skb->csum); + + skb->csum = csum_tcpudp_nofold(saddr, daddr, ulen, IPPROTO_UDP, 0); + + return csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)); +} + +void netpoll_poll(struct netpoll *np) +{ + int budget = 1; + + if(!np->dev || !netif_running(np->dev) || !np->dev->poll_controller) + return; + + /* Process pending work on NIC */ + np->dev->poll_controller(np->dev); + + /* If scheduling is stopped, tickle NAPI bits */ + if(trapped && np->dev->poll && + test_bit(__LINK_STATE_RX_SCHED, &np->dev->state)) + np->dev->poll(np->dev, &budget); +} + +static void refill_skbs(void) +{ + struct sk_buff *skb; + unsigned long flags; + + spin_lock_irqsave(&skb_list_lock, flags); + while (nr_skbs < MAX_SKBS) { + skb = alloc_skb(MAX_SKB_SIZE, GFP_ATOMIC); + if (!skb) + break; + + skb->next = skbs; + skbs = skb; + nr_skbs++; + } + spin_unlock_irqrestore(&skb_list_lock, flags); +} + +static void zap_completion_queue(void) +{ + unsigned long flags; + struct softnet_data *sd = &get_cpu_var(softnet_data); + + if (sd->completion_queue) { + struct sk_buff *clist; + + local_irq_save(flags); + clist = sd->completion_queue; + sd->completion_queue = NULL; + local_irq_restore(flags); + + while (clist != NULL) { + struct sk_buff *skb = clist; + clist = clist->next; + __kfree_skb(skb); + } + } + + put_cpu_var(softnet_data); +} + +static struct sk_buff * find_skb(struct netpoll *np, int len, int reserve) +{ + int once = 1, count = 0; + unsigned long flags; + struct sk_buff *skb = NULL; + +repeat: + zap_completion_queue(); + if (nr_skbs < MAX_SKBS) + refill_skbs(); + + skb = alloc_skb(len, GFP_ATOMIC); + + if (!skb) { + spin_lock_irqsave(&skb_list_lock, flags); + skb = skbs; + if (skb) + skbs = skb->next; + skb->next = NULL; + nr_skbs--; + spin_unlock_irqrestore(&skb_list_lock, flags); + } + + if(!skb) { + count++; + if (once && (count == 1000000)) { + printk("out of netpoll skbs!\n"); + once = 0; + } + netpoll_poll(np); + goto repeat; + } + + atomic_set(&skb->users, 1); + skb_reserve(skb, reserve); + return skb; +} + +void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) +{ + int status; + +repeat: + if(!np || !np->dev || !netif_running(np->dev)) { + __kfree_skb(skb); + return; + } + + spin_lock(&np->dev->xmit_lock); + np->dev->xmit_lock_owner = smp_processor_id(); + + if (netif_queue_stopped(np->dev)) { + np->dev->xmit_lock_owner = -1; + spin_unlock(&np->dev->xmit_lock); + + netpoll_poll(np); + zap_completion_queue(); + goto repeat; + } + + status = np->dev->hard_start_xmit(skb, np->dev); + np->dev->xmit_lock_owner = -1; + spin_unlock(&np->dev->xmit_lock); + + /* transmit busy */ + if(status) + goto repeat; +} + +void netpoll_send_udp(struct netpoll *np, const char *msg, int len) +{ + int total_len, eth_len, ip_len, udp_len; + struct sk_buff *skb; + struct udphdr *udph; + struct iphdr *iph; + struct ethhdr *eth; + + udp_len = len + sizeof(*udph); + ip_len = eth_len = udp_len + sizeof(*iph); + total_len = eth_len + ETH_HLEN; + + skb = find_skb(np, total_len, total_len - len); + if (!skb) + return; + + memcpy(skb->data, msg, len); + skb->len += len; + + udph = (struct udphdr *) skb_push(skb, sizeof(*udph)); + udph->source = htons(np->local_port); + udph->dest = htons(np->remote_port); + udph->len = htons(udp_len); + udph->check = 0; + + iph = (struct iphdr *)skb_push(skb, sizeof(*iph)); + + iph->version = 4; + iph->ihl = 5; + iph->tos = 0; + iph->tot_len = htons(ip_len); + iph->id = 0; + iph->frag_off = 0; + iph->ttl = 64; + iph->protocol = IPPROTO_UDP; + iph->check = 0; + iph->saddr = htonl(np->local_ip); + iph->daddr = htonl(np->remote_ip); + iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); + + eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); + + eth->h_proto = htons(ETH_P_IP); + memcpy(eth->h_source, np->local_mac, 6); + memcpy(eth->h_dest, np->remote_mac, 6); + + netpoll_send_skb(np, skb); +} + +static void arp_reply(struct sk_buff *skb) +{ + struct in_device *in_dev = (struct in_device *) skb->dev->ip_ptr; + struct arphdr *arp; + unsigned char *arp_ptr, *sha, *tha; + int size, type = ARPOP_REPLY, ptype = ETH_P_ARP; + u32 sip, tip; + struct sk_buff *send_skb; + unsigned long flags; + struct list_head *p; + struct netpoll *np = 0; + + spin_lock_irqsave(&rx_list_lock, flags); + list_for_each(p, &rx_list) { + np = list_entry(p, struct netpoll, rx_list); + if ( np->dev == skb->dev ) + break; + np = 0; + } + spin_unlock_irqrestore(&rx_list_lock, flags); + + if (!np) return; + + /* No arp on this interface */ + if (!in_dev || skb->dev->flags & IFF_NOARP) + return; + + if (!pskb_may_pull(skb, (sizeof(struct arphdr) + + (2 * skb->dev->addr_len) + + (2 * sizeof(u32))))) + return; + + skb->h.raw = skb->nh.raw = skb->data; + arp = skb->nh.arph; + + if ((arp->ar_hrd != htons(ARPHRD_ETHER) && + arp->ar_hrd != htons(ARPHRD_IEEE802)) || + arp->ar_pro != htons(ETH_P_IP) || + arp->ar_op != htons(ARPOP_REQUEST)) + return; + + arp_ptr= (unsigned char *)(arp+1); + sha = arp_ptr; + arp_ptr += skb->dev->addr_len; + memcpy(&sip, arp_ptr, 4); + arp_ptr += 4; + tha = arp_ptr; + arp_ptr += skb->dev->addr_len; + memcpy(&tip, arp_ptr, 4); + + /* Should we ignore arp? */ + if (tip != in_dev->ifa_list->ifa_address || + LOOPBACK(tip) || MULTICAST(tip)) + return; + + + size = sizeof(struct arphdr) + 2 * (skb->dev->addr_len + 4); + send_skb = find_skb(np, size + LL_RESERVED_SPACE(np->dev), + LL_RESERVED_SPACE(np->dev)); + + if (!send_skb) + return; + + send_skb->nh.raw = send_skb->data; + arp = (struct arphdr *) skb_put(send_skb, size); + send_skb->dev = skb->dev; + send_skb->protocol = htons(ETH_P_ARP); + + /* Fill the device header for the ARP frame */ + + if (np->dev->hard_header && + np->dev->hard_header(send_skb, skb->dev, ptype, + np->remote_mac, np->local_mac, + send_skb->len) < 0) { + kfree_skb(send_skb); + return; + } + + /* + * Fill out the arp protocol part. + * + * we only support ethernet device type, + * which (according to RFC 1390) should always equal 1 (Ethernet). + */ + + arp->ar_hrd = htons(np->dev->type); + arp->ar_pro = htons(ETH_P_IP); + arp->ar_hln = np->dev->addr_len; + arp->ar_pln = 4; + arp->ar_op = htons(type); + + arp_ptr=(unsigned char *)(arp + 1); + memcpy(arp_ptr, np->dev->dev_addr, np->dev->addr_len); + arp_ptr += np->dev->addr_len; + memcpy(arp_ptr, &tip, 4); + arp_ptr += 4; + memcpy(arp_ptr, np->local_mac, np->dev->addr_len); + arp_ptr += np->dev->addr_len; + memcpy(arp_ptr, &sip, 4); + + netpoll_send_skb(np, send_skb); +} + +int netpoll_rx(struct sk_buff *skb) +{ + int proto, len, ulen; + struct iphdr *iph; + struct udphdr *uh; + struct netpoll *np; + struct list_head *p; + unsigned long flags; + + if (skb->dev->type != ARPHRD_ETHER) + goto out; + + /* check if netpoll clients need ARP */ + if (skb->protocol == __constant_htons(ETH_P_ARP) && trapped) { + arp_reply(skb); + return 1; + } + + proto = ntohs(skb->mac.ethernet->h_proto); + if (proto != ETH_P_IP) + goto out; + if (skb->pkt_type == PACKET_OTHERHOST) + goto out; + if (skb_shared(skb)) + goto out; + + iph = (struct iphdr *)skb->data; + if (!pskb_may_pull(skb, sizeof(struct iphdr))) + goto out; + if (iph->ihl < 5 || iph->version != 4) + goto out; + if (!pskb_may_pull(skb, iph->ihl*4)) + goto out; + if (ip_fast_csum((u8 *)iph, iph->ihl) != 0) + goto out; + + len = ntohs(iph->tot_len); + if (skb->len < len || len < iph->ihl*4) + goto out; + + if (iph->protocol != IPPROTO_UDP) + goto out; + + len -= iph->ihl*4; + uh = (struct udphdr *)(((char *)iph) + iph->ihl*4); + ulen = ntohs(uh->len); + + if (ulen != len) + goto out; + if (checksum_udp(skb, uh, ulen, iph->saddr, iph->daddr) < 0) + goto out; + + spin_lock_irqsave(&rx_list_lock, flags); + list_for_each(p, &rx_list) { + np = list_entry(p, struct netpoll, rx_list); + if (np->dev && np->dev != skb->dev) + continue; + if (np->local_ip && np->local_ip != ntohl(iph->daddr)) + continue; + if (np->remote_ip && np->remote_ip != ntohl(iph->saddr)) + continue; + if (np->local_port && np->local_port != ntohs(uh->dest)) + continue; + + spin_unlock_irqrestore(&rx_list_lock, flags); + + if (np->rx_hook) + np->rx_hook(np, ntohs(uh->source), + (char *)(uh+1), ulen-sizeof(uh)-4); + + return 1; + } + spin_unlock_irqrestore(&rx_list_lock, flags); + +out: + return trapped; +} + +int netpoll_parse_options(struct netpoll *np, char *opt) +{ + char *cur=opt, *delim; + + if(*cur != '@') { + if ((delim = strchr(cur, '@')) == NULL) + goto parse_failed; + *delim=0; + np->local_port=simple_strtol(cur, 0, 10); + cur=delim; + } + cur++; + printk(KERN_INFO "%s: local port %d\n", np->name, np->local_port); + + if(*cur != '/') { + if ((delim = strchr(cur, '/')) == NULL) + goto parse_failed; + *delim=0; + np->local_ip=ntohl(in_aton(cur)); + cur=delim; + + printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n", + np->name, HIPQUAD(np->local_ip)); + } + cur++; + + if ( *cur != ',') { + /* parse out dev name */ + if ((delim = strchr(cur, ',')) == NULL) + goto parse_failed; + *delim=0; + strlcpy(np->dev_name, cur, sizeof(np->dev_name)); + cur=delim; + } + cur++; + + printk(KERN_INFO "%s: interface %s\n", np->name, np->dev_name); + + if ( *cur != '@' ) { + /* dst port */ + if ((delim = strchr(cur, '@')) == NULL) + goto parse_failed; + *delim=0; + np->remote_port=simple_strtol(cur, 0, 10); + cur=delim; + } + cur++; + printk(KERN_INFO "%s: remote port %d\n", np->name, np->remote_port); + + /* dst ip */ + if ((delim = strchr(cur, '/')) == NULL) + goto parse_failed; + *delim=0; + np->remote_ip=ntohl(in_aton(cur)); + cur=delim+1; + + printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n", + np->name, HIPQUAD(np->remote_ip)); + + if( *cur != 0 ) + { + /* MAC address */ + if ((delim = strchr(cur, ':')) == NULL) + goto parse_failed; + *delim=0; + np->remote_mac[0]=simple_strtol(cur, 0, 16); + cur=delim+1; + if ((delim = strchr(cur, ':')) == NULL) + goto parse_failed; + *delim=0; + np->remote_mac[1]=simple_strtol(cur, 0, 16); + cur=delim+1; + if ((delim = strchr(cur, ':')) == NULL) + goto parse_failed; + *delim=0; + np->remote_mac[2]=simple_strtol(cur, 0, 16); + cur=delim+1; + if ((delim = strchr(cur, ':')) == NULL) + goto parse_failed; + *delim=0; + np->remote_mac[3]=simple_strtol(cur, 0, 16); + cur=delim+1; + if ((delim = strchr(cur, ':')) == NULL) + goto parse_failed; + *delim=0; + np->remote_mac[4]=simple_strtol(cur, 0, 16); + cur=delim+1; + np->remote_mac[5]=simple_strtol(cur, 0, 16); + } + + printk(KERN_INFO "%s: remote ethernet address " + "%02x:%02x:%02x:%02x:%02x:%02x\n", + np->name, + np->remote_mac[0], + np->remote_mac[1], + np->remote_mac[2], + np->remote_mac[3], + np->remote_mac[4], + np->remote_mac[5]); + + return 0; + + parse_failed: + printk(KERN_INFO "%s: couldn't parse config at %s!\n", + np->name, cur); + return -1; +} + +int netpoll_setup(struct netpoll *np) +{ + struct net_device *ndev = NULL; + struct in_device *in_dev; + + if (np->dev_name) + ndev = dev_get_by_name(np->dev_name); + if (!ndev) { + printk(KERN_ERR "%s: %s doesn't exist, aborting.\n", + np->name, np->dev_name); + goto release; + } + if (!ndev->poll_controller) { + printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n", + np->name, np->dev_name); + goto release; + } + + if (!(ndev->flags & IFF_UP)) { + unsigned short oflags; + unsigned long jiff; + + printk(KERN_INFO "%s: device %s not up yet, forcing it\n", + np->name, np->dev_name); + + oflags = ndev->flags; + + rtnl_shlock(); + if (dev_change_flags(ndev, oflags | IFF_UP) < 0) { + printk(KERN_ERR "%s: failed to open %s\n", + np->name, np->dev_name); + rtnl_shunlock(); + goto release; + } + rtnl_shunlock(); + + jiff = jiffies + 6*HZ; + while(!netif_carrier_ok(ndev)) { + if (!time_before(jiffies, jiff)) { + printk(KERN_NOTICE + "%s: timeout waiting for carrier\n", + np->name); + break; + } + cond_resched(); + } + + } + + if (!memcmp(np->local_mac, "\0\0\0\0\0\0", 6) && ndev->dev_addr) + memcpy(np->local_mac, ndev->dev_addr, 6); + + if (!np->local_ip) { + in_dev = in_dev_get(ndev); + + if (!in_dev) { + printk(KERN_ERR "%s: no IP address for %s, aborting\n", + np->name, np->dev_name); + goto release; + } + + np->local_ip = ntohl(in_dev->ifa_list->ifa_local); + in_dev_put(in_dev); + printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n", + np->name, HIPQUAD(np->local_ip)); + } + + np->dev = ndev; + + if(np->rx_hook) { + unsigned long flags; + + np->dev->netpoll_rx = 1; + + spin_lock_irqsave(&rx_list_lock, flags); + list_add(&np->rx_list, &rx_list); + spin_unlock_irqrestore(&rx_list_lock, flags); + } + + return 0; + release: + dev_put(ndev); + return -1; +} + +void netpoll_cleanup(struct netpoll *np) +{ + if(np->rx_hook) { + unsigned long flags; + + spin_lock_irqsave(&rx_list_lock, flags); + list_del(&np->rx_list); + np->dev->netpoll_rx = 0; + spin_unlock_irqrestore(&rx_list_lock, flags); + } + + dev_put(np->dev); + np->dev = 0; +} + +int netpoll_trap() +{ + return trapped; +} + +void netpoll_set_trap(int trap) +{ + trapped = trap; +} + +EXPORT_SYMBOL(netpoll_set_trap); +EXPORT_SYMBOL(netpoll_trap); +EXPORT_SYMBOL(netpoll_parse_options); +EXPORT_SYMBOL(netpoll_setup); +EXPORT_SYMBOL(netpoll_cleanup); +EXPORT_SYMBOL(netpoll_send_skb); +EXPORT_SYMBOL(netpoll_send_udp); +EXPORT_SYMBOL(netpoll_poll); diff -puN /dev/null include/linux/netpoll.h --- /dev/null 2003-09-12 12:14:37.000000000 -0500 +++ ml-mpm/include/linux/netpoll.h 2003-10-02 16:48:38.000000000 -0500 @@ -0,0 +1,38 @@ +/* + * Common code for low-level network console, dump, and debugger code + * + * Derived from netconsole, kgdb-over-ethernet, and netdump patches + */ + +#ifndef _LINUX_NETPOLL_H +#define _LINUX_NETPOLL_H + +#include +#include +#include +#include + +struct netpoll; + +struct netpoll { + struct net_device *dev; + char dev_name[16], *name; + void (*rx_hook)(struct netpoll *, int, char *, int); + u32 local_ip, remote_ip; + u16 local_port, remote_port; + unsigned char local_mac[6], remote_mac[6]; + struct list_head rx_list; +}; + +void netpoll_poll(struct netpoll *np); +void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); +void netpoll_send_udp(struct netpoll *np, const char *msg, int len); +int netpoll_parse_options(struct netpoll *np, char *opt); +int netpoll_setup(struct netpoll *np); +int netpoll_trap(void); +void netpoll_set_trap(int trap); +void netpoll_cleanup(struct netpoll *np); +int netpoll_rx(struct sk_buff *skb); + + +#endif diff -puN net/core/Makefile~netpoll-core net/core/Makefile --- ml/net/core/Makefile~netpoll-core 2003-10-02 16:48:38.000000000 -0500 +++ ml-mpm/net/core/Makefile 2003-10-02 16:48:38.000000000 -0500 @@ -13,3 +13,4 @@ obj-$(CONFIG_NETFILTER) += netfilter.o obj-$(CONFIG_NET_DIVERT) += dv.o obj-$(CONFIG_NET_PKTGEN) += pktgen.o obj-$(CONFIG_NET_RADIO) += wireless.o +obj-$(CONFIG_NETPOLL) += netpoll.o diff -puN net/Kconfig~netpoll-core net/Kconfig --- ml/net/Kconfig~netpoll-core 2003-10-02 16:48:38.000000000 -0500 +++ ml-mpm/net/Kconfig 2003-10-02 16:48:38.000000000 -0500 @@ -670,4 +670,15 @@ source "net/irda/Kconfig" source "net/bluetooth/Kconfig" +config NETPOLL + bool "Netpoll API" + +config NETPOLL_RX + bool "Netpoll receive hooks" + depends on NETPOLL + +config NETPOLL_TRAP + bool "Netpoll traffic trapping" + depends on NETPOLL + endmenu diff -puN include/linux/netdevice.h~netpoll-core include/linux/netdevice.h --- ml/include/linux/netdevice.h~netpoll-core 2003-10-02 16:48:38.000000000 -0500 +++ ml-mpm/include/linux/netdevice.h 2003-10-02 16:48:38.000000000 -0500 @@ -452,6 +452,11 @@ struct net_device unsigned char *haddr); int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); int (*accept_fastpath)(struct net_device *, struct dst_entry*); +#ifdef CONFIG_NETPOLL_RX +#define HAVE_POLL_CONTROLLER + int netpoll_rx; + void (*poll_controller)(struct net_device *dev); +#endif /* bridge stuff */ struct net_bridge_port *br_port; @@ -530,6 +535,9 @@ extern int dev_new_index(void); extern struct net_device *dev_get_by_index(int ifindex); extern struct net_device *__dev_get_by_index(int ifindex); extern int dev_restart(struct net_device *dev); +#ifdef CONFIG_NETPOLL_TRAP +extern int netpoll_trap(void); +#endif typedef int gifconf_func_t(struct net_device * dev, char * bufptr, int len); extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf); @@ -588,12 +596,20 @@ static inline void netif_start_queue(str static inline void netif_wake_queue(struct net_device *dev) { +#ifdef CONFIG_NETPOLL_TRAP + if (netpoll_trap()) + return; +#endif if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) __netif_schedule(dev); } static inline void netif_stop_queue(struct net_device *dev) { +#ifdef CONFIG_NETPOLL_TRAP + if (netpoll_trap()) + return; +#endif set_bit(__LINK_STATE_XOFF, &dev->state); } diff -puN net/core/dev.c~netpoll-core net/core/dev.c --- ml/net/core/dev.c~netpoll-core 2003-10-02 16:48:38.000000000 -0500 +++ ml-mpm/net/core/dev.c 2003-10-02 16:48:38.000000000 -0500 @@ -105,6 +105,7 @@ #include #include #include +#include #ifdef CONFIG_NET_RADIO #include /* Note : will define WIRELESS_EXT */ #include @@ -1347,6 +1348,13 @@ int netif_rx(struct sk_buff *skb) struct softnet_data *queue; unsigned long flags; +#ifdef CONFIG_NETPOLL_RX + if (skb->dev->netpoll_rx && netpoll_rx(skb)) { + kfree_skb(skb); + return NET_RX_DROP; + } +#endif + if (!skb->stamp.tv_sec) do_gettimeofday(&skb->stamp); @@ -1531,6 +1539,13 @@ int netif_receive_skb(struct sk_buff *sk int ret = NET_RX_DROP; unsigned short type = skb->protocol; +#ifdef CONFIG_NETPOLL_RX + if (skb->dev->netpoll_rx && skb->dev->poll && netpoll_rx(skb)) { + kfree_skb(skb); + return NET_RX_DROP; + } +#endif + if (!skb->stamp.tv_sec) do_gettimeofday(&skb->stamp); diff -puN arch/i386/kernel/irq.c~netpoll-core arch/i386/kernel/irq.c _ -- Matt Mackall : http://www.selenic.com : of or relating to the moon From oxymoron@waste.org Thu Oct 2 18:45:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 18:45:48 -0700 (PDT) Received: from waste.org (waste.org [209.173.204.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h931jE25006307 for ; Thu, 2 Oct 2003 18:45:14 -0700 Received: from waste.org (localhost [127.0.0.1]) by waste.org (8.12.3/8.12.3/Debian-6.6) with ESMTP id h931j6RT024772; Thu, 2 Oct 2003 20:45:06 -0500 Received: (from oxymoron@localhost) by waste.org (8.12.3/8.12.3/Debian-6.6) id h931j60s024770; Thu, 2 Oct 2003 20:45:06 -0500 Date: Thu, 2 Oct 2003 20:45:05 -0500 From: Matt Mackall To: netdev@oss.sgi.com Cc: Andrew Morton , Jeff Garzik Subject: [RFC] [PATCH 2/3] tg3 netpoll hook Message-ID: <20031003014505.GS1897@waste.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Virus-Scanned: by amavisd-new X-archive-position: 481 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mpm@selenic.com Precedence: bulk X-list: netdev l-mpm/drivers/net/tg3.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) diff -puN drivers/net/tg3.c~tg3-poll drivers/net/tg3.c --- l/drivers/net/tg3.c~tg3-poll 2003-09-25 11:47:30.000000000 -0500 +++ l-mpm/drivers/net/tg3.c 2003-09-25 11:56:37.000000000 -0500 @@ -2475,6 +2475,15 @@ static irqreturn_t tg3_interrupt(int irq static int tg3_init_hw(struct tg3 *); static int tg3_halt(struct tg3 *); +#ifdef HAVE_POLL_CONTROLLER +static void tg3_poll_controller(struct net_device *dev) +{ + disable_irq(dev->irq); + tg3_interrupt (dev->irq, dev, NULL); + enable_irq(dev->irq); +} +#endif + static void tg3_reset_task(void *_data) { struct tg3 *tp = _data; @@ -7482,6 +7491,10 @@ static struct pci_dev * __devinit tg3_fi return peer; } +#ifdef HAVE_POLL_CONTROLLER +static void tg3_poll_controller(struct net_device *dev); +#endif + static int __devinit tg3_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -7632,6 +7645,9 @@ static int __devinit tg3_init_one(struct dev->watchdog_timeo = TG3_TX_TIMEOUT; dev->change_mtu = tg3_change_mtu; dev->irq = pdev->irq; +#ifdef HAVE_POLL_CONTROLLER + dev->poll_controller = tg3_poll_controller; +#endif err = tg3_get_invariants(tp); if (err) { _ -- Matt Mackall : http://www.selenic.com : of or relating to the moon From oxymoron@waste.org Thu Oct 2 18:52:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 18:52:57 -0700 (PDT) Received: from waste.org (waste.org [209.173.204.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h931qK25006667 for ; Thu, 2 Oct 2003 18:52:21 -0700 Received: from waste.org (localhost [127.0.0.1]) by waste.org (8.12.3/8.12.3/Debian-6.6) with ESMTP id h931qCRT025206; Thu, 2 Oct 2003 20:52:12 -0500 Received: (from oxymoron@localhost) by waste.org (8.12.3/8.12.3/Debian-6.6) id h931qCO8025204; Thu, 2 Oct 2003 20:52:12 -0500 Date: Thu, 2 Oct 2003 20:52:12 -0500 From: Matt Mackall To: netdev@oss.sgi.com Cc: Andrew Morton , Jeff Garzik Subject: [RFC] [PATCH 3/3] netconsole using netpoll Message-ID: <20031003015212.GU1897@waste.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Virus-Scanned: by amavisd-new X-archive-position: 482 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mpm@selenic.com Precedence: bulk X-list: netdev This patch uses the netpoll API to transmit kernel printks over UDP ml-mpm/Documentation/networking/netconsole.txt | 57 +++++++++++ ml-mpm/drivers/net/Kconfig | 7 + ml-mpm/drivers/net/Makefile | 1 ml-mpm/drivers/net/netconsole.c | 129 +++++++++++++++++++++++++ ml-mpm/net/Kconfig | 5 5 files changed, 196 insertions(+), 3 deletions(-) diff -puN -L net/core/netconsole.c /dev/null /dev/null diff -puN net/core/Makefile~netconsole net/core/Makefile diff -puN net/Kconfig~netconsole net/Kconfig --- ml/net/Kconfig~netconsole 2003-10-02 17:56:34.000000000 -0500 +++ ml-mpm/net/Kconfig 2003-10-02 17:56:34.000000000 -0500 @@ -671,11 +671,10 @@ source "net/irda/Kconfig" source "net/bluetooth/Kconfig" config NETPOLL - bool "Netpoll API" + def_bool NETCONSOLE config NETPOLL_RX - bool "Netpoll receive hooks" - depends on NETPOLL + def_bool NETCONSOLE config NETPOLL_TRAP bool "Netpoll traffic trapping" diff -puN /dev/null Documentation/networking/netconsole.txt --- /dev/null 2003-09-12 12:14:37.000000000 -0500 +++ ml-mpm/Documentation/networking/netconsole.txt 2003-10-02 17:56:34.000000000 -0500 @@ -0,0 +1,57 @@ + +started by Ingo Molnar , 2001.09.17 +2.6 port and netpoll api by Matt Mackall , Sep 9 2003 + +Please send bug reports to Matt Mackall + +This module logs kernel printk messages over UDP allowing debugging of +problem where disk logging fails and serial consoles are impractical. + +It can be used either built-in or as a module. As a built-in, +netconsole initializes immediately after NIC cards and will bring up +the specified interface as soon as possible. While this doesn't allow +capture of early kernel panics, it does capture most of the boot +process. + +It takes a string configuration parameter "netconsole" in the +following format: + + netconsole=[src-port]@[src-ip]/[],[tgt-port]@/[tgt-macaddr] + + where + src-port source for UDP packets (defaults to 6665) + src-ip source IP to use (interface address) + dev network interface (eth0) + tgt-port port for logging agent (6666) + tgt-ip IP address for logging agent + tgt-macaddr ethernet MAC address for logging agent (broadcast) + +Examples: + + linux netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc + + or + + insmod netconsole netconsole=@/,@10.0.0.2/ + +Built-in netconsole starts immediately after the TCP stack is +initialized and attempts to bring up the supplied dev at the supplied +address. + +The remote host can run either 'netcat -u -l -p ' or syslogd. + +WARNING: the default target ethernet setting uses the broadcast +ethernet address to send packets, which can cause increased load on +other systems on the same ethernet segment. + +NOTE: the network device (eth1 in the above case) can run any kind +of other network traffic, netconsole is not intrusive. Netconsole +might cause slight delays in other traffic if the volume of kernel +messages is high, but should have no other impact. + +Netconsole was designed to be as instantaneous as possible, to +enable the logging of even the most critical kernel bugs. It works +from IRQ contexts as well, and does not enable interrupts while +sending packets. Due to these unique needs, configuration can not +be more automatic, and some fundamental limitations will remain: +only IP networks, UDP packets and ethernet devices are supported. diff -puN drivers/net/Makefile~netconsole drivers/net/Makefile --- ml/drivers/net/Makefile~netconsole 2003-10-02 17:56:34.000000000 -0500 +++ ml-mpm/drivers/net/Makefile 2003-10-02 17:57:25.000000000 -0500 @@ -188,3 +188,4 @@ obj-$(CONFIG_NET_TULIP) += tulip/ obj-$(CONFIG_HAMRADIO) += hamradio/ obj-$(CONFIG_IRDA) += irda/ +obj-$(CONFIG_NETCONSOLE) += netconsole.o diff -puN drivers/net/Kconfig~netconsole drivers/net/Kconfig --- ml/drivers/net/Kconfig~netconsole 2003-10-02 17:56:34.000000000 -0500 +++ ml-mpm/drivers/net/Kconfig 2003-10-02 17:56:34.000000000 -0500 @@ -2455,6 +2455,13 @@ config SHAPER To compile this driver as a module, choose M here: the module will be called shaper. If unsure, say N. +config NETCONSOLE + tristate "Network console logging support" + depends on NETDEVICES + ---help--- + If you want to log kernel messages over the network, enable this. + See Documentation/networking/netconsole.txt for details. + source "drivers/net/wan/Kconfig" source "drivers/net/pcmcia/Kconfig" diff -puN /dev/null drivers/net/netconsole.c --- /dev/null 2003-09-12 12:14:37.000000000 -0500 +++ ml-mpm/drivers/net/netconsole.c 2003-10-02 17:56:34.000000000 -0500 @@ -0,0 +1,129 @@ +/* + * linux/drivers/net/netconsole.c + * + * Copyright (C) 2001 Ingo Molnar + * + * This file contains the implementation of an IRQ-safe, crash-safe + * kernel console implementation that outputs kernel messages to the + * network. + * + * Modification history: + * + * 2001-09-17 started by Ingo Molnar. + * 2003-08-11 2.6 port by Matt Mackall + * simplified options + * generic card hooks + * works non-modular + * 2003-09-07 rewritten with netpoll api + */ + +/**************************************************************** + * 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, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + ****************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MODULE_AUTHOR("Maintainer: Matt Mackall "); +MODULE_DESCRIPTION("Console driver for network interfaces"); +MODULE_LICENSE("GPL"); + +static char config[256]; +module_param_string(netconsole, config, 256, 0); +MODULE_PARM_DESC(netconsole, " netconsole=[src-port]@[src-ip]/[dev],[tgt-port]@/[tgt-macaddr]\n"); + +static void rx_hook(struct netpoll *np, int port, char *msg, int len); + +static struct netpoll np = { + .name = "netconsole", + .dev_name = "eth0", + .rx_hook = rx_hook, + .local_port = 6665, + .remote_port = 6666, + .remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, +}; + +#define MAX_PRINT_CHUNK 1000 + +static void write_msg(struct console *con, const char *msg, unsigned int len) +{ + int frag, left; + unsigned long flags; + + if (!np.dev) + return; + + local_irq_save(flags); + + for(left = len; left; ) { + frag = min(left, MAX_PRINT_CHUNK); + netpoll_send_udp(&np, msg, frag); + msg += frag; + left -= frag; + } + + local_irq_restore(flags); +} + +static void rx_hook(struct netpoll *np, int port, char *msg, int len) +{ + /* add sysrq support */ + printk("netconsole: no sysrq yet\n"); +} + +static struct console netconsole = { + .flags = CON_ENABLED | CON_PRINTBUFFER, + .write = write_msg +}; + +static int option_setup(char *opt) +{ + return netpoll_parse_options(&np, opt); +} + +__setup("netconsole=", option_setup); + +static int init_netconsole(void) +{ + if(strlen(config) && option_setup(config)) + return 1; + + if(!np.remote_ip || netpoll_setup(&np)) + return 1; + + register_console(&netconsole); + printk(KERN_INFO "netconsole: network logging started\n"); + return 0; +} + +static void cleanup_netconsole(void) +{ + unregister_console(&netconsole); + netpoll_cleanup(&np); +} + +module_init(init_netconsole); +module_exit(cleanup_netconsole); _ -- Matt Mackall : http://www.selenic.com : of or relating to the moon From mitch@sfgoth.com Thu Oct 2 19:17:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 19:17:58 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h932HO25007259 for ; Thu, 2 Oct 2003 19:17:24 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h932QG16043306; Thu, 2 Oct 2003 19:26:16 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h932QFLd043302; Thu, 2 Oct 2003 19:26:15 -0700 (PDT) (envelope-from mitch) Date: Thu, 2 Oct 2003 19:26:15 -0700 From: Mitchell Blank Jr To: "David S. Miller" Cc: chas3@users.sourceforge.net, chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-ID: <20031003022615.GA42593@gaz.sfgoth.com> References: <200310011134.h91BYPkT003172@ginger.cmf.nrl.navy.mil> <20031001054226.126cea7b.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031001054226.126cea7b.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 483 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev David S. Miller wrote: > Although, unless VCC connect can potentially sleep, it might > be better to keep exporting the rwlock and take it as a reader > instead of grabbing the rtnl semaphore. VCC connect can definately sleep - a good example is drirvers/usb/misc/speedtch.c but there are probably other ones. My personal recommendations: * There should be a per-atm-device semaphore held across calls into the driver's ->open, ->close, ->change_qos and maybe a couple other things to serialize those operations (for the sake of keeping the drivers sane - there's no reason there should be multiple operations pending) * The ATM layer shouldn't need to keep any other sorts of locks across calls into atm_dev->open or such. To avoid race conditions the ATM code needs to: 1. Take whatever internal spinlock it needs 2. Add the itf/vpi/vci tuple to whatever datastructure we're holding the vcc list in - but mark it as "inactive" so we don't find it while others are searching the list. Obviously the open will fail if we find a matching tuple (whether or not it was active) 3. Drop the spinlock 4. Take the per-device semaphore 5. Call atmdev->open 6. Drop the per-device semaphore 7. Re-take the internal spinlock 8. If open succeeded now mark the vcc as "active". If the open failed just delete it 9. Drop the internal spinlock To do a close the method is similar: 1. Take the internal spinlock 2. Find the tuple, mark it as inactive 3. Drop the spinlock 4. Take the per-device semaphore 5. Call atmdev->close 6. Drop the per-device semaphore 7. Re-take the internal spinlock 8. Delete vcc from the list 9. Drop the internal spinlock Then ->open and ->close can sleep like they need to but won't block other accesses to the list in the mean time. * If ATM_ITF_ANY is a pain to fix it should just be removed - it's basically a misfeature and is probably never used by anybody. I've already posted a patch to linux-atm-general that basically does this (it changes "ATM_ITF_ANY" to mean "first interface we find") -Mitch From jgarzik@pobox.com Thu Oct 2 19:20:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 19:20:57 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h932KM25007608 for ; Thu, 2 Oct 2003 19:20:23 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:35554 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A57YV-0005f4-J0; Thu, 02 Oct 2003 18:47:59 +0100 Message-ID: <3F7C64BC.7030701@pobox.com> Date: Thu, 02 Oct 2003 13:47:40 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robert Olsson , Andrew Morton CC: netdev@oss.sgi.com, dfages@arkoon.net Subject: Re: Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP References: <20030929123734.5bd97a47.akpm@osdl.org> <16248.41796.797321.700866@robur.slu.se> <3F78A691.1040406@pobox.com> <16252.17618.866515.952549@robur.slu.se> In-Reply-To: <16252.17618.866515.952549@robur.slu.se> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 484 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 Robert Olsson wrote: > > Jeff Garzik writes: > > > > If someone had a NAPI patch for tulip, we could remove HW_FLOWCONTROL > > option altogether :) > > Hello! > Here is something for 2.6.0-test6: > > * ifdef's to keep current non-NAPI tulip intact > > * Port based on Alexey's orig NAPI tulip design > (Only RX handled by dev->poll) > > * tulip HW_FLOW removed > > * NAPI and HW-mitigation options in Kconfig Looks great to me. I'll give it some testing here, and 99% likely will apply it. Andrew, would you be willing to merge this into -mm for some simultaneous netwide testing? FWIW, I seem to recall that the older NAPI patch you sent didn't apply for some reason. But forget about that, this one looks good. Jeff From mitch@sfgoth.com Thu Oct 2 19:25:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 19:26:10 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h932Pa25007969 for ; Thu, 2 Oct 2003 19:25:36 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h932YW16044036; Thu, 2 Oct 2003 19:34:32 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h932YVZs044035; Thu, 2 Oct 2003 19:34:31 -0700 (PDT) (envelope-from mitch) Date: Thu, 2 Oct 2003 19:34:31 -0700 From: Mitchell Blank Jr To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] skbuff more likely/unlikely Message-ID: <20031003023431.GC42593@gaz.sfgoth.com> References: <20031002102420.6e1cece9.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031002102420.6e1cece9.shemminger@osdl.org> User-Agent: Mutt/1.4.1i X-archive-position: 485 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev Stephen Hemminger wrote: > A couple more places where we can help by hinting the compiler > for 2.6.0-test6. If we are pulling off header, is is likely there; > and skb alloc's succeed in the normal case. > > Thought I saw an earlier similar patch, but here is my take on it. Yes, my patch from a couple weeks ago does the same thing (but also did a lot in skbuff.c) I haven't had a chance to rediff and test after the const parts went in. Do you want to adopt the rest of the changes? Original patch: http://oss.sgi.com/projects/netdev/archive/2003-09/msg00036.html -Mitch From davem@pizda.ninka.net Thu Oct 2 23:44:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 02 Oct 2003 23:45:31 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h936iv25023492 for ; Thu, 2 Oct 2003 23:44:57 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA22163; Thu, 2 Oct 2003 23:40:36 -0700 Date: Thu, 2 Oct 2003 23:40:36 -0700 From: "David S. Miller" To: Steve Modica Cc: netdev@oss.sgi.com Subject: Re: mod_timer improvement Message-Id: <20031002234036.704c4588.davem@redhat.com> In-Reply-To: <3F7C5D22.7010103@sgi.com> References: <3F7C5863.1080403@sgi.com> <3F7C5D22.7010103@sgi.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 486 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 On Thu, 02 Oct 2003 12:15:14 -0500 Steve Modica wrote: > D'OH! Sorry about the formatting. I think this is better: Probably the networking development list isn't the place to post patches that modify generic code such as the timer stuff you are modifying here. From ak@suse.de Fri Oct 3 00:10:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 00:10:37 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h937A125025700 for ; Fri, 3 Oct 2003 00:10:01 -0700 Received: from Hermes.suse.de (Hermes.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 5C3DE169D750; Fri, 3 Oct 2003 09:09:55 +0200 (CEST) Date: Fri, 3 Oct 2003 09:09:54 +0200 From: Andi Kleen To: Matt Mackall Cc: netdev@oss.sgi.com, Andrew Morton , Jeff Garzik Subject: Re: [RFC] [PATCH 1/3] netpoll api Message-ID: <20031003070954.GE25013@wotan.suse.de> References: <20031003014104.GR1897@waste.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031003014104.GR1897@waste.org> X-archive-position: 487 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 > The second patch is an example of implementing the poll_controller > hook needed to get a card to work with netpoll. Numerous other examples > are in -mm and recent Red Hat kernels. SuSE/UL kernels also have support for some chips. -Andi From davem@pizda.ninka.net Fri Oct 3 00:15:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 00:16:24 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h937Fm25026294 for ; Fri, 3 Oct 2003 00:15:49 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA22289; Fri, 3 Oct 2003 00:11:28 -0700 Date: Fri, 3 Oct 2003 00:11:28 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: ak@suse.de, netdev@oss.sgi.com Subject: Re: [PATCH] consolidate skb delivery Message-Id: <20031003001128.587ac102.davem@redhat.com> In-Reply-To: <20031002124345.7b34bf24.shemminger@osdl.org> References: <20031002102133.7285b5ee.shemminger@osdl.org> <20031002192546.GA29673@wotan.suse.de> <20031002124345.7b34bf24.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 488 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 On Thu, 2 Oct 2003 12:43:45 -0700 Stephen Hemminger wrote: > On Thu, 2 Oct 2003 21:25:46 +0200 > Andi Kleen wrote: > > > Are there even any old style protocols left? If not you could just make > > it BUG() > > > > bpqether,lapbether,ipconfig, and econet are still old style. I would suggest we eliminate support for old style protocols now. We can do that by making the ptype registry in net/core/dev.c fail if the thing being registered is old-style. I'll code this up. If we don't kill support for old-style protocols now, we can end up being stuck supporting it throughout 2.6.x which I'd like to avoid. I'll apply Stephen's patch here. From davem@pizda.ninka.net Fri Oct 3 00:23:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 00:24:11 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h937Na25030065 for ; Fri, 3 Oct 2003 00:23:36 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA22352; Fri, 3 Oct 2003 00:19:16 -0700 Date: Fri, 3 Oct 2003 00:19:16 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] skbuff more likely/unlikely Message-Id: <20031003001916.570546c4.davem@redhat.com> In-Reply-To: <20031003023431.GC42593@gaz.sfgoth.com> References: <20031002102420.6e1cece9.shemminger@osdl.org> <20031003023431.GC42593@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 489 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 On Thu, 2 Oct 2003 19:34:31 -0700 Mitchell Blank Jr wrote: > Stephen Hemminger wrote: > > A couple more places where we can help by hinting the compiler > > for 2.6.0-test6. If we are pulling off header, is is likely there; > > and skb alloc's succeed in the normal case. > > > > Thought I saw an earlier similar patch, but here is my take on it. > > Yes, my patch from a couple weeks ago does the same thing (but also > did a lot in skbuff.c) I haven't had a chance to rediff and test > after the const parts went in. Do you want to adopt the rest of the > changes? I applied Stephen's patch here, you can post something relative to that if you like. From davem@pizda.ninka.net Fri Oct 3 00:46:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 00:46:38 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h937k225032151 for ; Fri, 3 Oct 2003 00:46:02 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA22401; Fri, 3 Oct 2003 00:41:33 -0700 Date: Fri, 3 Oct 2003 00:41:33 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: modica@sgi.com, netdev@oss.sgi.com Subject: Re: do_gettimeofday Message-Id: <20031003004133.3148c39a.davem@redhat.com> In-Reply-To: <20031002125625.72b8c0a7.shemminger@osdl.org> References: <3F7C6F3B.6070502@sgi.com> <20031002125625.72b8c0a7.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 490 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 On Thu, 2 Oct 2003 12:56:25 -0700 Stephen Hemminger wrote: > It might be possible to introduce a per-cpu monotonic clock that is lockless > for use in network code, but that is a moderately painful undertaking which > is beyond the scope of getting 2.6.0 out. Yes, this issue is well known and it gets brought up again from time to time. And it's by no means just SO_TIMESTAMP that uses the skb->stamp values, even IPV4/IPV6 fragmentation uses these things. The SunRPC and RXRPC layers use it as well. It really is an arch-specific issue of how to "optimize" this the best, that's why it's hard to decide what the interface is that an arch needs to provide. But at the base I say we need three things: 1) Some kind of fast_timestamp_t, the property is that this stores enough information at time "T" such that at time "T + something" the fast_timestamp_t can be converted what the timeval was back at time "T". For networking, make skb->stamp into this type. 2) store_fast_timestamp(fast_timestamp_t *) For networking, change do_gettimeofday(&skb->stamp) into store_fast_timestamp(&skb->stamp) 3) fast_timestamp_to_timeval(arch_timestamp_t *, struct timeval *) For networking, change things that read the skb->stamp value into calls to fast_timestamp_to_timeval(). It is defined that the timeval given by fast_timestamp_to_timeval() needs to be the same thing that do_gettimeofday() would have recorded at the time store_fast_timestamp() was called. Here is the default generic implementation that would go into asm-generic/faststamp.h: 1) fast_timestamp_t is struct timeval 2) store_fast_timestamp() is gettimeofday() 3) fast_timestamp_to_timeval() merely copies the fast_timestamp_t into the passed in timeval. And here is how an example implementation could work on sparc64: 1) fast_timestamp_t is a u64 2) store_fast_timestamp() reads the cpu cycle counter 3) fast_timestamp_to_timeval() records the difference between the current cpu cycle counter and the one recorded, it takes a sample of the current xtime value and adjusts it accordingly to account for the cpu cycle counter difference. This only works because sparc64's cpu cycle counters are synchronized across all cpus, they increase monotonically, and are guarenteed not to overflow for at least 10 years. Alpha, for example, cannot do it this way because it's cpu cycle counter register overflows too quickly to be useful. Platforms with inter-cpu TSC synchronization issues will have some troubles doing the same trick too, because one must handle properly the case where the fast timestamp is converted to a timeval on a different cpu on which the fast timestamp was recorded. Regardless, we could put the infrastructure in there now and arch folks can work on implementations. The generic implementation code, which is what everyone will end up with at first, will cancel out to what we have currently. This is a pretty powerful idea that could be applied to other places, not just the networking. From mitch@sfgoth.com Fri Oct 3 01:17:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 01:18:18 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h938Hg25002544 for ; Fri, 3 Oct 2003 01:17:42 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h938Qg16053396; Fri, 3 Oct 2003 01:26:42 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h938QgYj053395; Fri, 3 Oct 2003 01:26:42 -0700 (PDT) (envelope-from mitch) Date: Fri, 3 Oct 2003 01:26:42 -0700 From: Mitchell Blank Jr To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: do_gettimeofday Message-ID: <20031003082642.GF42593@gaz.sfgoth.com> References: <3F7C6F3B.6070502@sgi.com> <20031002125625.72b8c0a7.shemminger@osdl.org> <20031003004133.3148c39a.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031003004133.3148c39a.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 491 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev David S. Miller wrote: > 3) fast_timestamp_to_timeval(arch_timestamp_t *, struct timeval *) > > For networking, change things that read the skb->stamp value > into calls to fast_timestamp_to_timeval(). Are there any common cases where skb->stamp is looked at more than once? If so I might recommend changing the API to be more like: const struct timeval *skb_timestamp(struct skbuff *skb); where the generic form would just be: typedef struct { struct timeval tv; } fast_timestamp_t; static inline const struct timeval *skb_timestamp(struct skbuff *skb) { return &skb->faststamp.tv; } ...but an arch could accelerate it with: typedef struct { union { struct timeval tv; u64 tsc; } int is_converted; } fast_timestamp_t; /* Caller must be sure we have exclusive ownership of this skbuff */ const struct timeval *skb_timestamp(struct skbuff *skb) { if (!skb->faststamp.is_converted) { tsc_to_timeval(&skb->faststamp.tv, skb->faststamp.tsc); skb->faststamp.is_converted = 1; } return &skb->faststamp.tv; } If we could hide "is_converted" as a flag somewhere else this would have zero storage penalty (since most archs would have a fast-stamp at least as big as a timeval) I dunno, just an idea. > Platforms with inter-cpu TSC synchronization issues will have some > troubles doing the same trick too, because one must handle properly > the case where the fast timestamp is converted to a timeval on a different > cpu on which the fast timestamp was recorded. Yeah, you'd probably have something like typedef struct { union { struct timeval tv; struct { u64 tsc; #ifdef CONFIG_SMP unsigned int cpu_id; #endif /* CONFIG_SMP */ } fast; } int is_converted; } fast_timestamp_t; And then skb_timestamp() would have to rummage around in the per-cpu timer state for whatever processor started the packet. (This is why I thought it might be good to cache the result - you don't want to thrash those cachelines more than once if you can help it) -Mitch From davem@pizda.ninka.net Fri Oct 3 01:32:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 01:32:50 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h938WF25003855 for ; Fri, 3 Oct 2003 01:32:15 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA22654; Fri, 3 Oct 2003 01:27:54 -0700 Date: Fri, 3 Oct 2003 01:27:54 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: netdev@oss.sgi.com Subject: Re: do_gettimeofday Message-Id: <20031003012754.23de3f66.davem@redhat.com> In-Reply-To: <20031003082642.GF42593@gaz.sfgoth.com> References: <3F7C6F3B.6070502@sgi.com> <20031002125625.72b8c0a7.shemminger@osdl.org> <20031003004133.3148c39a.davem@redhat.com> <20031003082642.GF42593@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 492 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 On Fri, 3 Oct 2003 01:26:42 -0700 Mitchell Blank Jr wrote: > Are there any common cases where skb->stamp is looked at more than > once? Yes, the packet scheduler can cause this to happen. >If so I might recommend changing the API to be more like: > > const struct timeval *skb_timestamp(struct skbuff *skb); Please no, making this a SKB or networking specific interface make it nearly valueless and we might as well just stay with the stuff we have. > > Platforms with inter-cpu TSC synchronization issues will have some > > troubles doing the same trick too, because one must handle properly > > the case where the fast timestamp is converted to a timeval on a different > > cpu on which the fast timestamp was recorded. > > Yeah, you'd probably have something like Doesn't work as-is. You'd have to not only store the timestamp and the cpu it was stored on, but also cross-call to that cpu to compute the correct timeval. That's really expensive and probably do_gettimeofday() is going to be faster in the long run compared to such a scheme. From mitch@sfgoth.com Fri Oct 3 01:39:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 01:40:23 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h938dm25004673 for ; Fri, 3 Oct 2003 01:39:48 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h938mm16054045; Fri, 3 Oct 2003 01:48:48 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h938mlVC054044; Fri, 3 Oct 2003 01:48:47 -0700 (PDT) (envelope-from mitch) Date: Fri, 3 Oct 2003 01:48:47 -0700 From: Mitchell Blank Jr To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: do_gettimeofday Message-ID: <20031003084847.GH42593@gaz.sfgoth.com> References: <3F7C6F3B.6070502@sgi.com> <20031002125625.72b8c0a7.shemminger@osdl.org> <20031003004133.3148c39a.davem@redhat.com> <20031003082642.GF42593@gaz.sfgoth.com> <20031003012754.23de3f66.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031003012754.23de3f66.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 493 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev David S. Miller wrote: > Doesn't work as-is. You'd have to not only store the timestamp and > the cpu it was stored on, but also cross-call to that cpu to compute > the correct timeval. That's definately the worst case. You could have each CPU periodically store its current {tsc,timeval} tuple in a per-cpu location and extrapolate from that. > That's really expensive and probably > do_gettimeofday() is going to be faster in the long run compared to > such a scheme. It all depends on what percentage of skb's have ->stamp computed on a CPU different from the one they came it on. For the common users of ->stamp won't they have stayed on the same CPU? The worst case of doing a cross-cpu-call should only happen relatively rarely. -Mitch From davem@pizda.ninka.net Fri Oct 3 01:56:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 01:57:14 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h938ue25006082 for ; Fri, 3 Oct 2003 01:56:41 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA22729; Fri, 3 Oct 2003 01:52:20 -0700 Date: Fri, 3 Oct 2003 01:52:20 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: netdev@oss.sgi.com Subject: Re: do_gettimeofday Message-Id: <20031003015220.7ee6e451.davem@redhat.com> In-Reply-To: <20031003084847.GH42593@gaz.sfgoth.com> References: <3F7C6F3B.6070502@sgi.com> <20031002125625.72b8c0a7.shemminger@osdl.org> <20031003004133.3148c39a.davem@redhat.com> <20031003082642.GF42593@gaz.sfgoth.com> <20031003012754.23de3f66.davem@redhat.com> <20031003084847.GH42593@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 494 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 On Fri, 3 Oct 2003 01:48:47 -0700 Mitchell Blank Jr wrote: > David S. Miller wrote: > > Doesn't work as-is. You'd have to not only store the timestamp and > > the cpu it was stored on, but also cross-call to that cpu to compute > > the correct timeval. > > That's definately the worst case. You could have each CPU periodically > store its current {tsc,timeval} tuple in a per-cpu location and extrapolate > from that. Right, that would work. There is the weird issue (with both the sparc64 example and your's here) of whether we should care about what happens when settimeofday() occurs. We probably shouldn't worry about it... as it gives weird results even currently. > It all depends on what percentage of skb's have ->stamp computed on a > CPU different from the one they came it on. For the common users of > ->stamp won't they have stayed on the same CPU? The worst case of > doing a cross-cpu-call should only happen relatively rarely. No, they typically won't. The packet comes in on cpu X, we stamp it on X, and we do a wakeup of tcpdump which will typically get scheduled first onto some other processor before X is done processing incoming packets. The higher the packet load the more likely this will happen. But forget this, as your dual tsc+timeval recording idea would work well and doesn't need a cross-cpu call. Although we'd need to think about how costly the cacheline activity is going to be with your idea compared to the seqlocked accesses to xtime. This is mainly a product of how often you intend to update the tsc+timeval thingy. From mitch@sfgoth.com Fri Oct 3 02:17:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 02:17:53 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h939HH25007993 for ; Fri, 3 Oct 2003 02:17:17 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h939QH16055146; Fri, 3 Oct 2003 02:26:18 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h939QH8k055145; Fri, 3 Oct 2003 02:26:17 -0700 (PDT) (envelope-from mitch) Date: Fri, 3 Oct 2003 02:26:17 -0700 From: Mitchell Blank Jr To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: do_gettimeofday Message-ID: <20031003092617.GI42593@gaz.sfgoth.com> References: <3F7C6F3B.6070502@sgi.com> <20031002125625.72b8c0a7.shemminger@osdl.org> <20031003004133.3148c39a.davem@redhat.com> <20031003082642.GF42593@gaz.sfgoth.com> <20031003012754.23de3f66.davem@redhat.com> <20031003084847.GH42593@gaz.sfgoth.com> <20031003015220.7ee6e451.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031003015220.7ee6e451.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 495 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev David S. Miller wrote: > There is the weird issue (with both the sparc64 example and your's > here) of whether we should care about what happens when settimeofday() > occurs. We probably shouldn't worry about it... as it gives weird > results even currently. Nah. If anything you'll get better results since you're computing the timeval later. This is another argument for caching the computation though - otherwise a settimeofday() could cause the packet timestamp to change drasically from one observation to the next :-) > > The worst case of > > doing a cross-cpu-call should only happen relatively rarely. > > No, they typically won't. The packet comes in on cpu X, we stamp > it on X, and we do a wakeup of tcpdump which will typically get > scheduled first onto some other processor before X is done processing > incoming packets. The higher the packet load the more likely this will > happen. I was more thinking about the other timestamp users. I don't consider tcpdump something that needs as much optimization. If we really wanted to we could have set a per-interface flag that says "someone will want the timestamp so compute it in the bh while we're still on the same processor" But see below - there probably isn't much cost anyways... > This is mainly a product > of how often you intend to update the tsc+timeval thingy. You could compute it relatively frequently and then only actually copy it to the hot cacheline if its diverged significantly from whats there. This would make the writes almost never happen (maybe once a minute) -Mitch From davem@pizda.ninka.net Fri Oct 3 02:27:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 02:28:31 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h939Rw25009594 for ; Fri, 3 Oct 2003 02:27:59 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22858; Fri, 3 Oct 2003 02:23:38 -0700 Date: Fri, 3 Oct 2003 02:23:38 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: netdev@oss.sgi.com Subject: Re: do_gettimeofday Message-Id: <20031003022338.6ffed45d.davem@redhat.com> In-Reply-To: <20031003092617.GI42593@gaz.sfgoth.com> References: <3F7C6F3B.6070502@sgi.com> <20031002125625.72b8c0a7.shemminger@osdl.org> <20031003004133.3148c39a.davem@redhat.com> <20031003082642.GF42593@gaz.sfgoth.com> <20031003012754.23de3f66.davem@redhat.com> <20031003084847.GH42593@gaz.sfgoth.com> <20031003015220.7ee6e451.davem@redhat.com> <20031003092617.GI42593@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 496 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 On Fri, 3 Oct 2003 02:26:17 -0700 Mitchell Blank Jr wrote: > I was more thinking about the other timestamp users. I don't consider > tcpdump something that needs as much optimization. Well, it's is the fact that usage of the timestamp is rare which we're trying to take advantage of. The whole idea is that fast_timestamp_to_timeval() can be a bit slow or suboptimal in order to make store_fast_timestamp() a lot faster or access less shared or locked state. From davem@pizda.ninka.net Fri Oct 3 02:52:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 02:53:07 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h939qQ25013731 for ; Fri, 3 Oct 2003 02:52:27 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22927; Fri, 3 Oct 2003 02:48:05 -0700 Date: Fri, 3 Oct 2003 02:48:05 -0700 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6 SCTP updates. Message-Id: <20031003024805.5bd85a56.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 497 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 On Thu, 2 Oct 2003 16:46:06 -0700 (PDT) Sridhar Samudrala wrote: > Please do a > bk pull http://linux-lksctp.bkbits.net/lksctp-2.5 > to get the following udpates to SCTP on top of linux 2.6.0-test6 > > The changesets include fixes for a couple of arch specific issues with ppc64 > and parisc64, few ADDIP extension related patches and a bug fix. Pulled, thanks a lot Sridhar. From ookhoi@humilis.net Fri Oct 3 03:30:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 03:30:58 -0700 (PDT) Received: from favonius.humilis.net (ookhoi.xs4all.nl [213.84.114.66]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93AUL25015452 for ; Fri, 3 Oct 2003 03:30:22 -0700 Received: by favonius.humilis.net (Postfix, from userid 1000) id 29F53AFF81; Fri, 3 Oct 2003 12:30:25 +0200 (CEST) Date: Fri, 3 Oct 2003 12:30:25 +0200 From: Ookhoi To: Florian Zwoch Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction Message-ID: <20031003103025.GA20676@favonius> Reply-To: ookhoi@humilis.net References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline In-Reply-To: X-Uptime: 10:31:59 up 116 days, 9:57, 36 users, load average: 2.21, 1.96, 1.94 User-Agent: Mutt/1.5.4i X-archive-position: 498 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ookhoi@humilis.net Precedence: bulk X-list: netdev --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Florian and others, Florian Zwoch wrote (ao): > issue seems to partly solved. the e1000 driver seems to be ok! > i reconfigured my kernel and intentionally left out netfilter options. > after that my network performance was back to normal. > > netfilter was only compiled in the kernel. it was not used with any rules! > > so my wild guess would be that something with the netfilter code (i am > not 100% sure it was netfilter.. _maybe_ it was some small odd kernel > option i accidently enabled/disabled) is broken since test3 (again > uncertified. but i firstly noticed this switching from test3 to test4). I have the same problem with a dual port gigabit intel nic. Download is very fast, upload around 40k/sec. Kernel is 2.6.0-test6 Nic is dual port gigabit intel 82546EB The nic is connected to a 100Mbit switch, only one port in use. If I do 'ethtool -A eth0 tx on' the machine is offline for 50 seconds. When it is back online the upload is fast for a few seconds, and then returns to its old speed. Full 'ethtool -d eth0' output below. I have netfilter enabled, and will try another -test6 kernel with netfilter not compiled in to see if that indeed makes a difference. Btw, I had to compile the e1000 driver as a module. Compiled in it doesn't work, as is stated on the intel support page: http://www.intel.com/support/network/adapter/1000/linux/e1000.htm " This driver is only supported as a loadable module at this time. Intel is not supplying patches against the kernel source to allow for static linking of the driver." This is not clear from the kernel config help. A patch against 2.6.0-test6 is attached (I don't know how to only give n/m as an option). Btw2, can somebody please explain what the option E1000_NAPI does? " Use Rx Polling (NAPI) (E1000_NAPI) [N/y] (NEW) ? Sorry, no help available for this option yet. " Thanks in advance. ethtool -d eth0 gives: MAC Registers ------------- 0x00000: CTRL (Device control register) 0x08F00249 Duplex: full Endian mode (buffers): little Link reset: reset Set link up: 1 Invert Loss-Of-Signal: no Receive flow control: enabled Transmit flow control: disabled VLAN mode: disabled Auto speed detect: disabled Speed select: 1000Mb/s Force speed: no Force duplex: no 0x00008: STATUS (Device status register) 0x0000BB43 Duplex: full Link up: link config TBI mode: disabled Link speed: 100Mb/s Bus type: PCI-X Bus speed: 133MHz Bus width: 64-bit 0x00100: RCTL (Receive control register) 0x00008002 Receiver: enabled Store bad packets: disabled Unicast promiscuous: disabled Multicast promiscuous: disabled Long packet: disabled Descriptor minimum threshold size: 1/2 Broadcast accept mode: accept VLAN filter: disabled Cononical form indicator: disabled Discard pause frames: filtered Pass MAC control frames: don't pass Receive buffer size: 2048 0x02808: RDLEN (Receive desc length) 0x00001000 0x02810: RDH (Receive desc head) 0x00000014 0x02818: RDT (Receive desc tail) 0x00000010 0x02820: RDTR (Receive delay timer) 0x00000000 0x00400: TCTL (Transmit ctrl register) 0x0004010A Transmitter: enabled Pad short packets: enabled Software XOFF Transmission: disabled Re-transmit on late collision: disabled 0x03808: TDLEN (Transmit desc length) 0x00001000 0x03810: TDH (Transmit desc head) 0x000000DC 0x03818: TDT (Transmit desc tail) 0x000000DC 0x03820: TIDV (Transmit delay timer) 0x00000040 --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="e1000-help-patch.diff" --- drivers/net/Kconfig.orig 2003-10-03 12:17:48.000000000 +0200 +++ drivers/net/Kconfig 2003-10-03 12:27:56.000000000 +0200 @@ -1876,9 +1876,12 @@ More specific information on configuring the driver is in . - To compile this driver as a module, choose M here and read - . The module - will be called e1000. + This driver is only supported as a loadable module at this + time. Intel is not supplying patches against the kernel source + to allow for static linking of the driver. + + Read . The + module will be called e1000. config E1000_NAPI bool "Use Rx Polling (NAPI)" --3MwIy2ne0vdjdPXF-- From hadi@cyberus.ca Fri Oct 3 04:09:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 04:10:28 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93B9r25016898 for ; Fri, 3 Oct 2003 04:09:54 -0700 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.12) id 1A5Nol-000G2V-00; Fri, 03 Oct 2003 07:09:51 -0400 Subject: Re: [RFC] [PATCH 1/3] netpoll api From: jamal Reply-To: hadi@cyberus.ca To: Matt Mackall Cc: netdev@oss.sgi.com, Andrew Morton , Jeff Garzik In-Reply-To: <20031003014104.GR1897@waste.org> References: <20031003014104.GR1897@waste.org> Content-Type: text/plain Organization: jamalopolis Message-Id: <1065179359.1031.42.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Oct 2003 07:09:20 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 499 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 Hi, On Thu, 2003-10-02 at 21:41, Matt Mackall wrote: > This patch implements a new netpoll API, which allows sending and > receiving packets in context where interrupts may be disabled. It > provides a common API for implementing features like netconsole, > netdump/LKCD, and kgdb-over-ethernet and manages to isolate them > almost completely from the details of the network layer. > Nice. Is the ethernet card in a case like this almost dedicated for this kind of work? Is disable_irq() in the controller safe for shared irqs? Or maybe this is critical enough that you dont care? Its a little wasteful to call the controller when there are is no work to be done; we have found in NAPI that any extra PCI transactions cost. (some IBM people doing benchmarking have complained about specweb not looking good where NAPI will have one extra PCI transaction per packet. You do it twice the rate NAPI would do it at low speeds). Again, the answer maybe who cares, this is critical work. Have you done any measurements to check whether it was worthwile to do the skb preallocation? cheers, jamal From yasuyuki.kozakai@toshiba.co.jp Fri Oct 3 04:21:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 04:22:08 -0700 (PDT) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93BLX25020146 for ; Fri, 3 Oct 2003 04:21:34 -0700 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id h93BJAF1024693; Fri, 3 Oct 2003 20:19:10 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id h93BJAPr009093; Fri, 3 Oct 2003 20:19:10 +0900 (JST) Received: from tis2 [133.199.160.66] by tsb-wall.toshiba.co.jp with SMTP id WAA09089 ; Fri, 3 Oct 2003 20:19:10 +0900 Received: from mx2.toshiba.co.jp by tis2.tis.toshiba.co.jp id UAA18460; Fri, 3 Oct 2003 20:19:09 +0900 (JST) Received: by toshiba.co.jp id UAA11088; Fri, 3 Oct 2003 20:19:08 +0900 (JST) Date: Fri, 03 Oct 2003 20:19:07 +0900 (JST) Message-Id: <200310031119.UAA11088@toshiba.co.jp> To: laforge@netfilter.org Cc: yasuyuki.kozakai@toshiba.co.jp, coreteam@netfilter.org, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [Patch]: IPv6 Connection Tracking From: Yasuyuki Kozakai In-Reply-To: <20030925092806.GC5758@sunbeam.de.gnumonks.org> References: <200309250521.OAA29293@toshiba.co.jp> <20030925092806.GC5758@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: 500 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 Hi, Harald, Sorry for the late reply. From: Harald Welte Date: Thu, 25 Sep 2003 11:28:06 +0200 > To summarize, I see the following options: > > 1) submit ip6_conntrack to the 2.6.x kernel > We would then need somebody committe to maintaining it, assuring > it keeps in sync with the work done on ip_conntrack. I do not want > to put the burden of ip_conntrack / ip6_conntrack synchronization on > everybody who submits patches/bugfixes/... > > 2) keep ip6_conntrack in patch-o-matic and start work on a l3 > independent conntrack system. > This would give more users to the code, since most advanced > netfilter users are using patch-o-matic anyway. I select 2), too. Harald, Could you add my patch to patch-o-matic ? Regards, ---------------------------------------- Yasuyuki KOZAKAI Communication Platform Laboratory, Corporate Research & Development Center, Toshiba Corporation yasuyuki.kozakai@toshiba.co.jp ---------------------------------------- From modica@sgi.com Fri Oct 3 05:09:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 05:09:57 -0700 (PDT) Received: from zok.sgi.com (zok.SGI.COM [204.94.215.101]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93C9K25020976 for ; Fri, 3 Oct 2003 05:09:20 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by zok.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h93C9Fq0007918 for ; Fri, 3 Oct 2003 05:09:15 -0700 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h93C9Ecc11932428 for ; Fri, 3 Oct 2003 07:09:14 -0500 (CDT) Received: from sgi.com (cf-vpn-sw-corp-64-11.corp.sgi.com [134.15.64.11]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h93C9ERn233151279 for ; Fri, 3 Oct 2003 07:09:14 -0500 (CDT) Message-ID: <3F7D675D.4000905@sgi.com> Date: Fri, 03 Oct 2003 07:11:09 -0500 From: Steve Modica User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Linking interfaces to slots Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 501 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev Hi All, If one wanted to figure out which ethX was in which PCI slot on which bus, what would be the most acceptable mechanism? The drivers have access to all this info, but then each driver would need some ioctl added. Is there some more generic place in the kernel that could be modified such that /proc/net/dev could hold this information? Steve From ookhoi@humilis.net Fri Oct 3 05:23:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 05:24:11 -0700 (PDT) Received: from favonius.humilis.net (ookhoi.xs4all.nl [213.84.114.66]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93CNU25021469 for ; Fri, 3 Oct 2003 05:23:32 -0700 Received: by favonius.humilis.net (Postfix, from userid 1000) id 5715993514; Fri, 3 Oct 2003 14:23:29 +0200 (CEST) Date: Fri, 3 Oct 2003 14:23:29 +0200 From: Ookhoi To: Ookhoi Cc: Florian Zwoch , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction Message-ID: <20031003122329.GA21532@favonius> Reply-To: ookhoi@humilis.net References: <20031003103025.GA20676@favonius> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031003103025.GA20676@favonius> X-Uptime: 12:41:52 up 116 days, 12:08, 38 users, load average: 1.00, 1.00, 1.00 User-Agent: Mutt/1.5.4i X-archive-position: 502 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ookhoi@humilis.net Precedence: bulk X-list: netdev Ookhoi wrote (ao): > Florian Zwoch wrote (ao): > > issue seems to partly solved. the e1000 driver seems to be ok! > > i reconfigured my kernel and intentionally left out netfilter options. > > after that my network performance was back to normal. > > > > netfilter was only compiled in the kernel. it was not used with any rules! > > > > so my wild guess would be that something with the netfilter code (i am > > not 100% sure it was netfilter.. _maybe_ it was some small odd kernel > > option i accidently enabled/disabled) is broken since test3 (again > > uncertified. but i firstly noticed this switching from test3 to test4). > I have netfilter enabled, and will try another -test6 kernel with > netfilter not compiled in to see if that indeed makes a difference. I can confirm now that disabling netfilter in 2.6.0-test6 makes the nic perform oke wrt upload. I (just like Florian) had no iptables rules active in the former 2.6.0-test6 kernel, but netfilter was compiled in. From david-b@pacbell.net Fri Oct 3 06:30:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 06:31:25 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93DUm25022513 for ; Fri, 3 Oct 2003 06:30:48 -0700 Received: from pacbell.net (ppp-67-118-247-247.dialup.pltn13.pacbell.net [67.118.247.247]) by mta7.pltn13.pbi.net (8.12.9/8.12.3) with ESMTP id h93DUl1R018123; Fri, 3 Oct 2003 06:30:47 -0700 (PDT) Message-ID: <3F7D7B89.7090406@pacbell.net> Date: Fri, 03 Oct 2003 06:37:13 -0700 From: David Brownell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en, fr MIME-Version: 1.0 To: Steve Modica CC: netdev@oss.sgi.com Subject: Re: Linking interfaces to slots References: <3F7D675D.4000905@sgi.com> In-Reply-To: <3F7D675D.4000905@sgi.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 503 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david-b@pacbell.net Precedence: bulk X-list: netdev Steve Modica wrote: > > If one wanted to figure out which ethX was in which PCI slot on which > bus, what would be the most acceptable mechanism? The drivers have > access to all this info, but then each driver would need some ioctl > added. Is there some more generic place in the kernel that could be > modified such that /proc/net/dev could hold this information? On 2.6 there's /sys/class/net/ethX/device, and ethtool_drvinfo.bus_info support should exist too... - Dave From lxie@us.ibm.com Fri Oct 3 06:39:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 06:40:26 -0700 (PDT) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93Ddr25022936; Fri, 3 Oct 2003 06:39:54 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h93Ddl67226034; Fri, 3 Oct 2003 09:39:47 -0400 Received: from d03nm691.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h93DdkBq164232; Fri, 3 Oct 2003 07:39:47 -0600 Subject: Re: Linking interfaces to slots To: Steve Modica Cc: netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: Linda Xie Date: Fri, 3 Oct 2003 08:39:44 -0500 X-MIMETrack: Serialize by Router on D03NM691/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 10/03/2003 07:39:46 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 504 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lxie@us.ibm.com Precedence: bulk X-list: netdev Those information can be obtained by ls -l /sys/class/net/ethX. Here is a example: bigboylp4:/home/linda # ls -l /sys/class/net/eth* /sys/class/net/eth0: total 0 drwxr-xr-x 3 root root 0 2003-10-02 18:52 . drwxr-xr-x 6 root root 0 2003-10-02 18:52 .. -r--r--r-- 1 root root 4096 2003-10-02 18:52 addr_len -r--r--r-- 1 root root 4096 2003-10-02 18:52 address -r--r--r-- 1 root root 4096 2003-10-02 18:52 broadcast lrwxrwxrwx 1 root root 53 2003-10-02 18:52 device -> ../../../devices/pci0005:00/0005:00:0b.2/0005:21:01.0 <-- pci dev lrwxrwxrwx 1 root root 29 2003-10-02 18:52 driver -> ../../../bus/pci/drivers/e100 -r--r--r-- 1 root root 4096 2003-10-02 18:52 features -rw-r--r-- 1 root root 4096 2003-10-02 18:52 flags -r--r--r-- 1 root root 4096 2003-10-02 18:52 ifindex -r--r--r-- 1 root root 4096 2003-10-02 18:52 iflink -rw-r--r-- 1 root root 4096 2003-10-02 18:52 mtu drwxr-xr-x 2 root root 0 2003-10-02 18:52 statistics -rw-r--r-- 1 root root 4096 2003-10-02 18:52 tx_queue_len -r--r--r-- 1 root root 4096 2003-10-02 18:52 type /sys/class/net/eth1: total 0 drwxr-xr-x 3 root root 0 2003-10-02 19:51 . drwxr-xr-x 6 root root 0 2003-10-02 18:52 .. -r--r--r-- 1 root root 4096 2003-10-02 19:51 addr_len -r--r--r-- 1 root root 4096 2003-10-02 19:51 address -r--r--r-- 1 root root 4096 2003-10-02 19:51 broadcast lrwxrwxrwx 1 root root 53 2003-10-02 19:51 device -> ../../../devices/pci0005:00/0005:00:0b.6/0005:61:01.0 <-- pci dev lrwxrwxrwx 1 root root 29 2003-10-02 19:51 driver -> ../../../bus/pci/drivers/e100 -r--r--r-- 1 root root 4096 2003-10-02 19:51 features -rw-r--r-- 1 root root 4096 2003-10-02 19:51 flags -r--r--r-- 1 root root 4096 2003-10-02 19:51 ifindex -r--r--r-- 1 root root 4096 2003-10-02 19:51 iflink -rw-r--r-- 1 root root 4096 2003-10-02 19:51 mtu drwxr-xr-x 2 root root 0 2003-10-02 19:51 statistics -rw-r--r-- 1 root root 4096 2003-10-02 19:51 tx_queue_len -r--r--r-- 1 root root 4096 2003-10-02 19:51 type bigboylp4:/home/linda # There are two ethernet adapters, eth0 and eth1, in the system. In PCI world, eth0 is 0005:21:01.0 and eth1 is pci_dev 0005:61:01.0. A shell script can be used for greping ethX info, then parsing the info and generating a nice formatted output. Linda From davem@pizda.ninka.net Fri Oct 3 07:00:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 07:00:49 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93E0F25023494 for ; Fri, 3 Oct 2003 07:00:16 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id GAA23902; Fri, 3 Oct 2003 06:55:52 -0700 Date: Fri, 3 Oct 2003 06:55:52 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jt@bougret.hpl.hp.com, irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] (1/11) Irda dongle module owner support Message-Id: <20031003065552.6b734105.davem@redhat.com> In-Reply-To: <20031002152026.4bfd2c67.shemminger@osdl.org> References: <20031002152026.4bfd2c67.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 505 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 Jean noted some problems he has with these changes, in particular the hashbin locking bits. So I'm going to wait until that stuff is resolved since all the other IRDA patches in this series depend upon this first dongle module owner infrastructure one. Or did I misinterpret what happened? From davem@pizda.ninka.net Fri Oct 3 07:02:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 07:03:21 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93E2l25023846 for ; Fri, 3 Oct 2003 07:02:47 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id GAA23922; Fri, 3 Oct 2003 06:58:24 -0700 Date: Fri, 3 Oct 2003 06:58:24 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: chas3@users.sourceforge.net, chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-Id: <20031003065824.713627c6.davem@redhat.com> In-Reply-To: <20031003022615.GA42593@gaz.sfgoth.com> References: <200310011134.h91BYPkT003172@ginger.cmf.nrl.navy.mil> <20031001054226.126cea7b.davem@redhat.com> <20031003022615.GA42593@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 506 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 On Thu, 2 Oct 2003 19:26:15 -0700 Mitchell Blank Jr wrote: > My personal recommendations: > * There should be a per-atm-device semaphore held across calls into the > driver's ->open, ->close, ->change_qos and maybe a couple other things > to serialize those operations (for the sake of keeping the drivers > sane - there's no reason there should be multiple operations pending) Ok, but what Chas is trying to do is move the ATM device stuff over to a model that makes use of the existing network device infrastructure for solving these kinds of problems. Part of that is using the rtnl semaphore etc. I would rather Chas use the rtnl semaphore for synchronization than to ultra-optimize this code by using the rwlock as I had suggested to him. From Robert.Olsson@data.slu.se Fri Oct 3 07:10:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 07:11:15 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93EAd25024344 for ; Fri, 3 Oct 2003 07:10:40 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.9.3+/8.9.3) with ESMTP id QAA29078; Fri, 3 Oct 2003 16:10:32 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id 8E771EC22F; Fri, 3 Oct 2003 16:10:33 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16253.33625.541433.36206@robur.slu.se> Date: Fri, 3 Oct 2003 16:10:33 +0200 To: Jeff Garzik Cc: Robert Olsson , Andrew Morton , netdev@oss.sgi.com, dfages@arkoon.net Subject: Re: Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP In-Reply-To: <3F7C64BC.7030701@pobox.com> References: <20030929123734.5bd97a47.akpm@osdl.org> <16248.41796.797321.700866@robur.slu.se> <3F78A691.1040406@pobox.com> <16252.17618.866515.952549@robur.slu.se> <3F7C64BC.7030701@pobox.com> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 507 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 Jeff Garzik writes: > > Looks great to me. I'll give it some testing here, and 99% likely will > apply it. > > Andrew, would you be willing to merge this into -mm for some > simultaneous netwide testing? Fine! Here is a additional patch to active disable poll so we don't have to wait in dev_close() for traffic to disappear. Cheers. --ro --- drivers/net/tulip/interrupt.c.03103 2001-11-03 18:52:54.000000000 +0100 +++ drivers/net/tulip/interrupt.c 2003-10-03 13:21:46.000000000 +0200 @@ -116,6 +116,8 @@ tp->stats_poll_starts++; #endif + if(!netif_running(dev)) goto done; + if (rx_work_limit > dev->quota) rx_work_limit = dev->quota; @@ -241,7 +243,7 @@ * finally: amount of IO did not increase at all. */ } while ((inl(dev->base_addr + CSR5) & RxIntr)); -/* done: */ +done: #ifdef USE_MITIGATION From davem@pizda.ninka.net Fri Oct 3 07:35:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 07:35:44 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93EZB25024954 for ; Fri, 3 Oct 2003 07:35:11 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA24087; Fri, 3 Oct 2003 07:30:40 -0700 Date: Fri, 3 Oct 2003 07:30:39 -0700 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com Subject: Re: tunnel xmit and h.raw Message-Id: <20031003073039.7ca1a76c.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 508 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 On Fri, 3 Oct 2003 03:00:27 +0300 (EEST) Julian Anastasov wrote: > Is the following change needed? May be yes for all kernels > where the nearest skb_shared checks are actual. There seems to be no end to these kinds of bugs in the tunnel drivers! Didn't we fix a nearly identical set of bugs in the tunnel drivers just a month or two ago? I'll review this some more tomorrow and unless I find some problem I'll apply your patch. Thanks a lot. From ja@ssi.bg Fri Oct 3 07:57:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 07:57:45 -0700 (PDT) Received: from l.himel.bg (IDENT:root@unamed.infotel.bg [212.39.68.18] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93Ev725026147 for ; Fri, 3 Oct 2003 07:57:09 -0700 Received: from linux.himel.bg (IDENT:ja@linux.himel.bg [127.0.0.1]) by l.himel.bg (8.11.6/8.9.3) with ESMTP id h93EuZY13146; Fri, 3 Oct 2003 17:56:35 +0300 Date: Fri, 3 Oct 2003 17:56:35 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@l To: "David S. Miller" cc: netdev@oss.sgi.com Subject: Re: tunnel xmit and h.raw In-Reply-To: <20031003073039.7ca1a76c.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 509 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Hello, On Fri, 3 Oct 2003, David S. Miller wrote: > > Is the following change needed? May be yes for all kernels > > where the nearest skb_shared checks are actual. > > There seems to be no end to these kinds of bugs in the tunnel > drivers! > > Didn't we fix a nearly identical set of bugs in the tunnel > drivers just a month or two ago? The same place, but this one is special: h.raw is updated for us on reallocation but if the skb is shared I do not know if this is fatal for the other skb users, we change also their h.raw. But I rely on your opinion, may be it is safer with this change. > I'll review this some more tomorrow and unless I find some problem > I'll apply your patch. Thanks a lot. Regards -- Julian Anastasov From davem@pizda.ninka.net Fri Oct 3 08:09:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 08:09:57 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93F9H25026856 for ; Fri, 3 Oct 2003 08:09:18 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA24271; Fri, 3 Oct 2003 08:04:44 -0700 Date: Fri, 3 Oct 2003 08:04:44 -0700 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com Subject: Re: tunnel xmit and h.raw Message-Id: <20031003080444.173a403c.davem@redhat.com> In-Reply-To: References: <20031003073039.7ca1a76c.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 510 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 On Fri, 3 Oct 2003 17:56:35 +0300 (EEST) Julian Anastasov wrote: > On Fri, 3 Oct 2003, David S. Miller wrote: > > > Didn't we fix a nearly identical set of bugs in the tunnel > > drivers just a month or two ago? > > The same place, but this one is special: h.raw is updated > for us on reallocation but if the skb is shared I do not know if this is > fatal for the other skb users, we change also their h.raw. But I rely > on your opinion, may be it is safer with this change. Oh, I see, the code is actually not buggy as-is. The following two sequences are identical: 1) skb->h.raw = skb->nh.raw; new_skb = skb_realloc_headroom(...); skb = new_skb; 2) new_skb = skb_realloc_headroom(...); skb = new_skb; skb->h.raw = skb->nh.raw; Because skb_realloc_headroom() keeps all the skb->*.raw pointers in the right relative place if it allocates new data pointers or whatever. But the code is certainly clearer to read with your changes so I'll add them as a code cleanup instead of a bug fix :) From davem@pizda.ninka.net Fri Oct 3 08:10:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 08:10:55 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93FAM25026943 for ; Fri, 3 Oct 2003 08:10:22 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA24277; Fri, 3 Oct 2003 08:05:43 -0700 Date: Fri, 3 Oct 2003 08:05:43 -0700 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com Subject: Re: tunnel xmit and h.raw Message-Id: <20031003080543.5d8e8d41.davem@redhat.com> In-Reply-To: References: <20031003073039.7ca1a76c.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 511 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 On Fri, 3 Oct 2003 17:56:35 +0300 (EEST) Julian Anastasov wrote: > The same place, but this one is special: h.raw is updated > for us on reallocation but if the skb is shared I do not know if this is > fatal for the other skb users, we change also their h.raw. Sorry, replying again... I hadn't read your reply correctly. Indeed, I have to think about what changing skb->h.raw might do to other users, it might indeed be an issue. From mika.penttila@kolumbus.fi Fri Oct 3 08:42:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 08:43:14 -0700 (PDT) Received: from notes.hallinto.turkuamk.fi (notes.hallinto.turkuamk.fi [195.148.215.149]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93Fgc25031383 for ; Fri, 3 Oct 2003 08:42:39 -0700 Received: from kolumbus.fi ([193.166.244.70]) by marconi.hallinto.turkuamk.fi (Lotus Domino Release 5.0.8) with ESMTP id 2003100318441262:30362 ; Fri, 3 Oct 2003 18:44:12 +0300 Message-ID: <3F7D9A87.3010005@kolumbus.fi> Date: Fri, 03 Oct 2003 18:49:27 +0300 From: =?ISO-8859-1?Q?Mika_Penttil=E4?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Julian Anastasov CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: tunnel xmit and h.raw References: In-Reply-To: X-MIMETrack: Itemize by SMTP Server on marconi.hallinto.turkuamk.fi/TAMK(Release 5.0.8 |June 18, 2001) at 03.10.2003 18:44:12, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 03.10.2003 18:43:38, Serialize complete at 03.10.2003 18:43:38 Content-Type: multipart/alternative; boundary="------------030205090500090605040302" X-archive-position: 512 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------030205090500090605040302 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed If skb is shared skb_realloc_headroom() makes a private head, so no problem here. Actually the skb_cloned() test seems redundant in this context. --Mika Julian Anastasov wrote: > Hello, > >On Fri, 3 Oct 2003, David S. Miller wrote: > > > >>> Is the following change needed? May be yes for all kernels >>>where the nearest skb_shared checks are actual. >>> >>> >>There seems to be no end to these kinds of bugs in the tunnel >>drivers! >> >>Didn't we fix a nearly identical set of bugs in the tunnel >>drivers just a month or two ago? >> >> > > The same place, but this one is special: h.raw is updated >for us on reallocation but if the skb is shared I do not know if this is >fatal for the other skb users, we change also their h.raw. But I rely >on your opinion, may be it is safer with this change. > > > >>I'll review this some more tomorrow and unless I find some problem >>I'll apply your patch. Thanks a lot. >> >> > >Regards > >-- >Julian Anastasov > > > > > --------------030205090500090605040302 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii If skb is shared skb_realloc_headroom() makes a private head, so no problem here. Actually the skb_cloned() test seems redundant in this context.

--Mika


Julian Anastasov wrote:
	Hello,

On Fri, 3 Oct 2003, David S. Miller wrote:

  
	Is the following change needed? May be yes for all kernels
where the nearest skb_shared checks are actual.
      
There seems to be no end to these kinds of bugs in the tunnel
drivers!

Didn't we fix a nearly identical set of bugs in the tunnel
drivers just a month or two ago?
    

	The same place, but this one is special: h.raw is updated
for us on reallocation but if the skb is shared I do not know if this is
fatal for the other skb users, we change also their h.raw. But I rely
on your opinion, may be it is safer with this change.

  
I'll review this some more tomorrow and unless I find some problem
I'll apply your patch.  Thanks a lot.
    

Regards

--
Julian Anastasov <ja@ssi.bg>



  
--------------030205090500090605040302-- From greearb@candelatech.com Fri Oct 3 09:42:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 09:43:07 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93GgT25003620 for ; Fri, 3 Oct 2003 09:42:31 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h93GgLUG031006; Fri, 3 Oct 2003 09:42:21 -0700 Message-ID: <3F7DA6EB.4040200@candelatech.com> Date: Fri, 03 Oct 2003 09:42:19 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mitchell Blank Jr CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: do_gettimeofday References: <3F7C6F3B.6070502@sgi.com> <20031002125625.72b8c0a7.shemminger@osdl.org> <20031003004133.3148c39a.davem@redhat.com> <20031003082642.GF42593@gaz.sfgoth.com> <20031003012754.23de3f66.davem@redhat.com> <20031003084847.GH42593@gaz.sfgoth.com> <20031003015220.7ee6e451.davem@redhat.com> <20031003092617.GI42593@gaz.sfgoth.com> In-Reply-To: <20031003092617.GI42593@gaz.sfgoth.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 513 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Mitchell Blank Jr wrote: > David S. Miller wrote: > >>There is the weird issue (with both the sparc64 example and your's >>here) of whether we should care about what happens when settimeofday() >>occurs. We probably shouldn't worry about it... as it gives weird >>results even currently. > > > Nah. If anything you'll get better results since you're computing > the timeval later. > > This is another argument for caching the computation though - otherwise > a settimeofday() could cause the packet timestamp to change drasically > from one observation to the next :-) It would also be nice to be able to set a flag on raw sockets to just have the 'raw' timestamp passed up to user-space. In many cases, the relative timestamp may be all that is needed, and user-space could optimize the conversion to gettimeofday as needed. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From shemminger@osdl.org Fri Oct 3 10:22:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 10:23:05 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93HMU25007957 for ; Fri, 3 Oct 2003 10:22:31 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h93HLw121579; Fri, 3 Oct 2003 10:21:58 -0700 Date: Fri, 3 Oct 2003 10:21:33 -0700 From: Stephen Hemminger To: jt@hpl.hp.com Cc: jt@bougret.hpl.hp.com, "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (1/11) Irda dongle module owner support (revised) Message-Id: <20031003102133.2e5a41a2.shemminger@osdl.org> In-Reply-To: <20031002233335.GA7945@bougret.hpl.hp.com> References: <20031002152026.4bfd2c67.shemminger@osdl.org> <20031002233335.GA7945@bougret.hpl.hp.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 514 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 Revised version of the dongle module owner patch, incorporating Jean's comments. This replaces the original patch. It provides an owner field an appropriate ref counting for IRDA dongles. Changes since list version: s/dongle_lock/dongles->hb_spinlock/ get lock on device_cleanup replace ASSERT() about in_interrupt with might_sleep(). In case your curious about locking, the callers are: module_init -> irda_device_init module_exit -> irda_device_cleanup irport_net_ioctl -> irda_device_dongle_init module_init -> XXX_dongle_init -> irda_device_register_dongle module_exit -> XXX_dongle_exit -> irda_device_unregister_dongle In other words, no interrupt or BH access to the dongle list. Obviously, hashing this list is overkill, but "when in Rome"... --- linux-2.5/net/irda/irda_device.c 2003-10-01 13:40:11.000000000 -0700 +++ irda-2.5/net/irda/irda_device.c 2003-10-03 10:03:52.497879915 -0700 @@ -85,7 +85,7 @@ static void irda_task_timer_expired(void int __init irda_device_init( void) { - dongles = hashbin_new(HB_LOCK); + dongles = hashbin_new(HB_NOLOCK); if (dongles == NULL) { printk(KERN_WARNING "IrDA: Can't allocate dongles hashbin!\n"); return -ENOMEM; @@ -109,7 +109,9 @@ void __exit irda_device_cleanup(void) IRDA_DEBUG(4, "%s()\n", __FUNCTION__); hashbin_delete(tasks, (FREE_FUNC) __irda_task_delete); + spin_lock(&dongles->hb_spinlock); hashbin_delete(dongles, NULL); + spin_unlock(&dongles->hb_spinlock); } /* @@ -424,25 +426,34 @@ int irda_device_txqueue_empty(struct net dongle_t *irda_device_dongle_init(struct net_device *dev, int type) { struct dongle_reg *reg; - dongle_t *dongle; + dongle_t *dongle = NULL; - ASSERT(dev != NULL, return NULL;); + might_sleep(); + + spin_lock(&dongles->hb_spinlock); + reg = hashbin_find(dongles, type, NULL); #ifdef CONFIG_KMOD - ASSERT(!in_interrupt(), return NULL;); /* Try to load the module needed */ - request_module("irda-dongle-%d", type); + if (!reg && capable(CAP_SYS_MODULE)) { + spin_unlock(&dongles->hb_spinlock); + + request_module("irda-dongle-%d", type); + + spin_lock(&dongles->hb_spinlock); + reg = hashbin_find(dongles, type, NULL); + } #endif - if (!(reg = hashbin_lock_find(dongles, type, NULL))) { - ERROR("IrDA: Unable to find requested dongle\n"); - return NULL; + if (!reg || !try_module_get(reg->owner) ) { + ERROR("IrDA: Unable to find requested dongle type %x\n", type); + goto out; } /* Allocate dongle info for this instance */ dongle = kmalloc(sizeof(dongle_t), GFP_KERNEL); if (!dongle) - return NULL; + goto out; memset(dongle, 0, sizeof(dongle_t)); @@ -450,6 +461,8 @@ dongle_t *irda_device_dongle_init(struct dongle->issue = reg; dongle->dev = dev; + out: + spin_unlock(&dongles->hb_spinlock); return dongle; } @@ -461,7 +474,7 @@ int irda_device_dongle_cleanup(dongle_t ASSERT(dongle != NULL, return -1;); dongle->issue->close(dongle); - + module_put(dongle->issue->owner); kfree(dongle); return 0; @@ -472,14 +485,16 @@ int irda_device_dongle_cleanup(dongle_t */ int irda_device_register_dongle(struct dongle_reg *new) { + spin_lock(&dongles->hb_spinlock); /* Check if this dongle has been registered before */ - if (hashbin_lock_find(dongles, new->type, NULL)) { - MESSAGE("%s: Dongle already registered\n", __FUNCTION__); - return 0; - } - - /* Insert IrDA dongle into hashbin */ - hashbin_insert(dongles, (irda_queue_t *) new, new->type, NULL); + if (hashbin_find(dongles, new->type, NULL)) { + MESSAGE("%s: Dongle type %x already registered\n", + __FUNCTION__, new->type); + } else { + /* Insert IrDA dongle into hashbin */ + hashbin_insert(dongles, (irda_queue_t *) new, new->type, NULL); + } + spin_unlock(&dongles->hb_spinlock); return 0; } @@ -494,11 +509,11 @@ void irda_device_unregister_dongle(struc { struct dongle *node; + spin_lock(&dongles->hb_spinlock); node = hashbin_remove(dongles, dongle->type, NULL); - if (!node) { + if (!node) ERROR("%s: dongle not found!\n", __FUNCTION__); - return; - } + spin_unlock(&dongles->hb_spinlock); } /* From jt@bougret.hpl.hp.com Fri Oct 3 10:31:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 10:32:06 -0700 (PDT) Received: from palrel12.hp.com (palrel12.hp.com [156.153.255.237]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93HVW25008900 for ; Fri, 3 Oct 2003 10:31:32 -0700 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel12.hp.com (Postfix) with ESMTP id 303091C02334; Fri, 3 Oct 2003 10:31:32 -0700 (PDT) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_28810)/8.9.3 HPLabs Timeshare Server) with ESMTP id KAA04053; Fri, 3 Oct 2003 10:31:31 -0700 (PDT) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1A5Tm7-0003lN-00; Fri, 03 Oct 2003 10:31:31 -0700 Date: Fri, 3 Oct 2003 10:31:31 -0700 To: Stephen Hemminger Cc: "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] (1/11) Irda dongle module owner support (revised) Message-ID: <20031003173131.GB14313@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20031002152026.4bfd2c67.shemminger@osdl.org> <20031002233335.GA7945@bougret.hpl.hp.com> <20031003102133.2e5a41a2.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031003102133.2e5a41a2.shemminger@osdl.org> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-archive-position: 515 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@bougret.hpl.hp.com Precedence: bulk X-list: netdev On Fri, Oct 03, 2003 at 10:21:33AM -0700, Stephen Hemminger wrote: > Revised version of the dongle module owner patch, incorporating Jean's comments. > This replaces the original patch. It provides an owner field an appropriate > ref counting for IRDA dongles. > > Changes since list version: > s/dongle_lock/dongles->hb_spinlock/ > get lock on device_cleanup > replace ASSERT() about in_interrupt with might_sleep(). Perfect ! Thanks for the quick turnaround, and sorry for the extra work. > In case your curious about locking, the callers are: > module_init -> irda_device_init > module_exit -> irda_device_cleanup > irport_net_ioctl -> irda_device_dongle_init > module_init -> XXX_dongle_init -> irda_device_register_dongle > module_exit -> XXX_dongle_exit -> irda_device_unregister_dongle > > In other words, no interrupt or BH access to the dongle list. > Obviously, hashing this list is overkill, Ok. > but "when in Rome"... Eat some pasta ? Maintaining others people code is very much like archeological excavation, sometimes you find treasures buried in the various stratas, but most of the time... Have fun... Jean From christopher.leech@intel.com Fri Oct 3 11:27:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 11:28:15 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93IRc25013142 for ; Fri, 3 Oct 2003 11:27:39 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h93IMVR27296 for ; Fri, 3 Oct 2003 18:22:31 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.py.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h93IQx408464 for ; Fri, 3 Oct 2003 18:26:59 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003100311273130087 ; Fri, 03 Oct 2003 11:27:31 -0700 Received: from orsmsx404.amr.corp.intel.com ([192.168.65.44]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Fri, 3 Oct 2003 11:27:30 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction Date: Fri, 3 Oct 2003 11:27:30 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction Thread-Index: AcOJmY73Di4fqm7+QR63OlqNHBtI+gAQBTMg From: "Leech, Christopher" To: Cc: , X-OriginalArrivalTime: 03 Oct 2003 18:27:30.0996 (UTC) FILETIME=[01A5CF40:01C389DC] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h93IRc25013142 X-archive-position: 516 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: christopher.leech@intel.com Precedence: bulk X-list: netdev > Btw, I had to compile the e1000 driver as a module. Compiled in it > doesn't work, as is stated on the intel support page: > This is not clear from the kernel config help. A patch against > 2.6.0-test6 is attached (I don't know how to only give n/m as an > option). This patch is not necessary or desired. The version of e1000 that ships with the kernel source should work fine statically linked, and the comment on the Intel support web page applies to the separate download of the e1000 source. If you download the driver source from Intel and do the work to add it into a kernel source tree yourself, Intel customer support may not help you when you have problems. If you are having problems compiling in the version of e1000 that ships with the kernel, please report it on netdev and we'll try and help. > Btw2, can somebody please explain what the option E1000_NAPI does? NAPI is a network driver polling mode interface. It enables a form of software managed interrupt moderation, and may result in better performance under some traffic patterns (specifically sustained high packet rate reception). -- Chris From shemminger@osdl.org Fri Oct 3 11:31:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 11:32:14 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93IVd25013741 for ; Fri, 3 Oct 2003 11:31:42 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h93IVW103727; Fri, 3 Oct 2003 11:31:32 -0700 Date: Fri, 3 Oct 2003 11:31:06 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] sbni -- get rid of check_region Message-Id: <20031003113106.45b21aa5.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 517 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 In sbni driver for 2.6.0-test6 Replace check_region with appropriate request_region, and make sure to do release_region as required in error unwinds. diff -Nru a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c --- a/drivers/net/wan/sbni.c Fri Oct 3 11:27:51 2003 +++ b/drivers/net/wan/sbni.c Fri Oct 3 11:27:51 2003 @@ -292,7 +292,6 @@ != NULL ) { int pci_irq_line; unsigned long pci_ioaddr; - u16 subsys; if( pdev->vendor != SBNI_PCI_VENDOR && pdev->device != SBNI_PCI_DEVICE ) @@ -302,10 +301,13 @@ pci_irq_line = pdev->irq; /* Avoid already found cards from previous calls */ - if( !request_region( pci_ioaddr, SBNI_IO_EXTENT, dev->name ) ) { - pci_read_config_word( pdev, PCI_SUBSYSTEM_ID, &subsys ); + if( !request_region( pci_ioaddr, SBNI_IO_EXTENT, dev->name )) { + u16 subsys; + pci_read_config_word( pdev, PCI_SUBSYSTEM_ID, &subsys); + if( subsys != 2 || /* Dual adapter is present */ - check_region( pci_ioaddr += 4, SBNI_IO_EXTENT ) ) + !request_region(pci_ioaddr += 4, SBNI_IO_EXTENT, + dev->name) ) continue; } @@ -318,10 +320,15 @@ pci_irq_line ); /* avoiding re-enable dual adapters */ - if( (pci_ioaddr & 7) == 0 && pci_enable_device( pdev ) ) - return -EIO; - if( sbni_probe1( dev, pci_ioaddr, pci_irq_line ) ) + if( (pci_ioaddr & 7) == 0 && pci_enable_device( pdev ) ) { + release_region( pci_ioaddr, SBNI_IO_EXTENT); + return -EIO; + } + + else if( sbni_probe1( dev, pci_ioaddr, pci_irq_line ) ) return 0; + + release_region( pci_ioaddr, SBNI_IO_EXTENT); } return -ENODEV; } @@ -332,10 +339,8 @@ { struct net_local *nl; - if( sbni_card_probe( ioaddr ) ) { - release_region( ioaddr, SBNI_IO_EXTENT ); + if( sbni_card_probe( ioaddr ) ) return 0; - } outb( 0, ioaddr + CSR0 ); @@ -352,7 +357,6 @@ if( !irq ) { printk( KERN_ERR "%s: can't detect device irq!\n", dev->name ); - release_region( ioaddr, SBNI_IO_EXTENT ); return 0; } } else if( irq == 2 ) @@ -365,7 +369,6 @@ nl = dev->priv; if( !nl ) { printk( KERN_ERR "%s: unable to get memory!\n", dev->name ); - release_region( ioaddr, SBNI_IO_EXTENT ); return 0; } From shemminger@osdl.org Fri Oct 3 11:44:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 11:44:56 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93IiM25014914 for ; Fri, 3 Oct 2003 11:44:22 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h93IiE106710; Fri, 3 Oct 2003 11:44:14 -0700 Date: Fri, 3 Oct 2003 11:43:47 -0700 From: Stephen Hemminger To: Jeff Garzik , "David S. Miller" Cc: netdev@oss.sgi.com Subject: [RFT] syncppp needs to pullup headers Message-Id: <20031003114347.31ee740b.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 518 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 In 2.6.0-test6 wan syncppp driver claims to be a "new" protocol and handle shared skb's but it needs to make sure data is contiguous before overlaying headers. It is not a serious problem because the sync drivers never generate nonlinear skbuff's anyway. Don't have hardware that uses this, so could someone please do a sanity test on this. diff -Nru a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c --- a/drivers/net/wan/syncppp.c Fri Oct 3 11:28:11 2003 +++ b/drivers/net/wan/syncppp.c Fri Oct 3 11:28:11 2003 @@ -236,7 +236,7 @@ sp->ipkts++; } - if (skb->len <= PPP_HEADER_LEN) { + if (!pskb_may_pull(skb, PPP_HEADER_LEN)) { /* Too small packet, drop it. */ if (sp->pp_flags & PP_DEBUG) printk (KERN_DEBUG "%s: input packet is too small, %d bytes\n", @@ -473,7 +473,7 @@ u8 *p, opt[6]; u32 rmagic; - if (len < 4) { + if (!pskb_may_pull(skb, sizeof(struct lcp_header))) { if (sp->pp_flags & PP_DEBUG) printk (KERN_WARNING "%s: invalid lcp packet length: %d bytes\n", dev->name, len); @@ -707,7 +707,9 @@ struct cisco_packet *h; struct net_device *dev = sp->pp_if; - if (skb->len != CISCO_PACKET_LEN && skb->len != CISCO_BIG_PACKET_LEN) { + if (!pskb_may_pull(skb, sizeof(struct cisco_packet)) + || (skb->len != CISCO_PACKET_LEN + && skb->len != CISCO_BIG_PACKET_LEN)) { if (sp->pp_flags & PP_DEBUG) printk (KERN_WARNING "%s: invalid cisco packet length: %d bytes\n", dev->name, skb->len); @@ -1211,8 +1213,7 @@ struct net_device *dev = sp->pp_if; int len = skb->len; - if (len < 4) - { + if (!pskb_may_pull(skb, sizeof(struct lcp_header))) { if (sp->pp_flags & PP_DEBUG) printk (KERN_WARNING "%s: invalid ipcp packet length: %d bytes\n", dev->name, len); From oxymoron@waste.org Fri Oct 3 12:12:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 12:12:37 -0700 (PDT) Received: from waste.org (waste.org [209.173.204.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93JBw25019968 for ; Fri, 3 Oct 2003 12:12:00 -0700 Received: from waste.org (localhost [127.0.0.1]) by waste.org (8.12.3/8.12.3/Debian-6.6) with ESMTP id h93JBHRT023993; Fri, 3 Oct 2003 14:11:17 -0500 Received: (from oxymoron@localhost) by waste.org (8.12.3/8.12.3/Debian-6.6) id h93JBG1Q023991; Fri, 3 Oct 2003 14:11:16 -0500 Date: Fri, 3 Oct 2003 14:11:16 -0500 From: Matt Mackall To: jamal Cc: netdev@oss.sgi.com, Andrew Morton , Jeff Garzik Subject: Re: [RFC] [PATCH 1/3] netpoll api Message-ID: <20031003191116.GA13573@waste.org> References: <20031003014104.GR1897@waste.org> <1065179359.1031.42.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1065179359.1031.42.camel@jzny.localdomain> User-Agent: Mutt/1.3.28i X-Virus-Scanned: by amavisd-new X-archive-position: 519 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mpm@selenic.com Precedence: bulk X-list: netdev On Fri, Oct 03, 2003 at 07:09:20AM -0400, jamal wrote: > Hi, > > > On Thu, 2003-10-02 at 21:41, Matt Mackall wrote: > > This patch implements a new netpoll API, which allows sending and > > receiving packets in context where interrupts may be disabled. It > > provides a common API for implementing features like netconsole, > > netdump/LKCD, and kgdb-over-ethernet and manages to isolate them > > almost completely from the details of the network layer. > > > > Nice. > Is the ethernet card in a case like this almost dedicated for this > kind of work? No, I've had good results with it as the only interface to the machine. As netpoll traffic is fairly infrequent, performance seems little affected. > Is disable_irq() in the controller safe for shared irqs? Or maybe this > is critical enough that you dont care? I'm not aware of any issues there. I understand Red Hat has banged on this piece pretty heavily recently for their AS kernel. > Its a little wasteful to call the controller when there are is no work > to be done; we have found in NAPI that any extra PCI transactions cost. > (some IBM people doing benchmarking have complained about specweb not > looking good where NAPI will have one extra PCI transaction per packet. > You do it twice the rate NAPI would do it at low speeds). > Again, the answer maybe who cares, this is critical work. Just to be sure you read this right, the poll method (NAPI) is different from poll_controller (netpoll). The name is unfortunate, but it's what Ingo had in his early 2.4 netconsole patches. I could s/poll_controller/netpoll/ perhaps. The NAPI method only gets called when we've frozen the system (kgdb or netdump) and we're the only ones checking for rx work. The netpoll method gets called in that case and when something like netconsole is sending out printks (eg low bandwidth or high priority). > Have you done any measurements to check whether it was worthwile to do > the skb preallocation? Yes, one of the longer sysrq dumps could knock over earlier versions of the code. -- Matt Mackall : http://www.selenic.com : of or relating to the moon From fubar@us.ibm.com Fri Oct 3 12:58:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 12:59:18 -0700 (PDT) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.104]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93Jwc25026115 for ; Fri, 3 Oct 2003 12:58:45 -0700 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e4.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id h93JvuYN816952; Fri, 3 Oct 2003 15:57:56 -0400 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h93JvrEx199050; Fri, 3 Oct 2003 15:57:55 -0400 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h93Jva1U004043; Fri, 3 Oct 2003 12:57:37 -0700 Message-Id: <200310031957.h93Jva1U004043@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: shmulik.hen@intel.com cc: "David S. Miller" , "Chad N. Tindel" , jgarzik@pobox.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] Re: [bonding] compatibilty issues In-Reply-To: Message from Shmulik Hen of "Thu, 02 Oct 2003 09:37:51 +0300." <200310020937.51781.shmulik.hen@intel.com> Date: Fri, 03 Oct 2003 12:57:35 -0700 From: Jay Vosburgh X-archive-position: 520 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev >Where should such a list go ? Oh, I was thinking either in a comment block (by the ABI version definitions, for example), tacked on to the end of bonding.txt, or maybe in a README.ABI in the bonding/ directory. I'm not too concerned about where it is. I just don't want to find ourselves a year or two down the road trying to figure out just what ABI version N is supposed to do when it suddenly quits working.... -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From mitch@sfgoth.com Fri Oct 3 14:36:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 14:37:22 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93Lak25003910 for ; Fri, 3 Oct 2003 14:36:47 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h93Ljg16077940; Fri, 3 Oct 2003 14:45:42 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h93LjfFr077939; Fri, 3 Oct 2003 14:45:41 -0700 (PDT) (envelope-from mitch) Date: Fri, 3 Oct 2003 14:45:41 -0700 From: Mitchell Blank Jr To: "David S. Miller" Cc: chas3@users.sourceforge.net, chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-ID: <20031003214541.GA73152@gaz.sfgoth.com> References: <200310011134.h91BYPkT003172@ginger.cmf.nrl.navy.mil> <20031001054226.126cea7b.davem@redhat.com> <20031003022615.GA42593@gaz.sfgoth.com> <20031003065824.713627c6.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031003065824.713627c6.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 521 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev David S. Miller wrote: > > My personal recommendations: > > * There should be a per-atm-device semaphore held across calls into the > > driver's ->open, ->close, ->change_qos and maybe a couple other things > > to serialize those operations (for the sake of keeping the drivers > > sane - there's no reason there should be multiple operations pending) > > Ok, but what Chas is trying to do is move the ATM device stuff over > to a model that makes use of the existing network device infrastructure > for solving these kinds of problems. > > Part of that is using the rtnl semaphore etc. > > I would rather Chas use the rtnl semaphore for synchronization > than to ultra-optimize this code by using the rwlock as I had suggested > to him. I have no problem with using rtnl_sem to syncronize the atmdev->{open, close,change_qos}() paths instead of a per-device semaphore. We *can't* use it to protect the state of the vcc list though because we need to do lookups in both interrupt and bh context. Using a sleeping lock alone is a non-starter. That's why we need to do the three-step spinlock->semaphore->spinlock dance in the vcc open and close paths. -Mitch From shemminger@osdl.org Fri Oct 3 14:46:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 14:47:27 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93Lks25004963 for ; Fri, 3 Oct 2003 14:46:54 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h93Lkg108707; Fri, 3 Oct 2003 14:46:45 -0700 Date: Fri, 3 Oct 2003 14:46:16 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (1/2) fix sppp device pointer Message-Id: <20031003144616.11a6b6c5.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 522 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 My bad, a change I put in while debugging the sealevel driver broke all the other sync drivers. The SPPP drivers expect that netdev->priv points to device local structure whose first element is a pointer to the ppp device. The bug was in sppp_of change that got rid of one level of indirection. To prevent future stupidity, do some reverse lookup check in sppp_attach and sppp_of. diff -Nru a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c --- a/drivers/net/wan/syncppp.c Fri Oct 3 11:28:23 2003 +++ b/drivers/net/wan/syncppp.c Fri Oct 3 11:28:23 2003 @@ -1069,6 +1069,9 @@ struct sppp *sp = &pd->sppp; unsigned long flags; + /* Make sure embedding is safe for sppp_of */ + BUG_ON(sppp_of(dev) != sp); + spin_lock_irqsave(&spppq_lock, flags); /* Initialize keepalive handler. */ if (! spppq) diff -Nru a/include/net/syncppp.h b/include/net/syncppp.h --- a/include/net/syncppp.h Fri Oct 3 11:28:23 2003 +++ b/include/net/syncppp.h Fri Oct 3 11:28:23 2003 @@ -59,8 +59,9 @@ static inline struct sppp *sppp_of(struct net_device *dev) { - struct ppp_device *ppp = dev->priv; - return &ppp->sppp; + struct ppp_device **ppp = dev->priv; + BUG_ON((*ppp)->dev != dev); + return &(*ppp)->sppp; } #define PP_KEEPALIVE 0x01 /* use keepalive protocol */ From shemminger@osdl.org Fri Oct 3 14:48:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 14:49:04 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h93LmV25005314 for ; Fri, 3 Oct 2003 14:48:31 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h93LmO109526; Fri, 3 Oct 2003 14:48:24 -0700 Date: Fri, 3 Oct 2003 14:47:58 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] sppp - fix sealevel Message-Id: <20031003144758.78c52154.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 523 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 My earlier change broke the if_ptr assumption used by SPPP drivers. This makes sealevel driver do if_ptr like it used to. diff -Nru a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c --- a/drivers/net/wan/sealevel.c Fri Oct 3 11:28:36 2003 +++ b/drivers/net/wan/sealevel.c Fri Oct 3 11:28:36 2003 @@ -31,6 +31,7 @@ struct slvl_device { + void *if_ptr; /* General purpose pointer (used by SPPP) */ struct z8530_channel *chan; struct ppp_device pppdev; int channel; @@ -238,6 +239,7 @@ return NULL; sv = d->priv; + sv->if_ptr = &sv->pppdev; sv->pppdev.dev = d; d->base_addr = iobase; d->irq = irq; From rddunlap@osdl.org Fri Oct 3 21:36:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 21:36:50 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h944aF25024840 for ; Fri, 3 Oct 2003 21:36:16 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h944a8116207; Fri, 3 Oct 2003 21:36:08 -0700 Date: Fri, 3 Oct 2003 21:29:04 -0700 From: "Randy.Dunlap" To: jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [PATCH] janitor: insert missing iounmap(), add error handling Message-Id: <20031003212904.34d4ca01.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (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: 524 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test6-current. Thanks, -- ~Randy From: Leann Ogasawara Subject: Re: [Kernel-janitors] [PATCH] insert missing iounmap() > > Patch inserts a missing iounmap(). Implements a cleanup path > > for error handling as well. Feedback is much appreciated. Thanks :) ===== drivers/net/natsemi.c 1.55 vs edited ===== linux-260-test6-kj1-rddunlap/drivers/net/natsemi.c | 39 ++++++++++----------- 1 files changed, 20 insertions(+), 19 deletions(-) diff -puN drivers/net/natsemi.c~net_natsemi_iounmap drivers/net/natsemi.c --- linux-260-test6-kj1/drivers/net/natsemi.c~net_natsemi_iounmap 2003-09-29 17:37:59.000000000 -0700 +++ linux-260-test6-kj1-rddunlap/drivers/net/natsemi.c 2003-09-29 17:37:59.000000000 -0700 @@ -765,19 +765,13 @@ static int __devinit natsemi_probe1 (str SET_NETDEV_DEV(dev, &pdev->dev); i = pci_request_regions(pdev, dev->name); - if (i) { - free_netdev(dev); - return i; - } + if (i) + goto err_pci_request_regions; - { - void *mmio = ioremap (ioaddr, iosize); - if (!mmio) { - pci_release_regions(pdev); - free_netdev(dev); - return -ENOMEM; - } - ioaddr = (unsigned long) mmio; + ioaddr = (unsigned long) ioremap (ioaddr, iosize); + if (!ioaddr) { + i = -ENOMEM; + goto err_ioremap; } /* Work around the dropped serial bit. */ @@ -835,13 +829,9 @@ static int __devinit natsemi_probe1 (str dev->mtu = mtu; i = register_netdev(dev); - if (i) { - pci_release_regions(pdev); - unregister_netdev(dev); - free_netdev(dev); - pci_set_drvdata(pdev, NULL); - return i; - } + if (i) + goto err_register_netdev; + netif_carrier_off(dev); if (netif_msg_drv(np)) { @@ -878,6 +868,17 @@ static int __devinit natsemi_probe1 (str return 0; + + err_register_netdev: + iounmap ((void *) dev->base_addr); + + err_ioremap: + pci_release_regions(pdev); + pci_set_drvdata(pdev, NULL); + + err_pci_request_regions: + free_netdev(dev); + return i; } _ From rddunlap@osdl.org Fri Oct 3 21:36:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 21:36:50 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h944aF25024839 for ; Fri, 3 Oct 2003 21:36:16 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h944a9116212; Fri, 3 Oct 2003 21:36:09 -0700 Date: Fri, 3 Oct 2003 21:35:17 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: ncorbic@sangoma.com, davem@redhat.com Subject: [PATCH] janitor: remove verify_area() in net/wan/sbni Message-Id: <20031003213517.6700a095.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (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: 524 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test6-current. Thanks, -- ~Randy From: Domen Puncer Subject: [Kernel-janitors] [PATCH] updated: verify_area: drivers/net/wan/sbni.c Someone added error checking to copy_*_user, so this [earlier] patch didn't apply. Removed unnecessary verify_area. linux-260-test6-kj1-rddunlap/drivers/net/wan/sbni.c | 20 +++++--------------- 1 files changed, 5 insertions(+), 15 deletions(-) diff -puN drivers/net/wan/sbni.c~net_wan_sbni_verify drivers/net/wan/sbni.c --- linux-260-test6-kj1/drivers/net/wan/sbni.c~net_wan_sbni_verify 2003-09-29 17:39:09.000000000 -0700 +++ linux-260-test6-kj1-rddunlap/drivers/net/wan/sbni.c 2003-09-29 17:39:09.000000000 -0700 @@ -1300,12 +1300,9 @@ sbni_ioctl( struct net_device *dev, st switch( cmd ) { case SIOCDEVGETINSTATS : - error = verify_area( VERIFY_WRITE, ifr->ifr_data, - sizeof(struct sbni_in_stats) ); - if( !error ) - if (copy_to_user( ifr->ifr_data, &nl->in_stats, - sizeof(struct sbni_in_stats) )) - return -EFAULT; + if (copy_to_user( ifr->ifr_data, &nl->in_stats, + sizeof(struct sbni_in_stats) )) + error = -EFAULT; break; case SIOCDEVRESINSTATS : @@ -1321,11 +1318,8 @@ sbni_ioctl( struct net_device *dev, st flags.rxl = nl->cur_rxl_index; flags.fixed_rxl = nl->delta_rxl == 0; - error = verify_area( VERIFY_WRITE, ifr->ifr_data, - sizeof flags ); - if( !error ) - if (copy_to_user( ifr->ifr_data, &flags, sizeof flags )) - return -EFAULT; + if (copy_to_user( ifr->ifr_data, &flags, sizeof flags )) + error = -EFAULT; break; case SIOCDEVSHWSTATE : @@ -1353,10 +1347,6 @@ sbni_ioctl( struct net_device *dev, st if( current->euid != 0 ) /* root only */ return -EPERM; - if( (error = verify_area( VERIFY_READ, ifr->ifr_data, - sizeof slave_name )) != 0 ) - return error; - if (copy_from_user( slave_name, ifr->ifr_data, sizeof slave_name )) return -EFAULT; slave_dev = dev_get_by_name( slave_name ); _ From davem@pizda.ninka.net Fri Oct 3 22:21:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 22:21:43 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h945L925028276 for ; Fri, 3 Oct 2003 22:21:09 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA26455; Fri, 3 Oct 2003 22:16:40 -0700 Date: Fri, 3 Oct 2003 22:16:40 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: chas3@users.sourceforge.net, chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-Id: <20031003221640.19aa485f.davem@redhat.com> In-Reply-To: <20031003214541.GA73152@gaz.sfgoth.com> References: <200310011134.h91BYPkT003172@ginger.cmf.nrl.navy.mil> <20031001054226.126cea7b.davem@redhat.com> <20031003022615.GA42593@gaz.sfgoth.com> <20031003065824.713627c6.davem@redhat.com> <20031003214541.GA73152@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 525 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 On Fri, 3 Oct 2003 14:45:41 -0700 Mitchell Blank Jr wrote: > We *can't* use it to protect the state of the vcc list though because we > need to do lookups in both interrupt and bh context. Using a sleeping > lock alone is a non-starter. > > That's why we need to do the three-step spinlock->semaphore->spinlock > dance in the vcc open and close paths. The semaphore protects "modifications", it basically serializes them. You still need a rwlock to protect the actual lists and this rwlock is what the interrupt/bh context code takes to traverse the lists and tables. This is how the netdev list works, for example. From mitch@sfgoth.com Fri Oct 3 22:46:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 22:47:03 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h945kT25030160 for ; Fri, 3 Oct 2003 22:46:29 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h945tR16093033; Fri, 3 Oct 2003 22:55:27 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h945tQvw093032; Fri, 3 Oct 2003 22:55:26 -0700 (PDT) (envelope-from mitch) Date: Fri, 3 Oct 2003 22:55:26 -0700 From: Mitchell Blank Jr To: "David S. Miller" Cc: chas3@users.sourceforge.net, chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-ID: <20031004055526.GG73152@gaz.sfgoth.com> References: <200310011134.h91BYPkT003172@ginger.cmf.nrl.navy.mil> <20031001054226.126cea7b.davem@redhat.com> <20031003022615.GA42593@gaz.sfgoth.com> <20031003065824.713627c6.davem@redhat.com> <20031003214541.GA73152@gaz.sfgoth.com> <20031003221640.19aa485f.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031003221640.19aa485f.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 526 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev David S. Miller wrote: > > We *can't* use it to protect the state of the vcc list though because we > > need to do lookups in both interrupt and bh context. Using a sleeping > > lock alone is a non-starter. > > > > That's why we need to do the three-step spinlock->semaphore->spinlock > > dance in the vcc open and close paths. > > The semaphore protects "modifications", it basically serializes them. > > You still need a rwlock to protect the actual lists and this rwlock > is what the interrupt/bh context code takes to traverse the lists > and tables. I think we're saying approximately the same thing at this point. I'm just trying to make the point that the spinlock (or rwlock, whatever) can't be held when we call atm_dev->{open,close}() since they can sleep. Which is why we need to do the three-step process I described in the earlier email. Once you do that there's no reason (that I know of) to take rtnl_sem except to serialize the actual calls into atm_dev's ops. There's no problem if multiple opens both get their vpi/vci's allocated in "inactive" state as long as the actual connects happen in series. -Mitch From davem@pizda.ninka.net Fri Oct 3 23:00:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 23:00:55 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9460L25031376 for ; Fri, 3 Oct 2003 23:00:22 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA26596; Fri, 3 Oct 2003 22:55:52 -0700 Date: Fri, 3 Oct 2003 22:55:52 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [RFT] syncppp needs to pullup headers Message-Id: <20031003225552.3c8f28d9.davem@redhat.com> In-Reply-To: <20031003114347.31ee740b.shemminger@osdl.org> References: <20031003114347.31ee740b.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 527 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 On Fri, 3 Oct 2003 11:43:47 -0700 Stephen Hemminger wrote: > In 2.6.0-test6 wan syncppp driver claims to be a "new" protocol and handle shared skb's > but it needs to make sure data is contiguous before overlaying headers. > It is not a serious problem because the sync drivers never generate nonlinear skbuff's > anyway. This looks obvious enough and correct to me, applied. From davem@pizda.ninka.net Fri Oct 3 23:10:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 23:11:11 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h946Aa25032378 for ; Fri, 3 Oct 2003 23:10:37 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA26656; Fri, 3 Oct 2003 23:06:06 -0700 Date: Fri, 3 Oct 2003 23:06:06 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jt@hpl.hp.com, jt@bougret.hpl.hp.com, irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] (1/11) Irda dongle module owner support (revised) Message-Id: <20031003230606.6a35677e.davem@redhat.com> In-Reply-To: <20031003102133.2e5a41a2.shemminger@osdl.org> References: <20031002152026.4bfd2c67.shemminger@osdl.org> <20031002233335.GA7945@bougret.hpl.hp.com> <20031003102133.2e5a41a2.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 528 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 On Fri, 3 Oct 2003 10:21:33 -0700 Stephen Hemminger wrote: > Revised version of the dongle module owner patch, incorporating Jean's comments. > This replaces the original patch. It provides an owner field an appropriate > ref counting for IRDA dongles. I applied this, but where's the necessary IRDA header file change that adds the 'owner' field to the dongle_reg structure? It's missing from this patch. Please send me that, and then I assume that I can just suck in all of your individual IRDA driver patches from yesterday? From davem@pizda.ninka.net Fri Oct 3 23:15:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 23:15:39 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h946F625000505 for ; Fri, 3 Oct 2003 23:15:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA26703; Fri, 3 Oct 2003 23:10:35 -0700 Date: Fri, 3 Oct 2003 23:10:35 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, ncorbic@sangoma.com Subject: Re: [PATCH] janitor: remove verify_area() in net/wan/sbni Message-Id: <20031003231035.7aa33bd3.davem@redhat.com> In-Reply-To: <20031003213517.6700a095.rddunlap@osdl.org> References: <20031003213517.6700a095.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 529 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 On Fri, 3 Oct 2003 21:35:17 -0700 "Randy.Dunlap" wrote: > Please apply to 2.6.0-test6-current. Applied, thanks Randy. From mitch@sfgoth.com Fri Oct 3 23:47:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 23:48:03 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h946lT25002874 for ; Fri, 3 Oct 2003 23:47:29 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h946uT16094516; Fri, 3 Oct 2003 23:56:30 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h946uTnZ094515; Fri, 3 Oct 2003 23:56:29 -0700 (PDT) (envelope-from mitch) Date: Fri, 3 Oct 2003 23:56:29 -0700 From: Mitchell Blank Jr To: "David S. Miller" Cc: chas3@users.sourceforge.net, chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-ID: <20031004065629.GA94203@gaz.sfgoth.com> References: <200310011134.h91BYPkT003172@ginger.cmf.nrl.navy.mil> <20031001054226.126cea7b.davem@redhat.com> <20031003022615.GA42593@gaz.sfgoth.com> <20031003065824.713627c6.davem@redhat.com> <20031003214541.GA73152@gaz.sfgoth.com> <20031003221640.19aa485f.davem@redhat.com> <20031004055526.GG73152@gaz.sfgoth.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031004055526.GG73152@gaz.sfgoth.com> User-Agent: Mutt/1.4.1i X-archive-position: 530 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev Mitchell Blank Jr wrote: > I'm just trying to make the point that the spinlock (or rwlock, whatever) > can't be held when we call atm_dev->{open,close}() since they can sleep. > Which is why we need to do the three-step process I described in the > earlier email. Actually I guess there's two ways of doing it... so instead of Method 1: 1. Take rwlock for writing 2. Search for {dev,vpi,vci} tuple. If found, fail - otherwise add it as "inactive" 3. Drop rwlock 4. Take semaphore 5. Call atm_dev->open() 6. Drop semaphore 7. Take rwlock for writing 8. If open succeeded clear "inactive" flag. If failed remove entry 9. Drop rwlock Method 2: 1. Take semaphore 2. Take rwlock for reading 3. Search for tuple, if found fail 4. Drop rwlock 5. Call atm_dev->open 6. Take rwlock for writing 7. Add tuple to list 8. Drop rwlock 9. Drop semaphore The second method has the advantage that you don't need the "inactive" flag. On the other hand, you have to wait for the semaphore before you can return EADDRINUSE. -Mitch From ookhoi@humilis.net Fri Oct 3 23:49:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 23:50:28 -0700 (PDT) Received: from favonius.humilis.net (ookhoi.xs4all.nl [213.84.114.66]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h946nq25003313 for ; Fri, 3 Oct 2003 23:49:53 -0700 Received: by favonius.humilis.net (Postfix, from userid 1000) id 6A82EB0127; Sat, 4 Oct 2003 08:49:52 +0200 (CEST) Date: Sat, 4 Oct 2003 08:49:52 +0200 From: Sander To: "Leech, Christopher" Cc: ookhoi@humilis.net, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction Message-ID: <20031004064952.GA27027@favonius> Reply-To: sander@humilis.net References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Uptime: 07:59:12 up 117 days, 7:32, 34 users, load average: 1.32, 1.07, 1.02 User-Agent: Mutt/1.5.4i X-archive-position: 531 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sander@humilis.net Precedence: bulk X-list: netdev Leech, Christopher wrote (ao): > > Btw, I had to compile the e1000 driver as a module. Compiled in it > > doesn't work, as is stated on the intel support page: > > > This is not clear from the kernel config help. A patch against > > 2.6.0-test6 is attached (I don't know how to only give n/m as an > > option). > > This patch is not necessary or desired. The version of e1000 that ships > with the kernel source should work fine statically linked, and the > comment on the Intel support web page applies to the separate download > of the e1000 source. If you download the driver source from Intel and > do the work to add it into a kernel source tree yourself, Intel customer > support may not help you when you have problems. > > If you are having problems compiling in the version of e1000 that ships > with the kernel, please report it on netdev and we'll try and help. I'm sorry for the patch. The problem I had with e1000 compiled into the kernel was that the interface resets every 60(?) seconds, and there was no network connection. After a google search I came onto the intel support page, saw the module-only text, tried e1000 as a module and it worked. This all is with the e1000 driver which is in the 2.6.0-test6 kernel, which I thought was the intel provided driver. The server is co-located now, so I'm sorry to say that I can't try again to give more details. > > Btw2, can somebody please explain what the option E1000_NAPI does? > > NAPI is a network driver polling mode interface. It enables a form of > software managed interrupt moderation, and may result in better > performance under some traffic patterns (specifically sustained high > packet rate reception). Aha, tnx. Can you please provide a patch to get this text in the 2.6 help? From mitch@sfgoth.com Fri Oct 3 23:50:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 03 Oct 2003 23:50:57 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h946oO25003405 for ; Fri, 3 Oct 2003 23:50:24 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h946xP16094554; Fri, 3 Oct 2003 23:59:25 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h946xPi7094553; Fri, 3 Oct 2003 23:59:25 -0700 (PDT) (envelope-from mitch) Date: Fri, 3 Oct 2003 23:59:25 -0700 From: Mitchell Blank Jr To: "David S. Miller" Cc: chas3@users.sourceforge.net, chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-ID: <20031004065925.GB94203@gaz.sfgoth.com> References: <200310011134.h91BYPkT003172@ginger.cmf.nrl.navy.mil> <20031001054226.126cea7b.davem@redhat.com> <20031003022615.GA42593@gaz.sfgoth.com> <20031003065824.713627c6.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031003065824.713627c6.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 532 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev David S. Miller wrote: > Part of that is using the rtnl semaphore etc. I've thought about this some more and I think we really DO want a per-atm-device semaphore for this rather than overloading rtnl_sem. A device like an ADSL card might need to do a complete physical-layer negotiation when you open a VCC (assuming there were no VCCs open before) This could take on the order of a minute if it fails. You don't want to be hogging rtnl_sem for that long. -Mitch From chas@cmf.nrl.navy.mil Sat Oct 4 05:50:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 04 Oct 2003 05:50:41 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h94Co625026376 for ; Sat, 4 Oct 2003 05:50:06 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h94Co0kT017402; Sat, 4 Oct 2003 08:50:00 -0400 (EDT) Message-Id: <200310041250.h94Co0kT017402@ginger.cmf.nrl.navy.mil> To: Mitchell Blank Jr cc: "David S. Miller" , netdev@oss.sgi.com Reply-To: chas3@users.sourceforge.net Subject: Re: [RFC] add rtnl semaphore to linux-atm In-reply-to: Your message of "Fri, 03 Oct 2003 23:59:25 PDT." <20031004065925.GB94203@gaz.sfgoth.com> Date: Sat, 04 Oct 2003 08:50:00 -0400 From: chas williams X-Spam-Score: (*) hits=1.7 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 533 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev just to summarize the last couple messages and my thoughts about all of this: atm_dev will become a netdevice in the future. there is no good reason it shouldnt. the atm layer needs to start doing things the 'netdevice' way. ATM_ITF_ANY is rarely used. we just need it to work properly with a minimum of effort. the rtnl semaphore blocks modifications to the device list so routines that might sleep can safely iterate it. there are (currently) no atm devices with slow open routines so please dont bother with hypothetical devices. people who use ATM_ITF_ANY are going to pay a penalty. that's just the way it is. its a bit of a bad idea really. what if you want something like round-robin instead of in-order? should vcc->open() and vcc->close() sleep? this is a problem for some people. i can see why you might want to sleep in close() -- like waiting for all the skb's to transmit/return, but this is only because vcc's dont hold a per skb reference count and dont know when its safe to go away (and this becuase the atm transmit side doesnt skb_clone() like it should). serialization for open/change_qos/close should be handled in the driver (assuming we are discussing serialization across different vcc's and not a single vcc -- a single vcc case is already handled via lock_sock). if your driver h/w doesnt need this, then it shouldnt be thrust upon you. further, i believe this is wrong thinking. what data are you protecting with this lock? (the he driver has a 'global' lock, but its used to protect the register space, which has a serialization effect). vcc_sklist holds a list of sockets active or otherwise. the atm layer already has flags (ATM_VF_READY) that indicate if a vcc is ready to recv. it is unfortunate that the bh's of most drivers dont bother to check this bit (assuming some other mechanism isnt used to prevent the bottom half from running while opening/preparing a vcc). in the future (and this isnt a hypothetical driver) vcc's will probably live slightly longer than the close routine (those outstanding skbs) and cant be removed from the vcc_sklist until every last reference is gone. yes, this means that close could finish but you wouldnt be able to open the vpi/vci again right away. From mitch@sfgoth.com Sat Oct 4 12:42:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 04 Oct 2003 12:43:17 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h94Jge25016146 for ; Sat, 4 Oct 2003 12:42:41 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h94Jgh16013332; Sat, 4 Oct 2003 12:42:43 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h94Jghw3013331; Sat, 4 Oct 2003 12:42:43 -0700 (PDT) (envelope-from mitch) Date: Sat, 4 Oct 2003 12:42:42 -0700 From: Mitchell Blank Jr To: chas3@users.sourceforge.net Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-ID: <20031004194242.GC94203@gaz.sfgoth.com> References: <20031004065925.GB94203@gaz.sfgoth.com> <200310041250.h94Co0kT017402@ginger.cmf.nrl.navy.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200310041250.h94Co0kT017402@ginger.cmf.nrl.navy.mil> User-Agent: Mutt/1.4.1i X-archive-position: 534 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev chas williams wrote: > atm_dev will become a netdevice in the future. there is no good reason > it shouldnt. Agreed. I'm not sure if it's a giant win (since atm devices are pretty unique) but you seem pretty gung-ho about converting it so I'll trust you on it. > there are > (currently) no atm devices with slow open routines so please dont bother > with hypothetical devices. Well that might be true in the tree. I think as more DSL adpaters are supported this will change. The atm_dev->open() is really the only sane place currently to kick-off DSL negotiation (so the link is brought up when pppd or whatever is started) > people who use ATM_ITF_ANY are going to pay > a penalty. that's just the way it is. its a bit of a bad idea really. > what if you want something like round-robin instead of in-order? Exactly - its a userspace problem. > i can see why you might want to sleep in close() -- like waiting > for all the skb's to transmit/return, but this is only because vcc's dont > hold a per skb reference count and dont know when its safe to go away I can't speak for all the cards but at least lanai.c has to sleep in ->close() due to hardware issues. Each VCC has its own cell buffers allocated which the card DMAs into. When you close a vcc you need to wait for an internal RX queue to drain before you can safely free the buffer or you might end up scribbling on random memory. The only alternative I can think of would be to have the buffer free kicked off later from a tasklet or someting but that could get pretty gross. Plus as I mentioned DSL adapters have good reason to sleep in open/close. Since we require VCCs to be opened and closed from process context this isn't a problem (as long as we do the locking correctly) > serialization for open/change_qos/close should be handled in the > driver (assuming we are discussing serialization across different > vcc's and not a single vcc -- a single vcc case is already > handled via lock_sock). if your driver h/w doesnt need this, then > it shouldnt be thrust upon you. Its a matter of opinion. My feelings are: 1. Serializing these operations through a semaphore shouldn't affect performance one bit - even in conditions where open/close happen relatively frequently (say, LANE) there would still be negligable contention on the semaphore 2. Given the rather spotty history of ATM drivers and SMP I'd rather keep the driver API as safe as possible. Basically the driver should only have to worry about locking when dealing with the rx/tx paths (and there are still lots of problems there I think) Everything else can be safely serialized by the ATM layer > vcc_sklist holds a list of sockets active or otherwise. the atm layer > already has flags (ATM_VF_READY) that indicate if a vcc is ready to recv. Unfortunately the flag is currently managed by the driver instead of the ATM layer. If you're willing to strip out all of the ATM_VF_* use inside of the drivers then yes we can use that flag. > it is unfortunate that the bh's of most drivers dont bother to check this > bit This is just a matter of adding an efficient API for searching for vpi/vci's (as we recently discussed on l-a-g) If that was done then we could get rid of the duplicated data strucutres that exist in most of the drivers (and get rid of a whole class of races in the rx paths) Then the ATM layer can easily handle checking the ATM_VF_READY flag. > in the future (and this > isnt a hypothetical driver) vcc's will probably live slightly longer than > the close routine (those outstanding skbs) and cant be removed from the > vcc_sklist until every last reference is gone. yes, this means that close > could finish but you wouldnt be able to open the vpi/vci again right away. I don't think that's the case at all - you could safely remove the vcc from the list at ->close time (but not free its memory until the last reference disappears) Then an ->open would see the vpi/vci as free immediately (which should be safe) -Mitch From hadi@cyberus.ca Sat Oct 4 13:02:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 04 Oct 2003 13:02:50 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h94K2F25017693 for ; Sat, 4 Oct 2003 13:02:15 -0700 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 1A5sbS-000Gpv-00; Sat, 04 Oct 2003 16:02:10 -0400 Subject: Re: [RFC] [PATCH 1/3] netpoll api From: jamal Reply-To: hadi@cyberus.ca To: Matt Mackall Cc: netdev@oss.sgi.com, Andrew Morton , Jeff Garzik In-Reply-To: <20031003191116.GA13573@waste.org> References: <20031003014104.GR1897@waste.org> <1065179359.1031.42.camel@jzny.localdomain> <20031003191116.GA13573@waste.org> Content-Type: text/plain Organization: jamalopolis Message-Id: <1065297729.1031.73.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Oct 2003 16:02:09 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 535 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 On Fri, 2003-10-03 at 15:11, Matt Mackall wrote: > > Nice. > > Is the ethernet card in a case like this almost dedicated for this > > kind of work? > > No, I've had good results with it as the only interface to the > machine. As netpoll traffic is fairly infrequent, performance seems > little affected. > Ok, I suppose if you are running some serious server you wont be debugging either. Did i understand correctly that no netpoll trafic translates to a device being removed from the poll list? i.e only when theres traffic to send for example would the controller be invoked? > > Is disable_irq() in the controller safe for shared irqs? Or maybe this > > is critical enough that you dont care? > > I'm not aware of any issues there. I understand Red Hat has banged on > this piece pretty heavily recently for their AS kernel. > Lets say you have a vga card and ethernet sharing the same irq and doing a lot of debugging ... would disabling that shared irq kill the display for example? > > Its a little wasteful to call the controller when there are is no work > > to be done; we have found in NAPI that any extra PCI transactions cost. > > (some IBM people doing benchmarking have complained about specweb not > > looking good where NAPI will have one extra PCI transaction per packet. > > You do it twice the rate NAPI would do it at low speeds). > > Again, the answer maybe who cares, this is critical work. > > Just to be sure you read this right, the poll method (NAPI) is > different from poll_controller (netpoll). The name is unfortunate, but > it's what Ingo had in his early 2.4 netconsole patches. I could > s/poll_controller/netpoll/ perhaps. > Actually the name is proper since polling is involved. I can see the confusion with NAPI - so from that angle changing it to something more descriptive of its function rather than how it achieves it would help. > The NAPI method only gets called when we've frozen the system (kgdb or > netdump) and we're the only ones checking for rx work. The netpoll > method gets called in that case and when something like netconsole is > sending out printks (eg low bandwidth or high priority). > netpoll calls the interupt handler which typically involved substantial PCI reads (and maybe writes). Calling such routines when theres no state change in the PCI registers is what i refered to as a waste. This is a non-issue under normal conditions since an interupt signals a state change. It wouldnt matter if it is event driven (i.e for a brief period of time when netconsole has traffic to send thats what you do). It also wouldnt matter if you are using the box as dev. environment etc. cheers, jamal From oxymoron@waste.org Sat Oct 4 13:33:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 04 Oct 2003 13:34:28 -0700 (PDT) Received: from waste.org (waste.org [209.173.204.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h94KXp25020380 for ; Sat, 4 Oct 2003 13:33:52 -0700 Received: from waste.org (localhost [127.0.0.1]) by waste.org (8.12.3/8.12.3/Debian-6.6) with ESMTP id h94KX8RT008304; Sat, 4 Oct 2003 15:33:08 -0500 Received: (from oxymoron@localhost) by waste.org (8.12.3/8.12.3/Debian-6.6) id h94KX4Ir008301; Sat, 4 Oct 2003 15:33:04 -0500 Date: Sat, 4 Oct 2003 15:33:04 -0500 From: Matt Mackall To: jamal Cc: netdev@oss.sgi.com, Andrew Morton , Jeff Garzik Subject: Re: [RFC] [PATCH 1/3] netpoll api Message-ID: <20031004203304.GD13573@waste.org> References: <20031003014104.GR1897@waste.org> <1065179359.1031.42.camel@jzny.localdomain> <20031003191116.GA13573@waste.org> <1065297729.1031.73.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1065297729.1031.73.camel@jzny.localdomain> User-Agent: Mutt/1.3.28i X-Virus-Scanned: by amavisd-new X-archive-position: 536 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mpm@selenic.com Precedence: bulk X-list: netdev On Sat, Oct 04, 2003 at 04:02:09PM -0400, jamal wrote: > On Fri, 2003-10-03 at 15:11, Matt Mackall wrote: > > > > Nice. > > > Is the ethernet card in a case like this almost dedicated for this > > > kind of work? > > > > No, I've had good results with it as the only interface to the > > machine. As netpoll traffic is fairly infrequent, performance seems > > little affected. > > > > Ok, I suppose if you are running some serious server you wont be > debugging either. Did i understand correctly that no netpoll trafic > translates to a device being removed from the poll list? i.e only when > theres traffic to send for example would the controller be invoked? Polling is only on demand. Eg, in the netconsole case, polling only happens to push a packet out when a printk occurs. In the netdump or kgdb case, the entire machine is essentially brought to a halt anyway, so overhead is irrelevant. > > > Is disable_irq() in the controller safe for shared irqs? Or maybe this > > > is critical enough that you dont care? > > > > I'm not aware of any issues there. I understand Red Hat has banged on > > this piece pretty heavily recently for their AS kernel. > > > > Lets say you have a vga card and ethernet sharing the same irq and doing > a lot of debugging ... would disabling that shared irq kill the display > for example? Yes. Again, in the netconsole case, this will only happen when a printk is occurring. Netconsole is primarily of interest for debugging or replacing serial console for headless servers. In the 'replacing serial console' case, it actually reduces overhead because polling the network is much faster than polling serial. > > > Its a little wasteful to call the controller when there are is no work > > > to be done; we have found in NAPI that any extra PCI transactions cost. > > > (some IBM people doing benchmarking have complained about specweb not > > > looking good where NAPI will have one extra PCI transaction per packet. > > > You do it twice the rate NAPI would do it at low speeds). > > > Again, the answer maybe who cares, this is critical work. > > > > Just to be sure you read this right, the poll method (NAPI) is > > different from poll_controller (netpoll). The name is unfortunate, but > > it's what Ingo had in his early 2.4 netconsole patches. I could > > s/poll_controller/netpoll/ perhaps. > > > > Actually the name is proper since polling is involved. I can see the > confusion with NAPI - so from that angle changing it to something > more descriptive of its function rather than how it achieves it would > help. Ok, netpoll it is. -- Matt Mackall : http://www.selenic.com : of or relating to the moon From oxymoron@waste.org Sat Oct 4 19:55:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 04 Oct 2003 19:55:58 -0700 (PDT) Received: from waste.org (waste.org [209.173.204.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h952tM25007652 for ; Sat, 4 Oct 2003 19:55:23 -0700 Received: from waste.org (localhost [127.0.0.1]) by waste.org (8.12.3/8.12.3/Debian-6.6) with ESMTP id h952tCRT009087; Sat, 4 Oct 2003 21:55:12 -0500 Received: (from oxymoron@localhost) by waste.org (8.12.3/8.12.3/Debian-6.6) id h952tCAH009085; Sat, 4 Oct 2003 21:55:12 -0500 Date: Sat, 4 Oct 2003 21:55:12 -0500 From: Matt Mackall To: Jeff Garzik Cc: netdev@oss.sgi.com, Andrew Morton Subject: Re: [RFC] [PATCH 2/3] tg3 netpoll hook Message-ID: <20031005025512.GF13573@waste.org> References: <20031003014505.GS1897@waste.org> <3F7F857D.5010504@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F7F857D.5010504@pobox.com> User-Agent: Mutt/1.3.28i X-Virus-Scanned: by amavisd-new X-archive-position: 537 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mpm@selenic.com Precedence: bulk X-list: netdev On Sat, Oct 04, 2003 at 10:44:13PM -0400, Jeff Garzik wrote: > Matt Mackall wrote: > > l-mpm/drivers/net/tg3.c | 16 ++++++++++++++++ > > 1 files changed, 16 insertions(+) > > > >diff -puN drivers/net/tg3.c~tg3-poll drivers/net/tg3.c > >+++ l-mpm/drivers/net/tg3.c 2003-09-25 11:56:37.000000000 -0500 > >@@ -2475,6 +2475,15 @@ static irqreturn_t tg3_interrupt(int irq > > static int tg3_init_hw(struct tg3 *); > > static int tg3_halt(struct tg3 *); > > > >+#ifdef HAVE_POLL_CONTROLLER > >+static void tg3_poll_controller(struct net_device *dev) > >+{ > >+ disable_irq(dev->irq); > >+ tg3_interrupt (dev->irq, dev, NULL); > >+ enable_irq(dev->irq); > >+} > >+#endif > >+ > > static void tg3_reset_task(void *_data) > > { > > struct tg3 *tp = _data; > >@@ -7482,6 +7491,10 @@ static struct pci_dev * __devinit tg3_fi > > return peer; > > } > > > >+#ifdef HAVE_POLL_CONTROLLER > >+static void tg3_poll_controller(struct net_device *dev); > >+#endif > > This prototype is pointless. Indeed. Have an opinion on s/->poll_controller/->netpoll/? -- Matt Mackall : http://www.selenic.com : of or relating to the moon From jgarzik@pobox.com Sat Oct 4 20:11:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 04 Oct 2003 20:12:26 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h953Bq25008163 for ; Sat, 4 Oct 2003 20:11:52 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36263 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A5zJG-0001Xo-Un; Sun, 05 Oct 2003 04:11:51 +0100 Message-ID: <3F7F8BDF.5000903@pobox.com> Date: Sat, 04 Oct 2003 23:11:27 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matt Mackall CC: netdev@oss.sgi.com, Andrew Morton Subject: Re: [RFC] [PATCH 2/3] tg3 netpoll hook References: <20031003014505.GS1897@waste.org> <3F7F857D.5010504@pobox.com> <20031005025512.GF13573@waste.org> In-Reply-To: <20031005025512.GF13573@waste.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 538 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 Matt Mackall wrote: > Have an opinion on s/->poll_controller/->netpoll/? I have an opinion, yes :) which I despise myself for holding... I don't like either name, but don't have any better suggestions either, besides something extremely verbose like ->process_hw_events(). "poll_controller" is annoying because (a) it's way too close to NAPI, but (b) it's a reasonably accurate description of what it does. I think "netpoll" is even worse... It describes who calls it, not what it does. Jeff From kaos@ocs.com.au Sat Oct 4 20:16:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 04 Oct 2003 20:16:59 -0700 (PDT) Received: from mail.ocs.com.au (mail.ocs.com.au [203.34.97.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h953GO25008591 for ; Sat, 4 Oct 2003 20:16:25 -0700 Received: (qmail 8026 invoked from network); 5 Oct 2003 03:16:21 -0000 Received: from ocs3.intra.ocs.com.au (192.168.255.3) by mail.ocs.com.au with SMTP; 5 Oct 2003 03:16:21 -0000 Received: by ocs3.intra.ocs.com.au (Postfix, from userid 16331) id 4C66BC02B9; Sun, 5 Oct 2003 13:16:20 +1000 (EST) Received: from ocs3.intra.ocs.com.au (localhost [127.0.0.1]) by ocs3.intra.ocs.com.au (Postfix) with ESMTP id 4A59A14008E; Sun, 5 Oct 2003 13:16:20 +1000 (EST) X-Mailer: exmh version 2.5 01/15/2001 with nmh-1.0.4 From: Keith Owens To: Jeff Garzik Cc: Matt Mackall , netdev@oss.sgi.com, Andrew Morton Subject: Re: [RFC] [PATCH 2/3] tg3 netpoll hook In-reply-to: Your message of "Sat, 04 Oct 2003 23:11:27 -0400." <3F7F8BDF.5000903@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 05 Oct 2003 13:16:19 +1000 Message-ID: <31674.1065323779@ocs3.intra.ocs.com.au> X-archive-position: 539 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaos@ocs.com.au Precedence: bulk X-list: netdev On Sat, 04 Oct 2003 23:11:27 -0400, Jeff Garzik wrote: >Matt Mackall wrote: >> Have an opinion on s/->poll_controller/->netpoll/? >I don't like either name, but don't have any better suggestions either, >besides something extremely verbose like ->process_hw_events(). > >"poll_controller" is annoying because (a) it's way too close to NAPI, >but (b) it's a reasonably accurate description of what it does. > >I think "netpoll" is even worse... It describes who calls it, not what >it does. ->polled_io ? From jgarzik@pobox.com Sat Oct 4 21:17:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 04 Oct 2003 21:17:45 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h954HA25012058 for ; Sat, 4 Oct 2003 21:17:11 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36231 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A5ysu-0001LY-Gy; Sun, 05 Oct 2003 03:44:36 +0100 Message-ID: <3F7F857D.5010504@pobox.com> Date: Sat, 04 Oct 2003 22:44:13 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matt Mackall CC: netdev@oss.sgi.com, Andrew Morton Subject: Re: [RFC] [PATCH 2/3] tg3 netpoll hook References: <20031003014505.GS1897@waste.org> In-Reply-To: <20031003014505.GS1897@waste.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 541 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 Matt Mackall wrote: > l-mpm/drivers/net/tg3.c | 16 ++++++++++++++++ > 1 files changed, 16 insertions(+) > > diff -puN drivers/net/tg3.c~tg3-poll drivers/net/tg3.c > --- l/drivers/net/tg3.c~tg3-poll 2003-09-25 11:47:30.000000000 -0500 > +++ l-mpm/drivers/net/tg3.c 2003-09-25 11:56:37.000000000 -0500 > @@ -2475,6 +2475,15 @@ static irqreturn_t tg3_interrupt(int irq > static int tg3_init_hw(struct tg3 *); > static int tg3_halt(struct tg3 *); > > +#ifdef HAVE_POLL_CONTROLLER > +static void tg3_poll_controller(struct net_device *dev) > +{ > + disable_irq(dev->irq); > + tg3_interrupt (dev->irq, dev, NULL); > + enable_irq(dev->irq); > +} > +#endif > + > static void tg3_reset_task(void *_data) > { > struct tg3 *tp = _data; > @@ -7482,6 +7491,10 @@ static struct pci_dev * __devinit tg3_fi > return peer; > } > > +#ifdef HAVE_POLL_CONTROLLER > +static void tg3_poll_controller(struct net_device *dev); > +#endif This prototype is pointless. > @@ -7632,6 +7645,9 @@ static int __devinit tg3_init_one(struct > dev->watchdog_timeo = TG3_TX_TIMEOUT; > dev->change_mtu = tg3_change_mtu; > dev->irq = pdev->irq; > +#ifdef HAVE_POLL_CONTROLLER > + dev->poll_controller = tg3_poll_controller; > +#endif > > err = tg3_get_invariants(tp); > if (err) { > > _ > > From jgarzik@pobox.com Sat Oct 4 21:17:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 04 Oct 2003 21:17:43 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h954H725012053 for ; Sat, 4 Oct 2003 21:17:08 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36268 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A5zSf-0001aV-IS; Sun, 05 Oct 2003 04:21:33 +0100 Message-ID: <3F7F8E26.3080307@pobox.com> Date: Sat, 04 Oct 2003 23:21:10 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Keith Owens CC: Matt Mackall , netdev@oss.sgi.com, Andrew Morton Subject: Re: [RFC] [PATCH 2/3] tg3 netpoll hook References: <31674.1065323779@ocs3.intra.ocs.com.au> In-Reply-To: <31674.1065323779@ocs3.intra.ocs.com.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 540 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 Keith Owens wrote: > On Sat, 04 Oct 2003 23:11:27 -0400, > Jeff Garzik wrote: > >>Matt Mackall wrote: >> >>>Have an opinion on s/->poll_controller/->netpoll/? >> >>I don't like either name, but don't have any better suggestions either, >>besides something extremely verbose like ->process_hw_events(). >> >>"poll_controller" is annoying because (a) it's way too close to NAPI, >>but (b) it's a reasonably accurate description of what it does. >> >>I think "netpoll" is even worse... It describes who calls it, not what >>it does. > > > ->polled_io ? Not too bad... Better than any suggestion of mine, at any rate :) Jeff From wsx@6com.sk Sun Oct 5 02:18:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 02:19:21 -0700 (PDT) Received: from mail.6com.sk (postfix@cement.ksp.edi.fmph.uniba.sk [158.195.16.151] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h959Ik25031377 for ; Sun, 5 Oct 2003 02:18:46 -0700 Received: by mail.6com.sk (Postfix, from userid 501) id 105AD20C22; Sun, 5 Oct 2003 11:18:45 +0200 (CEST) Date: Sun, 5 Oct 2003 11:18:45 +0200 From: Jan Oravec To: "David S. Miller" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPv6, sit: set prefix length 64 for link-local addresses Message-ID: <20031005091844.GA23676@wsx.ksp.sk> Reply-To: Jan Oravec References: <20030926175405.GA31498@wsx.ksp.sk> <20030926201953.3dfc67bf.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030926201953.3dfc67bf.davem@redhat.com> User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 542 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev Hello, The mail with the patch was not delivered to netdev ML for some reasons. Resending it.. The function sit_add_v4_addrs() calls ipv6_add_addr() with plen 64 if local endpoint of tunnel is not configured, so I do not see a reason to set plen to 128 if local endpoint is configured. We are running patched kernel in our test-lab for about week and it is working fine. On Fri, Sep 26, 2003 at 08:19:53PM -0700, David S. Miller wrote: > On Fri, 26 Sep 2003 19:54:05 +0200 > Jan Oravec wrote: > > > please apply the following patch. > > > > It sets the prefix length 64 instead of 128 for link-local addresses on sit interfaces. > > I've seen this patch before, and I remember it being rejected > by other ipv6 developers. > > Do the USAGI or other folks remember what is going on here? --- linux/net/ipv6/addrconf.c.orig 2003-09-08 21:50:29.000000000 +0200 +++ linux/net/ipv6/addrconf.c 2003-09-26 19:37:27.000000000 +0200 @@ -1681,7 +1681,7 @@ } if (addr.s6_addr32[3]) { - ifp = ipv6_add_addr(idev, &addr, 128, scope, IFA_F_PERMANENT); + ifp = ipv6_add_addr(idev, &addr, 64, scope, IFA_F_PERMANENT); if (!IS_ERR(ifp)) { spin_lock_bh(&ifp->lock); ifp->flags &= ~IFA_F_TENTATIVE; Best Regards, -- Jan Oravec 6COM s.r.o. http://www.6com.sk From wsx@6com.sk Sun Oct 5 02:21:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 02:21:39 -0700 (PDT) Received: from mail.6com.sk (postfix@cement.ksp.edi.fmph.uniba.sk [158.195.16.151] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h959Kt25031711 for ; Sun, 5 Oct 2003 02:20:55 -0700 Received: by mail.6com.sk (Postfix, from userid 501) id 7ABF120C1F; Sun, 5 Oct 2003 11:06:10 +0200 (CEST) Date: Sun, 5 Oct 2003 11:06:10 +0200 From: Jan Oravec To: netdev@oss.sgi.com, davem@redhat.com Subject: [PATCH] IPv6, mcast: deactivate timers before ipv6_mc_destroy_dev() Message-ID: <20031005090610.GA23600@wsx.ksp.sk> Reply-To: Jan Oravec Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 543 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev Hello, the following patch calls ipv6_mc_down(idev) to deactivate timers. If we do not deactivate them, the following may happen: 1) remove last IPv6 address from the interface - mld_ifc_timer may be active, thus referencing idev - addrconf_ifdown() is called (which calls ipv6_mc_destroy_dev()), removing all references to idev except the timer reference - timer expires, mld_ifc_timer_expire() is called, reference to idev is removed, but not tested (__in6_dev_put()) - idev is not removed and it is referencing dev 2) destroy interface - idev's reference to dev never disappears --- linux/net/ipv6/mcast.c.orig 2003-09-28 02:50:53.000000000 +0200 +++ linux/net/ipv6/mcast.c 2003-10-05 10:42:57.535993672 +0200 @@ -2029,6 +2029,9 @@ struct ifmcaddr6 *i; struct in6_addr maddr; + /* Deactivate timers */ + ipv6_mc_down(idev); + /* Delete all-nodes address. */ ipv6_addr_all_nodes(&maddr); Best Regards, -- Jan Oravec 6COM s.r.o. http://www.6com.sk From wsx@6com.sk Sun Oct 5 02:37:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 02:38:09 -0700 (PDT) Received: from mail.6com.sk (postfix@cement.ksp.edi.fmph.uniba.sk [158.195.16.151] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h959bW25000785 for ; Sun, 5 Oct 2003 02:37:32 -0700 Received: by mail.6com.sk (Postfix, from userid 501) id 4962920C1F; Sun, 5 Oct 2003 11:37:31 +0200 (CEST) Date: Sun, 5 Oct 2003 11:37:31 +0200 From: Jan Oravec To: netdev@oss.sgi.com, davem@redhat.com Subject: BUG_ON() while creating/removing ipip interfaces Message-ID: <20031005093731.GA24023@wsx.ksp.sk> Reply-To: Jan Oravec Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 544 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev Hello, Assume that we have application 'A' and application 'B': A: cnt=0; while(1) { if_index=create_ipip("name%i", cnt++); listen_on_netlink_and_wait_for_if_destroy(if_index); } B: for i in `seq 0 100` do iptunnel del name$i done 'A' is written in C so it is much faster than 'B'. We run 'A', then 'B' (on linux-2.6.0-test5). Shortly after that this happens: kernel BUG at net/core/dev.c:2912! invalid operand: 0000 [#1] CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010297 EIP is at unregister_netdevice+0x19f/0x1fc eax: 00000001 ebx: 000089f2 ecx: c06b68e0 edx: c0f1c000 esi: c62b1c00 edi: 00000000 ebp: c62b1c00 esp: c0f1de8c ds: 007b es: 007b ss: 0068 Process iptunnel (pid: 8369, threadinfo=c0f1c000 task=c3218100) Stack: 00000025 0000000a c0f1df19 000089f2 ffffffff c04c67e6 c62b1c00 ffffffff 00003878 00000000 0000000a ffffffff 00000004 00000000 00000292 ffffffff ffffffff 00000000 c016ce20 cfef7b2c 000000d0 c0317b87 c0f1df18 3f0e20e8 Call Trace: [] ipip_tunnel_ioctl+0x236/0x440 [] d_alloc+0x20/0x1d0 [] vsprintf+0x27/0x30 [] dev_ifsioc+0x130/0x4b0 [] dev_get+0x21/0x50 [] dev_ioctl+0xe0/0x350 [] sock_ioctl+0x0/0x260 [] sock_ioctl+0x110/0x260 [] sys_ioctl+0x277/0x300 [] syscall_call+0x7/0xb Code: 0f 0b 60 0b 14 e1 62 c0 e9 9c fe ff ff c7 44 24 04 8f 0b 00 I have seen some recent patches for tunnel devices on netdev, but was not able to test it yet. Best Regards, -- Jan Oravec 6COM s.r.o. http://www.6com.sk From ja@ssi.bg Sun Oct 5 03:30:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 03:30:45 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h95AN925005526 for ; Sun, 5 Oct 2003 03:23:13 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h9599K201576; Sun, 5 Oct 2003 12:09:23 +0300 Date: Sun, 5 Oct 2003 12:09:20 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: Rusty Russell , Wensong Zhang , Subject: [2.6 PATCH] ipvs - properly handle non-linear skbs Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1607745702-212897576-1065344960=:1204" X-archive-position: 545 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --1607745702-212897576-1065344960=:1204 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, Attached is a patch that includes the changes from Rusty about handling non-linear skbs correctly and modified a bit from Wensong Zhang and me. This is a huge patch that changes interfaces for many functions. It looks difficult to split it in parts but if required we can try to do it. It is ready for inclusion. Regards -- Julian Anastasov --1607745702-212897576-1065344960=:1204 Content-Type: APPLICATION/x-gzip; name="nonlinear-test5-1.diff.gz" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Handle non-linear skbs Content-Disposition: attachment; filename="nonlinear-test5-1.diff.gz" H4sICNkjfz8AA25vbmxpbmVhci10ZXN0NS0xLmRpZmYA7Fxrd9vG0f4M/Yq1 c6qSBEnxrotjNbYsuzqxKVWi0uRNclAIWIqIQADBgro09X/vzOziRgC82G7S nvMqjkQuZnZnZ2dnntkLvmKTmSMY/DPZayf6lvOAh+yWezw0I26zwIysGZv6 IYtmHP66rv/geLcsCP1fuBUd7XzFLuRHNjbn/Ii9d7zFI7vjocddFoWcAwU1 kdQ0NyNsz/Ei7tnQBFb+bnytCCx/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PMfxaNjRIRzF5 oL6pml6JM4AFlVf1hyuvqgWqCHLqCFzVleKj/SHNf0xNJQiyVGHDy0PqaTyk nsZDRH/yiRQ6T9hpm9U6ZQcVsrxcWVJZ7UkMmXTtQFZ1+/izAqXbd4+5HHLo FxGAatCoJMwE+LzLqphy17EomAA62Vo8ochpujZZmgtFE2UazekPbtH58hLk HKg3gr0OVXRHkwnFqmKjUThlOI3M/WWIEw+/3sFswmwJqZ8gXkvFtdJSzmPo C2UMh+Q6bdnRCENlbFscKgs63hl0nYtYpt7Nq/VSm5lYmN7QpBVCYY2MGTBW ds+msabs82qO4vIELvHWiJY5VMmyNtcJOzM87kjYWtf4/GQPqWvEeGgPK1Pm JQmLQkaUOioQcEwwoJEYYPS5suIMowzadaAhwV9/BZZfRbIAx5CKx+3pOQkE 92DhyDgoBkzaqrElxEMkjnDs6rW64/26j+4Vt7BxQvK/K5djYK8KM+AaKuwM JSriv2nU+EQfHTWssgzHlI4NKcEaykM+M0S3VKg3HOoztekeRXQOFhKdOaDi ag2EzvUNDcVE+rbtvy1rDyGUkhbTrf1/JvV3+L56AQA= --1607745702-212897576-1065344960=:1204-- From davem@pizda.ninka.net Sun Oct 5 05:24:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 05:24:41 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h95CO525017066 for ; Sun, 5 Oct 2003 05:24:05 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id FAA27077; Sun, 5 Oct 2003 05:19:13 -0700 Date: Sun, 5 Oct 2003 05:19:13 -0700 From: "David S. Miller" To: Julian Anastasov Cc: rusty@rustcorp.com.au, wensong@linux-vs.org, netdev@oss.sgi.com Subject: Re: [2.6 PATCH] ipvs - properly handle non-linear skbs Message-Id: <20031005051913.0df50683.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 546 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 On Sun, 5 Oct 2003 12:09:20 +0300 (EEST) Julian Anastasov wrote: > Attached is a patch that includes the changes from > Rusty about handling non-linear skbs correctly and modified > a bit from Wensong Zhang and me. Patch applied, thanks to everyone for following through on this work. From yoshfuji@linux-ipv6.org Sun Oct 5 05:27:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 05:28:26 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h95CRr25017413 for ; Sun, 5 Oct 2003 05:27:53 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h95CSkft008590; Sun, 5 Oct 2003 21:28:53 +0900 Date: Sun, 05 Oct 2003 21:28:46 +0900 (JST) Message-Id: <20031005.212846.50858920.yoshfuji@linux-ipv6.org> To: jan.oravec@6com.sk Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6, sit: set prefix length 64 for link-local addresses From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031005091844.GA23676@wsx.ksp.sk> References: <20030926175405.GA31498@wsx.ksp.sk> <20030926201953.3dfc67bf.davem@redhat.com> <20031005091844.GA23676@wsx.ksp.sk> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 547 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 <20031005091844.GA23676@wsx.ksp.sk> (at Sun, 5 Oct 2003 11:18:45 +0200), Jan Oravec says: > The function sit_add_v4_addrs() calls ipv6_add_addr() with plen 64 if local > endpoint of tunnel is not configured, so I do not see a reason to set plen > to 128 if local endpoint is configured. This patch seems logically wrong. --yoshfuji From wensong@linux-vs.org Sun Oct 5 05:47:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 05:48:09 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h95ClU25017899 for ; Sun, 5 Oct 2003 05:47:33 -0700 Received: from penguin.linux-vs.org ([211.136.72.123]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h95Ckb6v031611 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sun, 5 Oct 2003 20:46:58 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h95CfYeN001962; Sun, 5 Oct 2003 20:42:14 +0800 Date: Sun, 5 Oct 2003 20:41:34 +0800 (CST) From: Wensong Zhang To: "David S. Miller" cc: Rusty Russell , Julian Anastasov , Subject: [2.6 PATCH] ipvs - two additional minor patches Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; BOUNDARY="-1463755008-1767717351-1065357462=:1942" Content-ID: X-archive-position: 548 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463755008-1767717351-1065357462=:1942 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: Hi, Here are two additional minor patches for IPVS in the kernel 2.6. The ip_vs_conn_unlock.patch is to fix the unlocking bug in the ip_vs_conn_seq_stop, otherwise listing connections would cause the system lock up. The ip_vs_procfs.patch is to the #ifdef CONFIG_PROC_FS macro for proc file creation/destruction. Please consider to include them. Thanks, Wensong ---1463755008-1767717351-1065357462=:1942 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="ip_vs_conn_unlock.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME="ip_vs_conn_unlock.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTM4NiAgLT4gMS4xMzg3IA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX2Nvbm4uYwkxLjEwICAgIC0+IDEuMTEgICAN CiMNCiMgVGhlIGZvbGxvd2luZyBpcyB0aGUgQml0S2VlcGVyIENoYW5nZVNl dCBMb2cNCiMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0NCiMgMDMvMTAvMDQJd2Vuc29uZ0BsaW51eC12cy5vcmcJMS4x Mzg3DQojIFtJUFZTXSBmaXggdGhlIHVubG9ja2luZyBidWcgaW4gdGhlIGlw X3ZzX2Nvbm5fc2VxX3N0b3ANCiMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0NCiMNCmRpZmYgLU5ydSBhL25ldC9pcHY0 L2lwdnMvaXBfdnNfY29ubi5jIGIvbmV0L2lwdjQvaXB2cy9pcF92c19jb25u LmMNCi0tLSBhL25ldC9pcHY0L2lwdnMvaXBfdnNfY29ubi5jCVNhdCBPY3Qg IDQgMjI6NTQ6NTggMjAwMw0KKysrIGIvbmV0L2lwdjQvaXB2cy9pcF92c19j b25uLmMJU2F0IE9jdCAgNCAyMjo1NDo1OCAyMDAzDQpAQCAtNjcwLDggKzY3 MCw4IEBADQogew0KIAlzdHJ1Y3QgbGlzdF9oZWFkICpsID0gc2VxLT5wcml2 YXRlOw0KIA0KLQlpZiAobCkgDQotCQljdF9yZWFkX3VubG9jayhsIC0gaXBf dnNfY29ubl90YWIpOw0KKwlpZiAobCkNCisJCWN0X3JlYWRfdW5sb2NrX2Jo KGwgLSBpcF92c19jb25uX3RhYik7DQogfQ0KIA0KIHN0YXRpYyBpbnQgaXBf dnNfY29ubl9zZXFfc2hvdyhzdHJ1Y3Qgc2VxX2ZpbGUgKnNlcSwgdm9pZCAq dikNCg== ---1463755008-1767717351-1065357462=:1942 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="ip_vs_procfs.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME="ip_vs_procfs.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvb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lyZXR1cm4gcmV0Ow0KIAl9DQogDQor I2lmZGVmIENPTkZJR19QUk9DX0ZTDQogCXByb2NfbmV0X2ZvcHNfY3JlYXRl KCJpcF92cyIsIDAsICZpcF92c19pbmZvX2ZvcHMpOw0KIAlwcm9jX25ldF9m b3BzX2NyZWF0ZSgiaXBfdnNfc3RhdHMiLDAsICZpcF92c19zdGF0c19mb3Bz KTsNCisjZW5kaWYNCiANCiAJaXB2NF92c190YWJsZS5zeXNjdGxfaGVhZGVy ID0NCiAJCXJlZ2lzdGVyX3N5c2N0bF90YWJsZShpcHY0X3ZzX3RhYmxlLnJv b3RfZGlyLCAwKTsNCkBAIC0yMjQyLDggKzIyNDIsMTAgQEANCiAJZGVsX3Rp bWVyX3N5bmMoJmRlZmVuc2VfdGltZXIpOw0KIAlpcF92c19raWxsX2VzdGlt YXRvcigmaXBfdnNfc3RhdHMpOw0KIAl1bnJlZ2lzdGVyX3N5c2N0bF90YWJs ZShpcHY0X3ZzX3RhYmxlLnN5c2N0bF9oZWFkZXIpOw0KKyNpZmRlZiBDT05G SUdfUFJPQ19GUw0KIAlwcm9jX25ldF9yZW1vdmUoImlwX3ZzX3N0YXRzIik7 DQogCXByb2NfbmV0X3JlbW92ZSgiaXBfdnMiKTsNCisjZW5kaWYNCiAJbmZf dW5yZWdpc3Rlcl9zb2Nrb3B0KCZpcF92c19zb2Nrb3B0cyk7DQogCUxlYXZl RnVuY3Rpb24oMik7DQogfQ0K ---1463755008-1767717351-1065357462=:1942-- From chas@cmf.nrl.navy.mil Sun Oct 5 05:53:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 05:53:42 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h95Cr325018280 for ; Sun, 5 Oct 2003 05:53:03 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h95CqvkT022363; Sun, 5 Oct 2003 08:52:57 -0400 (EDT) Message-Id: <200310051252.h95CqvkT022363@ginger.cmf.nrl.navy.mil> To: Mitchell Blank Jr cc: "David S. Miller" , netdev@oss.sgi.com Reply-To: chas3@users.sourceforge.net Subject: Re: [RFC] add rtnl semaphore to linux-atm In-reply-to: Your message of "Sat, 04 Oct 2003 12:42:42 PDT." <20031004194242.GC94203@gaz.sfgoth.com> Date: Sun, 05 Oct 2003 08:52:58 -0400 From: chas williams X-Spam-Score: () hits=-6.8 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 549 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev In message <20031004194242.GC94203@gaz.sfgoth.com>,Mitchell Blank Jr writes: >Agreed. I'm not sure if it's a giant win (since atm devices are pretty >unique) but you seem pretty gung-ho about converting it so I'll trust >you on it. well if you ignore the sysfs and notifier handling provided by netdevice and rtnetlink then no you dont really gain anything. but i can see a use for both of these things. like to watching the carrier status of an atm card. >Well that might be true in the tree. I think as more DSL adpaters are >supported this will change. The atm_dev->open() is really the only sane >place currently to kick-off DSL negotiation (so the link is brought up >when pppd or whatever is started) i am not sure the negotiation should be handled by the kernel. we will cross this bridge when we get there. i dont see a rush of people trying to add dsl drivers. in fact, the community seems to be pretty stingy with documentation about the dsl hardware. >> people who use ATM_ITF_ANY are going to pay a penalty >Exactly - its a userspace problem. so the idea is to fix it minimally. people who use it should be encouraged to change. i would either get rid of completely or make it work as before. not change the way it works. >I can't speak for all the cards but at least lanai.c has to sleep in >->close() due to hardware issues. Each VCC has its own cell buffers >allocated which the card DMAs into. When you close a vcc you need to >wait for an internal RX queue to drain before you can safely free the >buffer or you might end up scribbling on random memory. right. the he has the same problem. however, you should be sleeping in close. the vcc/sk should have a count of the outstanding skb's (i.e. loaned to the card). the he sends an interrupt when its done with a skb so you drop the refcount on the vcc/sk. when this reaches 0 the vcc/sk they go away and you dont have a problem. no sleeping in the vcc->close() since the removal of all outstanding skb's would be handled asychronously. currently this is impossible since the skb's coming in to the atm card's are typically owned by other layer. (which sort of explains vcc->pop()). > 2. Given the rather spotty history of ATM drivers and SMP I'd rather > keep the driver API as safe as possible. Basically the driver > should only have to worry about locking when dealing with the > rx/tx paths (and there are still lots of problems there I think) > Everything else can be safely serialized by the ATM layer i dont believe any of the smp problems have come from open/close/change_qos. almost all smp problems can be traced to a lack of locking on the appropriate data structures and the improper handling of skb's in the tx/rx paths. (and YOU CANT SLEEP IN SEND!) smp actually seems to be pretty stable now (however we do have a local 2.4 tree that is more 2.6 as far as atm). 2-way, 4-way, 128-way (this one has 4 adapters with a preliminary version of load-balancing). these hosts are atm only. >Unfortunately the flag is currently managed by the driver instead of the >ATM layer. If you're willing to strip out all of the ATM_VF_* use inside >of the drivers then yes we can use that flag. i believe that was the plan. >This is just a matter of adding an efficient API for searching for vpi/vci's >(as we recently discussed on l-a-g) If that was done then we could get rid >of the duplicated data strucutres that exist in most of the drivers (and >get rid of a whole class of races in the rx paths) well the linear seach is already fairly efficient for most people since most people dont have more than a handful of vcc's open at a time. my machine is pure atm and typically i only have about 12 vcc's open at a time. >I don't think that's the case at all - you could safely remove the vcc from >the list at ->close time (but not free its memory until the last reference >disappears) Then an ->open would see the vpi/vci as free immediately (which >should be safe) not sure about this. the fore200e seems to have a problem with reopening on a vcc while there still might be outstanding skb's on a vcc from a previos open/close. From wsx@6com.sk Sun Oct 5 06:16:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 06:17:10 -0700 (PDT) Received: from mail.6com.sk (postfix@cement.ksp.edi.fmph.uniba.sk [158.195.16.151] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h95DGP25018794 for ; Sun, 5 Oct 2003 06:16:26 -0700 Received: by mail.6com.sk (Postfix, from userid 501) id AC59820C1F; Sun, 5 Oct 2003 14:35:36 +0200 (CEST) Date: Sun, 5 Oct 2003 14:35:36 +0200 From: Jan Oravec To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6, sit: set prefix length 64 for link-local addresses Message-ID: <20031005123536.GA24311@wsx.ksp.sk> Reply-To: Jan Oravec References: <20030926175405.GA31498@wsx.ksp.sk> <20030926201953.3dfc67bf.davem@redhat.com> <20031005091844.GA23676@wsx.ksp.sk> <20031005.212846.50858920.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031005.212846.50858920.yoshfuji@linux-ipv6.org> User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 550 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev On Sun, Oct 05, 2003 at 09:28:46PM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > In article <20031005091844.GA23676@wsx.ksp.sk> (at Sun, 5 Oct 2003 11:18:45 +0200), Jan Oravec says: > > > The function sit_add_v4_addrs() calls ipv6_add_addr() with plen 64 if local > > endpoint of tunnel is not configured, so I do not see a reason to set plen > > to 128 if local endpoint is configured. > > This patch seems logically wrong. You mean the text above (current kernel implementation) or the patch which sets it to 64 in both cases? If the patch is wrong, can you explain why? Jan From davem@pizda.ninka.net Sun Oct 5 07:44:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 07:44:55 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h95EiJ25019791 for ; Sun, 5 Oct 2003 07:44:19 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA27451; Sun, 5 Oct 2003 07:39:31 -0700 Date: Sun, 5 Oct 2003 07:39:31 -0700 From: "David S. Miller" To: Wensong Zhang Cc: rusty@rustcorp.com.au, ja@ssi.bg, netdev@oss.sgi.com Subject: Re: [2.6 PATCH] ipvs - two additional minor patches Message-Id: <20031005073931.783bf673.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 551 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 On Sun, 5 Oct 2003 20:41:34 +0800 (CST) Wensong Zhang wrote: > Here are two additional minor patches for IPVS in the kernel 2.6. I'll apply these, thanks. From davem@pizda.ninka.net Sun Oct 5 07:55:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 07:56:20 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h95Etj25020206 for ; Sun, 5 Oct 2003 07:55:46 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA27476; Sun, 5 Oct 2003 07:50:59 -0700 Date: Sun, 5 Oct 2003 07:50:58 -0700 From: "David S. Miller" To: Wensong Zhang Cc: rusty@rustcorp.com.au, ja@ssi.bg, netdev@oss.sgi.com Subject: Re: [2.6 PATCH] ipvs - two additional minor patches Message-Id: <20031005075058.70532394.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 552 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 On Sun, 5 Oct 2003 20:41:34 +0800 (CST) Wensong Zhang wrote: > The ip_vs_procfs.patch is to the #ifdef CONFIG_PROC_FS macro for proc file > creation/destruction. I'm not applying this patch, it is completely not needed. linux/proc_fs.h defines two versions of these interfaces based upon whether CONFIG_PROC_FS is defined or not, when it is not defined calling the interfaces is a nop. In this way we don't have to litter the sources with tons of ifdefs like your patch was adding. From kevin@pheared.net Sun Oct 5 10:01:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 10:02:31 -0700 (PDT) Received: from taurus.lunarpages.com (taurus.lunarpages.com [64.235.234.121]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h95H1v25024353 for ; Sun, 5 Oct 2003 10:01:57 -0700 Received: from adsl-138-88-55-141.ba-dsg.net ([138.88.55.141] helo=ganon ident=kevin) by taurus.lunarpages.com with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1A6CGq-0008OF-DB; Sun, 05 Oct 2003 10:02:12 -0700 Date: Sun, 5 Oct 2003 13:01:54 -0400 From: Kevin Dwyer To: netdev@oss.sgi.com Cc: linux-ha@lists.linux-ha.org Subject: Strange UDP binding behavior (SO_BINDTODEVICE) Message-Id: <20031005130154.5bd9d182.kevin@pheared.net> X-Mailer: Sylpheed version 0.9.5claws28 (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Signature=_Sun__5_Oct_2003_13_01_54_-0400_MiYcidPLlDoJFbX=" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - taurus.lunarpages.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pheared.net X-archive-position: 553 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kevin@pheared.net Precedence: bulk X-list: netdev --Signature=_Sun__5_Oct_2003_13_01_54_-0400_MiYcidPLlDoJFbX= Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit Hello, We have come across something that may be a bug, unless this behavior was intentional. The problem can be simulated by creating a socket, setting SO_BINDTODEVICE, and binding to a port. Then, in a separate process we attempt to bind to the same port but without the SO_BINDTODEVICE option. The expected behavior is to get EINVAL because the port is already bound by a prior call. However, it succeeds, and the second process steals the first process' packets. The likely code in question resides in net/ipv4/udp.c: for (sk2 = udp_hash[snum & (UDP_HTABLE_SIZE - 1)]; sk2 != NULL; sk2 = sk2->next) { if (sk2->num == snum && sk2 != sk && sk2->bound_dev_if == sk->bound_dev_if && (!sk2->rcv_saddr || !sk->rcv_saddr || sk2->rcv_saddr == sk->rcv_saddr) && (!sk2->reuse || !sk->reuse)) goto fail; } The condition (sk2->bound_dev_if == sk->bound_dev_if) will fail because sk2->bound_dev_if will be the ifindex of the interface we bound to, and sk->bound_dev_if will be 0, since we didn't bind to a specific interface. Lars Ellenberg suggests something like: | (!sk2->bound_dev_if || | !sk->bound_dev_if || | sk2->bound_dev_if == sk->bound_dev_if) && Which on its face appears to clear the bug. I don't see any obvious downsides to it either, but this is why I'm here. So, is this intentional or a bug? Thanks. -- - kpd "If at first you don't succeed, redefine success." - Anonymous --Signature=_Sun__5_Oct_2003_13_01_54_-0400_MiYcidPLlDoJFbX= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/gE6CN4rbBhHCVDkRAhq0AKC8qufYmGQ20xqb9wTJteA8P6QFbQCfXVav QPuNUevzS/kGILqDOPuF8sY= =GFnq -----END PGP SIGNATURE----- --Signature=_Sun__5_Oct_2003_13_01_54_-0400_MiYcidPLlDoJFbX=-- From willy@w.ods.org Sun Oct 5 15:28:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 15:29:23 -0700 (PDT) Received: from www.home.local (willy.net1.nerim.net [62.212.114.60]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h95MSf25017001 for ; Sun, 5 Oct 2003 15:28:42 -0700 Received: from alpha.home.local (alpha [10.0.1.2]) by www.home.local (8.12.1/8.12.1) with ESMTP id h95MSKkW006153; Mon, 6 Oct 2003 00:28:20 +0200 Received: from pcw.home.local (pcw [10.0.3.1]) by alpha.home.local (8.12.4/8.12.1) with ESMTP id h95MSJJe028247; Mon, 6 Oct 2003 00:28:19 +0200 Received: (from willy@localhost) by pcw.home.local (8.10.2/8.10.2) id h95MSHD02577; Mon, 6 Oct 2003 00:28:17 +0200 Date: Mon, 6 Oct 2003 00:28:17 +0200 From: Willy TARREAU To: Jay Vosburgh , shmulik.hen@intel.com, "Chad N. Tindel" , bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org, Jeff Garzik , "Noam, Amir" , "Mendelson, Tsippy" , "Noam, Marom" Subject: Re: [Bonding-announce] [PATCH SET][bonding] cleanup Message-ID: <20031005222817.GA2527@pcw.home.local> References: <200309252011.53960.shmulik.hen@intel.com> <200309251733.h8PHXWpV013559@death.ibm.com> <20030925211259.GA59653@calma.pair.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030925211259.GA59653@calma.pair.com> User-Agent: Mutt/1.4i X-archive-position: 554 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: willy@w.ods.org Precedence: bulk X-list: netdev Hi ! On Thu, Sep 25, 2003 at 05:13:00PM -0400, Chad N. Tindel wrote: > I was specifically told by David Miller that we are not to break binary > compatibility within a 2.4 release. Such things had to wait until 2.5 > or later. We can not require a user to upgrade their ifenslave within a 2.4 > series kernel just to keep using the same functionality they were using in > 2.4.1. I strongly agree. I have been facing this problem and it was really a pain. I used the last bonding version which didn't define the ABI version, together with the associated ifenslave, but when the need to upgrade to plain 2.4.22 came in, I had the surprize of getting a non-working bonding because this intermediate ifenslave. Well, I upgraded it to latest version, which prevents me from downgrading to the previous kernel because it has ABIv2 with no version, so the newer ifenslave thinks it's an ABIv1. So the result is a symlink with two versions of ifenslave on the disk, just in case I have to downgrade. Although I agree it's clearly my fault and I should have been more careful, I prefer to warn everyone about the consequences this might have on production systems. Schmulik has done quite a great job here, and I believe most of it should be integrated, but we have to carefully test each combination of old/new ifenslave with old/new driver if we don't want to break some setups or prevent admins from downgrading if something goes wrong. Cheers, Willy From rusty@samba.org Sun Oct 5 17:02:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 17:02:59 -0700 (PDT) Received: from lists.samba.org (dp.samba.org [66.70.73.150]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9602Q25025160 for ; Sun, 5 Oct 2003 17:02:26 -0700 Received: by lists.samba.org (Postfix, from userid 590) id AF7642C0A7; Mon, 6 Oct 2003 00:02:25 +0000 (GMT) From: Rusty Russell To: Julian Anastasov Cc: "David S. Miller" , Wensong Zhang , netdev@oss.sgi.com Subject: Re: [2.6 PATCH] ipvs - properly handle non-linear skbs In-reply-to: Your message of "Sun, 05 Oct 2003 12:09:20 +0300." Date: Mon, 06 Oct 2003 07:42:09 +1000 Message-Id: <20031006000225.AF7642C0A7@lists.samba.org> X-archive-position: 555 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev In message you write: > Hello, > > Attached is a patch that includes the changes from > Rusty about handling non-linear skbs correctly and modified > a bit from Wensong Zhang and me. This is a huge patch that changes > interfaces for many functions. It looks difficult to split it in > parts but if required we can try to do it. It is ready for > inclusion. Hi Julian! I diffed our two patches. Is see you still use iph temp vars: fair enough: I removed mine after some subtle bugs (although it does make the code a bit uglier). Looks really good. Could you just clarify a couple of things for me please? @@ -527,10 +528,7 @@ struct ip_vs_conn { struct ip_vs_dest *dest; /* real server */ atomic_t in_pkts; /* incoming packet counter */ - /* packet transmitter for different forwarding methods. If it - mangles the packet, it must return NF_DROP or NF_STOLEN, otherwise - this must be changed to a sk_buff **. - */ + /* packet transmitter for different forwarding methods */ int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); This comment is still true: the skb pointer from the caller is useless, so xmit *must* return NF_DROP or NF_STOLEN. I thought about making it return void and the callers always return NF_STOLEN, but there was enough change already. You might want to put a comment in there. ip_vs_make_skb_writable(): how is this different from skb_ip_make_writable(), except you have to maintain it yourself? The advantage of the general one is that Dave looks after it for us 8) In ip_vs_out_icmp(): /* Is the embedded protocol header present? */ if (unlikely(ciph.frag_off & __constant_htons(IP_OFFSET) && - /* FIXME: Remove minhlen, and surely dont_defrag - * test is backwards? --RR */ (pp->minhlen || pp->dont_defrag))) return NF_ACCEPT; If the protocol says "don't defrag" they never see fragmented packets. AFAICT, minhlen and dont_defrag are now the same everywhere (minhlen is not respected: protocols are expected to catch skb_copy_bits failing on their own, and they do). Perhaps drop minhlen altogether, and just keep dont_defrag? Hey, thanks for doing the hard work for me! Cheers, Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. From tgr@reeler.org Sun Oct 5 17:26:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 17:27:18 -0700 (PDT) Received: from rei.rakuen (dclient217-162-65-211.hispeed.ch [217.162.65.211]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h960Qg25025828 for ; Sun, 5 Oct 2003 17:26:43 -0700 Received: by reeler.org id 1A6JCd-0002eW-00 ; Mon, 06 Oct 2003 02:26:19 +0200 Date: Mon, 6 Oct 2003 02:26:19 +0200 From: Thomas Graf To: davem@redhat.com, kuznet@ms2.inr.ac.ru Cc: netdev@oss.sgi.com Subject: [RFC] nfmark modify extension to classifiers Message-ID: <20031006002619.GC11250@rei.reeler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-archive-position: 556 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 Hello The netfilter mark field is heavly used nowadays to communicate between tc, netfilter and ip rule. Classifiers are not yet capable of modifying the nfmark field. However it would make sense, especially in ingress context. Example: $TC filter add dev $DEV parent 10:0 protocol ip prio 10 u32 match ip protocol 6 0xff nfmark 0x10 flowid 10:12 ^^^^^^^^^^^ Would set nfmark=0x10 for all icmp packets. Applications (examples): - Differentiate source classifier if multiple classifiers classify into a single class (match again with cls_fw.c). - Mark packets in ingress and reuse nfmark in ip rules if netfilter is too slow. - Use rsvp(6)/route/tcindex capabilities in netfilter/ip rule. Below is a patch to the u32 classifier adding this extension. It would be easy to do the same for other classifiers. (I also have a patch against tc if someone is interested.) The ifdef mess cannot be avoided unless nfmark in skbuff is freed from its ifdefs. Regards -- Thomas GRAF # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1495 -> 1.1496 # include/linux/pkt_cls.h 1.2 -> 1.3 # net/sched/cls_u32.c 1.8 -> 1.9 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/06 tgraf@suug.ch 1.1496 # This changeset extends the u32 classifier to change the netfilter mark if the filter matches. # -------------------------------------------- # diff -Nru a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h --- a/include/linux/pkt_cls.h Mon Oct 6 03:37:58 2003 +++ b/include/linux/pkt_cls.h Mon Oct 6 03:37:58 2003 @@ -48,6 +48,7 @@ TCA_U32_LINK, TCA_U32_DIVISOR, TCA_U32_SEL, + TCA_U32_NFMARK, TCA_U32_POLICE, }; diff -Nru a/net/sched/cls_u32.c b/net/sched/cls_u32.c --- a/net/sched/cls_u32.c Mon Oct 6 03:37:58 2003 +++ b/net/sched/cls_u32.c Mon Oct 6 03:37:58 2003 @@ -62,6 +62,9 @@ struct tcf_police *police; #endif struct tcf_result res; +#ifdef CONFIG_NETFILTER + unsigned long nfmark; +#endif struct tc_u_hnode *ht_down; struct tc_u32_sel sel; }; @@ -129,6 +132,10 @@ check_terminal: if (n->sel.flags&TC_U32_TERMINAL) { *res = n->res; +#ifdef CONFIG_NETFILTER + if (n->nfmark) + skb->nfmark = n->nfmark; +#endif #ifdef CONFIG_NET_CLS_POLICE if (n->police) { int pol_res = tcf_police(skb, n->police); @@ -470,6 +477,10 @@ if (cl) q->ops->cl_ops->unbind_tcf(q, cl); } +#ifdef CONFIG_NETFILTER + if (tb[TCA_U32_NFMARK-1]) + n->nfmark = *(u32*)RTA_DATA(tb[TCA_U32_NFMARK-1]); +#endif #ifdef CONFIG_NET_CLS_POLICE if (tb[TCA_U32_POLICE-1]) { struct tcf_police *police = tcf_police_locate(tb[TCA_U32_POLICE-1], est); @@ -654,6 +665,10 @@ } if (n->res.classid) RTA_PUT(skb, TCA_U32_CLASSID, 4, &n->res.classid); +#ifdef CONFIG_NETFILTER + if (n->nfmark) + RTA_PUT(skb, TCA_U32_NFMARK, 4, &n->nfmark); +#endif if (n->ht_down) RTA_PUT(skb, TCA_U32_LINK, 4, &n->ht_down->handle); #ifdef CONFIG_NET_CLS_POLICE From rddunlap@osdl.org Sun Oct 5 20:48:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 20:48:36 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h963m225031359 for ; Sun, 5 Oct 2003 20:48:02 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h963lu131988; Sun, 5 Oct 2003 20:47:56 -0700 Date: Sun, 5 Oct 2003 20:39:06 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH] janitor: sched_timeout() sets curr_state (net/) Message-Id: <20031005203906.2eadaac4.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (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: 557 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test6-current. -- ~Randy From: Alexey Dobriyan linux-260-test6-kj1-rddunlap/net/atm/resources.c | 1 - linux-260-test6-kj1-rddunlap/net/bluetooth/hci_core.c | 1 - linux-260-test6-kj1-rddunlap/net/ipv4/ipvs/ip_vs_sync.c | 2 -- linux-260-test6-kj1-rddunlap/net/sunrpc/svcsock.c | 1 - 4 files changed, 5 deletions(-) diff -puN net/atm/resources.c~net_all_taskrun net/atm/resources.c --- linux-260-test6-kj1/net/atm/resources.c~net_all_taskrun 2003-09-29 17:34:55.000000000 -0700 +++ linux-260-test6-kj1-rddunlap/net/atm/resources.c 2003-09-29 17:34:55.000000000 -0700 @@ -139,7 +139,6 @@ void atm_dev_deregister(struct atm_dev * while (atomic_read(&dev->refcnt) != 1) { current->state = TASK_INTERRUPTIBLE; schedule_timeout(HZ / 4); - current->state = TASK_RUNNING; if ((jiffies - warning_time) > 10 * HZ) { printk(KERN_EMERG "atm_dev_deregister: waiting for " "dev %d to become free. Usage count = %d\n", diff -puN net/bluetooth/hci_core.c~net_all_taskrun net/bluetooth/hci_core.c --- linux-260-test6-kj1/net/bluetooth/hci_core.c~net_all_taskrun 2003-09-29 17:34:55.000000000 -0700 +++ linux-260-test6-kj1-rddunlap/net/bluetooth/hci_core.c 2003-09-29 17:34:55.000000000 -0700 @@ -161,7 +161,6 @@ static int __hci_request(struct hci_dev req(hdev, opt); schedule_timeout(timeout); - set_current_state(TASK_RUNNING); remove_wait_queue(&hdev->req_wait_q, &wait); if (signal_pending(current)) diff -puN net/ipv4/ipvs/ip_vs_sync.c~net_all_taskrun net/ipv4/ipvs/ip_vs_sync.c --- linux-260-test6-kj1/net/ipv4/ipvs/ip_vs_sync.c~net_all_taskrun 2003-09-29 17:34:55.000000000 -0700 +++ linux-260-test6-kj1-rddunlap/net/ipv4/ipvs/ip_vs_sync.c 2003-09-29 17:34:55.000000000 -0700 @@ -669,7 +669,6 @@ static void sync_master_loop(void) __set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(HZ); - __set_current_state(TASK_RUNNING); } /* clean up the sync_buff queue */ @@ -728,7 +727,6 @@ static void sync_backup_loop(void) __set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(HZ); - __set_current_state(TASK_RUNNING); } /* release the sending multicast socket */ diff -puN net/sunrpc/svcsock.c~net_all_taskrun net/sunrpc/svcsock.c --- linux-260-test6-kj1/net/sunrpc/svcsock.c~net_all_taskrun 2003-09-29 17:34:55.000000000 -0700 +++ linux-260-test6-kj1-rddunlap/net/sunrpc/svcsock.c 2003-09-29 17:34:55.000000000 -0700 @@ -1151,7 +1151,6 @@ svc_recv(struct svc_serv *serv, struct s if (!p) { set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(HZ/2); - current->state = TASK_RUNNING; continue; } rqstp->rq_argpages[rqstp->rq_arghi++] = p; _ From rddunlap@osdl.org Sun Oct 5 20:48:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 20:48:36 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h963m325031360 for ; Sun, 5 Oct 2003 20:48:03 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h963lv131992; Sun, 5 Oct 2003 20:47:57 -0700 Date: Sun, 5 Oct 2003 20:40:27 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: kas@fi.muni.cz Subject: [PATCH] janitor: sched_timeout() sets curr_state (cosa) Message-Id: <20031005204027.182a0188.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (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: 558 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test6-current. -- ~Randy From: Alexey Dobriyan linux-260-test6-kj1-rddunlap/drivers/net/wan/cosa.c | 2 -- 1 files changed, 2 deletions(-) diff -puN drivers/net/wan/cosa.c~net_wan_taskrun drivers/net/wan/cosa.c --- linux-260-test6-kj1/drivers/net/wan/cosa.c~net_wan_taskrun 2003-09-29 17:35:07.000000000 -0700 +++ linux-260-test6-kj1-rddunlap/drivers/net/wan/cosa.c 2003-09-29 17:35:07.000000000 -0700 @@ -519,7 +519,6 @@ static int cosa_probe(int base, int irq, current->state = TASK_INTERRUPTIBLE; cosa_putstatus(cosa, SR_TX_INT_ENA); schedule_timeout(30); - current->state = TASK_RUNNING; irq = probe_irq_off(irqs); /* Disable all IRQs from the card */ cosa_putstatus(cosa, 0); @@ -1532,7 +1531,6 @@ static int cosa_reset_and_read_id(struct #ifdef MODULE current->state = TASK_INTERRUPTIBLE; schedule_timeout(HZ/2); - current->state = TASK_RUNNING; #else udelay(5*100000); #endif _ From rddunlap@osdl.org Sun Oct 5 20:48:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 20:48:36 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h963lx25031358 for ; Sun, 5 Oct 2003 20:47:59 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h963lr131924; Sun, 5 Oct 2003 20:47:53 -0700 Date: Sun, 5 Oct 2003 20:34:25 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: chas@cmf.nrl.navy.mil Subject: [PATCH] janitor: sched_timeout() sets curr_state (atm) Message-Id: <20031005203425.5e474ccd.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (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: 557 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test6-current. -- ~Randy From: Alexey Dobriyan linux-260-test6-kj1-rddunlap/drivers/atm/he.c | 1 - 1 files changed, 1 deletion(-) diff -puN drivers/atm/he.c~atm_he_taskrun drivers/atm/he.c --- linux-260-test6-kj1/drivers/atm/he.c~atm_he_taskrun 2003-09-29 17:32:02.000000000 -0700 +++ linux-260-test6-kj1-rddunlap/drivers/atm/he.c 2003-09-29 17:32:02.000000000 -0700 @@ -2633,7 +2633,6 @@ he_close(struct atm_vcc *vcc) (retry < MAX_RETRY)) { set_current_state(TASK_UNINTERRUPTIBLE); (void) schedule_timeout(sleep); - set_current_state(TASK_RUNNING); if (sleep < HZ) sleep = sleep * 2; _ From vinay.nallamothu@gsecone.com Sun Oct 5 21:52:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 05 Oct 2003 21:52:36 -0700 (PDT) Received: from gateway.gsecone.com ([61.95.227.64]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h964px25001864 for ; Sun, 5 Oct 2003 21:52:01 -0700 Received: from vinay.gsecone.com (vinay.gsecone.com [192.168.1.15]) by gateway.gsecone.com (8.12.8/8.12.8) with ESMTP id h95EBh0J004444; Sun, 5 Oct 2003 19:41:45 +0530 Subject: Re: [PATCH 2.6.0-test6][X25] timer cleanup From: Vinay K Nallamothu To: "David S. Miller" Cc: akpm@osdl.org, netdev@oss.sgi.com, LKML In-Reply-To: <20031002013620.6d8b6f10.davem@redhat.com> References: <1065018387.7194.336.camel@lima.royalchallenge.com> <20031001155623.06b89258.akpm@osdl.org> <1065078208.4340.3.camel@lima.royalchallenge.com> <20031002013620.6d8b6f10.davem@redhat.com> Content-Type: text/plain Organization: Global Security One Message-Id: <1065362979.4370.34.camel@lima.royalchallenge.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sun, 05 Oct 2003 19:39:39 +0530 Content-Transfer-Encoding: 7bit X-archive-position: 559 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vinay.nallamothu@gsecone.com Precedence: bulk X-list: netdev Hi Dave, On Thu, 2003-10-02 at 14:06, David S. Miller wrote: > Please find a way to at least minimally test the protocols > you are changing then, or find someone else who can. I have tested the patch using LAPB over Ethernet (I do not have real hardware) under linux-2.6.0-test5-uml1 and it works fine for me. I used the x25_utils available at http://www.baty.hanse.de/linux-x25/utils/x25_utils-2.3.93.tar.gz and have been successfully able to run X.25 telnet application. I have updated the patch to fix a locking bug in x25_accept I encountered while testing. Thanks Vinay 1. Replace del_timer, mod_timer sequences with mod_timer. 2. Add missing lock_sock/release_sock in x25_accept af_x25.c | 15 +++++++++------ x25_link.c | 16 ++++++---------- x25_timer.c | 47 +++++++++++++++-------------------------------- 3 files changed, 30 insertions(+), 48 deletions(-) diff -urN linux-2.6.0-test6/net/x25/af_x25.c linux-2.6.0-test6-nvk/net/x25/af_x25.c --- linux-2.6.0-test6/net/x25/af_x25.c 2003-09-09 11:12:07.000000000 +0530 +++ linux-2.6.0-test6-nvk/net/x25/af_x25.c 2003-10-05 19:23:45.000000000 +0530 @@ -345,10 +345,8 @@ if (atomic_read(&sk->sk_wmem_alloc) || atomic_read(&sk->sk_rmem_alloc)) { /* Defer: outstanding buffers */ - init_timer(&sk->sk_timer); sk->sk_timer.expires = jiffies + 10 * HZ; sk->sk_timer.function = x25_destroy_timer; - sk->sk_timer.data = (unsigned long)sk; add_timer(&sk->sk_timer); } else { /* drop last reference so sock_put will free */ @@ -463,6 +461,8 @@ goto out; } +void x25_init_timers(struct sock *sk); + static int x25_create(struct socket *sock, int protocol) { struct sock *sk; @@ -481,7 +481,7 @@ sock_init_data(sock, sk); sk_set_owner(sk, THIS_MODULE); - init_timer(&x25->timer); + x25_init_timers(sk); sock->ops = &x25_proto_ops; sk->sk_protocol = protocol; @@ -537,7 +537,7 @@ x25->facilities = ox25->facilities; x25->qbitincl = ox25->qbitincl; - init_timer(&x25->timer); + x25_init_timers(sk); out: return sk; } @@ -760,13 +760,14 @@ if (sk->sk_type != SOCK_SEQPACKET) goto out; + lock_sock(sk); rc = x25_wait_for_data(sk, sk->sk_rcvtimeo); if (rc) - goto out; + goto out2; skb = skb_dequeue(&sk->sk_receive_queue); rc = -EINVAL; if (!skb->sk) - goto out; + goto out2; newsk = skb->sk; newsk->sk_pair = NULL; newsk->sk_socket = newsock; @@ -779,6 +780,8 @@ newsock->sk = newsk; newsock->state = SS_CONNECTED; rc = 0; +out2: + release_sock(sk); out: return rc; } diff -urN linux-2.6.0-test6/net/x25/x25_link.c linux-2.6.0-test6-nvk/net/x25/x25_link.c --- linux-2.6.0-test6/net/x25/x25_link.c 2003-09-09 11:12:07.000000000 +0530 +++ linux-2.6.0-test6-nvk/net/x25/x25_link.c 2003-10-01 19:50:04.000000000 +0530 @@ -51,15 +51,9 @@ /* * Linux set/reset timer routines */ -static void x25_start_t20timer(struct x25_neigh *nb) +static inline void x25_start_t20timer(struct x25_neigh *nb) { - del_timer(&nb->t20timer); - - nb->t20timer.data = (unsigned long)nb; - nb->t20timer.function = &x25_t20timer_expiry; - nb->t20timer.expires = jiffies + nb->t20; - - add_timer(&nb->t20timer); + mod_timer(&nb->t20timer, jiffies + nb->t20); } static void x25_t20timer_expiry(unsigned long param) @@ -71,12 +65,12 @@ x25_start_t20timer(nb); } -static void x25_stop_t20timer(struct x25_neigh *nb) +static inline void x25_stop_t20timer(struct x25_neigh *nb) { del_timer(&nb->t20timer); } -static int x25_t20timer_pending(struct x25_neigh *nb) +static inline int x25_t20timer_pending(struct x25_neigh *nb) { return timer_pending(&nb->t20timer); } @@ -291,6 +285,8 @@ skb_queue_head_init(&nb->queue); init_timer(&nb->t20timer); + nb->t20timer.data = (unsigned long)nb; + nb->t20timer.function = &x25_t20timer_expiry; dev_hold(dev); nb->dev = dev; diff -urN linux-2.6.0-test6/net/x25/x25_timer.c linux-2.6.0-test6-nvk/net/x25/x25_timer.c --- linux-2.6.0-test6/net/x25/x25_timer.c 2003-09-09 11:12:07.000000000 +0530 +++ linux-2.6.0-test6-nvk/net/x25/x25_timer.c 2003-10-01 19:50:04.000000000 +0530 @@ -43,15 +43,22 @@ static void x25_heartbeat_expiry(unsigned long); static void x25_timer_expiry(unsigned long); -void x25_start_heartbeat(struct sock *sk) +void x25_init_timers(struct sock *sk) { - del_timer(&sk->sk_timer); + struct x25_opt *x25 = x25_sk(sk); + init_timer(&x25->timer); + x25->timer.data = (unsigned long)sk; + x25->timer.function = &x25_timer_expiry; + + /* initialized by sock_init_data */ sk->sk_timer.data = (unsigned long)sk; sk->sk_timer.function = &x25_heartbeat_expiry; - sk->sk_timer.expires = jiffies + 5 * HZ; +} - add_timer(&sk->sk_timer); +void x25_start_heartbeat(struct sock *sk) +{ + mod_timer(&sk->sk_timer, jiffies + 5 * HZ); } void x25_stop_heartbeat(struct sock *sk) @@ -63,52 +70,28 @@ { struct x25_opt *x25 = x25_sk(sk); - del_timer(&x25->timer); - - x25->timer.data = (unsigned long)sk; - x25->timer.function = &x25_timer_expiry; - x25->timer.expires = jiffies + x25->t2; - - add_timer(&x25->timer); + mod_timer(&x25->timer, jiffies + x25->t2); } void x25_start_t21timer(struct sock *sk) { struct x25_opt *x25 = x25_sk(sk); - del_timer(&x25->timer); - - x25->timer.data = (unsigned long)sk; - x25->timer.function = &x25_timer_expiry; - x25->timer.expires = jiffies + x25->t21; - - add_timer(&x25->timer); + mod_timer(&x25->timer, jiffies + x25->t21); } void x25_start_t22timer(struct sock *sk) { struct x25_opt *x25 = x25_sk(sk); - del_timer(&x25->timer); - - x25->timer.data = (unsigned long)sk; - x25->timer.function = &x25_timer_expiry; - x25->timer.expires = jiffies + x25->t22; - - add_timer(&x25->timer); + mod_timer(&x25->timer, jiffies + x25->t22); } void x25_start_t23timer(struct sock *sk) { struct x25_opt *x25 = x25_sk(sk); - del_timer(&x25->timer); - - x25->timer.data = (unsigned long)sk; - x25->timer.function = &x25_timer_expiry; - x25->timer.expires = jiffies + x25->t23; - - add_timer(&x25->timer); + mod_timer(&x25->timer, jiffies + x25->t23); } void x25_stop_timer(struct sock *sk) From mitch@sfgoth.com Mon Oct 6 02:03:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 02:03:49 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9693B25020611 for ; Mon, 6 Oct 2003 02:03:11 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h96935ob007392; Mon, 6 Oct 2003 02:03:05 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h96934nl007391; Mon, 6 Oct 2003 02:03:04 -0700 (PDT) (envelope-from mitch) Date: Mon, 6 Oct 2003 02:03:04 -0700 From: Mitchell Blank Jr To: chas williams Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm Message-ID: <20031006090304.GD4651@gaz.sfgoth.com> References: <20031004194242.GC94203@gaz.sfgoth.com> <200310051252.h95CqvkT022363@ginger.cmf.nrl.navy.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200310051252.h95CqvkT022363@ginger.cmf.nrl.navy.mil> User-Agent: Mutt/1.4.1i X-archive-position: 560 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev chas williams wrote: > i am not sure the negotiation should be handled by the kernel. > we will cross this bridge when we get there. i dont see a > rush of people trying to add dsl drivers. in fact, the > community seems to be pretty stingy with documentation about > the dsl hardware. Yeah, I've been trying to get that resolved but so far noone is anwering my emails. There are two DSL drivers in some state of completion that could be merged if the companies involved to just release them. > >> people who use ATM_ITF_ANY are going to pay a penalty > >Exactly - its a userspace problem. > > so the idea is to fix it minimally. people who use it should be > encouraged to change. i would either get rid of completely or > make it work as before. not change the way it works. I don't think there are any current users that would be broken by a "just pick the first interface" policy. I just don't want to entirely remove it in case someone is using '*.0.50' in their clip configs or something. There are no users inside the atm tools that need ATM_ITF_ANY. Anyone using it directly in a PVC address is already broken and non-determanistic if they have more than one interface, so I'm not worried if the semantics in that case are only 90% identical instead of 100% > i dont believe any of the smp problems have come from open/close/change_qos. I doubt many crashes happen there (in practice mostly those operations will be serialized by userland - it's rare to have multiple threads opening/closing vccs at once) but that doesn't mean that races aren't hiding. Again, there's zero performance implication to serializing them so we might as well make the driver API a little more foolproof. > well the linear seach is already fairly efficient for most people since > most people dont have more than a handful of vcc's open at a time. Yes, but the worst-case is unacceptable. There are at least some people who have used the code to terminate VCCs coming from DSL customers (a project like that is actually what got me started with hacking on linux-atm 5 years ago :-). They could have hundreds of VCCs active at once. > >I don't think that's the case at all - you could safely remove the vcc from > >the list at ->close time (but not free its memory until the last reference > >disappears) Then an ->open would see the vpi/vci as free immediately (which > >should be safe) > > not sure about this. the fore200e seems to have a problem with > reopening on a vcc while there still might be outstanding skb's on a > vcc from a previos open/close. Hmmmm... ok. I really believe that we need to sleep in close until the VCC is truly free. If userland can't do a close followed immediately by an open on the same vci then something is busted. -Mitch From ja@ssi.bg Mon Oct 6 03:24:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 03:25:23 -0700 (PDT) Received: from l.himel.bg (IDENT:root@unamed.infotel.bg [212.39.68.18] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96AOh25028066 for ; Mon, 6 Oct 2003 03:24:44 -0700 Received: from linux.himel.bg (IDENT:ja@linux.himel.bg [127.0.0.1]) by l.himel.bg (8.11.6/8.9.3) with ESMTP id h96ANGv04842; Mon, 6 Oct 2003 13:23:16 +0300 Date: Mon, 6 Oct 2003 13:23:16 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@l To: Rusty Russell cc: "David S. Miller" , Wensong Zhang , Subject: Re: [2.6 PATCH] ipvs - properly handle non-linear skbs In-Reply-To: <20031006000225.AF7642C0A7@lists.samba.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 561 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Hello, On Mon, 6 Oct 2003, Rusty Russell wrote: > I diffed our two patches. Is see you still use iph temp vars: > fair enough: I removed mine after some subtle bugs (although it does > make the code a bit uglier). > > Looks really good. Could you just clarify a couple of things for me please? > > @@ -527,10 +528,7 @@ struct ip_vs_conn { > struct ip_vs_dest *dest; /* real server */ > atomic_t in_pkts; /* incoming packet counter */ > > - /* packet transmitter for different forwarding methods. If it > - mangles the packet, it must return NF_DROP or NF_STOLEN, otherwise > - this must be changed to a sk_buff **. > - */ > + /* packet transmitter for different forwarding methods */ > int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, > struct ip_vs_protocol *pp); > > This comment is still true: the skb pointer from the caller is > useless, so xmit *must* return NF_DROP or NF_STOLEN. I thought about > making it return void and the callers always return NF_STOLEN, but > there was enough change already. You might want to put a comment in > there. My merging mistake, your comment is valid. In this way is better, sometimes we want to return NF_STOLEN, sometimes NF_DROP. But it is true that it can be only NF_STOLEN. I made some changes to return NF_DROP if possible, may be someone wants to log later these packets as dropped ones. > ip_vs_make_skb_writable(): how is this different from > skb_ip_make_writable(), except you have to maintain it yourself? The > advantage of the general one is that Dave looks after it for us 8) The main difference is that we should not call skb_copy for cloned skbs, this is a waste of CPU for allocating new skb. May be you will change skb_ip_make_writable :) > In ip_vs_out_icmp(): > > /* Is the embedded protocol header present? */ > if (unlikely(ciph.frag_off & __constant_htons(IP_OFFSET) && > - /* FIXME: Remove minhlen, and surely dont_defrag > - * test is backwards? --RR */ > (pp->minhlen || pp->dont_defrag))) > return NF_ACCEPT; > > If the protocol says "don't defrag" they never see fragmented packets. The semantic is: Do not defrag for me, I do not care for my protocol header, you can give me fragmented skbs. This is true for now for AH and ESP because we treat these protocols like slave ones, i.e. UDP 500->500 is a master connection and we forward AH/ESP according to the main connection ignoring any protocol headers and payloads. But I'm not sure how that will change in the feature. > AFAICT, minhlen and dont_defrag are now the same everywhere (minhlen > is not respected: protocols are expected to catch skb_copy_bits > failing on their own, and they do). Perhaps drop minhlen altogether, > and just keep dont_defrag? Yes, I forgot it. We have to remove minhlen and minhlen_icmp. It must be: && pp->dont_defrag > Hey, thanks for doing the hard work for me! np, tonight I'll cleanup these things and may be other missed ones. > Cheers, > Rusty. > -- > Anyone who quotes me in their sig is an idiot. -- Rusty Russell. Regards -- Julian Anastasov From wensong@linux-vs.org Mon Oct 6 04:56:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 04:57:00 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96BuL25005884 for ; Mon, 6 Oct 2003 04:56:23 -0700 Received: from penguin.linux-vs.org ([211.136.72.124]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h96Btx6v026767 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 6 Oct 2003 19:56:11 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h96Bsn00003085; Mon, 6 Oct 2003 19:54:58 +0800 Date: Mon, 6 Oct 2003 19:54:49 +0800 (CST) From: Wensong Zhang To: "David S. Miller" cc: rusty@rustcorp.com.au, , Subject: Re: [2.6 PATCH] ipvs - two additional minor patches In-Reply-To: <20031005075058.70532394.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 562 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev On Sun, 5 Oct 2003, David S. Miller wrote: > On Sun, 5 Oct 2003 20:41:34 +0800 (CST) > Wensong Zhang wrote: > > > The ip_vs_procfs.patch is to the #ifdef CONFIG_PROC_FS macro for proc file > > creation/destruction. > > I'm not applying this patch, it is completely not needed. > > linux/proc_fs.h defines two versions of these interfaces based > upon whether CONFIG_PROC_FS is defined or not, when it is not > defined calling the interfaces is a nop. > > In this way we don't have to litter the sources with tons of > ifdefs like your patch was adding. > I see. Sorry for the trouble. Regards, Wensong From vandrove@vc.cvut.cz Mon Oct 6 07:03:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 07:03:57 -0700 (PDT) Received: from vana.vc.cvut.cz (root@vana.vc.cvut.cz [147.32.240.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96E3M25009577 for ; Mon, 6 Oct 2003 07:03:23 -0700 Received: from vana.vc.cvut.cz (smmsp@localhost [127.0.0.1]) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-4) with ESMTP id h96E3Kwk026875; Mon, 6 Oct 2003 16:03:20 +0200 Received: (from root@localhost) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-4) id h96E3K9H026872; Mon, 6 Oct 2003 16:03:20 +0200 Date: Mon, 6 Oct 2003 16:03:20 +0200 From: Petr Vandrovec To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH] Deadlock on ip_mc_list->lock Message-ID: <20031006140320.GB24082@vana.vc.cvut.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i X-archive-position: 563 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vandrove@vc.cvut.cz Precedence: bulk X-list: netdev Hi Dave, for past few days I'm getting reproducible complaint from net/ipv4/igmp.c:159, saying that it attempts to lock spinlock which was already locked at net/ipv4/igmp.c:1388. It happens when slp daemon goes down on system shutdown. Currently this 'return -EINVAL' below is one I suspect from being guilty, as it looks to me like that nobody is unlocking spinlock & bh in this case, and so system dies horrible death after this (saying that userspace scheduled while in_atomic:1). I do not know why it now fails with -EINVAL while it worked in the past (I see no igmp.c changes between test6 and current bk, yet test6 worked while current bk does not), but it might be caused by slpd update, and not by something in the kernel. Thanks, Petr Vandrovec vandrove@vc.cvut.cz diff -urN linux-2.6.0-test6-c1451.dist/net/ipv4/igmp.c linux-2.6.0-test6-c1451/net/ipv4/igmp.c --- linux-2.6.0-test6-c1451.dist/net/ipv4/igmp.c 2003-10-05 20:42:05.000000000 +0200 +++ linux-2.6.0-test6-c1451/net/ipv4/igmp.c 2003-10-06 15:53:10.000000000 +0200 @@ -1391,8 +1391,9 @@ sf_markstate(pmc); #endif if (!delta) { + err = -EINVAL; if (!pmc->sfcount[sfmode]) - return -EINVAL; + goto out_unlock; pmc->sfcount[sfmode]--; } err = 0; @@ -1423,6 +1424,7 @@ igmp_ifc_event(pmc->interface); #endif } +out_unlock: spin_unlock_bh(&pmc->lock); return err; } From chas@cmf.nrl.navy.mil Mon Oct 6 07:46:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 07:47:05 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96EkT25010386 for ; Mon, 6 Oct 2003 07:46:30 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h96EkOkT029882; Mon, 6 Oct 2003 10:46:25 -0400 (EDT) Message-Id: <200310061446.h96EkOkT029882@ginger.cmf.nrl.navy.mil> To: Mitchell Blank Jr cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [RFC] add rtnl semaphore to linux-atm In-Reply-To: Message from Mitchell Blank Jr of "Mon, 06 Oct 2003 02:03:04 PDT." <20031006090304.GD4651@gaz.sfgoth.com> Date: Mon, 06 Oct 2003 10:46:25 -0400 From: chas williams X-Spam-Score: () hits=-0.9 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 564 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev In message <20031006090304.GD4651@gaz.sfgoth.com>,Mitchell Blank Jr writes: >There are no users inside the atm tools that need ATM_ITF_ANY. Anyone >using it directly in a PVC address is already broken and non-determanistic >if they have more than one interface, so I'm not worried if the semantics >in that case are only 90% identical instead of 100% i think the vswitch stuff used it. but it can be made to work w/o too much trouble. >I doubt many crashes happen there (in practice mostly those operations >will be serialized by userland - it's rare to have multiple threads >opening/closing vccs at once) but that doesn't mean that races aren't >hiding. Again, there's zero performance implication to serializing >them so we might as well make the driver API a little more foolproof. so if it isnt a problem why fix it? further, if, as you say, open and close could sleep and possibly for long periods of time then holding this semaphore will block other open/close during this time. that's going to be very annoying. (i have already seen this problem with the old-style SOCKOPS lock_kernel() nonsense. on vcc's that are slow to close the machine basically comes to a complete stop until that vcc is closed). so either you make open/close non sleeping and add a semaphore and just dont add a semaphore. >Yes, but the worst-case is unacceptable. There are at least some people >who have used the code to terminate VCCs coming from DSL customers (a >project like that is actually what got me started with hacking on >linux-atm 5 years ago :-). They could have hundreds of VCCs active at >once. i agree. our atm router typically has something like 100 open at a time. so a linear search here is bad, but the he driver does a little work to make this somewhat more efficient (like caching the mapping since this cant change while under the lock). >Hmmmm... ok. I really believe that we need to sleep in close until the >VCC is truly free. If userland can't do a close followed immediately by >an open on the same vci then something is busted. see above why sleeping is bad. tcp sockets can also get 'stuck' in a close where you cant reopen immediately, TIME_WAIT i believe. From wensong@linux-vs.org Mon Oct 6 10:00:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 10:01:14 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96H0I25001546 for ; Mon, 6 Oct 2003 10:00:39 -0700 Received: from penguin.linux-vs.org ([211.136.72.124]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h96GxY6v014578 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 7 Oct 2003 00:59:55 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h96GwTul001241; Tue, 7 Oct 2003 00:58:34 +0800 Date: Tue, 7 Oct 2003 00:58:29 +0800 (CST) From: Wensong Zhang To: "David S. Miller" cc: rusty@rustcorp.com.au, Julian Anastasov , , Subject: [2.4 PATCH] two ipvs fixes Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463755008-474097134-1065459509=:1212" X-archive-position: 565 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463755008-474097134-1065459509=:1212 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, Here are IPVS two patches for kernel 2.4, which are basically back ported from the IPVS changes in kernel 2.6. One is to fix ip_vs_tunnel_xmit to return NF_DROP when no memory available, the other is to add strict boundary check in parsing FTP commands. Please check them. Thanks, Wensong ---1463755008-474097134-1065459509=:1212 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="linux-2.4-ipvs-tunnel-xmit.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="linux-2.4-ipvs-tunnel-xmit.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTE0MSAgLT4gMS4xMTQyIA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX2Nvbm4uYwkxLjEgICAgIC0+IDEuMiAgICAN CiMNCiMgVGhlIGZvbGxvd2luZyBpcyB0aGUgQml0S2VlcGVyIENoYW5nZVNl dCBMb2cNCiMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0NCiMgMDMvMTAvMDEJd2Vuc29uZ0BsaW51eC12cy5vcmcJMS4x MTQyDQojIFtJUFZTXSBGaXggaXBfdnNfdHVubmVsX3htaXQgdG8gcmV0dXJu IE5GX0RST1Agd2hlbiBubyBtZW1vcnkgYXZhaWxhYmxlDQojIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQojDQpkaWZm IC1OcnUgYS9uZXQvaXB2NC9pcHZzL2lwX3ZzX2Nvbm4uYyBiL25ldC9pcHY0 L2lwdnMvaXBfdnNfY29ubi5jDQotLS0gYS9uZXQvaXB2NC9pcHZzL2lwX3Zz X2Nvbm4uYwlXZWQgT2N0ICAxIDE5OjU0OjAyIDIwMDMNCisrKyBiL25ldC9p cHY0L2lwdnMvaXBfdnNfY29ubi5jCVdlZCBPY3QgIDEgMTk6NTQ6MDIgMjAw Mw0KQEAgLTkwMyw5ICs5MDMsOCBAQA0KIAkJCXNrYl9yZWFsbG9jX2hlYWRy b29tKHNrYiwgbWF4X2hlYWRyb29tKTsNCiAJCWlmICghbmV3X3NrYikgew0K IAkJCWlwX3J0X3B1dChydCk7DQotCQkJa2ZyZWVfc2tiKHNrYik7DQogCQkJ SVBfVlNfRVJSX1JMKCJpcF92c190dW5uZWxfeG1pdCgpOiBubyBtZW1vcnlc biIpOw0KLQkJCXJldHVybiAtRUlOVkFMOw0KKwkJCXJldHVybiBORl9EUk9Q Ow0KIAkJfQ0KIAkJa2ZyZWVfc2tiKHNrYik7DQogCQlza2IgPSBuZXdfc2ti Ow0K ---1463755008-474097134-1065459509=:1212 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="linux-2.4-ipvs-ftp-parse.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="linux-2.4-ipvs-ftp-parse.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0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F9TVFJJTkcsIHNpemVvZihDTElFTlRfU1RSSU5HKS0x LA0KIAkJCQkgICAnXHInLCAmdG8sICZwb3J0LA0KLQkJCQkgICAmc3RhcnQs ICZlbmQpID09IDApDQorCQkJCSAgICZzdGFydCwgJmVuZCkgIT0gMSkNCiAJ CXJldHVybiAwOw0KIA0KIAlJUF9WU19EQkcoMS1kZWJ1ZywgIlBPUlQgJXUu JXUuJXUuJXU6JWQgZGV0ZWN0ZWRcbiIsDQo= ---1463755008-474097134-1065459509=:1212-- From felipewd@terra.com.br Mon Oct 6 11:09:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 11:09:33 -0700 (PDT) Received: from paiol.terra.com.br (paiol.terra.com.br [200.176.3.18]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96I8x25004189 for ; Mon, 6 Oct 2003 11:09:00 -0700 Received: from botucatu.terra.com.br (botucatu.terra.com.br [200.176.3.78]) by paiol.terra.com.br (Postfix) with ESMTP id 835568486E2; Mon, 6 Oct 2003 15:08:57 -0300 (BRT) Received: from terra.com.br (200-163-191-105.paemt7004.e.brasiltelecom.net.br [200.163.191.105]) (authenticated user felipewd) by botucatu.terra.com.br (Postfix) with ESMTP id 3F90929C9FD; Mon, 6 Oct 2003 15:08:55 -0300 (BRT) Message-ID: <3F81B086.9050905@terra.com.br> Date: Mon, 06 Oct 2003 15:12:22 -0300 From: Felipe W Damasio User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9 MIME-Version: 1.0 To: Jeff Garzik Cc: Linux Kernel Mailing List , linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] finer-grained locking in wan/lmc driver Content-Type: multipart/mixed; boundary="------------070408090007040706060403" X-archive-position: 566 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipewd@terra.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------070408090007040706060403 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Jeff, Patch against 2.6-test6. - lmc_ioctl was calling copy_{from|to}_user with the device lock held, replace it with finer-grained locking; - Remove check_version usage; - If copy_from_user fails, returns -EFAULT instead of -ENOMEM; I didn't acquire the device lock before calling lmc_proto_ioctl, which will call syncppp ioctls, which will might call copy_{to|from}_user, but I think the locking shouldn't be done on that layer of the driver. (maybe on lmc_proto_main?) I'm not sure I locked everywhere I was suppose to lock, please review. If it looks ok, please consider applying, Thanks. Felipe --------------070408090007040706060403 Content-Type: text/plain; name="lmc-cleanup.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lmc-cleanup.patch" --- drivers/net/wan/lmc/lmc_main.c.orig 2003-10-06 13:24:01.000000000 -0300 +++ drivers/net/wan/lmc/lmc_main.c 2003-10-06 14:46:56.000000000 -0300 @@ -132,7 +132,6 @@ lmc_ctl_t ctl; int ret; u_int16_t regVal; - unsigned long flags; struct sppp *sp; @@ -142,12 +141,6 @@ lmc_trace(dev, "lmc_ioctl in"); - /* - * Most functions mess with the structure - * Disable interrupts while we do the polling - */ - spin_lock_irqsave(&sc->lmc_lock, flags); - switch (cmd) { /* * Return current driver state. Since we keep this up @@ -173,7 +166,8 @@ if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t))) return -EFAULT; - + + spin_lock_irq(&sc->lmc_lock); sc->lmc_media->set_status (sc, &ctl); if(ctl.crc_length != sc->ictl.crc_length) { @@ -188,9 +182,11 @@ sp->pp_flags &= ~PP_KEEPALIVE; /* Turn off */ else sp->pp_flags |= PP_KEEPALIVE; /* Turn on */ + + spin_unlock_irq(&sc->lmc_lock); ret = 0; - break; + break; case LMCIOCIFTYPE: /*fold01*/ { @@ -204,14 +200,14 @@ if (copy_from_user(&new_type, ifr->ifr_data, sizeof(u_int16_t))) return -EFAULT; - - + if (new_type == old_type) { - ret = 0 ; + ret = 0; break; /* no change */ } - + + spin_lock_irq(&sc->lmc_lock); lmc_proto_close(sc); lmc_proto_detach(sc); @@ -219,12 +215,14 @@ // lmc_proto_init(sc); lmc_proto_attach(sc); lmc_proto_open(sc); + spin_unlock_irq(&sc->lmc_lock); ret = 0 ; break ; } case LMCIOCGETXINFO: /*fold01*/ + spin_lock_irq(&sc->lmc_lock); sc->lmc_xinfo.Magic0 = 0xBEEFCAFE; sc->lmc_xinfo.PciCardType = sc->lmc_cardtype; @@ -240,6 +238,7 @@ sc->lmc_xinfo.Magic1 = 0xDEADBEEF; + spin_unlock_irq(&sc->lmc_lock); if (copy_to_user(ifr->ifr_data, &sc->lmc_xinfo, sizeof (struct lmc_xinfo))) return -EFAULT; @@ -248,6 +247,7 @@ break; case LMCIOCGETLMCSTATS: /*fold01*/ + spin_lock_irq(&sc->lmc_lock); if (sc->lmc_cardtype == LMC_CARDTYPE_T1){ lmc_mii_writereg (sc, 0, 17, T1FRAMER_FERR_LSB); sc->stats.framingBitErrorCount += @@ -271,6 +271,7 @@ sc->stats.severelyErroredFrameCount += regVal & T1FRAMER_SEF_MASK; } + spin_unlock_irq(&sc->lmc_lock); if (copy_to_user(ifr->ifr_data, &sc->stats, sizeof (struct lmc_statistics))) @@ -285,11 +286,13 @@ break; } + spin_lock_irq(&sc->lmc_lock); memset (&sc->stats, 0, sizeof (struct lmc_statistics)); sc->stats.check = STATCHECK; sc->stats.version_size = (DRIVER_VERSION << 16) + sizeof (struct lmc_statistics); sc->stats.lmc_cardtype = sc->lmc_cardtype; + spin_unlock_irq(&sc->lmc_lock); ret = 0; break; @@ -306,8 +309,11 @@ if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t))) return -EFAULT; - sc->lmc_media->set_circuit_type(sc, ctl.circuit_type); + + spin_lock_irq(&sc->lmc_lock); + sc->lmc_media->set_circuit_type(sc, ctl.circuit_type); sc->ictl.circuit_type = ctl.circuit_type; + spin_unlock_irq(&sc->lmc_lock); ret = 0; break; @@ -319,9 +325,11 @@ } /* Reset driver and bring back to current state */ + spin_lock_irq(&sc->lmc_lock); printk (" REG16 before reset +%04x\n", lmc_mii_readreg (sc, 0, 16)); lmc_running_reset (dev); printk (" REG16 after reset +%04x\n", lmc_mii_readreg (sc, 0, 16)); + spin_unlock_irq(&sc->lmc_lock); LMC_EVENT_LOG(LMC_EVENT_FORCEDRESET, LMC_CSR_READ (sc, csr_status), lmc_mii_readreg (sc, 0, 16)); @@ -364,6 +372,8 @@ case lmc_xilinx_reset: /*fold02*/ { u16 mii; + + spin_lock_irq(&sc->lmc_lock); mii = lmc_mii_readreg (sc, 0, 16); /* @@ -422,11 +432,8 @@ lmc_led_off(sc, LMC_DS3_LED2); } } - - - ret = 0x0; - + spin_unlock_irq(&sc->lmc_lock); } break; @@ -434,6 +441,7 @@ { u16 mii; int timeout = 500000; + spin_lock_irq(&sc->lmc_lock); mii = lmc_mii_readreg (sc, 0, 16); /* @@ -476,12 +484,10 @@ * stop driving Xilinx-related signals */ lmc_gpio_mkinput(sc, 0xff); - ret = 0x0; - + spin_unlock_irq(&sc->lmc_lock); break; - } case lmc_xilinx_load: /*fold02*/ @@ -505,12 +511,13 @@ if(copy_from_user(data, xc.data, xc.len)) { kfree(data); - ret = -ENOMEM; + ret = -EFAULT; break; } printk("%s: Starting load of data Len: %d at 0x%p == 0x%p\n", dev->name, xc.len, xc.data, data); + spin_lock_irq(&sc->lmc_lock); lmc_gpio_mkinput(sc, 0xff); /* @@ -609,8 +616,8 @@ kfree(data); + spin_unlock_irq(&sc->lmc_lock); ret = 0; - break; } default: /*fold02*/ @@ -619,7 +626,9 @@ } netif_wake_queue(dev); - sc->lmc_txfull = 0; + spin_lock_irq(&sc->lmc_lock); + sc->lmc_txfull = 0; + spin_unlock_irq(&sc->lmc_lock); } break; @@ -629,8 +638,6 @@ break; } - spin_unlock_irqrestore(&sc->lmc_lock, flags); /*fold01*/ - lmc_trace(dev, "lmc_ioctl out"); return ret; @@ -930,7 +937,10 @@ * later on, no one else will take our card away from * us. */ - request_region (ioaddr, LMC_REG_RANGE, dev->name); + if (!request_region (ioaddr, LMC_REG_RANGE, dev->name)) { + printk (KERN_WARNING "io port %3lX is busy", ioaddr); + return NULL; + } sc->lmc_cardtype = LMC_CARDTYPE_UNKNOWN; sc->lmc_timing = LMC_CTL_CLOCK_SOURCE_EXT; @@ -1060,8 +1070,7 @@ * Fix the two variables * */ - if (!(check_region (pci_ioaddr, LMC_REG_RANGE)) && - (vendor == CORRECT_VENDOR_ID) && + if ((vendor == CORRECT_VENDOR_ID) && (device == CORRECT_DEV_ID) && ((subvendor == PCI_VENDOR_LMC) || (subdevice == PCI_VENDOR_LMC))){ struct net_device *cur, *prev = NULL; --------------070408090007040706060403-- From felipewd@terra.com.br Mon Oct 6 12:28:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 12:28:35 -0700 (PDT) Received: from ivoti.terra.com.br (ivoti.terra.com.br [200.176.3.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96JS025011636 for ; Mon, 6 Oct 2003 12:28:01 -0700 Received: from gunga.terra.com.br (gunga.terra.com.br [200.176.3.45]) by ivoti.terra.com.br (Postfix) with ESMTP id 2E39E79C92F; Mon, 6 Oct 2003 16:27:59 -0300 (BRT) Received: from terra.com.br (200-163-191-105.paemt7004.e.brasiltelecom.net.br [200.163.191.105]) (authenticated user felipewd) by gunga.terra.com.br (Postfix) with ESMTP id BC5B812808C; Mon, 6 Oct 2003 16:27:55 -0300 (BRT) Message-ID: <3F81C30B.7080106@terra.com.br> Date: Mon, 06 Oct 2003 16:31:23 -0300 From: Felipe W Damasio User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9 MIME-Version: 1.0 To: Jeff Garzik , Richard Procter Cc: Linux Kernel Mailing List , linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] SMP support and perfomance improvement in 3c527 net driver Content-Type: multipart/mixed; boundary="------------010003080109070003070903" X-archive-position: 567 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipewd@terra.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------010003080109070003070903 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Jeff/Richard, Richard Procter and I worked to remove cli/sti to add proper SMP support (I did the original stuff and Richard did the actual current code :)). Besides that, Richard did a great jog improving the perfomance of the driver quite a bit: - Improve mc32_command by 770% (438% non-inlined) over the semaphore version (at a cost of 1 sem + 2 completions per driver). - Removed mutex covering mc32_send_packet (hard_start_xmit). This lets the interrupt handler operate concurrently and removes unnecessary locking. It makes the code only slightly more brittle Original post: http://marc.theaimsgroup.com/?l=linux-netdev&m=106438449315202&w=2 Since it didn't apply cleanly against 2.6.0-test6, I forward ported it. Patch attached. Jeff, please consider applying, Thanks. Felipe --------------010003080109070003070903 Content-Type: text/plain; name="3c527-cli_sti_removal.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="3c527-cli_sti_removal.patch" --- linux-2.6.0-test6/drivers/net/3c527.c.orig 2003-10-06 15:21:38.000000000 -0300 +++ linux-2.6.0-test6/drivers/net/3c527.c 2003-10-06 16:18:32.000000000 -0300 @@ -1,9 +1,10 @@ -/* 3c527.c: 3Com Etherlink/MC32 driver for Linux 2.4 +/* 3c527.c: 3Com Etherlink/MC32 driver for Linux 2.4 and 2.6. * * (c) Copyright 1998 Red Hat Software Inc * Written by Alan Cox. * Further debugging by Carl Drougge. - * Modified by Richard Procter (rnp@netlink.co.nz) + * Initial SMP support by Felipe W Damasio + * Heavily modified by Richard Procter * * Based on skeleton.c written 1993-94 by Donald Becker and ne2.c * (for the MCA stuff) written by Wim Dumon. @@ -17,11 +18,11 @@ */ #define DRV_NAME "3c527" -#define DRV_VERSION "0.6a" -#define DRV_RELDATE "2001/11/17" +#define DRV_VERSION "0.7-SMP" +#define DRV_RELDATE "2003/10/06" static const char *version = -DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Proctor (rnp@netlink.co.nz)\n"; +DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Procter \n"; /** * DOC: Traps for the unwary @@ -100,7 +101,9 @@ #include #include #include +#include +#include #include #include #include @@ -152,8 +155,10 @@ /* Information that needs to be kept for each board. */ struct mc32_local { - struct net_device_stats net_stats; int slot; + + u32 base; + struct net_device_stats net_stats; volatile struct mc32_mailbox *rx_box; volatile struct mc32_mailbox *tx_box; volatile struct mc32_mailbox *exec_box; @@ -163,22 +168,22 @@ u16 tx_len; /* Transmit list count */ u16 rx_len; /* Receive list count */ - u32 base; - u16 exec_pending; - u16 mc_reload_wait; /* a multicast load request is pending */ + u16 xceiver_desired_state; /* HALTED or RUNNING */ + u16 cmd_nonblocking; /* Thread is uninterested in command result */ + u16 mc_reload_wait; /* A multicast load request is pending */ u32 mc_list_valid; /* True when the mclist is set */ - u16 xceiver_state; /* Current transceiver state. bitmapped */ - u16 desired_state; /* The state we want the transceiver to be in */ - atomic_t tx_count; /* buffers left */ - wait_queue_head_t event; struct mc32_ring_desc tx_ring[TX_RING_LEN]; /* Host Transmit ring */ struct mc32_ring_desc rx_ring[RX_RING_LEN]; /* Host Receive ring */ - u16 tx_ring_tail; /* index to tx de-queue end */ - u16 tx_ring_head; /* index to tx en-queue end */ - + atomic_t tx_count; /* buffers left */ + volatile u16 tx_ring_head; /* index to tx en-queue end */ + u16 tx_ring_tail; /* index to tx de-queue end */ u16 rx_ring_tail; /* index to rx de-queue end */ + + struct semaphore cmd_mutex; /* Serialises issuing of execute commands */ + struct completion execution_cmd; /* Card has completed an execute command */ + struct completion xceiver_cmd; /* Card has completed a tx or rx command */ }; /* The station (ethernet) address prefix, used for a sanity check. */ @@ -234,7 +239,6 @@ { static int current_mca_slot = -1; int i; - int adapter_found = 0; SET_MODULE_OWNER(dev); @@ -245,11 +249,11 @@ Autodetecting MCA cards is extremely simple. Just search for the card. */ - for(i = 0; (mc32_adapters[i].name != NULL) && !adapter_found; i++) { + for(i = 0; (mc32_adapters[i].name != NULL); i++) { current_mca_slot = mca_find_unused_adapter(mc32_adapters[i].id, 0); - if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) { + if(current_mca_slot != MCA_NOTFOUND) { if(!mc32_probe1(dev, current_mca_slot)) { mca_set_adapter_name(current_mca_slot, @@ -407,7 +411,7 @@ * Grab the IRQ */ - i = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ, dev->name, dev); + i = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); if (i) { release_region(dev->base_addr, MC32_IO_EXTENT); printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq); @@ -496,7 +500,9 @@ lp->tx_len = lp->exec_box->data[9]; /* Transmit list count */ lp->rx_len = lp->exec_box->data[11]; /* Receive list count */ - init_waitqueue_head(&lp->event); + init_MUTEX_LOCKED(&lp->cmd_mutex); + init_completion(&lp->execution_cmd); + init_completion(&lp->xceiver_cmd); printk("%s: Firmware Rev %d. %d RX buffers, %d TX buffers. Base of 0x%08X.\n", dev->name, lp->exec_box->data[12], lp->rx_len, lp->tx_len, lp->base); @@ -510,10 +516,6 @@ dev->watchdog_timeo = HZ*5; /* Board does all the work */ dev->ethtool_ops = &netdev_ethtool_ops; - lp->xceiver_state = HALTED; - - lp->tx_ring_tail=lp->tx_ring_head=0; - /* Fill in the fields of the device structure with ethernet values. */ ether_setup(dev); @@ -537,7 +539,7 @@ * status of any pending commands and takes very little time at all. */ -static void mc32_ready_poll(struct net_device *dev) +static inline void mc32_ready_poll(struct net_device *dev) { int ioaddr = dev->base_addr; while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR)); @@ -552,31 +554,36 @@ * @len: Length of the data block * * Send a command from interrupt state. If there is a command - * currently being executed then we return an error of -1. It simply - * isn't viable to wait around as commands may be slow. Providing we - * get in, we busy wait for the board to become ready to accept the - * command and issue it. We do not wait for the command to complete - * --- the card will interrupt us when it's done. + * currently being executed then we return an error of -1. It + * simply isn't viable to wait around as commands may be + * slow. This can theoretically be starved on SMP, but it's hard + * to see a realistic situation. We do not wait for the command + * to complete --- we rely on the interrupt handler to tidy up + * after us. */ static int mc32_command_nowait(struct net_device *dev, u16 cmd, void *data, int len) { struct mc32_local *lp = (struct mc32_local *)dev->priv; int ioaddr = dev->base_addr; - - if(lp->exec_pending) - return -1; + int ret = -1; - lp->exec_pending=3; - lp->exec_box->mbox=0; - lp->exec_box->mbox=cmd; - memcpy((void *)lp->exec_box->data, data, len); - barrier(); /* the memcpy forgot the volatile so be sure */ + if (down_trylock(&lp->cmd_mutex) == 0) + { + lp->cmd_nonblocking=1; + lp->exec_box->mbox=0; + lp->exec_box->mbox=cmd; + memcpy((void *)lp->exec_box->data, data, len); + barrier(); /* the memcpy forgot the volatile so be sure */ + + /* Send the command */ + mc32_ready_poll(dev); + outb(1<<6, ioaddr+HOST_CMD); - /* Send the command */ - while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR)); - outb(1<<6, ioaddr+HOST_CMD); - return 0; + ret = 0; + /* Interrupt handler will signal mutex on completion */ + } + return ret; } @@ -590,7 +597,7 @@ * Sends exec commands in a user context. This permits us to wait around * for the replies and also to wait for the command buffer to complete * from a previous command before we execute our command. After our - * command completes we will complete any pending multicast reload + * command completes we will attempt any pending multicast reload * we blocked off by hogging the exec buffer. * * You feed the card a command, you wait, it interrupts you get a @@ -598,66 +605,37 @@ * commands for filter list changes which come in at bh level from things * like IPV6 group stuff. * - * We have a simple state machine - * - * 0 - nothing issued - * - * 1 - command issued, wait reply - * - * 2 - reply waiting - reader then goes to state 0 - * - * 3 - command issued, trash reply. In which case the irq - * takes it back to state 0 - * */ static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len) { struct mc32_local *lp = (struct mc32_local *)dev->priv; int ioaddr = dev->base_addr; - unsigned long flags; int ret = 0; + + down(&lp->cmd_mutex); /* - * Wait for a command - */ - - save_flags(flags); - cli(); - - while(lp->exec_pending) - sleep_on(&lp->event); - - /* - * Issue mine + * My turn */ - lp->exec_pending=1; - - restore_flags(flags); - + lp->cmd_nonblocking=0; lp->exec_box->mbox=0; lp->exec_box->mbox=cmd; memcpy((void *)lp->exec_box->data, data, len); barrier(); /* the memcpy forgot the volatile so be sure */ - /* Send the command */ - while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR)); - outb(1<<6, ioaddr+HOST_CMD); - - save_flags(flags); - cli(); + mc32_ready_poll(dev); + outb(1<<6, ioaddr+HOST_CMD); - while(lp->exec_pending!=2) - sleep_on(&lp->event); - lp->exec_pending=0; - restore_flags(flags); + wait_for_completion(&lp->execution_cmd); if(lp->exec_box->mbox&(1<<13)) ret = -1; + up(&lp->cmd_mutex); /* - * A multicast set got blocked - do it now + * A multicast set got blocked - try it now */ if(lp->mc_reload_wait) @@ -676,10 +654,8 @@ * This may be called from the interrupt state, where it is used * to restart the rx ring if the card runs out of rx buffers. * - * First, we check if it's ok to start the transceiver. We then show - * the card where to start in the rx ring and issue the - * commands to start reception and transmission. We don't wait - * around for these to complete. + * We must first check if it's ok to (re)start the transceiver. See + * mc32_close for details. */ static void mc32_start_transceiver(struct net_device *dev) { @@ -688,24 +664,20 @@ int ioaddr = dev->base_addr; /* Ignore RX overflow on device closure */ - if (lp->desired_state==HALTED) + if (lp->xceiver_desired_state==HALTED) return; + /* Give the card the offset to the post-EOL-bit RX descriptor */ mc32_ready_poll(dev); - - lp->tx_box->mbox=0; lp->rx_box->mbox=0; - - /* Give the card the offset to the post-EOL-bit RX descriptor */ lp->rx_box->data[0]=lp->rx_ring[prev_rx(lp->rx_ring_tail)].p->next; - outb(HOST_CMD_START_RX, ioaddr+HOST_CMD); mc32_ready_poll(dev); + lp->tx_box->mbox=0; outb(HOST_CMD_RESTRT_TX, ioaddr+HOST_CMD); /* card ignores this on RX restart */ /* We are not interrupted on start completion */ - lp->xceiver_state=RUNNING; } @@ -725,24 +697,18 @@ { struct mc32_local *lp = (struct mc32_local *)dev->priv; int ioaddr = dev->base_addr; - unsigned long flags; mc32_ready_poll(dev); - lp->tx_box->mbox=0; lp->rx_box->mbox=0; outb(HOST_CMD_SUSPND_RX, ioaddr+HOST_CMD); + wait_for_completion(&lp->xceiver_cmd); + mc32_ready_poll(dev); + lp->tx_box->mbox=0; outb(HOST_CMD_SUSPND_TX, ioaddr+HOST_CMD); - - save_flags(flags); - cli(); - - while(lp->xceiver_state!=HALTED) - sleep_on(&lp->event); - - restore_flags(flags); + wait_for_completion(&lp->xceiver_cmd); } @@ -754,7 +720,7 @@ * the point where mc32_start_transceiver() can be called. * * The card sets up the receive ring for us. We are required to use the - * ring it provides although we can change the size of the ring. + * ring it provides, although the size of the ring is configurable. * * We allocate an sk_buff for each ring entry in turn and * initalise its house-keeping info. At the same time, we read @@ -775,7 +741,7 @@ rx_base=lp->rx_chain; - for(i=0;irx_ring[i].skb=alloc_skb(1532, GFP_KERNEL); skb_reserve(lp->rx_ring[i].skb, 18); @@ -812,21 +778,20 @@ * * Free the buffer for each ring slot. This may be called * before mc32_load_rx_ring(), eg. on error in mc32_open(). + * Requires rx skb pointers to point to a valid skb, or NULL. */ static void mc32_flush_rx_ring(struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; - struct sk_buff *skb; int i; for(i=0; i < RX_RING_LEN; i++) - { - skb = lp->rx_ring[i].skb; - if (skb!=NULL) { - kfree_skb(skb); - skb=NULL; + { + if (lp->rx_ring[i].skb) { + dev_kfree_skb(lp->rx_ring[i].skb); + lp->rx_ring[i].skb = NULL; } lp->rx_ring[i].p=NULL; } @@ -858,7 +823,7 @@ tx_base=lp->tx_box->data[0]; - for(i=0;itx_len;i++) + for(i=0 ; ibase+tx_base); lp->tx_ring[i].p=p; @@ -868,8 +833,8 @@ } /* -1 so that tx_ring_head cannot "lap" tx_ring_tail, */ - /* which would be bad news for mc32_tx_ring as cur. implemented */ - + /* see mc32_tx_ring */ + atomic_set(&lp->tx_count, TX_RING_LEN-1); lp->tx_ring_head=lp->tx_ring_tail=0; } @@ -878,45 +843,27 @@ /** * mc32_flush_tx_ring - free transmit ring * @lp: Local data of 3c527 to flush the tx ring of - * - * We have to consider two cases here. We want to free the pending - * buffers only. If the ring buffer head is past the start then the - * ring segment we wish to free wraps through zero. The tx ring - * house-keeping variables are then reset. + * + * If the ring is non-empty, zip over the it, freeing any + * allocated skb_buffs. The tx ring house-keeping variables are + * then reset. Requires rx skb pointers to point to a valid skb, + * or NULL. */ static void mc32_flush_tx_ring(struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; + + int i; - if(lp->tx_ring_tail!=lp->tx_ring_head) + for (i=0; i < TX_RING_LEN; i++) { - int i; - if(lp->tx_ring_tail < lp->tx_ring_head) - { - for(i=lp->tx_ring_tail;itx_ring_head;i++) - { - dev_kfree_skb(lp->tx_ring[i].skb); - lp->tx_ring[i].skb=NULL; - lp->tx_ring[i].p=NULL; - } - } - else + if (lp->tx_ring[i].skb) { - for(i=lp->tx_ring_tail; itx_ring[i].skb); - lp->tx_ring[i].skb=NULL; - lp->tx_ring[i].p=NULL; - } - for(i=0; itx_ring_head; i++) - { - dev_kfree_skb(lp->tx_ring[i].skb); - lp->tx_ring[i].skb=NULL; - lp->tx_ring[i].p=NULL; - } - } - } + dev_kfree_skb(lp->tx_ring[i].skb); + lp->tx_ring[i].skb = NULL; + } + } atomic_set(&lp->tx_count, 0); lp->tx_ring_tail=lp->tx_ring_head=0; @@ -955,9 +902,14 @@ regs=inb(ioaddr+HOST_CTRL); regs|=HOST_CTRL_INTE; outb(regs, ioaddr+HOST_CTRL); - /* + * Allow ourselves to issue commands + */ + + up(&lp->cmd_mutex); + + /* * Send the indications on command */ @@ -1008,7 +960,7 @@ return -ENOBUFS; } - lp->desired_state = RUNNING; + lp->xceiver_desired_state = RUNNING; /* And finally, set the ball rolling... */ mc32_start_transceiver(dev); @@ -1045,61 +997,64 @@ * Transmit a buffer. This normally means throwing the buffer onto * the transmit queue as the queue is quite large. If the queue is * full then we set tx_busy and return. Once the interrupt handler - * gets messages telling it to reclaim transmit queue entries we will + * gets messages telling it to reclaim transmit queue entries, we will * clear tx_busy and the kernel will start calling this again. * - * We use cli rather than spinlocks. Since I have no access to an SMP - * MCA machine I don't plan to change it. It is probably the top - * performance hit for this driver on SMP however. + * We do not disable interrupts or acquire any locks; this can + * run concurrently with mc32_tx_ring(), and the function itself + * is serialised at a higher layer. However, this makes it + * crucial that we update lp->tx_ring_head only after we've + * established a valid packet in the tx ring (and is why we mark + * tx_ring_head volatile). */ static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; - unsigned long flags; - + + u16 head = lp->tx_ring_head; + volatile struct skb_header *p, *np; netif_stop_queue(dev); - save_flags(flags); - cli(); - - if(atomic_read(&lp->tx_count)==0) - { - restore_flags(flags); + if(atomic_read(&lp->tx_count)==0) { return 1; } + skb = skb_padto(skb, ETH_ZLEN); + if (skb == NULL) { + netif_wake_queue(dev); + return 0; + } + atomic_dec(&lp->tx_count); /* P is the last sending/sent buffer as a pointer */ - p=lp->tx_ring[lp->tx_ring_head].p; - - lp->tx_ring_head=next_tx(lp->tx_ring_head); - + p=lp->tx_ring[head].p; + + head = next_tx(head); + /* NP is the buffer we will be loading */ - np=lp->tx_ring[lp->tx_ring_head].p; + np=lp->tx_ring[head].p; + + /* We will need this to flush the buffer out */ + lp->tx_ring[head].skb=skb; - if (skb->len < ETH_ZLEN) { - skb = skb_padto(skb, ETH_ZLEN); - if (skb == NULL) - goto out; - } + np->length = unlikely(skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len; - /* We will need this to flush the buffer out */ - lp->tx_ring[lp->tx_ring_head].skb = skb; - - np->length = (skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len; - np->data = isa_virt_to_bus(skb->data); np->status = 0; np->control = CONTROL_EOP | CONTROL_EOL; wmb(); - - p->control &= ~CONTROL_EOL; /* Clear EOL on p */ -out: - restore_flags(flags); + + /* + * The new frame has been setup; we can now + * let the card and interrupt handler "see" it + */ + + p->control &= ~CONTROL_EOL; + lp->tx_ring_head= head; netif_wake_queue(dev); return 0; @@ -1180,11 +1135,11 @@ { struct mc32_local *lp=dev->priv; volatile struct skb_header *p; - u16 rx_ring_tail = lp->rx_ring_tail; - u16 rx_old_tail = rx_ring_tail; - + u16 rx_ring_tail; + u16 rx_old_tail; int x=0; - + + rx_old_tail = rx_ring_tail = lp->rx_ring_tail; do { p=lp->rx_ring[rx_ring_tail].p; @@ -1273,8 +1228,13 @@ struct mc32_local *lp=(struct mc32_local *)dev->priv; volatile struct skb_header *np; - /* NB: lp->tx_count=TX_RING_LEN-1 so that tx_ring_head cannot "lap" tail here */ - + /* + * We rely on head==tail to mean 'queue empty'. + * This is why lp->tx_count=TX_RING_LEN-1: in order to prevent + * tx_ring_head wrapping to tail and confusing a 'queue empty' + * condition with 'queue full' + */ + while (lp->tx_ring_tail != lp->tx_ring_head) { u16 t; @@ -1386,8 +1346,7 @@ break; case 3: /* Halt */ case 4: /* Abort */ - lp->xceiver_state |= TX_HALTED; - wake_up(&lp->event); + complete(&lp->xceiver_cmd); break; default: printk("%s: strange tx ack %d\n", dev->name, status&7); @@ -1402,8 +1361,7 @@ break; case 3: /* Halt */ case 4: /* Abort */ - lp->xceiver_state |= RX_HALTED; - wake_up(&lp->event); + complete(&lp->xceiver_cmd); break; case 6: /* Out of RX buffers stat */ @@ -1419,26 +1377,17 @@ status>>=3; if(status&1) { + /* + * No thread is waiting: we need to tidy + * up ourself. + */ - /* 0=no 1=yes 2=replied, get cmd, 3 = wait reply & dump it */ - - if(lp->exec_pending!=3) { - lp->exec_pending=2; - wake_up(&lp->event); - } - else - { - lp->exec_pending=0; - - /* A new multicast set may have been - blocked while the old one was - running. If so, do it now. */ - + if (lp->cmd_nonblocking) { + up(&lp->cmd_mutex); if (lp->mc_reload_wait) mc32_reset_multicast_list(dev); - else - wake_up(&lp->event); } + else complete(&lp->execution_cmd); } if(status&2) { @@ -1496,7 +1445,7 @@ u8 regs; u16 one=1; - lp->desired_state = HALTED; + lp->xceiver_desired_state = HALTED; netif_stop_queue(dev); /* @@ -1508,12 +1457,10 @@ /* Shut down the transceiver */ mc32_halt_transceiver(dev); + + /* Ensure we issue no more commands beyond this point */ + down(&lp->cmd_mutex); - /* Catch any waiting commands */ - - while(lp->exec_pending==1) - sleep_on(&lp->event); - /* Ok the card is now stopping */ regs=inb(ioaddr+HOST_CTRL); @@ -1540,12 +1487,10 @@ static struct net_device_stats *mc32_get_stats(struct net_device *dev) { - struct mc32_local *lp; + struct mc32_local *lp = (struct mc32_local *)dev->priv;; mc32_update_stats(dev); - lp = (struct mc32_local *)dev->priv; - return &lp->net_stats; } --------------010003080109070003070903-- From shemminger@osdl.org Mon Oct 6 13:19:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 13:20:24 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96KJl25016782 for ; Mon, 6 Oct 2003 13:19:48 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h96KJc127360; Mon, 6 Oct 2003 13:19:38 -0700 Date: Mon, 6 Oct 2003 13:19:16 -0700 From: Stephen Hemminger To: Bart De Schuymer Cc: netdev@oss.sgi.com, bridge , "David S.Miller" , Ben Greear , vlan@wanfear.com Subject: Re: [PATCH/RFC] Let {ip,arp}tables "see" bridged VLAN tagged {I,AR}P packets Message-Id: <20031006131916.6a7ba5c0.shemminger@osdl.org> In-Reply-To: <200310062204.07230.bdschuym@pandora.be> References: <200310062204.07230.bdschuym@pandora.be> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 568 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 On Mon, 6 Oct 2003 22:04:07 +0200 Bart De Schuymer wrote: > Hi all, > > The patch below does four trivial changes and one big change > Trivial changes, these are all in br_netfilter.c: > - check ar_pln==4 when giving bridged ARP packets to arptables > - delete unnecessary if in br_nf_local_in > - add more logging for the "Argh" message > - add some brag-comments in the file head comment > > Big change: let {ip,arp}tables see VLAN tagged {I,AR}P packets. > This patch also makes an oops go away when locally generated packets > are sent through something like br0.1000. > > This is what the patch does: > - add vlan_dev_hard_start_xmit_p, because br_netfilter.c needs to know > the address of vlan_dev_hard_start_xmit(). When the local machine sends > a packet through br0.1000, we need to allow filtering in LOCAL_OUT/FILTER > on the bridge out port, so we need to be able to postpone the iptables > filtering. > Comments are welcome. > If people could test this patch and give feedback, that would be great. > > cheers, > Bart I can test the no VLAN case, but actual VLAN's are a little harder to setup. How does this affect the ability to rmmod either vlan or bridge? From greearb@candelatech.com Mon Oct 6 13:24:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 13:25:02 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96KOS25017792 for ; Mon, 6 Oct 2003 13:24:29 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h96KOLme013421; Mon, 6 Oct 2003 13:24:21 -0700 Message-ID: <3F81CF75.5050802@candelatech.com> Date: Mon, 06 Oct 2003 13:24:21 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bart De Schuymer CC: netdev@oss.sgi.com, bridge , vlan@wanfear.com, Stephen Hemminger Subject: Re: [PATCH/RFC] Let {ip,arp}tables "see" bridged VLAN tagged {I,AR}P packets References: <200310062204.07230.bdschuym@pandora.be> In-Reply-To: <200310062204.07230.bdschuym@pandora.be> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 569 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Bart De Schuymer wrote: > - add some code in vlan_dev.c::vlan_dev_hard_start_xmit(): > skb->protocol = __constant_htons(ETH_P_8021Q); > skb->mac.raw -= VLAN_HLEN; > skb->nh.raw -= VLAN_HLEN; I wonder if this is what was messing up the tcpdump packet capture as well? It would be fine with me if you un-conditionally exported the vlan hard-start-xmit pointer, but I don't feel strongly either way. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From bdschuym@pandora.be Mon Oct 6 13:38:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 13:38:44 -0700 (PDT) Received: from astra.telenet-ops.be (astra.telenet-ops.be [195.130.132.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96Kbw25019098 for ; Mon, 6 Oct 2003 13:37:59 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by astra.telenet-ops.be (Postfix) with SMTP id 147BE37EA4; Mon, 6 Oct 2003 22:04:01 +0200 (MEST) Received: from 192.168.123.138 (D5762BF3.kabel.telenet.be [213.118.43.243]) by astra.telenet-ops.be (Postfix) with ESMTP id 9D83F37E9B; Mon, 6 Oct 2003 22:03:54 +0200 (MEST) From: Bart De Schuymer To: netdev@oss.sgi.com, bridge , "David S.Miller" , Ben Greear , vlan@wanfear.com, Stephen Hemminger Subject: [PATCH/RFC] Let {ip,arp}tables "see" bridged VLAN tagged {I,AR}P packets Date: Mon, 6 Oct 2003 22:04:07 +0200 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310062204.07230.bdschuym@pandora.be> X-archive-position: 570 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev Hi all, The patch below does four trivial changes and one big change Trivial changes, these are all in br_netfilter.c: - check ar_pln==4 when giving bridged ARP packets to arptables - delete unnecessary if in br_nf_local_in - add more logging for the "Argh" message - add some brag-comments in the file head comment Big change: let {ip,arp}tables see VLAN tagged {I,AR}P packets. This patch also makes an oops go away when locally generated packets are sent through something like br0.1000. This is what the patch does: - add vlan_dev_hard_start_xmit_p, because br_netfilter.c needs to know the address of vlan_dev_hard_start_xmit(). When the local machine sends a packet through br0.1000, we need to allow filtering in LOCAL_OUT/FILTER on the bridge out port, so we need to be able to postpone the iptables filtering. - add nf_bridge->netoutdev for vlan. When the local machine sends a packet through br0.1000, iptables -o br0.1000 should match instead of iptables -o br0. In the bridge code, it is not known that the out device was br0.1000, so we need to save this info in nf_bridge->netoutdev. - change nf_bridge->hh size to 18, which is the Ethernet header size + VLAN header size. - add BRNF_NF_BRIDGE_PREROUTING mask, to make sure the iptables PREROUTING chain isn't traversed twice. The old mechanism isn't satisfactory when the bridge port is a VLAN tagged device. - add some code in vlan_dev.c::vlan_dev_hard_start_xmit(): skb->protocol = __constant_htons(ETH_P_8021Q); skb->mac.raw -= VLAN_HLEN; skb->nh.raw -= VLAN_HLEN; When the logical VLAN device adds its VLAN header to the packet, I think it should update the skb. The protocol then becomes VLAN, the Ethernet header pointer should be updated correctly. Also, the network header pointer should now point to the VLAN header. This code is needed for the code in br_netfilter.c to work, without it things will get more complicated inside br_netfilter.c. I can put it between an #ifdef CONFIG_BRIDGE_NETFILTER if you like, but I think that to keep the skb correct these changes should always happen. - {arp,ip}tables can filter the VLAN tagged packets thanks to some playing around with the skb->data and skb->nh.raw pointer inside br_netfilter.c. When br0.1000 (or the like) exists, this is what happens to the device matching in {eb,ip}tables: Suppose a frame arrives on br0: in PREROUTING the (logical) in-dev is br0. When the frame is bridged, the in-dev remains br0. When the frame is destined for the bridge box, the in-dev for iptables LOCAL_IN becomes br0.1000, for ebtables LOCAL_IN it remains br0. Suppose the bridge box sends a locally generated IP packet through br0.1000. The out-dev for iptables is br0.1000, the out-dev for ebtables is br0. Comments are welcome. If people could test this patch and give feedback, that would be great. cheers, Bart --- linux-2.6.0-test6/net/8021q/vlan.c Sun Sep 28 02:50:40 2003 +++ linux-2.6.0-test6-new/net/8021q/vlan.c Sun Oct 5 21:56:15 2003 @@ -103,6 +103,9 @@ static int __init vlan_proto_init(void) vlan_ioctl_set(vlan_ioctl_handler); +#ifdef CONFIG_BRIDGE_NETFILTER + vlan_dev_hard_start_xmit_p = vlan_dev_hard_start_xmit; +#endif return 0; } @@ -125,6 +128,9 @@ static void __exit vlan_cleanup_devices( } } rtnl_unlock(); +#ifdef CONFIG_BRIDGE_NETFILTER + vlan_dev_hard_start_xmit_p = NULL; +#endif } /* --- linux-2.6.0-test6/net/core/dev.c Sun Sep 28 02:50:20 2003 +++ linux-2.6.0-test6-new/net/core/dev.c Sun Oct 5 21:56:15 2003 @@ -1489,6 +1489,14 @@ static void net_tx_action(struct softirq } #if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE) + +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) +#ifdef CONFIG_BRIDGE_NETFILTER +/* net/bridge/br_netfilter.c needs the address of vlan_dev_hard_start_xmit */ +int (*vlan_dev_hard_start_xmit_p)(struct sk_buff *skb, struct net_device *dev); +#endif +#endif + int (*br_handle_frame_hook)(struct sk_buff *skb); static __inline__ int handle_bridge(struct sk_buff *skb, --- linux-2.6.0-test6/include/linux/if_vlan.h Sun Sep 28 02:50:10 2003 +++ linux-2.6.0-test6-new/include/linux/if_vlan.h Sun Oct 5 21:56:15 2003 @@ -54,6 +54,12 @@ struct vlan_hdr { #define VLAN_VID_MASK 0xfff +#ifdef CONFIG_BRIDGE_NETFILTER +extern int (*vlan_dev_hard_start_xmit_p)(struct sk_buff *skb, + struct net_device *dev); +#endif + + /* found in socket.c */ extern void vlan_ioctl_set(int (*hook)(unsigned long)); --- linux-2.6.0-test6/net/netsyms.c Sun Sep 28 02:50:17 2003 +++ linux-2.6.0-test6-new/net/netsyms.c Sun Oct 5 21:56:15 2003 @@ -236,6 +236,11 @@ EXPORT_SYMBOL(scm_detach_fds); #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) EXPORT_SYMBOL(br_handle_frame_hook); +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) +#ifdef CONFIG_BRIDGE_NETFILTER +EXPORT_SYMBOL(vlan_dev_hard_start_xmit_p); +#endif +#endif #endif #ifdef CONFIG_NET_DIVERT --- linux-2.6.0-test6/include/linux/skbuff.h Sun Sep 28 02:50:29 2003 +++ linux-2.6.0-test6-new/include/linux/skbuff.h Sun Oct 5 21:56:15 2003 @@ -103,8 +103,11 @@ struct nf_bridge_info { atomic_t use; struct net_device *physindev; struct net_device *physoutdev; +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + struct net_device *netoutdev; +#endif unsigned int mask; - unsigned long hh[16 / sizeof(unsigned long)]; + unsigned char hh[18]; }; #endif --- linux-2.6.0-test6/include/linux/netfilter_bridge.h Sun Sep 28 02:50:28 2003 +++ linux-2.6.0-test6-new/include/linux/netfilter_bridge.h Mon Oct 6 20:56:42 2003 @@ -8,6 +8,9 @@ #include #if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER) #include +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) +#include +#endif #endif /* Bridge Hooks */ @@ -44,6 +47,7 @@ enum nf_br_hook_priorities { #define BRNF_BRIDGED_DNAT 0x02 #define BRNF_DONT_TAKE_PARENT 0x04 #define BRNF_BRIDGED 0x08 +#define BRNF_NF_BRIDGE_PREROUTING 0x10 static inline struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb) @@ -54,9 +58,39 @@ struct nf_bridge_info *nf_bridge_alloc(s atomic_set(&(*nf_bridge)->use, 1); (*nf_bridge)->mask = 0; (*nf_bridge)->physindev = (*nf_bridge)->physoutdev = NULL; +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + (*nf_bridge)->netoutdev = NULL; +#endif } return *nf_bridge; +} + +/* Only used in br_forward.c */ +static inline +void nf_bridge_maybe_copy_header(struct sk_buff *skb) +{ + if (skb->nf_bridge) { +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + memcpy(skb->data - 18, skb->nf_bridge->hh, 18); + skb_push(skb, 4); + } else +#endif + memcpy(skb->data - 16, skb->nf_bridge->hh, 16); + } +} + +static inline +void nf_bridge_save_header(struct sk_buff *skb) +{ + int header_size = 16; + +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + if (skb->protocol == __constant_htons(ETH_P_8021Q)) + header_size = 18; +#endif + memcpy(skb->nf_bridge->hh, skb->data - header_size, header_size); } struct bridge_skb_cb { --- linux-2.6.0-test6/net/bridge/br_forward.c Sun Sep 28 02:50:15 2003 +++ linux-2.6.0-test6-new/net/bridge/br_forward.c Mon Oct 6 20:19:32 2003 @@ -35,8 +35,7 @@ int br_dev_queue_push_xmit(struct sk_buf { #ifdef CONFIG_BRIDGE_NETFILTER /* ip_refrag calls ip_fragment, which doesn't copy the MAC header. */ - if (skb->nf_bridge) - memcpy(skb->data - 16, skb->nf_bridge->hh, 16); + nf_bridge_maybe_copy_header(skb); #endif skb_push(skb, ETH_HLEN); --- linux-2.6.0-test6/net/8021q/vlan_dev.c Sun Sep 28 02:51:00 2003 +++ linux-2.6.0-test6-new/net/8021q/vlan_dev.c Sun Oct 5 21:56:15 2003 @@ -502,6 +502,10 @@ int vlan_dev_hard_start_xmit(struct sk_b stats->tx_packets++; /* for statics only */ stats->tx_bytes += skb->len; + skb->protocol = __constant_htons(ETH_P_8021Q); + skb->mac.raw -= VLAN_HLEN; + skb->nh.raw -= VLAN_HLEN; + dev_queue_xmit(skb); return 0; --- linux-2.6.0-test6/net/bridge/br_netfilter.c Sun Sep 28 02:51:07 2003 +++ linux-2.6.0-test6-new/net/bridge/br_netfilter.c Mon Oct 6 21:10:40 2003 @@ -4,7 +4,13 @@ * * Authors: * Lennert Buytenhek - * Bart De Schuymer + * Bart De Schuymer (maintainer) + * + * Changes: + * Apr 29 2003: physdev module support (bdschuym) + * Jun 19 2003: let arptables see bridged ARP traffic (bdschuym) + * Oct 06 2003: filter encapsulated IP/ARP VLAN traffic on untagged bridge + * (bdschuym) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -20,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +47,11 @@ #define has_bridge_parent(device) ((device)->br_port != NULL) #define bridge_parent(device) ((device)->br_port->br->dev) +#define IS_VLAN_IP (skb->protocol == __constant_htons(ETH_P_8021Q) && \ + hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_IP)) +#define IS_VLAN_ARP (skb->protocol == __constant_htons(ETH_P_8021Q) && \ + hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_ARP)) + /* We need these fake structures to make netfilter happy -- * lots of places assume that skb->dst != NULL, which isn't * all that unreasonable. @@ -135,8 +147,13 @@ static int br_nf_pre_routing_finish_brid skb->pkt_type = PACKET_HOST; skb->nf_bridge->mask |= BRNF_PKT_TYPE; } + skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; skb->dev = bridge_parent(skb->dev); + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_pull(skb, VLAN_HLEN); + skb->nh.raw += VLAN_HLEN; + } skb->dst->output(skb); return 0; } @@ -155,6 +172,7 @@ static int br_nf_pre_routing_finish(stru skb->pkt_type = PACKET_OTHERHOST; nf_bridge->mask ^= BRNF_PKT_TYPE; } + nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; if (dnat_took_place(skb)) { if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, @@ -186,6 +204,11 @@ bridged_dnat: nf_bridge->mask |= BRNF_BRIDGED_DNAT; skb->dev = nf_bridge->physindev; clear_cb(skb); + if (skb->protocol == + __constant_htons(ETH_P_8021Q)) { + skb_push(skb, VLAN_HLEN); + skb->nh.raw -= VLAN_HLEN; + } NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, br_nf_pre_routing_finish_bridge, @@ -202,6 +225,10 @@ bridged_dnat: clear_cb(skb); skb->dev = nf_bridge->physindev; + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_push(skb, VLAN_HLEN); + skb->nh.raw -= VLAN_HLEN; + } NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, br_handle_frame_finish, 1); @@ -220,13 +247,20 @@ static unsigned int br_nf_pre_routing(un { struct iphdr *iph; __u32 len; - struct sk_buff *skb; + struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; - if ((*pskb)->protocol != __constant_htons(ETH_P_IP)) - return NF_ACCEPT; - - if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL) + if (skb->protocol != __constant_htons(ETH_P_IP)) { + struct vlan_ethhdr *hdr = (struct vlan_ethhdr *) + ((*pskb)->mac.ethernet); + + if (!IS_VLAN_IP) + return NF_ACCEPT; + if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL) + goto out; + skb_pull(*pskb, VLAN_HLEN); + (*pskb)->nh.raw += VLAN_HLEN; + } else if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL) goto out; if (!pskb_may_pull(skb, sizeof(struct iphdr))) @@ -264,6 +298,7 @@ static unsigned int br_nf_pre_routing(un nf_bridge->mask |= BRNF_PKT_TYPE; } + nf_bridge->mask |= BRNF_NF_BRIDGE_PREROUTING; nf_bridge->physindev = skb->dev; skb->dev = bridge_parent(skb->dev); store_orig_dstaddr(skb); @@ -294,9 +329,6 @@ static unsigned int br_nf_local_in(unsig { struct sk_buff *skb = *pskb; - if (skb->protocol != __constant_htons(ETH_P_IP)) - return NF_ACCEPT; - if (skb->dst == (struct dst_entry *)&__fake_rtable) { dst_release(skb->dst); skb->dst = NULL; @@ -310,12 +342,13 @@ static int br_nf_forward_finish(struct s { struct nf_bridge_info *nf_bridge = skb->nf_bridge; struct net_device *in; + struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); #ifdef CONFIG_NETFILTER_DEBUG skb->nf_debug ^= (1 << NF_BR_FORWARD); #endif - if (skb->protocol == __constant_htons(ETH_P_IP)) { + if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) { in = nf_bridge->physindev; if (nf_bridge->mask & BRNF_PKT_TYPE) { skb->pkt_type = PACKET_OTHERHOST; @@ -324,7 +357,10 @@ static int br_nf_forward_finish(struct s } else { in = *((struct net_device **)(skb->cb)); } - + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_push(skb, VLAN_HLEN); + skb->nh.raw -= VLAN_HLEN; + } NF_HOOK_THRESH(PF_BRIDGE, NF_BR_FORWARD, skb, in, skb->dev, br_forward_finish, 1); return 0; @@ -342,15 +378,20 @@ static unsigned int br_nf_forward(unsign { struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; + struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); if (skb->protocol != __constant_htons(ETH_P_IP) && - skb->protocol != __constant_htons(ETH_P_ARP)) - return NF_ACCEPT; + skb->protocol != __constant_htons(ETH_P_ARP)) { + if (!IS_VLAN_IP && !IS_VLAN_ARP) + return NF_ACCEPT; + skb_pull(*pskb, VLAN_HLEN); + (*pskb)->nh.raw += VLAN_HLEN; + } #ifdef CONFIG_NETFILTER_DEBUG skb->nf_debug ^= (1 << NF_BR_FORWARD); #endif - if (skb->protocol == __constant_htons(ETH_P_IP)) { + if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) { nf_bridge = skb->nf_bridge; if (skb->pkt_type == PACKET_OTHERHOST) { skb->pkt_type = PACKET_HOST; @@ -365,7 +406,15 @@ static unsigned int br_nf_forward(unsign bridge_parent(out), br_nf_forward_finish); } else { struct net_device **d = (struct net_device **)(skb->cb); + struct arphdr *arp = skb->nh.arph; + if (arp->ar_pln != 4) { + if (IS_VLAN_ARP) { + skb_push(*pskb, VLAN_HLEN); + (*pskb)->nh.raw -= VLAN_HLEN; + } + return NF_ACCEPT; + } *d = (struct net_device *)in; NF_HOOK(NF_ARP, NF_ARP_FORWARD, skb, (struct net_device *)in, (struct net_device *)out, br_nf_forward_finish); @@ -381,6 +430,10 @@ static int br_nf_local_out_finish(struct #ifdef CONFIG_NETFILTER_DEBUG skb->nf_debug &= ~(1 << NF_BR_LOCAL_OUT); #endif + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_push(skb, VLAN_HLEN); + skb->nh.raw -= VLAN_HLEN; + } NF_HOOK_THRESH(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, br_forward_finish, NF_BR_PRI_FIRST + 1); @@ -419,8 +472,9 @@ static unsigned int br_nf_local_out(unsi struct net_device *realindev; struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; + struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); - if (skb->protocol != __constant_htons(ETH_P_IP)) + if (skb->protocol != __constant_htons(ETH_P_IP) && !IS_VLAN_IP) return NF_ACCEPT; /* Sometimes we get packets with NULL ->dst here (for example, @@ -444,11 +498,26 @@ static unsigned int br_nf_local_out(unsi skb->pkt_type = PACKET_OTHERHOST; nf_bridge->mask ^= BRNF_PKT_TYPE; } + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_push(skb, VLAN_HLEN); + skb->nh.raw -= VLAN_HLEN; + } NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, realindev, skb->dev, okfn); } else { + struct net_device *realoutdev = bridge_parent(skb->dev); + +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + /* iptables should match -o br0.x */ + if (nf_bridge->netoutdev) + realoutdev = nf_bridge->netoutdev; +#endif okfn = br_nf_local_out_finish; + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_pull(skb, VLAN_HLEN); + (*pskb)->nh.raw += VLAN_HLEN; + } /* IP forwarded traffic has a physindev, locally * generated traffic hasn't. */ @@ -456,9 +525,8 @@ static unsigned int br_nf_local_out(unsi if (((nf_bridge->mask & BRNF_DONT_TAKE_PARENT) == 0) && has_bridge_parent(realindev)) realindev = bridge_parent(realindev); - NF_HOOK_THRESH(PF_INET, NF_IP_FORWARD, skb, realindev, - bridge_parent(skb->dev), okfn, + realoutdev, okfn, NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD + 1); } else { #ifdef CONFIG_NETFILTER_DEBUG @@ -466,7 +534,7 @@ static unsigned int br_nf_local_out(unsi #endif NF_HOOK_THRESH(PF_INET, NF_IP_LOCAL_OUT, skb, realindev, - bridge_parent(skb->dev), okfn, + realoutdev, okfn, NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT + 1); } } @@ -482,6 +550,8 @@ static unsigned int br_nf_post_routing(u { 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 net_device *realoutdev = bridge_parent(skb->dev); /* Be very paranoid. Must be a device driver bug. */ if (skb->mac.raw < skb->head || skb->mac.raw + ETH_HLEN > skb->data) { @@ -492,11 +562,11 @@ static unsigned int br_nf_post_routing(u if (has_bridge_parent(skb->dev)) printk("[%s]", bridge_parent(skb->dev)->name); } - printk("\n"); + printk(" head:%p, raw:%p\n", skb->head, skb->mac.raw); return NF_ACCEPT; } - if (skb->protocol != __constant_htons(ETH_P_IP)) + if (skb->protocol != __constant_htons(ETH_P_IP) && !IS_VLAN_IP) return NF_ACCEPT; /* Sometimes we get packets with NULL ->dst here (for example, @@ -517,10 +587,19 @@ static unsigned int br_nf_post_routing(u nf_bridge->mask |= BRNF_PKT_TYPE; } - memcpy(nf_bridge->hh, skb->data - 16, 16); + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_pull(skb, VLAN_HLEN); + skb->nh.raw += VLAN_HLEN; + } + + nf_bridge_save_header(skb); +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + if (nf_bridge->netoutdev) + realoutdev = nf_bridge->netoutdev; +#endif NF_HOOK(PF_INET, NF_IP_POST_ROUTING, skb, NULL, - bridge_parent(skb->dev), br_dev_queue_push_xmit); + realoutdev, br_dev_queue_push_xmit); return NF_STOLEN; } @@ -535,8 +614,8 @@ static unsigned int ipv4_sabotage_in(uns const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - if (in->hard_start_xmit == br_dev_xmit && - okfn != br_nf_pre_routing_finish) { + if ((*pskb)->nf_bridge && + !((*pskb)->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING)) { okfn(*pskb); return NF_STOLEN; } @@ -552,10 +631,15 @@ static unsigned int ipv4_sabotage_out(un const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - if (out->hard_start_xmit == br_dev_xmit && + if ((out->hard_start_xmit == br_dev_xmit && okfn != br_nf_forward_finish && okfn != br_nf_local_out_finish && - okfn != br_dev_queue_push_xmit) { + okfn != br_dev_queue_push_xmit) +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + || (out->hard_start_xmit == vlan_dev_hard_start_xmit_p && + VLAN_DEV_INFO(out)->real_dev->hard_start_xmit == br_dev_xmit) +#endif + ) { struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; @@ -574,6 +658,11 @@ static unsigned int ipv4_sabotage_out(un nf_bridge->mask &= BRNF_DONT_TAKE_PARENT; nf_bridge->physindev = (struct net_device *)in; } +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + /* the iptables outdev is br0.x, not br0 */ + if (out->hard_start_xmit == vlan_dev_hard_start_xmit_p) + nf_bridge->netoutdev = (struct net_device *)out; +#endif okfn(skb); return NF_STOLEN; } From bdschuym@pandora.be Mon Oct 6 13:58:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 13:59:18 -0700 (PDT) Received: from apate.telenet-ops.be (apate.telenet-ops.be [195.130.132.57]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96KwS25021642 for ; Mon, 6 Oct 2003 13:58:44 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by apate.telenet-ops.be (Postfix) with SMTP id 0AE0037F00; Mon, 6 Oct 2003 22:58:28 +0200 (MEST) Received: from 192.168.123.138 (D5762BF3.kabel.telenet.be [213.118.43.243]) by apate.telenet-ops.be (Postfix) with ESMTP id 2744D37FA5; Mon, 6 Oct 2003 22:58:15 +0200 (MEST) From: Bart De Schuymer To: Ben Greear Subject: Re: [Bridge] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged {I, AR}P packets Date: Mon, 6 Oct 2003 22:58:27 +0200 User-Agent: KMail/1.5 Cc: netdev@oss.sgi.com, vlan@wanfear.com, bridge , Stephen Hemminger References: <200310062204.07230.bdschuym@pandora.be> <3F81CF75.5050802@candelatech.com> In-Reply-To: <3F81CF75.5050802@candelatech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310062258.27943.bdschuym@pandora.be> X-archive-position: 571 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Monday 06 October 2003 22:24, Ben Greear wrote: > Bart De Schuymer wrote: > > - add some code in vlan_dev.c::vlan_dev_hard_start_xmit(): > > skb->protocol = __constant_htons(ETH_P_8021Q); > > skb->mac.raw -= VLAN_HLEN; > > skb->nh.raw -= VLAN_HLEN; > > I wonder if this is what was messing up the tcpdump packet capture > as well? A wrong Ethernet header pointer should probably do the trick. > It would be fine with me if you un-conditionally exported the > vlan hard-start-xmit pointer, but I don't feel strongly either way. Me neither. I just let Dave decide in those cases :-) cheers, Bart From bdschuym@pandora.be Mon Oct 6 14:28:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 14:28:43 -0700 (PDT) Received: from astra.telenet-ops.be (astra.telenet-ops.be [195.130.132.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96LRw25024052 for ; Mon, 6 Oct 2003 14:27:59 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by astra.telenet-ops.be (Postfix) with SMTP id CCF5337FE0; Mon, 6 Oct 2003 22:55:26 +0200 (MEST) Received: from 192.168.123.138 (D5762BF3.kabel.telenet.be [213.118.43.243]) by astra.telenet-ops.be (Postfix) with ESMTP id 1FC8B37ED0; Mon, 6 Oct 2003 22:55:26 +0200 (MEST) From: Bart De Schuymer To: Stephen Hemminger Subject: Re: [PATCH/RFC] Let {ip,arp}tables "see" bridged VLAN tagged {I,AR}P packets Date: Mon, 6 Oct 2003 22:55:38 +0200 User-Agent: KMail/1.5 Cc: netdev@oss.sgi.com, bridge , "David S.Miller" , Ben Greear , vlan@wanfear.com References: <200310062204.07230.bdschuym@pandora.be> <20031006131916.6a7ba5c0.shemminger@osdl.org> In-Reply-To: <20031006131916.6a7ba5c0.shemminger@osdl.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310062255.38789.bdschuym@pandora.be> X-archive-position: 572 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Monday 06 October 2003 22:19, Stephen Hemminger wrote: > I can test the no VLAN case, but actual VLAN's are a little harder to > setup. Setting up vlan's is easy: brctl addbr br0 brctl addif br0 eth0 ifconfig br0 $address vconfig add br0 1000 ifconfig br0.1000 $address > How does this affect the ability to rmmod either vlan or bridge? Well, when br0.1000 exists and you then rmmod the bridge, it doesn't work. The way to do it is rmmod 8021q;rmmod bridge. I came across this issue, but I assumed it was not my fault. I thought the problem would exist without my code too, but I'm not sure if I checked. What also doesn't work is rmmod bridge followed by rmmod 8021q on a different console. I now just realize this is probably because the bridge depends on 8021q and we thus get a deadlock. I think the right solution to this problem is, when rmmod bridge happens, it removes any tagged bridge devices first. cheers, Bart From ja@ssi.bg Mon Oct 6 15:16:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 15:17:18 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96MGa25027572 for ; Mon, 6 Oct 2003 15:16:42 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h96MGav07032; Tue, 7 Oct 2003 01:16:36 +0300 Date: Tue, 7 Oct 2003 01:16:36 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: Rusty Russell cc: "David S. Miller" , Wensong Zhang , Subject: [2.6 PATCH] ipvs - remove some unused fields from the protocols In-Reply-To: <20031006000225.AF7642C0A7@lists.samba.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 573 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Hello, The promised removal of some unused fields. For inclusion after comments from Rusty. Rusty, it seems we can not convert the transmitters to NF_STOLEN, ip_vs_null_xmit returns NF_ACCEPT. Regards, Julian Anastasov # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1357 -> 1.1358 # net/ipv4/ipvs/ip_vs_core.c 1.4 -> 1.5 # include/net/ip_vs.h 1.5 -> 1.6 # net/ipv4/ipvs/ip_vs_proto_icmp.c 1.2 -> 1.3 # net/ipv4/ipvs/ip_vs_proto_tcp.c 1.3 -> 1.4 # net/ipv4/ipvs/ip_vs_proto_ah.c 1.2 -> 1.3 # net/ipv4/ipvs/ip_vs_proto_esp.c 1.2 -> 1.3 # net/ipv4/ipvs/ip_vs_proto_udp.c 1.3 -> 1.4 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/07 ja@ssi.bg 1.1358 # [IPVS]: remove some unused fields from the protocols # -------------------------------------------- # diff -Nru a/include/net/ip_vs.h b/include/net/ip_vs.h --- a/include/net/ip_vs.h Tue Oct 7 01:01:36 2003 +++ b/include/net/ip_vs.h Tue Oct 7 01:01:36 2003 @@ -435,11 +435,7 @@ struct ip_vs_protocol *next; char *name; __u16 protocol; - int minhlen; - int minhlen_icmp; int dont_defrag; - int skip_nonexisting; - int slave; /* if controlled by others */ atomic_t appcnt; /* counter of proto app incs */ int *timeout_table; /* protocol timeout table */ @@ -528,7 +524,10 @@ struct ip_vs_dest *dest; /* real server */ atomic_t in_pkts; /* incoming packet counter */ - /* packet transmitter for different forwarding methods */ + /* packet transmitter for different forwarding methods. If it + mangles the packet, it must return NF_DROP or NF_STOLEN, otherwise + this must be changed to a sk_buff **. + */ int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); diff -Nru a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c --- a/net/ipv4/ipvs/ip_vs_core.c Tue Oct 7 01:01:36 2003 +++ b/net/ipv4/ipvs/ip_vs_core.c Tue Oct 7 01:01:36 2003 @@ -660,7 +660,7 @@ /* Is the embedded protocol header present? */ if (unlikely(ciph.frag_off & __constant_htons(IP_OFFSET) && - (pp->minhlen || pp->dont_defrag))) + pp->dont_defrag)) return NF_ACCEPT; IP_VS_DBG_PKT(11, pp, skb, offset, "Checking outgoing ICMP for"); @@ -911,7 +911,7 @@ /* Is the embedded protocol header present? */ if (unlikely(ciph.frag_off & __constant_htons(IP_OFFSET) && - (pp->minhlen || pp->dont_defrag))) + pp->dont_defrag)) return NF_ACCEPT; IP_VS_DBG_PKT(11, pp, skb, offset, "Checking incoming ICMP for"); diff -Nru a/net/ipv4/ipvs/ip_vs_proto_ah.c b/net/ipv4/ipvs/ip_vs_proto_ah.c --- a/net/ipv4/ipvs/ip_vs_proto_ah.c Tue Oct 7 01:01:36 2003 +++ b/net/ipv4/ipvs/ip_vs_proto_ah.c Tue Oct 7 01:01:36 2003 @@ -69,11 +69,11 @@ if (!cp) { /* * We are not sure if the packet is from our - * service, so the caller should check skip_nonexisting + * service, so our conn_schedule hook should return NF_ACCEPT */ IP_VS_DBG(12, "Unknown ISAKMP entry for outin packet " "%s%s %u.%u.%u.%u->%u.%u.%u.%u\n", - inverse?"ICMP+":"", + inverse ? "ICMP+" : "", pp->name, NIPQUAD(iph->saddr), NIPQUAD(iph->daddr)); @@ -104,11 +104,6 @@ } if (!cp) { - /* - * We are not sure if the packet is from our - * service, so the caller should check skip_nonexisting - * or our conn_schedule hook should return NF_ACCEPT - */ IP_VS_DBG(12, "Unknown ISAKMP entry for inout packet " "%s%s %u.%u.%u.%u->%u.%u.%u.%u\n", inverse ? "ICMP+" : "", @@ -167,11 +162,7 @@ struct ip_vs_protocol ip_vs_protocol_ah = { .name = "AH", .protocol = IPPROTO_AH, - .minhlen = 0, - .minhlen_icmp = 0, .dont_defrag = 1, - .skip_nonexisting = 1, - .slave = 1, .init = ah_init, .exit = ah_exit, .conn_schedule = ah_conn_schedule, @@ -179,11 +170,11 @@ .conn_out_get = ah_conn_out_get, .snat_handler = NULL, .dnat_handler = NULL, + .csum_check = NULL, .state_transition = NULL, .register_app = NULL, .unregister_app = NULL, .app_conn_bind = NULL, - .csum_check = NULL, .debug_packet = ah_debug_packet, .timeout_change = NULL, /* ISAKMP */ .set_state_timeout = NULL, diff -Nru a/net/ipv4/ipvs/ip_vs_proto_esp.c b/net/ipv4/ipvs/ip_vs_proto_esp.c --- a/net/ipv4/ipvs/ip_vs_proto_esp.c Tue Oct 7 01:01:36 2003 +++ b/net/ipv4/ipvs/ip_vs_proto_esp.c Tue Oct 7 01:01:36 2003 @@ -69,7 +69,7 @@ if (!cp) { /* * We are not sure if the packet is from our - * service, so the caller should check skip_nonexisting + * service, so our conn_schedule hook should return NF_ACCEPT */ IP_VS_DBG(12, "Unknown ISAKMP entry for outin packet " "%s%s %u.%u.%u.%u->%u.%u.%u.%u\n", @@ -104,14 +104,9 @@ } if (!cp) { - /* - * We are not sure if the packet is from our - * service, so the caller should check skip_nonexisting - * or our conn_schedule hook should return NF_ACCEPT - */ IP_VS_DBG(12, "Unknown ISAKMP entry for inout packet " "%s%s %u.%u.%u.%u->%u.%u.%u.%u\n", - inverse?"ICMP+":"", + inverse ? "ICMP+" : "", pp->name, NIPQUAD(iph->saddr), NIPQUAD(iph->daddr)); @@ -166,11 +161,7 @@ struct ip_vs_protocol ip_vs_protocol_esp = { .name = "ESP", .protocol = IPPROTO_ESP, - .minhlen = 0, - .minhlen_icmp = 0, .dont_defrag = 1, - .skip_nonexisting = 1, - .slave = 1, .init = esp_init, .exit = esp_exit, .conn_schedule = esp_conn_schedule, diff -Nru a/net/ipv4/ipvs/ip_vs_proto_icmp.c b/net/ipv4/ipvs/ip_vs_proto_icmp.c --- a/net/ipv4/ipvs/ip_vs_proto_icmp.c Tue Oct 7 01:01:36 2003 +++ b/net/ipv4/ipvs/ip_vs_proto_icmp.c Tue Oct 7 01:01:36 2003 @@ -163,11 +163,7 @@ struct ip_vs_protocol ip_vs_protocol_icmp = { .name = "ICMP", .protocol = IPPROTO_ICMP, - .minhlen = sizeof(struct icmphdr), - .minhlen_icmp = 8, .dont_defrag = 0, - .skip_nonexisting = 0, - .slave = 0, .init = icmp_init, .exit = icmp_exit, .conn_schedule = icmp_conn_schedule, diff -Nru a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c --- a/net/ipv4/ipvs/ip_vs_proto_tcp.c Tue Oct 7 01:01:36 2003 +++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c Tue Oct 7 01:01:36 2003 @@ -132,7 +132,7 @@ if (unlikely(cp->app != NULL)) { /* Some checks before mangling */ - if (pp->csum_check && !pp->slave && !pp->csum_check(*pskb, pp)) + if (pp->csum_check && !pp->csum_check(*pskb, pp)) return 0; /* Call application helper if needed */ @@ -180,7 +180,7 @@ if (unlikely(cp->app != NULL)) { /* Some checks before mangling */ - if (pp->csum_check && !pp->slave && !pp->csum_check(*pskb, pp)) + if (pp->csum_check && !pp->csum_check(*pskb, pp)) return 0; /* @@ -614,11 +614,7 @@ struct ip_vs_protocol ip_vs_protocol_tcp = { .name = "TCP", .protocol = IPPROTO_TCP, - .minhlen = sizeof(struct tcphdr), - .minhlen_icmp = 8, .dont_defrag = 0, - .skip_nonexisting = 0, - .slave = 0, .appcnt = ATOMIC_INIT(0), .init = tcp_init, .exit = tcp_exit, diff -Nru a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c --- a/net/ipv4/ipvs/ip_vs_proto_udp.c Tue Oct 7 01:01:36 2003 +++ b/net/ipv4/ipvs/ip_vs_proto_udp.c Tue Oct 7 01:01:36 2003 @@ -133,7 +133,7 @@ if (unlikely(cp->app != NULL)) { /* Some checks before mangling */ - if (pp->csum_check && !pp->slave && !pp->csum_check(*pskb, pp)) + if (pp->csum_check && !pp->csum_check(*pskb, pp)) return 0; /* @@ -187,7 +187,7 @@ if (unlikely(cp->app != NULL)) { /* Some checks before mangling */ - if (pp->csum_check && !pp->slave && !pp->csum_check(*pskb, pp)) + if (pp->csum_check && !pp->csum_check(*pskb, pp)) return 0; /* @@ -401,11 +401,7 @@ struct ip_vs_protocol ip_vs_protocol_udp = { .name = "UDP", .protocol = IPPROTO_UDP, - .minhlen = sizeof(struct udphdr), - .minhlen_icmp = 8, .dont_defrag = 0, - .skip_nonexisting = 0, - .slave = 0, .init = udp_init, .exit = udp_exit, .conn_schedule = udp_conn_schedule, From hadi@cyberus.ca Mon Oct 6 15:39:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 15:40:30 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96Mds25029914 for ; Mon, 6 Oct 2003 15:39:55 -0700 Received: from pc3.sgkashiwa-unet.ocn.ne.jp ([219.166.50.147] helo=[10.0.1.44]) by mail.cyberus.ca with esmtp (Exim 4.12) id 1A6e19-0008FO-00; Mon, 06 Oct 2003 18:39:51 -0400 Subject: Re: [RFC] nfmark modify extension to classifiers From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , Alexey , netdev@oss.sgi.com In-Reply-To: <20031006002619.GC11250@rei.reeler.org> References: <20031006002619.GC11250@rei.reeler.org> Content-Type: text/plain Organization: jamalopolis Message-Id: <1065479986.1102.3.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 06 Oct 2003 18:39:47 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 574 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 Hi there, This is a bad idea. Please consider using the tc action extensions. I was going to write a generic metadata modifier action (classid, tcindex, nfmark etc). Maybe you can beat me to it. cheers, jamal On Sun, 2003-10-05 at 20:26, Thomas Graf wrote: > Hello > > The netfilter mark field is heavly used nowadays to communicate > between tc, netfilter and ip rule. Classifiers are not yet > capable of modifying the nfmark field. However it would make > sense, especially in ingress context. > > Example: > $TC filter add dev $DEV parent 10:0 protocol ip prio 10 u32 > match ip protocol 6 0xff nfmark 0x10 flowid 10:12 > ^^^^^^^^^^^ > Would set nfmark=0x10 for all icmp packets. > > Applications (examples): > - Differentiate source classifier if multiple classifiers > classify into a single class (match again with cls_fw.c). > - Mark packets in ingress and reuse nfmark in ip rules if > netfilter is too slow. > - Use rsvp(6)/route/tcindex capabilities in netfilter/ip rule. > > Below is a patch to the u32 classifier adding this extension. > It would be easy to do the same for other classifiers. > (I also have a patch against tc if someone is interested.) > > The ifdef mess cannot be avoided unless nfmark in skbuff is > freed from its ifdefs. > > Regards From Casey@Carter.net Mon Oct 6 15:50:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 15:51:33 -0700 (PDT) Received: from c000.snv.cp.net (h008.c000.snv.cp.net [209.228.32.72]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96Mov25031027 for ; Mon, 6 Oct 2003 15:50:57 -0700 Received: (cpmta 11081 invoked from network); 6 Oct 2003 15:50:55 -0700 Received: from 12.221.64.39 (HELO Carter.net) by smtp.carter.net (209.228.32.72) with SMTP; 6 Oct 2003 15:50:55 -0700 X-Sent: 6 Oct 2003 22:50:55 GMT Message-ID: <3F81F1CD.8050803@Carter.net> Date: Mon, 06 Oct 2003 17:50:53 -0500 From: Casey Carter User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Dwyer CC: netdev@oss.sgi.com, linux-ha@lists.linux-ha.org Subject: Re: Strange UDP binding behavior (SO_BINDTODEVICE) References: <20031005130154.5bd9d182.kevin@pheared.net> In-Reply-To: <20031005130154.5bd9d182.kevin@pheared.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 575 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Casey@Carter.net Precedence: bulk X-list: netdev Kevin Dwyer wrote: >Hello, > >We have come across something that may be a bug, unless this behavior >was intentional. > >The problem can be simulated by creating a socket, setting >SO_BINDTODEVICE, and binding to a port. Then, in a separate process we >attempt to bind to the same port but without the SO_BINDTODEVICE option. >The expected behavior is to get EINVAL because the port is already >bound by a prior call. However, it succeeds, and the second process >steals the first process' packets. > >The likely code in question resides in net/ipv4/udp.c: > > for (sk2 = udp_hash[snum & (UDP_HTABLE_SIZE - 1)]; > sk2 != NULL; > sk2 = sk2->next) { > if (sk2->num == snum && > sk2 != sk && > sk2->bound_dev_if == sk->bound_dev_if && > (!sk2->rcv_saddr || > !sk->rcv_saddr || > sk2->rcv_saddr == sk->rcv_saddr) && > (!sk2->reuse || !sk->reuse)) > goto fail; > } > >The condition (sk2->bound_dev_if == sk->bound_dev_if) will fail because >sk2->bound_dev_if will be the ifindex of the interface we bound to, and >sk->bound_dev_if will be 0, since we didn't bind to a specific >interface. > >Lars Ellenberg suggests something like: >| (!sk2->bound_dev_if || >| !sk->bound_dev_if || >| sk2->bound_dev_if == sk->bound_dev_if) && > >Which on its face appears to clear the bug. I don't see any obvious >downsides to it either, but this is why I'm here. > >So, is this intentional or a bug? > >Thanks. > > > This is not a bug, it's a feature! It is possible to use multiple sockets with the same port number bound to different interfaces (where "no interface" is one possible choice). The UDP packet delivery code favors the socket that is bound to the interface through which packets are received. So, if I am only interested in packets for port 6666 on eth1, then I am prioritized ahead of the socket bound to "no interface" port 6666. The only way you can "steal" packets is to create sockets and SO_BINDTODEVICE them "below" another process's non-interface-bound socket. This is a clear security issue, and is the main reason for restricting SO_BINDEVICE to users with CAP_NET_ADMIN. -- Casey Carter Casey@Carter.net ccarter@cs.uiuc.edu AIM: cartec69 From jt@bougret.hpl.hp.com Mon Oct 6 16:23:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 16:24:10 -0700 (PDT) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h96NNZ25003951 for ; Mon, 6 Oct 2003 16:23:35 -0700 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel13.hp.com (Postfix) with ESMTP id 34AD41C00C69; Mon, 6 Oct 2003 16:23:35 -0700 (PDT) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_28810+JAGae91741+JAGae92668)/8.9.3 HPLabs Timeshare Server) with ESMTP id QAA28564; Mon, 6 Oct 2003 16:23:34 -0700 (PDT) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1A6ehS-0002SG-00; Mon, 06 Oct 2003 16:23:34 -0700 Date: Mon, 6 Oct 2003 16:23:34 -0700 To: Stephen Hemminger Cc: "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] (1/11) Irda dongle module owner support Message-ID: <20031006232334.GA9277@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20031002152026.4bfd2c67.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031002152026.4bfd2c67.shemminger@osdl.org> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-archive-position: 576 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@bougret.hpl.hp.com Precedence: bulk X-list: netdev On Thu, Oct 02, 2003 at 03:20:26PM -0700, Stephen Hemminger wrote: > IRDA dongle interface needed to be converted to have an owner field > to avoid races on module unload. > > Eliminated the use of hashbin locking because the dongle control > code needed to do it's own locking to avoid races. This also closed > the race between find and insert. > > The find/insert hashbin race may be a general problem with all the IRDA > hashbin stuff. IMHO the hashbin stuff should be replaced, it is full > of dead incomplete code and done better by the list macros. Hi, More testing on 2.6.0-test6-bk8 on my SMP box... After modprobing irport, a modprobe of the actisys module hangs forever. Conditions : irport was not yet attached/up. I had irdadump running and an irda-usb active, and I had just rmmod sir_dev. I can see that modprobe is taking 100% cpu : --------------------------------------- 1786 pts/1 R 4:11 modprobe actisys --------------------------------------- I can't kill it ! No messages in the log. --------------------------------------- # cat /proc/modules actisys 4032 1 - Loading 0xd0859000 irport 12672 0 - Live 0xd0884000 irda 182260 5 actisys,irport,irnet,irda_usb, Live 0xd08d3000 --------------------------------------- After a clean reboot, I just tried to modprobe actisys even before modprobing irport. Same result : -------------------------------- # cat /proc/modules actisys 4032 1 - Loading 0xd0859000 irda 182260 1 actisys, Live 0xd08d3000 -------------------------------- Any tip for debugging that ? Thanks... Jean From kevin@pheared.net Mon Oct 6 18:06:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 18:06:44 -0700 (PDT) Received: from taurus.lunarpages.com (taurus.lunarpages.com [64.235.234.121]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9716625009784 for ; Mon, 6 Oct 2003 18:06:06 -0700 Received: from adsl-138-88-53-207.ba-dsg.net ([138.88.53.207] helo=ganon ident=kevin) by taurus.lunarpages.com with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1A6gIj-0001I3-6S; Mon, 06 Oct 2003 18:06:09 -0700 Date: Mon, 6 Oct 2003 21:06:00 -0400 From: Kevin Dwyer To: Casey Carter Cc: netdev@oss.sgi.com, linux-ha@lists.linux-ha.org Subject: Re: Strange UDP binding behavior (SO_BINDTODEVICE) Message-Id: <20031006210600.37da62c9.kevin@pheared.net> In-Reply-To: <3F81F1CD.8050803@Carter.net> References: <20031005130154.5bd9d182.kevin@pheared.net> <3F81F1CD.8050803@Carter.net> X-Mailer: Sylpheed version 0.9.5claws28 (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Signature=_Mon__6_Oct_2003_21_06_00_-0400_8.KgV4SaTS2UuHQX" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - taurus.lunarpages.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - pheared.net X-archive-position: 577 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kevin@pheared.net Precedence: bulk X-list: netdev --Signature=_Mon__6_Oct_2003_21_06_00_-0400_8.KgV4SaTS2UuHQX Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit On Mon, 06 Oct 2003 17:50:53 -0500 Casey Carter wrote: > This is not a bug, it's a feature! It is possible to use multiple > sockets with the same port number bound to different interfaces (where > "no interface" is one possible choice). The UDP packet delivery code > favors the socket that is bound to the interface through which packets > are received. So, if I am only interested in packets for port 6666 on > eth1, then I am prioritized ahead of the socket bound to "no > interface" port 6666. Well, I would buy that as reasonable, acceptable behavior, but I think the reverse is true. We are binding specifically to say, eth0 on port 694. Someone comes along and binds to "no interface" on port 694 and trumps our socket. Isn't that the opposite of what you describe? -- - kpd "If at first you don't succeed, redefine success." - Anonymous --Signature=_Mon__6_Oct_2003_21_06_00_-0400_8.KgV4SaTS2UuHQX Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/ghF7N4rbBhHCVDkRArTxAJ9R2pv9Z9CReHsjc7ME1Eaf5GvhZQCgkOtA z18NlcvJg0aSBETQPQ0VxXk= =RLiO -----END PGP SIGNATURE----- --Signature=_Mon__6_Oct_2003_21_06_00_-0400_8.KgV4SaTS2UuHQX-- From tgr@reeler.org Mon Oct 6 18:30:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 18:31:01 -0700 (PDT) Received: from rei.rakuen (dclient217-162-65-211.hispeed.ch [217.162.65.211]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h971U525010260 for ; Mon, 6 Oct 2003 18:30:26 -0700 Received: by reeler.org id 1A6gep-00078T-00 ; Tue, 07 Oct 2003 03:28:59 +0200 Date: Tue, 7 Oct 2003 03:28:59 +0200 From: Thomas Graf To: jamal Cc: "David S. Miller" , Alexey , netdev@oss.sgi.com Subject: Re: [RFC] nfmark modify extension to classifiers Message-ID: <20031007012858.GF11250@rei.reeler.org> References: <20031006002619.GC11250@rei.reeler.org> <1065479986.1102.3.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1065479986.1102.3.camel@jzny.localdomain> X-archive-position: 578 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 Hello > This is a bad idea. > Please consider using the tc action extensions. You mean TC_POLICE_NFMARK? This was actually my initial idea but I wanted to avoid a dependency mess. > I was going to write a generic metadata modifier action > (classid, tcindex, nfmark etc). Maybe you can beat me to it. I also thought about that, more specificly: Extend tcf_result and set nfmark/tcindex in tc_classify? There are so many solutions to this and I have no clue what is the best solution. Regards -- Thomas GRAF From shemminger@osdl.org Mon Oct 6 22:26:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 06 Oct 2003 22:27:22 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h975Qm25027999 for ; Mon, 6 Oct 2003 22:26:49 -0700 Received: from mylinux.hemminger.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h975QZ121432; Mon, 6 Oct 2003 22:26:35 -0700 Date: Mon, 6 Oct 2003 22:26:31 -0700 From: Stephen Hemminger To: jt@hpl.hp.com, davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH] spinlock badness in last dongle changes. Message-Id: <20031006222631.1934f8e1.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6 (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: 579 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 On 2.6.0-test6 bk latest, rmmod of irda hangs on SMP... A couple of locking problems happened when converted from using hashbin lock outside of irqueue. First, the lock was never initialized; Second, the lock was being unlocked after the hashbin was free. Since the hashbin of dongles should be empty (ie all dongle unregistered) don't really need locking there, so just warn if we find anything... diff -Nru a/net/irda/irda_device.c b/net/irda/irda_device.c --- a/net/irda/irda_device.c Mon Oct 6 22:25:01 2003 +++ b/net/irda/irda_device.c Mon Oct 6 22:25:01 2003 @@ -90,6 +90,7 @@ printk(KERN_WARNING "IrDA: Can't allocate dongles hashbin!\n"); return -ENOMEM; } + spin_lock_init(&dongles->hb_spinlock); tasks = hashbin_new(HB_LOCK); if (tasks == NULL) { @@ -104,14 +105,20 @@ return 0; } +static void __exit leftover_dongle(void *arg) +{ + struct dongle_reg *reg = arg; + printk(KERN_WARNING "IrDA: Dongle type %x not unregistered\n", + reg->type); +} + void __exit irda_device_cleanup(void) { IRDA_DEBUG(4, "%s()\n", __FUNCTION__); hashbin_delete(tasks, (FREE_FUNC) __irda_task_delete); - spin_lock(&dongles->hb_spinlock); - hashbin_delete(dongles, NULL); - spin_unlock(&dongles->hb_spinlock); + + hashbin_delete(dongles, leftover_dongle); } /* From kuznet@ms2.inr.ac.ru Tue Oct 7 03:39:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 03:40:22 -0700 (PDT) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97AdL25004601 for ; Tue, 7 Oct 2003 03:39:42 -0700 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id OAA30009; Tue, 7 Oct 2003 14:38:50 +0400 From: kuznet@ms2.inr.ac.ru Message-Id: <200310071038.OAA30009@yakov.inr.ac.ru> Subject: Re: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable To: mashirle@us.ibm.com (Shirley Ma) Date: Tue, 7 Oct 2003 14:38:50 +0400 (MSD) Cc: davem@redhat.com, netdev@oss.sgi.com In-Reply-To: <200310011637.27013.mashirle@us.ibm.com> from "Shirley Ma" at ïËÔ 01, 2003 04:37:26 X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 580 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Hello! > +=09unsigned long=09cstamp; /* created time */ > +=09unsigned long=09tstamp; /* updated time */ Please, do not use "long" things, they are not allowed in API. u32 would be good. Alexey From davem@pizda.ninka.net Tue Oct 7 03:45:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 03:45:54 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Aj825004989 for ; Tue, 7 Oct 2003 03:45:21 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA02303; Tue, 7 Oct 2003 03:40:03 -0700 Date: Tue, 7 Oct 2003 03:40:03 -0700 From: "David S. Miller" To: "David S. Miller" Cc: shemminger@osdl.org, ak@suse.de, netdev@oss.sgi.com Subject: Re: [PATCH] consolidate skb delivery Message-Id: <20031007034003.7a926a05.davem@redhat.com> In-Reply-To: <20031003001128.587ac102.davem@redhat.com> References: <20031002102133.7285b5ee.shemminger@osdl.org> <20031002192546.GA29673@wotan.suse.de> <20031002124345.7b34bf24.shemminger@osdl.org> <20031003001128.587ac102.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 581 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 On Fri, 3 Oct 2003 00:11:28 -0700 "David S. Miller" wrote: > I would suggest we eliminate support for old style protocols > now. We can do that by making the ptype registry in net/core/dev.c > fail if the thing being registered is old-style. > > I'll code this up. Ok, as it turns out, instead I converted all the old-style protocols. When things seemed really complex or hard to convert easily I just put: nskb = skb_copy(skb, GFP_ATOMIC); if (!nskb) goto drop; kfree_skb(skb); skb = nskb; at the top of the input handler. The only instance that I did this for actually was x25. From davem@pizda.ninka.net Tue Oct 7 03:46:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 03:46:53 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97AkR25005253 for ; Tue, 7 Oct 2003 03:46:47 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA02316; Tue, 7 Oct 2003 03:40:51 -0700 Date: Tue, 7 Oct 2003 03:40:51 -0700 From: "David S. Miller" To: kuznet@ms2.inr.ac.ru Cc: mashirle@us.ibm.com, netdev@oss.sgi.com Subject: Re: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable Message-Id: <20031007034051.3fcb3218.davem@redhat.com> In-Reply-To: <200310071038.OAA30009@yakov.inr.ac.ru> References: <200310011637.27013.mashirle@us.ibm.com> <200310071038.OAA30009@yakov.inr.ac.ru> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 582 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 On Tue, 7 Oct 2003 14:38:50 +0400 (MSD) kuznet@ms2.inr.ac.ru wrote: > Please, do not use "long" things, they are not allowed in API. > u32 would be good. Do you think it is large enough for timestamp? :) From kuznet@ms2.inr.ac.ru Tue Oct 7 04:16:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 04:17:15 -0700 (PDT) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97BGQ25006387 for ; Tue, 7 Oct 2003 04:16:38 -0700 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id PAA30760; Tue, 7 Oct 2003 15:16:20 +0400 From: kuznet@ms2.inr.ac.ru Message-Id: <200310071116.PAA30760@yakov.inr.ac.ru> Subject: Re: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable To: davem@redhat.com (David S. Miller) Date: Tue, 7 Oct 2003 15:16:20 +0400 (MSD) Cc: mashirle@us.ibm.com, netdev@oss.sgi.com In-Reply-To: <20031007034051.3fcb3218.davem@redhat.com> from "David S. Miller" at ïËÔ 07, 2003 03:40:51 X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 583 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Hello! > Do you think it is large enough for timestamp? :) If it is not, "unsigned long" is not enough either. Actually, this does not depend on our implementation. If people implement a MIB, required precision of these times is prescribed in the rfc. And this is definitely not jiffies. Alexey From davem@pizda.ninka.net Tue Oct 7 04:18:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 04:19:04 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97BIM25006710 for ; Tue, 7 Oct 2003 04:18:29 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA02678; Tue, 7 Oct 2003 04:12:47 -0700 Date: Tue, 7 Oct 2003 04:12:46 -0700 From: "David S. Miller" To: kuznet@ms2.inr.ac.ru Cc: mashirle@us.ibm.com, netdev@oss.sgi.com Subject: Re: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable Message-Id: <20031007041246.13aa0391.davem@redhat.com> In-Reply-To: <200310071116.PAA30760@yakov.inr.ac.ru> References: <20031007034051.3fcb3218.davem@redhat.com> <200310071116.PAA30760@yakov.inr.ac.ru> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 584 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 On Tue, 7 Oct 2003 15:16:20 +0400 (MSD) kuznet@ms2.inr.ac.ru wrote: > Actually, this does not depend on our implementation. If people implement > a MIB, required precision of these times is prescribed in the rfc. > And this is definitely not jiffies. Right, Shirley what is it? From yoshfuji@linux-ipv6.org Tue Oct 7 04:34:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 04:34:54 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97BYJ25009871 for ; Tue, 7 Oct 2003 04:34:20 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h97BZIft021551; Tue, 7 Oct 2003 20:35:18 +0900 Date: Tue, 07 Oct 2003 20:35:18 +0900 (JST) Message-Id: <20031007.203518.82055464.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: kuznet@ms2.inr.ac.ru, mashirle@us.ibm.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031007041246.13aa0391.davem@redhat.com> References: <20031007034051.3fcb3218.davem@redhat.com> <200310071116.PAA30760@yakov.inr.ac.ru> <20031007041246.13aa0391.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 585 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 <20031007041246.13aa0391.davem@redhat.com> (at Tue, 7 Oct 2003 04:12:46 -0700), "David S. Miller" says: > On Tue, 7 Oct 2003 15:16:20 +0400 (MSD) > kuznet@ms2.inr.ac.ru wrote: > > > Actually, this does not depend on our implementation. If people implement > > a MIB, required precision of these times is prescribed in the rfc. > > And this is definitely not jiffies. > > Right, Shirley what is it? The type is TimeTicks (RFC2578) via TimeStamp (RFC2579). Thus, uint32_t counter in 1/100 sec. unit. --yoshfuji From kuznet@ms2.inr.ac.ru Tue Oct 7 05:03:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 05:04:03 -0700 (PDT) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97C3S25011009 for ; Tue, 7 Oct 2003 05:03:29 -0700 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id PAA31530; Tue, 7 Oct 2003 15:56:41 +0400 From: kuznet@ms2.inr.ac.ru Message-Id: <200310071156.PAA31530@yakov.inr.ac.ru> Subject: Re: Fw: Re: [PATCH] ipv4 tcp autobind problem To: hidden@balabit.hu (Kovacs Krisztian) Date: Tue, 7 Oct 2003 15:56:41 +0400 (MSD) Cc: davem@redhat.com (David S. Miller), jmorris@redhat.com, netdev@oss.sgi.com, linux-net@vger.rutgers.edu, bazsi@balabit.hu (Balazs Scheidler) In-Reply-To: <3F7990FB.7030606@balabit.hu> from "Kovacs Krisztian" at óÅÎ 30, 2003 04:19:39 X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 586 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Hello! > - When the socket is closed (inet_release() is called, tproxy has its > "callback" function here), the corresponding entries are deleted from > tproxy's hash tables, again, based on the local ip:port pair. The mistake is here. inet_release() has nothing to do to connection state. Socket is not closed at this point, it goes to FIN-WAIT*, LAST-ACK or something like this and can exist for long time after this and proxying is to be continued all this time. Right place to finish tracking is when socket is removed from TCP hash tables, and to start tracking is when the socket is inserted to TCP hash tables. BTW you would not see the problem with binding if it was made right. Alexey From zrzeng@linuxforum.net Tue Oct 7 05:09:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 05:16:10 -0700 (PDT) Received: from ftp.linuxforum.net (branch-2-h194.sta.net.cn [61.152.210.194] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97C9F25011515 for ; Tue, 7 Oct 2003 05:09:23 -0700 Message-Id: <200310071209.h97C9F25011515@oss.sgi.com> Received: from 127.0.0.1 (HELO mail.ipmotor.com) (envelope-from zrzeng@linuxforum.net) by localhost (quarkmail-1.2.1) with SMTP id S4555834AbTJGLwo for netdev@oss.sgi.com; Tue, 7 Oct 2003 19:52:44 +0800 From: zrzeng@linuxforum.net To: netdev@oss.sgi.com Subject: TCP:Is it possible for both sk->dead==1 and sk->lock.users==1 to be true? Date: Tue Oct 7 11:52:44 2003 +0000 X-Priority: 3 Content-type: text/plain Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by oss.sgi.com id h97C9F25011515 X-archive-position: 587 X-Approved-By: ralf@linux-mips.org X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: zrzeng@linuxforum.net Precedence: bulk X-list: netdev Hi, gurus, In tcp_input.c, function tcp_rcv_state_process(), when doing ack processing of state TCP_FIN_WAIT1, there are statements (kernel 2.4.21): if (!sk->dead) ...... else { ...... if (tmo > TCP_TIMEWAIT_LEN) { ...... --->> } else if (th->fin || sk->lock.users) { /* Bad case. We could lose such FIN otherwise. * It is not a big problem, but it looks confusing * and not so rare event. We still can lose it now, * if it spins in bh_lock_sock(), but it is really * marginal case. */ tcp_reset_keepalive_timer(sk, tmo); } else { ...... } but as far as I understand, 1)if sk is dead, there would be no process context reference to it. 2)if sk->lock.users==1, it means that some process context is referencing it, and most likely it is in backlog processing when doing release_sock(). 1) and 2) seems to be a bit conflict to me, Am I missing any important points? Thank you for your kind help in advance. From Robert.Olsson@data.slu.se Tue Oct 7 05:34:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 05:35:20 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97CYf25012208 for ; Tue, 7 Oct 2003 05:34:42 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.9.3+/8.9.3) with ESMTP id OAA32429; Tue, 7 Oct 2003 14:34:35 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id 11A6FEC230; Tue, 7 Oct 2003 14:34:37 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16258.45789.42373.575294@robur.slu.se> Date: Tue, 7 Oct 2003 14:34:37 +0200 To: scott.feldman@intel.com Cc: Jeff Garzik , Robert Olsson , netdev@oss.sgi.com Subject: e1000 close (NAPI) X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 588 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 Hello! Here is an patch to check netif_running in dev->poll so we don't have to hang in dev_close until all polls are finished. Cheers. --ro --- drivers/net/e1000/e1000_main.c.031007 2003-05-08 16:29:08.000000000 +0200 +++ drivers/net/e1000/e1000_main.c 2003-10-07 14:26:12.000000000 +0200 @@ -2040,7 +2040,7 @@ *budget -= work_done; netdev->quota -= work_done; - if(work_done < work_to_do) { + if(work_done < work_to_do || !netif_running(netdev)) { netif_rx_complete(netdev); e1000_irq_enable(adapter); } From hidden@balabit.hu Tue Oct 7 05:35:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 05:36:07 -0700 (PDT) Received: from viefep15-int.chello.at (viefep15-int.chello.at [213.46.255.19]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97CZX25012249 for ; Tue, 7 Oct 2003 05:35:34 -0700 Received: from mail ([213.222.168.63]) by viefep15-int.chello.at (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with ESMTP id <20031007123527.YFMB17534.viefep15-int.chello.at@mail>; Tue, 7 Oct 2003 14:35:27 +0200 Received: by mail (Postfix, from userid 103) id B99231806B; Tue, 7 Oct 2003 14:35:25 +0200 (CEST) Received: from balabit.hu (nienna.balabit [192.168.131.49]) by mail (Postfix) with ESMTP id 248C517F3A; Tue, 7 Oct 2003 14:35:25 +0200 (CEST) Message-ID: <3F82B326.9050508@balabit.hu> Date: Tue, 07 Oct 2003 14:35:50 +0200 From: Kovacs Krisztian User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030825 Debian/1.4-XD2.1 X-Accept-Language: hu, en, de MIME-Version: 1.0 To: kuznet@ms2.inr.ac.ru Cc: "David S. Miller" , jmorris@redhat.com, netdev@oss.sgi.com, linux-net@vger.kernel.org, Balazs Scheidler Subject: Re: [PATCH] ipv4 tcp autobind problem References: <200310071156.PAA31530@yakov.inr.ac.ru> In-Reply-To: <200310071156.PAA31530@yakov.inr.ac.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 589 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hidden@balabit.hu Precedence: bulk X-list: netdev Hi, kuznet@ms2.inr.ac.ru wrote: > Right place to finish tracking is when socket is removed from TCP > hash tables, and to start tracking is when the socket is inserted > to TCP hash tables. BTW you would not see the problem with binding > if it was made right. Thanks for the reply. In the meantime, although because of slightly different reasons, we also came to the same conclusion. Right now I'm testing a version in which our "unassign" hook is removed from inet_release(), and added to udp_v4_unhash() and tcp_put_port(). However, I'm not quite sure there won't be locking problems when calling our hook from these places. -- Regards, Krisztian KOVACS From laforge@netfilter.org Tue Oct 7 05:43:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 05:44:02 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97ChL25013081 for ; Tue, 7 Oct 2003 05:43:22 -0700 Received: from [192.168.200.2] (helo=sunbeam.gnumonks.org) by coruscant.gnumonks.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.22) id 1A6rBP-0000I4-8P; Tue, 07 Oct 2003 14:43:19 +0200 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.20) id 1A6qyr-0000Cc-6Q; Tue, 07 Oct 2003 14:30:21 +0200 Date: Tue, 7 Oct 2003 14:30:21 +0200 From: Harald Welte To: Yasuyuki Kozakai Cc: coreteam@netfilter.org, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [Patch]: IPv6 Connection Tracking Message-ID: <20031007123021.GX18246@sunbeam.de.gnumonks.org> Mail-Followup-To: Harald Welte , Yasuyuki Kozakai , coreteam@netfilter.org, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org References: <20030925092806.GC5758@sunbeam.de.gnumonks.org> <200310031119.UAA11088@toshiba.co.jp> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aEcIyhw0mmnxygNd" Content-Disposition: inline In-Reply-To: <200310031119.UAA11088@toshiba.co.jp> X-Operating-system: Linux sunbeam 2.6.0-test5-nftest X-Date: Today is Prickle-Prickle, the 60th day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-Spam-Score: -7.0 (-------) X-archive-position: 590 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 --aEcIyhw0mmnxygNd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 03, 2003 at 08:19:07PM +0900, Yasuyuki Kozakai wrote: > I select 2), too. Ok, thanks for your patience and understanding. > Harald, Could you add my patch to patch-o-matic ? Ok, I'll put it into patch-o-matic asap. > Regards, > Yasuyuki KOZAKAI --=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 --aEcIyhw0mmnxygNd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/grHdXaXGVTD0i/8RAgpNAJ45UTeBOXL3dqPY74rWZjQqntjQiACgipl8 M9YLjRtvXOs9Qs9ISzIQjtU= =IaCj -----END PGP SIGNATURE----- --aEcIyhw0mmnxygNd-- From rusty@samba.org Tue Oct 7 06:49:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 06:50:25 -0700 (PDT) Received: from lists.samba.org (dp.samba.org [66.70.73.150]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97DnW25016291 for ; Tue, 7 Oct 2003 06:49:52 -0700 Received: by lists.samba.org (Postfix, from userid 590) id CA9662C7A8; Tue, 7 Oct 2003 13:49:31 +0000 (GMT) From: Rusty Russell To: Julian Anastasov Cc: "David S. Miller" , Wensong Zhang , netdev@oss.sgi.com Subject: Re: [2.6 PATCH] ipvs - remove some unused fields from the protocols In-reply-to: Your message of "Tue, 07 Oct 2003 01:16:36 +0300." Date: Tue, 07 Oct 2003 20:14:25 +1000 Message-Id: <20031007134931.CA9662C7A8@lists.samba.org> X-archive-position: 591 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev In message you write: > > Hello, > > The promised removal of some unused fields. For inclusion after > comments from Rusty. Rusty, it seems we can not convert the transmitters > to NF_STOLEN, ip_vs_null_xmit returns NF_ACCEPT. Ah that's right. I hit that as I was halfway through changing, and reverted. Sorry. Leaving the comment there and adding one in ip_vs_null_xmit on why breaking the rule in that case is OK is the right approach, I think. Patch looks good! Thanks, Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. From davem@pizda.ninka.net Tue Oct 7 07:47:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 07:47:46 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97ElC25019597 for ; Tue, 7 Oct 2003 07:47:12 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA25753; Tue, 7 Oct 2003 07:41:52 -0700 Date: Tue, 7 Oct 2003 07:41:52 -0700 From: "David S. Miller" To: Jan Oravec Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPv6, mcast: deactivate timers before ipv6_mc_destroy_dev() Message-Id: <20031007074152.2b6ae089.davem@redhat.com> In-Reply-To: <20031005090610.GA23600@wsx.ksp.sk> References: <20031005090610.GA23600@wsx.ksp.sk> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 592 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 On Sun, 5 Oct 2003 11:06:10 +0200 Jan Oravec wrote: > the following patch calls ipv6_mc_down(idev) to deactivate timers. If we do > not deactivate them, the following may happen: Applied, thanks a lot Jan. From davem@pizda.ninka.net Tue Oct 7 07:49:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 07:50:02 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97EnS25019892 for ; Tue, 7 Oct 2003 07:49:28 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA25779; Tue, 7 Oct 2003 07:44:21 -0700 Date: Tue, 7 Oct 2003 07:44:21 -0700 From: "David S. Miller" To: Rusty Russell Cc: ja@ssi.bg, wensong@linux-vs.org, netdev@oss.sgi.com Subject: Re: [2.6 PATCH] ipvs - remove some unused fields from the protocols Message-Id: <20031007074421.61afeb43.davem@redhat.com> In-Reply-To: <20031007134931.CA9662C7A8@lists.samba.org> References: <20031007134931.CA9662C7A8@lists.samba.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 593 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 On Tue, 07 Oct 2003 20:14:25 +1000 Rusty Russell wrote: > Patch looks good! I've applied it, thanks guys. From davem@pizda.ninka.net Tue Oct 7 07:51:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 07:51:33 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Ep025020338 for ; Tue, 7 Oct 2003 07:51:00 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA25823; Tue, 7 Oct 2003 07:45:54 -0700 Date: Tue, 7 Oct 2003 07:45:53 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] janitor: sched_timeout() sets curr_state (net/) Message-Id: <20031007074553.1385f5f1.davem@redhat.com> In-Reply-To: <20031005203906.2eadaac4.rddunlap@osdl.org> References: <20031005203906.2eadaac4.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 594 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 On Sun, 5 Oct 2003 20:39:06 -0700 "Randy.Dunlap" wrote: > From: Alexey Dobriyan > > linux-260-test6-kj1-rddunlap/net/atm/resources.c | 1 - > linux-260-test6-kj1-rddunlap/net/bluetooth/hci_core.c | 1 - > linux-260-test6-kj1-rddunlap/net/ipv4/ipvs/ip_vs_sync.c | 2 -- > linux-260-test6-kj1-rddunlap/net/sunrpc/svcsock.c | 1 - > 4 files changed, 5 deletions(-) Applied, thanks Randy. From davem@pizda.ninka.net Tue Oct 7 07:51:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 07:52:14 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Epf25020429 for ; Tue, 7 Oct 2003 07:51:41 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA25845; Tue, 7 Oct 2003 07:46:33 -0700 Date: Tue, 7 Oct 2003 07:46:32 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, kas@fi.muni.cz Subject: Re: [PATCH] janitor: sched_timeout() sets curr_state (cosa) Message-Id: <20031007074632.287c5ef5.davem@redhat.com> In-Reply-To: <20031005204027.182a0188.rddunlap@osdl.org> References: <20031005204027.182a0188.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 595 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 On Sun, 5 Oct 2003 20:40:27 -0700 "Randy.Dunlap" wrote: > From: Alexey Dobriyan > > linux-260-test6-kj1-rddunlap/drivers/net/wan/cosa.c | 2 -- > 1 files changed, 2 deletions(-) Applied, thanks Randy. From davem@pizda.ninka.net Tue Oct 7 07:52:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 07:52:33 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97EqH25020644 for ; Tue, 7 Oct 2003 07:52:17 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA25882; Tue, 7 Oct 2003 07:47:06 -0700 Date: Tue, 7 Oct 2003 07:47:06 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, chas@cmf.nrl.navy.mil Subject: Re: [PATCH] janitor: sched_timeout() sets curr_state (atm) Message-Id: <20031007074706.4fc345ea.davem@redhat.com> In-Reply-To: <20031005203425.5e474ccd.rddunlap@osdl.org> References: <20031005203425.5e474ccd.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 596 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 On Sun, 5 Oct 2003 20:34:25 -0700 "Randy.Dunlap" wrote: > From: Alexey Dobriyan > > linux-260-test6-kj1-rddunlap/drivers/atm/he.c | 1 - > 1 files changed, 1 deletion(-) Applied, thanks Randy. From davem@pizda.ninka.net Tue Oct 7 07:53:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 07:54:31 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Eru25021395 for ; Tue, 7 Oct 2003 07:53:57 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA25913; Tue, 7 Oct 2003 07:48:33 -0700 Date: Tue, 7 Oct 2003 07:48:33 -0700 From: "David S. Miller" To: Vinay K Nallamothu Cc: akpm@osdl.org, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2.6.0-test6][X25] timer cleanup Message-Id: <20031007074833.6bb5a6e1.davem@redhat.com> In-Reply-To: <1065362979.4370.34.camel@lima.royalchallenge.com> References: <1065018387.7194.336.camel@lima.royalchallenge.com> <20031001155623.06b89258.akpm@osdl.org> <1065078208.4340.3.camel@lima.royalchallenge.com> <20031002013620.6d8b6f10.davem@redhat.com> <1065362979.4370.34.camel@lima.royalchallenge.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 597 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 On Sun, 05 Oct 2003 19:39:39 +0530 Vinay K Nallamothu wrote: > On Thu, 2003-10-02 at 14:06, David S. Miller wrote: > > Please find a way to at least minimally test the protocols > > you are changing then, or find someone else who can. > > I have tested the patch using LAPB over Ethernet (I do not have real > hardware) under linux-2.6.0-test5-uml1 and it works fine for me. Fair enough, I've applied this patch, thanks a lot Vinay. From davem@pizda.ninka.net Tue Oct 7 07:59:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 07:59:59 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97ExP25021844 for ; Tue, 7 Oct 2003 07:59:25 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA26010; Tue, 7 Oct 2003 07:54:18 -0700 Date: Tue, 7 Oct 2003 07:54:17 -0700 From: "David S. Miller" To: Petr Vandrovec Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Deadlock on ip_mc_list->lock Message-Id: <20031007075417.0e2a9173.davem@redhat.com> In-Reply-To: <20031006140320.GB24082@vana.vc.cvut.cz> References: <20031006140320.GB24082@vana.vc.cvut.cz> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 598 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 On Mon, 6 Oct 2003 16:03:20 +0200 Petr Vandrovec wrote: > Currently this 'return -EINVAL' below is one I suspect from > being guilty, as it looks to me like that nobody is unlocking > spinlock & bh in this case, and so system dies horrible death > after this (saying that userspace scheduled while in_atomic:1). Patch applied, thanks Petr. From davem@pizda.ninka.net Tue Oct 7 08:02:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 08:03:00 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97F2Q25022266 for ; Tue, 7 Oct 2003 08:02:26 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA26070; Tue, 7 Oct 2003 07:57:07 -0700 Date: Tue, 7 Oct 2003 07:57:07 -0700 From: "David S. Miller" To: Wensong Zhang Cc: rusty@rustcorp.com.au, ja@ssi.bg, netdev@oss.sgi.com, lvs-users@LinuxVirtualServer.org Subject: Re: [2.4 PATCH] two ipvs fixes Message-Id: <20031007075707.47d7596b.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 599 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 On Tue, 7 Oct 2003 00:58:29 +0800 (CST) Wensong Zhang wrote: > Here are IPVS two patches for kernel 2.4, which are basically back ported > from the IPVS changes in kernel 2.6. Looks good, applied. Thanks Wensong. From davem@pizda.ninka.net Tue Oct 7 08:12:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 08:12:36 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97FC225022920 for ; Tue, 7 Oct 2003 08:12:02 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA26107; Tue, 7 Oct 2003 08:06:40 -0700 Date: Tue, 7 Oct 2003 08:06:40 -0700 From: "David S. Miller" To: Bart De Schuymer Cc: netdev@oss.sgi.com, bridge@osdl.org, greearb@candelatech.com, vlan@wanfear.com, shemminger@osdl.org Subject: Re: [PATCH/RFC] Let {ip,arp}tables "see" bridged VLAN tagged {I,AR}P packets Message-Id: <20031007080640.50de4d45.davem@redhat.com> In-Reply-To: <200310062204.07230.bdschuym@pandora.be> References: <200310062204.07230.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 600 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 On Mon, 6 Oct 2003 22:04:07 +0200 Bart De Schuymer wrote: > - unsigned long hh[16 / sizeof(unsigned long)]; > + unsigned char hh[18]; Maybe don't do this? It should be aligned on a 'long' boundry I think. The only real hard objection I have with the patch is the vlan xmit routine pointer crap, just export the symbol. Once you fix that I'll apply your patch as long as Stephen has no objections. From davem@pizda.ninka.net Tue Oct 7 08:34:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 08:34:45 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97FYC25026840 for ; Tue, 7 Oct 2003 08:34:12 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA26283; Tue, 7 Oct 2003 08:29:03 -0700 Date: Tue, 7 Oct 2003 08:29:02 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jt@hpl.hp.com, netdev@oss.sgi.com Subject: Re: [PATCH] spinlock badness in last dongle changes. Message-Id: <20031007082902.03dc16be.davem@redhat.com> In-Reply-To: <20031006222631.1934f8e1.shemminger@osdl.org> References: <20031006222631.1934f8e1.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 601 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 On Mon, 6 Oct 2003 22:26:31 -0700 Stephen Hemminger wrote: > A couple of locking problems happened when converted from using > hashbin lock outside of irqueue. First, the lock was never initialized; > Second, the lock was being unlocked after the hashbin was free. > > Since the hashbin of dongles should be empty (ie all dongle unregistered) > don't really need locking there, so just warn if we find anything... Applied, thanks Stephen. Jean didn't express his opinion, but if he doesn't like the change we can just put the fix he prefers on top. From davem@pizda.ninka.net Tue Oct 7 08:37:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 08:38:23 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Fbn25027253 for ; Tue, 7 Oct 2003 08:37:49 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA26330; Tue, 7 Oct 2003 08:32:37 -0700 Date: Tue, 7 Oct 2003 08:32:37 -0700 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com Subject: Re: tunnel xmit and h.raw Message-Id: <20031007083237.1de6e10a.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 602 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 On Fri, 3 Oct 2003 03:00:27 +0300 (EEST) Julian Anastasov wrote: > # -------------------------------------------- > # 03/10/03 ja@ssi.bg 1.1357 > # [IPV4/IPV6]: tunnel xmit must load skb->h.raw after all reallocations > # -------------------------------------------- I've applied this, it is absolutely correct. While studying this I've discovered some deeper problems. The skb_shared() checks in these tunnel drivers is bogus, on transmit skb->users should never ever be anything but 1. Besides the tunnel drivers, the loopback driver and ipmr.c do similar things in their ->hard_start_xmit() handlers. In particular, the ipmr.c case is really in bad shape. I've put fixing this onto the todo list... From shemminger@osdl.org Tue Oct 7 08:53:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 08:53:42 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Fr925027885 for ; Tue, 7 Oct 2003 08:53:10 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h97Fr2132167; Tue, 7 Oct 2003 08:53:02 -0700 Date: Tue, 7 Oct 2003 08:52:41 -0700 From: Stephen Hemminger To: Bart De Schuymer Cc: netdev@oss.sgi.com, bridge , "David S.Miller" , Ben Greear , vlan@wanfear.com Subject: Re: [PATCH/RFC] Let {ip,arp}tables "see" bridged VLAN tagged {I,AR}P packets Message-Id: <20031007085241.7410611a.shemminger@osdl.org> In-Reply-To: <200310062204.07230.bdschuym@pandora.be> References: <200310062204.07230.bdschuym@pandora.be> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 603 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 Instead of using vlan_dev_hard_start_xmit_p which causes looking too deep inside vlan, use the fact that all bridges and vlan devices are marked with dev->priv_flags. Instead of: #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) || (out->hard_start_xmit == vlan_dev_hard_start_xmit_p && VLAN_DEV_INFO(out)->real_dev->hard_start_xmit == br_dev_xmit #endif Try: #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) || (out->priv_flags & IFF_802_1Q_VLAN) && (VLAN_DEV_INFO(out)->real_dev->priv_vlags & IFF_EBRIDGE) #endif Gets rid of all the symbol export and other nastiness From Christian.Darnell@se.flextronics.com Tue Oct 7 09:28:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 09:29:29 -0700 (PDT) Received: from nic-outside.fw2.se.flextronics.com (fw2.flextronics.se [195.67.90.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97GSt26029259 for ; Tue, 7 Oct 2003 09:28:56 -0700 Received: from knant116.se.flextronics.com by nic-outside.fw2.se.flextronics.com via smtpd (for oss.sgi.com [192.48.159.27]) with SMTP; 7 Oct 2003 16:22:45 UT Received: from nic-dmz3.fw2.se.flextronics.com ([10.210.134.173]) by knant116.se.flextronics.com with SMTP id M2003100711101225689 ; Tue, 07 Oct 2003 11:10:12 +0200 Received: from eukna204.kna.flextronics.com by nic-dmz3.fw2.se.flextronics.com via smtpd (for smtp-eu1.flextronics.com [10.211.33.20]) with SMTP; 7 Oct 2003 09:03:17 UT Received: by eukna204.europe.ad.flextronics.com with Internet Mail Service (5.5.2653.19) id <4BMNQ36A>; Tue, 7 Oct 2003 11:09:27 +0200 Message-ID: <5B537508CDBED3118403009027745A210B8C1499@knant18.kna.flextronics.com> From: Christian Darnell To: "'Linux 802.1Q VLAN'" , Bart De Schuymer Cc: netdev@oss.sgi.com, bridge Subject: RE: [VLAN] Re: [PATCH/RFC] Let {ip,arp}tables "see" bridged VLAN tagged{I,AR}P packets Date: Tue, 7 Oct 2003 11:06:13 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-archive-position: 604 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Christian.Darnell@se.flextronics.com Precedence: bulk X-list: netdev >-----Original Message----- >From: Ben Greear [mailto:greearb@candelatech.com] >Sent: Monday, October 06, 2003 10:24 PM >To: Bart De Schuymer >Cc: netdev@oss.sgi.com; vlan@wanfear.com; bridge >Subject: [VLAN] Re: [PATCH/RFC] Let {ip,arp}tables "see" bridged VLAN >tagged{I,AR}P packets > > >Bart De Schuymer wrote: >> - add some code in vlan_dev.c::vlan_dev_hard_start_xmit(): >> skb->protocol = __constant_htons(ETH_P_8021Q); >> skb->mac.raw -= VLAN_HLEN; >> skb->nh.raw -= VLAN_HLEN; > >I wonder if this is what was messing up the tcpdump packet capture >as well? Hi Ben and all others, Just to clarify for other who hasn't been a part of this discussion before. ---- 8< ---- When trying to grab a packet with pcap when using VLAN the beginning of the packet is corrupt an the VLAN TCI bits are missing. This is only a problem when sniffing on incoming traffic not outgoing. 00 60 08 50 00 60 08 50 26 2a 00 60 08 6a b4 53 xx xx xx xx 08 00 45 00 ^^^^^^^^^^^ ^^^^^^^^^^^^ Where does these bytes come from? Bytes missing (VLAN header)? The correct MAC addresses here are: 00 60 08 50 26 2a and 00 60 08 6a b4 53 ---- 8< ---- I added those lines (see above) to vlan_dev.c but it didn't solve the problem with tcpdump (pcap) incoming packets. vlan_dev_hard_start_xmit() tells me that this is only outgoing packets right? For outgoing packets tcpdump works (and Ethereal for Windows sees the packet correctly on the wire) so the problem doesn't occur when sending packets. I added following line to vlan_dev.c: vlan_dev.c:: int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype): vlan_TCI = ntohs(vhdr->h_vlan_TCI); + /* Print the 802.1p priority */ +printk("VLAN Prio: %hx\n", vlan_TCI >> 13); vid = (vlan_TCI & VLAN_VID_MASK); With the code above I get the 802.1p correctly. Does anyone know how and when pcap grabs the packet (does pcap grab the packet before or after vlan_skb_recv is called)? When I'm sniffing with pcap I sniff the Ethernet interface, so the VLAN stuff isn't really involved when pcap grab the packet or have I misunderstand how it works? Best Regards, Christian Darnell From xma@us.ibm.com Tue Oct 7 10:12:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 10:12:44 -0700 (PDT) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97HC225030765 for ; Tue, 7 Oct 2003 10:12:09 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h97HBAxu465424; Tue, 7 Oct 2003 13:11:10 -0400 Received: from d03nm124.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h97HAmit059116; Tue, 7 Oct 2003 11:11:05 -0600 Importance: Normal Sensitivity: Subject: Re: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, kuznet@ms2.inr.ac.ru, mashirle@us.ibm.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: Shirley Ma Date: Tue, 7 Oct 2003 10:11:00 -0700 X-MIMETrack: Serialize by Router on D03NM124/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 10/07/2003 11:11:04 MIME-Version: 1.0 Content-type: text/plain; charset=ISO-2022-JP X-archive-position: 605 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xma@us.ibm.com Precedence: bulk X-list: netdev Yes. Yoshifuji is right.The timeStamp should be -- hundredths of seconds since an epoch TimeTicks ::= [APPLICATION 3] IMPLICIT INTEGER (0..4294967295) I will modify the patch, and resubmit it against Linux-2.6.0-test6-bk8 again. Thanks Shirley Ma IBM Linux Technology Center 15300 SW Koll Parkway Beaverton, OR 97006-6063 Phone: (503) 578-7638 FAX: (503) 578-3228 YOSHIFUJI Hideaki / $B5HF#1QL@(B @oss.sgi.com on 10/07/2003 04:35:18 AM Sent by: netdev-bounce@oss.sgi.com To: davem@redhat.com cc: kuznet@ms2.inr.ac.ru, mashirle@us.ltcfwd.linux.ibm.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable In article <20031007041246.13aa0391.davem@redhat.com> (at Tue, 7 Oct 2003 04:12:46 -0700), "David S. Miller" says: > On Tue, 7 Oct 2003 15:16:20 +0400 (MSD) > kuznet@ms2.inr.ac.ru wrote: > > > Actually, this does not depend on our implementation. If people implement > > a MIB, required precision of these times is prescribed in the rfc. > > And this is definitely not jiffies. > > Right, Shirley what is it? The type is TimeTicks (RFC2578) via TimeStamp (RFC2579). Thus, uint32_t counter in 1/100 sec. unit. --yoshfuji From andi@averellmail.firstfloor.org Tue Oct 7 10:53:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 10:54:24 -0700 (PDT) Received: from zero.aec.at (Bissell_Gip@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Hrn25031906 for ; Tue, 7 Oct 2003 10:53:50 -0700 Received: from fred.muc.de (J_H_Bumbleshook@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id h97HrZS22591; Tue, 7 Oct 2003 19:53:37 +0200 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id C52F85BBEF; Tue, 7 Oct 2003 19:53:38 +0200 (CEST) Date: Tue, 7 Oct 2003 19:53:38 +0200 From: Andi Kleen To: jgarzik@pobox.com, netdev@oss.sgi.com Subject: [PATCH] Mark non 64bit clean network drivers Message-ID: <20031007175338.GA1692@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 606 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev This marks some net drivers which are clearly not 64bit (judging from the warnings) as !64BIT. -Andi diff -u linux-2.5-cleanup/drivers/net/Kconfig-o linux-2.5-cleanup/drivers/net/Kconfig --- linux-2.5-cleanup/drivers/net/Kconfig-o 2003-10-02 18:12:03.000000000 +0200 +++ linux-2.5-cleanup/drivers/net/Kconfig 2003-12-02 17:20:58.742717656 +0100 @@ -1616,7 +1616,7 @@ config TLAN tristate "TI ThunderLAN support" - depends on NET_PCI && (PCI || EISA) + depends on NET_PCI && (PCI || EISA) && !64BIT ---help--- If you have a PCI Ethernet network card based on the ThunderLAN chip which is supported by this driver, say Y and read the @@ -2412,7 +2412,7 @@ config RCPCI tristate "Red Creek Hardware VPN (EXPERIMENTAL)" - depends on NETDEVICES && EXPERIMENTAL && PCI + depends on NETDEVICES && EXPERIMENTAL && PCI && !64BIT help This is a driver for hardware which provides a Virtual Private Network (VPN). Say Y if you have it. From andi@averellmail.firstfloor.org Tue Oct 7 10:54:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 10:55:22 -0700 (PDT) Received: from zero.aec.at (Conmore_Apel_Brune@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Hsm25032023 for ; Tue, 7 Oct 2003 10:54:48 -0700 Received: from fred.muc.de (Harley_Shum@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id h97HsgS22633; Tue, 7 Oct 2003 19:54:42 +0200 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 269895BBEF; Tue, 7 Oct 2003 19:54:46 +0200 (CEST) Date: Tue, 7 Oct 2003 19:54:46 +0200 From: Andi Kleen To: jgarzik@pobox.com, netdev@oss.sgi.com Subject: [PATCH] Fix warnings in hp100 Message-ID: <20031007175446.GA1719@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 607 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Fix some harmless integer/pointer size mismatch warnings in hp100.c on 64bit compiles diff -u linux-2.5-cleanup/drivers/net/hp100.c-o linux-2.5-cleanup/drivers/net/hp100.c --- linux-2.5-cleanup/drivers/net/hp100.c-o 2003-09-23 07:28:00.000000000 +0200 +++ linux-2.5-cleanup/drivers/net/hp100.c 2003-12-02 17:12:03.343110768 +0100 @@ -1265,9 +1265,9 @@ { /* pdlptr is starting address for this pdl */ - if (0 != (((unsigned) pdlptr) & 0xf)) - printk("hp100: %s: Init rxpdl: Unaligned pdlptr 0x%x.\n", - dev->name, (unsigned) pdlptr); + if (0 != (((unsigned long) pdlptr) & 0xf)) + printk("hp100: %s: Init rxpdl: Unaligned pdlptr 0x%lx.\n", + dev->name, (unsigned long) pdlptr); ringptr->pdl = pdlptr + 1; ringptr->pdl_paddr = virt_to_whatever(dev, pdlptr + 1); @@ -1292,8 +1292,8 @@ register hp100_ring_t * ringptr, register u32 * pdlptr) { - if (0 != (((unsigned) pdlptr) & 0xf)) - printk("hp100: %s: Init txpdl: Unaligned pdlptr 0x%x.\n", dev->name, (unsigned) pdlptr); + if (0 != (((unsigned long) pdlptr) & 0xf)) + printk("hp100: %s: Init txpdl: Unaligned pdlptr 0x%lx.\n", dev->name, (unsigned long) pdlptr); ringptr->pdl = pdlptr; /* +1; */ ringptr->pdl_paddr = virt_to_whatever(dev, pdlptr); /* +1 */ From andi@averellmail.firstfloor.org Tue Oct 7 10:55:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 10:56:12 -0700 (PDT) Received: from zero.aec.at (Arion_Spurl_Doke@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Htb25032282 for ; Tue, 7 Oct 2003 10:55:38 -0700 Received: from fred.muc.de (Jali_Hane@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id h97HtWS22644; Tue, 7 Oct 2003 19:55:32 +0200 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 062E75BBEF; Tue, 7 Oct 2003 19:55:35 +0200 (CEST) Date: Tue, 7 Oct 2003 19:55:35 +0200 From: Andi Kleen To: jgarzik@pobox.com, netdev@oss.sgi.com Subject: [PATCH] Fix warnings in defxx.c Message-ID: <20031007175535.GA1743@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 608 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Fix harmless 64bit warnings in defxx.c diff -u linux-2.5-cleanup/drivers/net/defxx.c-o linux-2.5-cleanup/drivers/net/defxx.c --- linux-2.5-cleanup/drivers/net/defxx.c-o 2003-08-22 13:35:29.000000000 +0200 +++ linux-2.5-cleanup/drivers/net/defxx.c 2003-12-02 17:12:55.629162080 +0100 @@ -2664,8 +2664,8 @@ static void my_skb_align(struct sk_buff *skb, int n) { - u32 x=(u32)skb->data; /* We only want the low bits .. */ - u32 v; + unsigned long x=(unsigned long)skb->data; + unsigned long v; v=(x+n-1)&~(n-1); /* Where we want to be */ From andi@averellmail.firstfloor.org Tue Oct 7 10:56:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 10:57:11 -0700 (PDT) Received: from zero.aec.at (Anita_M_Bobe@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Hue25032715 for ; Tue, 7 Oct 2003 10:56:41 -0700 Received: from fred.muc.de (Bishop_Sheber@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id h97HuYS22653; Tue, 7 Oct 2003 19:56:35 +0200 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id EAA825BBEF; Tue, 7 Oct 2003 19:56:38 +0200 (CEST) Date: Tue, 7 Oct 2003 19:56:38 +0200 From: Andi Kleen To: jgarzik@pobox.com, netdev@oss.sgi.com Subject: [PATCH] Fix 64bit warnings in rtl8139too Message-ID: <20031007175638.GA1754@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 609 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Fix a harmless 64bit pointer/integer mismatch warning in 8139too. diff -u linux-2.5-cleanup/drivers/net/8139too.c-o linux-2.5-cleanup/drivers/net/8139too.c --- linux-2.5-cleanup/drivers/net/8139too.c-o 2003-09-08 00:02:03.000000000 +0200 +++ linux-2.5-cleanup/drivers/net/8139too.c 2003-12-02 17:13:24.634752560 +0100 @@ -746,7 +746,8 @@ u8 tmp8; int rc; unsigned int i; - u32 pio_start, pio_end, pio_flags, pio_len; + unsigned long pio_start; + u32 pio_end, pio_flags, pio_len; unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; u32 version; From andi@averellmail.firstfloor.org Tue Oct 7 10:58:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 10:58:36 -0700 (PDT) Received: from zero.aec.at (Edam_Smith@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Hw125000748 for ; Tue, 7 Oct 2003 10:58:02 -0700 Received: from fred.muc.de (Conmore_Apel_Brune@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id h97HvsS22667; Tue, 7 Oct 2003 19:57:54 +0200 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id EFBEB5BBEF; Tue, 7 Oct 2003 19:57:57 +0200 (CEST) Date: Tue, 7 Oct 2003 19:57:57 +0200 From: Andi Kleen To: ncorbic@sangoma.com, davem@redhat.com, netdev@oss.sgi.com Subject: [PATCH] Fix 64bit warning/bug in farsync.c Message-ID: <20031007175757.GA1764@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 610 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Fix obvious 64bit bug/warning in farsync.c diff -u linux-2.5-cleanup/drivers/net/wan/farsync.c-o linux-2.5-cleanup/drivers/net/wan/farsync.c --- linux-2.5-cleanup/drivers/net/wan/farsync.c-o 2003-08-04 22:06:34.000000000 +0200 +++ linux-2.5-cleanup/drivers/net/wan/farsync.c 2003-12-02 16:50:08.040067224 +0100 @@ -317,7 +317,7 @@ }; /* Calculate offset of a buffer object within the shared memory window */ -#define BUF_OFFSET(X) ((unsigned int)&(((struct buf_window *)BFM_BASE)->X)) +#define BUF_OFFSET(X) offsetof(struct buf_window, X) #pragma pack() From andi@averellmail.firstfloor.org Tue Oct 7 10:59:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 11:00:30 -0700 (PDT) Received: from zero.aec.at (Dumbo_Omohundro@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Hxu25001209 for ; Tue, 7 Oct 2003 10:59:56 -0700 Received: from fred.muc.de (Barney_Stims@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id h97HxnS22681; Tue, 7 Oct 2003 19:59:50 +0200 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 8E1FF5BBEF; Tue, 7 Oct 2003 19:59:53 +0200 (CEST) Date: Tue, 7 Oct 2003 19:59:53 +0200 From: Andi Kleen To: ncorbic@sangoma.com Cc: netdev@oss.sgi.com, davem@redhat.com Subject: [PATCH] Fix 64bit bugs in dscc44.c Message-ID: <20031007175953.GA1802@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 611 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev ioremap_nocache returns unsigned long, not u32. This makes a difference on 64bit hosts. -Andi diff -u linux-2.5-cleanup/drivers/net/wan/dscc4.c-o linux-2.5-cleanup/drivers/net/wan/dscc4.c --- linux-2.5-cleanup/drivers/net/wan/dscc4.c-o 2003-12-01 14:04:34.000000000 +0100 +++ linux-2.5-cleanup/drivers/net/wan/dscc4.c 2003-12-02 16:55:14.298508864 +0100 @@ -980,7 +980,7 @@ * * This code doesn't need to be efficient. Keep It Simple */ -static void dscc4_pci_reset(struct pci_dev *pdev, u32 ioaddr) +static void dscc4_pci_reset(struct pci_dev *pdev, unsigned long ioaddr) { int i; @@ -1461,7 +1461,8 @@ struct dscc4_dev_priv *root = token; struct dscc4_pci_priv *priv; struct net_device *dev; - u32 ioaddr, state; + unsigned long ioaddr; + u32 state; unsigned long flags; int i, handled = 1; @@ -1613,7 +1614,7 @@ goto try; } if (state & Xpr) { - u32 scc_addr, ring; + unsigned long scc_addr, ring; int i; /* @@ -1954,7 +1955,7 @@ { struct dscc4_pci_priv *ppriv; struct dscc4_dev_priv *root; - u32 ioaddr; + unsigned long ioaddr; int i; ppriv = pci_get_drvdata(pdev); From macro@ds2.pg.gda.pl Tue Oct 7 11:15:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 11:16:00 -0700 (PDT) Received: from delta.ds2.pg.gda.pl (macro@delta.ds2.pg.gda.pl [213.192.72.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97IFD25002095 for ; Tue, 7 Oct 2003 11:15:27 -0700 Received: from localhost by delta.ds2.pg.gda.pl (8.9.3/8.9.3) with SMTP id UAA15621; Tue, 7 Oct 2003 20:15:05 +0200 (MET DST) X-Authentication-Warning: delta.ds2.pg.gda.pl: macro owned process doing -bs Date: Tue, 7 Oct 2003 20:15:04 +0200 (MET DST) From: "Maciej W. Rozycki" To: Andi Kleen cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix warnings in defxx.c In-Reply-To: <20031007175535.GA1743@averell> Message-ID: Organization: Technical University of Gdansk MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 612 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: macro@ds2.pg.gda.pl Precedence: bulk X-list: netdev On Tue, 7 Oct 2003, Andi Kleen wrote: > Fix harmless 64bit warnings in defxx.c > > diff -u linux-2.5-cleanup/drivers/net/defxx.c-o linux-2.5-cleanup/drivers/net/defxx.c > --- linux-2.5-cleanup/drivers/net/defxx.c-o 2003-08-22 13:35:29.000000000 +0200 > +++ linux-2.5-cleanup/drivers/net/defxx.c 2003-12-02 17:12:55.629162080 +0100 > @@ -2664,8 +2664,8 @@ > > static void my_skb_align(struct sk_buff *skb, int n) > { > - u32 x=(u32)skb->data; /* We only want the low bits .. */ > - u32 v; > + unsigned long x=(unsigned long)skb->data; > + unsigned long v; > > v=(x+n-1)&~(n-1); /* Where we want to be */ Thanks for the fix. I have a 64-bit system to test the driver at the run time (for both endiannesses, even), so in a long run I'm going to keep an eye on such bits. -- + Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: macro@ds2.pg.gda.pl, PGP key available + From joe@perches.com Tue Oct 7 11:38:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 11:38:44 -0700 (PDT) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97IcA25003343 for ; Tue, 7 Oct 2003 11:38:11 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id MAA01997; Tue, 7 Oct 2003 12:14:25 -0700 Subject: comment on [NET]: Delete support for old-style protocols, no longer necessary. From: Joe Perches To: davem@nuts.ninka.net, linux-net@vger.kernel.org, netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1065551829.2340.9.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 07 Oct 2003 11:37:09 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 613 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 How about netdevice.h struct sock; struct packet_type { unsigned short type; /* This is really htons(ether_type). */ struct net_device *dev; /* NULL is wildcarded here */ int (*func) (struct sk_buff *, struct net_device *, struct packet_type *); - void *af_packet_priv; + struct sock *sk; /* appropriate comment: socket copy? */ struct list_head list; }; and s/af_packet_priv/sk/g in the rest of the files? From davem@pizda.ninka.net Tue Oct 7 11:57:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 11:58:28 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Ivs25004785 for ; Tue, 7 Oct 2003 11:57:54 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA27158; Tue, 7 Oct 2003 11:52:44 -0700 Date: Tue, 7 Oct 2003 11:52:44 -0700 From: "David S. Miller" To: Joe Perches Cc: davem@nuts.ninka.net, linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: comment on [NET]: Delete support for old-style protocols, no longer necessary. Message-Id: <20031007115244.14a887ed.davem@redhat.com> In-Reply-To: <1065551829.2340.9.camel@localhost.localdomain> References: <1065551829.2340.9.camel@localhost.localdomain> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 614 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 On Tue, 07 Oct 2003 11:37:09 -0700 Joe Perches wrote: > - void *af_packet_priv; > + struct sock *sk; /* appropriate comment: socket copy? */ AF_PACKET is the only user of this private field, and I want people to be aware of this and not try to use it for other stuff. Nobody else can use it for something different, the code in net/core/dev.c does specific things when it's non-NULL knowing that this non-NULL value means that it's an AF_PACKET packet_type being passed to it. So we won't make your suggested change. From bdschuym@pandora.be Tue Oct 7 12:12:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 12:13:28 -0700 (PDT) Received: from apate.telenet-ops.be (apate.telenet-ops.be [195.130.132.57]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97JCo25006264 for ; Tue, 7 Oct 2003 12:12:51 -0700 Received: from 192.168.123.138 (D5762BF3.kabel.telenet.be [213.118.43.243]) by apate.telenet-ops.be (Postfix) with ESMTP id 60B6737FBC; Tue, 7 Oct 2003 21:12:39 +0200 (MEST) From: Bart De Schuymer To: "David S. Miller" Subject: Re: [Bridge] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged {I,AR}P packets Date: Tue, 7 Oct 2003 21:12:53 +0200 User-Agent: KMail/1.5 Cc: netdev@oss.sgi.com, greearb@candelatech.com, bridge@osdl.org, vlan@wanfear.com, shemminger@osdl.org References: <200310062204.07230.bdschuym@pandora.be> <20031007080640.50de4d45.davem@redhat.com> In-Reply-To: <20031007080640.50de4d45.davem@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310072112.53821.bdschuym@pandora.be> X-archive-position: 615 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Tuesday 07 October 2003 17:06, David S. Miller wrote: > On Mon, 6 Oct 2003 22:04:07 +0200 > > Bart De Schuymer wrote: > > - unsigned long hh[16 / sizeof(unsigned long)]; > > + unsigned char hh[18]; > > Maybe don't do this? It should be aligned on a 'long' boundry I > think. I've changed it to 32 instead of 16. This wastes some space, but it's OK with me if it's OK with you. > The only real hard objection I have with the patch is the vlan xmit > routine pointer crap, just export the symbol. > > Once you fix that I'll apply your patch as long as Stephen has no > objections. I've used Stephen's suggestion (out->priv_flags & IFF_802_1Q_VLAN), this removes all that cruft. cheers, Bart --- linux-2.6.0-test6/include/linux/skbuff.h Sun Sep 28 02:50:29 2003 +++ linux-2.6.0-test6-new/include/linux/skbuff.h Tue Oct 7 19:42:49 2003 @@ -103,8 +103,11 @@ struct nf_bridge_info { atomic_t use; struct net_device *physindev; struct net_device *physoutdev; +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + struct net_device *netoutdev; +#endif unsigned int mask; - unsigned long hh[16 / sizeof(unsigned long)]; + unsigned long hh[32 / sizeof(unsigned long)]; }; #endif --- linux-2.6.0-test6/include/linux/netfilter_bridge.h Sun Sep 28 02:50:28 2003 +++ linux-2.6.0-test6-new/include/linux/netfilter_bridge.h Tue Oct 7 19:36:36 2003 @@ -8,6 +8,9 @@ #include #if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER) #include +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) +#include +#endif #endif /* Bridge Hooks */ @@ -44,6 +47,7 @@ enum nf_br_hook_priorities { #define BRNF_BRIDGED_DNAT 0x02 #define BRNF_DONT_TAKE_PARENT 0x04 #define BRNF_BRIDGED 0x08 +#define BRNF_NF_BRIDGE_PREROUTING 0x10 static inline struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb) @@ -54,9 +58,39 @@ struct nf_bridge_info *nf_bridge_alloc(s atomic_set(&(*nf_bridge)->use, 1); (*nf_bridge)->mask = 0; (*nf_bridge)->physindev = (*nf_bridge)->physoutdev = NULL; +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + (*nf_bridge)->netoutdev = NULL; +#endif } return *nf_bridge; +} + +/* Only used in br_forward.c */ +static inline +void nf_bridge_maybe_copy_header(struct sk_buff *skb) +{ + if (skb->nf_bridge) { +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + memcpy(skb->data - 18, skb->nf_bridge->hh, 18); + skb_push(skb, 4); + } else +#endif + memcpy(skb->data - 16, skb->nf_bridge->hh, 16); + } +} + +static inline +void nf_bridge_save_header(struct sk_buff *skb) +{ + int header_size = 16; + +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + if (skb->protocol == __constant_htons(ETH_P_8021Q)) + header_size = 18; +#endif + memcpy(skb->nf_bridge->hh, skb->data - header_size, header_size); } struct bridge_skb_cb { --- linux-2.6.0-test6/net/bridge/br_forward.c Sun Sep 28 02:50:15 2003 +++ linux-2.6.0-test6-new/net/bridge/br_forward.c Tue Oct 7 19:36:36 2003 @@ -35,8 +35,7 @@ int br_dev_queue_push_xmit(struct sk_buf { #ifdef CONFIG_BRIDGE_NETFILTER /* ip_refrag calls ip_fragment, which doesn't copy the MAC header. */ - if (skb->nf_bridge) - memcpy(skb->data - 16, skb->nf_bridge->hh, 16); + nf_bridge_maybe_copy_header(skb); #endif skb_push(skb, ETH_HLEN); --- linux-2.6.0-test6/net/8021q/vlan_dev.c Sun Sep 28 02:51:00 2003 +++ linux-2.6.0-test6-new/net/8021q/vlan_dev.c Tue Oct 7 19:36:36 2003 @@ -502,6 +502,10 @@ int vlan_dev_hard_start_xmit(struct sk_b stats->tx_packets++; /* for statics only */ stats->tx_bytes += skb->len; + skb->protocol = __constant_htons(ETH_P_8021Q); + skb->mac.raw -= VLAN_HLEN; + skb->nh.raw -= VLAN_HLEN; + dev_queue_xmit(skb); return 0; --- linux-2.6.0-test6/net/bridge/br_netfilter.c Sun Sep 28 02:51:07 2003 +++ linux-2.6.0-test6-new/net/bridge/br_netfilter.c Tue Oct 7 19:38:04 2003 @@ -4,7 +4,13 @@ * * Authors: * Lennert Buytenhek - * Bart De Schuymer + * Bart De Schuymer (maintainer) + * + * Changes: + * Apr 29 2003: physdev module support (bdschuym) + * Jun 19 2003: let arptables see bridged ARP traffic (bdschuym) + * Oct 06 2003: filter encapsulated IP/ARP VLAN traffic on untagged bridge + * (bdschuym) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -20,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +47,11 @@ #define has_bridge_parent(device) ((device)->br_port != NULL) #define bridge_parent(device) ((device)->br_port->br->dev) +#define IS_VLAN_IP (skb->protocol == __constant_htons(ETH_P_8021Q) && \ + hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_IP)) +#define IS_VLAN_ARP (skb->protocol == __constant_htons(ETH_P_8021Q) && \ + hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_ARP)) + /* We need these fake structures to make netfilter happy -- * lots of places assume that skb->dst != NULL, which isn't * all that unreasonable. @@ -135,8 +147,13 @@ static int br_nf_pre_routing_finish_brid skb->pkt_type = PACKET_HOST; skb->nf_bridge->mask |= BRNF_PKT_TYPE; } + skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; skb->dev = bridge_parent(skb->dev); + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_pull(skb, VLAN_HLEN); + skb->nh.raw += VLAN_HLEN; + } skb->dst->output(skb); return 0; } @@ -155,6 +172,7 @@ static int br_nf_pre_routing_finish(stru skb->pkt_type = PACKET_OTHERHOST; nf_bridge->mask ^= BRNF_PKT_TYPE; } + nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; if (dnat_took_place(skb)) { if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, @@ -186,6 +204,11 @@ bridged_dnat: nf_bridge->mask |= BRNF_BRIDGED_DNAT; skb->dev = nf_bridge->physindev; clear_cb(skb); + if (skb->protocol == + __constant_htons(ETH_P_8021Q)) { + skb_push(skb, VLAN_HLEN); + skb->nh.raw -= VLAN_HLEN; + } NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, br_nf_pre_routing_finish_bridge, @@ -202,6 +225,10 @@ bridged_dnat: clear_cb(skb); skb->dev = nf_bridge->physindev; + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_push(skb, VLAN_HLEN); + skb->nh.raw -= VLAN_HLEN; + } NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, br_handle_frame_finish, 1); @@ -220,13 +247,20 @@ static unsigned int br_nf_pre_routing(un { struct iphdr *iph; __u32 len; - struct sk_buff *skb; + struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; - if ((*pskb)->protocol != __constant_htons(ETH_P_IP)) - return NF_ACCEPT; - - if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL) + if (skb->protocol != __constant_htons(ETH_P_IP)) { + struct vlan_ethhdr *hdr = (struct vlan_ethhdr *) + ((*pskb)->mac.ethernet); + + if (!IS_VLAN_IP) + return NF_ACCEPT; + if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL) + goto out; + skb_pull(*pskb, VLAN_HLEN); + (*pskb)->nh.raw += VLAN_HLEN; + } else if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL) goto out; if (!pskb_may_pull(skb, sizeof(struct iphdr))) @@ -264,6 +298,7 @@ static unsigned int br_nf_pre_routing(un nf_bridge->mask |= BRNF_PKT_TYPE; } + nf_bridge->mask |= BRNF_NF_BRIDGE_PREROUTING; nf_bridge->physindev = skb->dev; skb->dev = bridge_parent(skb->dev); store_orig_dstaddr(skb); @@ -294,9 +329,6 @@ static unsigned int br_nf_local_in(unsig { struct sk_buff *skb = *pskb; - if (skb->protocol != __constant_htons(ETH_P_IP)) - return NF_ACCEPT; - if (skb->dst == (struct dst_entry *)&__fake_rtable) { dst_release(skb->dst); skb->dst = NULL; @@ -310,12 +342,13 @@ static int br_nf_forward_finish(struct s { struct nf_bridge_info *nf_bridge = skb->nf_bridge; struct net_device *in; + struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); #ifdef CONFIG_NETFILTER_DEBUG skb->nf_debug ^= (1 << NF_BR_FORWARD); #endif - if (skb->protocol == __constant_htons(ETH_P_IP)) { + if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) { in = nf_bridge->physindev; if (nf_bridge->mask & BRNF_PKT_TYPE) { skb->pkt_type = PACKET_OTHERHOST; @@ -324,7 +357,10 @@ static int br_nf_forward_finish(struct s } else { in = *((struct net_device **)(skb->cb)); } - + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_push(skb, VLAN_HLEN); + skb->nh.raw -= VLAN_HLEN; + } NF_HOOK_THRESH(PF_BRIDGE, NF_BR_FORWARD, skb, in, skb->dev, br_forward_finish, 1); return 0; @@ -342,15 +378,20 @@ static unsigned int br_nf_forward(unsign { struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; + struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); if (skb->protocol != __constant_htons(ETH_P_IP) && - skb->protocol != __constant_htons(ETH_P_ARP)) - return NF_ACCEPT; + skb->protocol != __constant_htons(ETH_P_ARP)) { + if (!IS_VLAN_IP && !IS_VLAN_ARP) + return NF_ACCEPT; + skb_pull(*pskb, VLAN_HLEN); + (*pskb)->nh.raw += VLAN_HLEN; + } #ifdef CONFIG_NETFILTER_DEBUG skb->nf_debug ^= (1 << NF_BR_FORWARD); #endif - if (skb->protocol == __constant_htons(ETH_P_IP)) { + if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) { nf_bridge = skb->nf_bridge; if (skb->pkt_type == PACKET_OTHERHOST) { skb->pkt_type = PACKET_HOST; @@ -365,7 +406,15 @@ static unsigned int br_nf_forward(unsign bridge_parent(out), br_nf_forward_finish); } else { struct net_device **d = (struct net_device **)(skb->cb); + struct arphdr *arp = skb->nh.arph; + if (arp->ar_pln != 4) { + if (IS_VLAN_ARP) { + skb_push(*pskb, VLAN_HLEN); + (*pskb)->nh.raw -= VLAN_HLEN; + } + return NF_ACCEPT; + } *d = (struct net_device *)in; NF_HOOK(NF_ARP, NF_ARP_FORWARD, skb, (struct net_device *)in, (struct net_device *)out, br_nf_forward_finish); @@ -381,6 +430,10 @@ static int br_nf_local_out_finish(struct #ifdef CONFIG_NETFILTER_DEBUG skb->nf_debug &= ~(1 << NF_BR_LOCAL_OUT); #endif + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_push(skb, VLAN_HLEN); + skb->nh.raw -= VLAN_HLEN; + } NF_HOOK_THRESH(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, br_forward_finish, NF_BR_PRI_FIRST + 1); @@ -419,8 +472,9 @@ static unsigned int br_nf_local_out(unsi struct net_device *realindev; struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; + struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet); - if (skb->protocol != __constant_htons(ETH_P_IP)) + if (skb->protocol != __constant_htons(ETH_P_IP) && !IS_VLAN_IP) return NF_ACCEPT; /* Sometimes we get packets with NULL ->dst here (for example, @@ -444,11 +498,26 @@ static unsigned int br_nf_local_out(unsi skb->pkt_type = PACKET_OTHERHOST; nf_bridge->mask ^= BRNF_PKT_TYPE; } + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_push(skb, VLAN_HLEN); + skb->nh.raw -= VLAN_HLEN; + } NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, realindev, skb->dev, okfn); } else { + struct net_device *realoutdev = bridge_parent(skb->dev); + +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + /* iptables should match -o br0.x */ + if (nf_bridge->netoutdev) + realoutdev = nf_bridge->netoutdev; +#endif okfn = br_nf_local_out_finish; + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_pull(skb, VLAN_HLEN); + (*pskb)->nh.raw += VLAN_HLEN; + } /* IP forwarded traffic has a physindev, locally * generated traffic hasn't. */ @@ -456,9 +525,8 @@ static unsigned int br_nf_local_out(unsi if (((nf_bridge->mask & BRNF_DONT_TAKE_PARENT) == 0) && has_bridge_parent(realindev)) realindev = bridge_parent(realindev); - NF_HOOK_THRESH(PF_INET, NF_IP_FORWARD, skb, realindev, - bridge_parent(skb->dev), okfn, + realoutdev, okfn, NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD + 1); } else { #ifdef CONFIG_NETFILTER_DEBUG @@ -466,7 +534,7 @@ static unsigned int br_nf_local_out(unsi #endif NF_HOOK_THRESH(PF_INET, NF_IP_LOCAL_OUT, skb, realindev, - bridge_parent(skb->dev), okfn, + realoutdev, okfn, NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT + 1); } } @@ -482,6 +550,8 @@ static unsigned int br_nf_post_routing(u { 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 net_device *realoutdev = bridge_parent(skb->dev); /* Be very paranoid. Must be a device driver bug. */ if (skb->mac.raw < skb->head || skb->mac.raw + ETH_HLEN > skb->data) { @@ -492,11 +562,11 @@ static unsigned int br_nf_post_routing(u if (has_bridge_parent(skb->dev)) printk("[%s]", bridge_parent(skb->dev)->name); } - printk("\n"); + printk(" head:%p, raw:%p\n", skb->head, skb->mac.raw); return NF_ACCEPT; } - if (skb->protocol != __constant_htons(ETH_P_IP)) + if (skb->protocol != __constant_htons(ETH_P_IP) && !IS_VLAN_IP) return NF_ACCEPT; /* Sometimes we get packets with NULL ->dst here (for example, @@ -517,10 +587,19 @@ static unsigned int br_nf_post_routing(u nf_bridge->mask |= BRNF_PKT_TYPE; } - memcpy(nf_bridge->hh, skb->data - 16, 16); + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_pull(skb, VLAN_HLEN); + skb->nh.raw += VLAN_HLEN; + } + + nf_bridge_save_header(skb); +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + if (nf_bridge->netoutdev) + realoutdev = nf_bridge->netoutdev; +#endif NF_HOOK(PF_INET, NF_IP_POST_ROUTING, skb, NULL, - bridge_parent(skb->dev), br_dev_queue_push_xmit); + realoutdev, br_dev_queue_push_xmit); return NF_STOLEN; } @@ -535,8 +614,8 @@ static unsigned int ipv4_sabotage_in(uns const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - if (in->hard_start_xmit == br_dev_xmit && - okfn != br_nf_pre_routing_finish) { + if ((*pskb)->nf_bridge && + !((*pskb)->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING)) { okfn(*pskb); return NF_STOLEN; } @@ -552,10 +631,15 @@ static unsigned int ipv4_sabotage_out(un const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { - if (out->hard_start_xmit == br_dev_xmit && + if ((out->hard_start_xmit == br_dev_xmit && okfn != br_nf_forward_finish && okfn != br_nf_local_out_finish && - okfn != br_dev_queue_push_xmit) { + okfn != br_dev_queue_push_xmit) +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + || ((out->priv_flags & IFF_802_1Q_VLAN) && + VLAN_DEV_INFO(out)->real_dev->hard_start_xmit == br_dev_xmit) +#endif + ) { struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; @@ -574,6 +658,11 @@ static unsigned int ipv4_sabotage_out(un nf_bridge->mask &= BRNF_DONT_TAKE_PARENT; nf_bridge->physindev = (struct net_device *)in; } +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + /* the iptables outdev is br0.x, not br0 */ + if (out->priv_flags & IFF_802_1Q_VLAN) + nf_bridge->netoutdev = (struct net_device *)out; +#endif okfn(skb); return NF_STOLEN; } From davem@pizda.ninka.net Tue Oct 7 12:18:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 12:18:45 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97JIB25007795 for ; Tue, 7 Oct 2003 12:18:12 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA27226; Tue, 7 Oct 2003 12:12:58 -0700 Date: Tue, 7 Oct 2003 12:12:58 -0700 From: "David S. Miller" To: Bart De Schuymer Cc: netdev@oss.sgi.com, greearb@candelatech.com, bridge@osdl.org, vlan@wanfear.com, shemminger@osdl.org Subject: Re: [Bridge] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged {I,AR}P packets Message-Id: <20031007121258.35c65486.davem@redhat.com> In-Reply-To: <200310072112.53821.bdschuym@pandora.be> References: <200310062204.07230.bdschuym@pandora.be> <20031007080640.50de4d45.davem@redhat.com> <200310072112.53821.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 616 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 On Tue, 7 Oct 2003 21:12:53 +0200 Bart De Schuymer wrote: > I've used Stephen's suggestion (out->priv_flags & IFF_802_1Q_VLAN), this > removes all that cruft. The new patch definitely looks better. Unless someone barks I'll apply this after I catch some sleep. Thanks Bart. From shemminger@osdl.org Tue Oct 7 13:23:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 13:23:35 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97KN125012333 for ; Tue, 7 Oct 2003 13:23:01 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h97KMl123676; Tue, 7 Oct 2003 13:22:47 -0700 Date: Tue, 7 Oct 2003 13:22:26 -0700 From: Stephen Hemminger To: Bart De Schuymer Cc: "David S. Miller" , netdev@oss.sgi.com, greearb@candelatech.com, bridge@osdl.org, vlan@wanfear.com Subject: Re: [Bridge] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged {I, AR}P packets Message-Id: <20031007132226.5ac7a184.shemminger@osdl.org> In-Reply-To: <200310072112.53821.bdschuym@pandora.be> References: <200310062204.07230.bdschuym@pandora.be> <20031007080640.50de4d45.davem@redhat.com> <200310072112.53821.bdschuym@pandora.be> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 617 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 On > > > > Once you fix that I'll apply your patch as long as Stephen has no > > objections. Looks fine to me, there are some things that might want to be cleaned up, but they can go in later. From ccarter@cs.uiuc.edu Tue Oct 7 13:52:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 13:53:21 -0700 (PDT) Received: from c000.snv.cp.net (h007.c000.snv.cp.net [209.228.32.71]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Kqj25013232 for ; Tue, 7 Oct 2003 13:52:45 -0700 Received: (cpmta 29516 invoked from network); 7 Oct 2003 13:52:44 -0700 Received: from 12.221.64.39 (HELO cs.uiuc.edu) by smtp.carter.net (209.228.32.71) with SMTP; 7 Oct 2003 13:52:44 -0700 X-Sent: 7 Oct 2003 20:52:44 GMT Message-ID: <3F83276D.3070700@cs.uiuc.edu> Date: Tue, 07 Oct 2003 15:51:57 -0500 From: Casey Carter User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Dwyer CC: Casey Carter , netdev@oss.sgi.com, linux-ha@lists.linux-ha.org Subject: Re: Strange UDP binding behavior (SO_BINDTODEVICE) References: <20031005130154.5bd9d182.kevin@pheared.net> <3F81F1CD.8050803@Carter.net> <20031006210600.37da62c9.kevin@pheared.net> In-Reply-To: <20031006210600.37da62c9.kevin@pheared.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 618 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ccarter@cs.uiuc.edu Precedence: bulk X-list: netdev Kevin Dwyer wrote: >On Mon, 06 Oct 2003 17:50:53 -0500 >Casey Carter wrote: > > > >>This is not a bug, it's a feature! It is possible to use multiple >>sockets with the same port number bound to different interfaces (where >>"no interface" is one possible choice). The UDP packet delivery code >>favors the socket that is bound to the interface through which packets >>are received. So, if I am only interested in packets for port 6666 on >>eth1, then I am prioritized ahead of the socket bound to "no >>interface" port 6666. >> >> > >Well, I would buy that as reasonable, acceptable behavior, but I think >the reverse is true. > >We are binding specifically to say, eth0 on port 694. Someone comes >along and binds to "no interface" on port 694 and trumps our socket. >Isn't that the opposite of what you describe? > > Taking a look at the UDP delivery code in net/ipv4/udp.c (version 2.6.0-test6) we see: struct sock *udp_v4_lookup_longway(u32 saddr, u16 sport, u32 daddr, u16 dport, int dif) { struct sock *sk, *result = NULL; struct hlist_node *node; unsigned short hnum = ntohs(dport); int badness = -1; sk_for_each(sk, node, &udp_hash[hnum & (UDP_HTABLE_SIZE - 1)]) { struct inet_opt *inet = inet_sk(sk); if (inet->num == hnum && !ipv6_only_sock(sk)) { int score = (sk->sk_family == PF_INET ? 1 : 0); if (inet->rcv_saddr) { if (inet->rcv_saddr != daddr) continue; score+=2; } if (inet->daddr) { if (inet->daddr != saddr) continue; score+=2; } if (inet->dport) { if (inet->dport != sport) continue; score+=2; } if (sk->sk_bound_dev_if) { if (sk->sk_bound_dev_if != dif) continue; score+=2; } if(score == 9) { result = sk; break; } else if(score > badness) { result = sk; badness = score; } } } return result; } This code picks a UDP socket to deliver to, amongst those with the correct destination port number. It does so by ranking each socket on a scale from 0 to 9 and picking the first socket with the best score. Since the score increments are all 2, this code weights equally a socket that is bound to the correct interface and (for example) a socket bound to no interface but bound to the specific IP address the packet is addressed to. IMHO, the delivery should weigh sk_bound_dev_if much more strongly (7 instead of 2), so that if-bound sockets are always favored over non-if-bound. I would be happy to submit the (trivial) patch to do so if the networking gurus agree? -- Casey Carter Casey@Carter.net ccarter@cs.uiuc.edu AIM: cartec69 From kevin@pheared.net Tue Oct 7 14:08:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 14:09:02 -0700 (PDT) Received: from taurus.lunarpages.com (taurus.lunarpages.com [64.235.234.121]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97L8Q25013962 for ; Tue, 7 Oct 2003 14:08:26 -0700 Received: from detainee.security.algx.net ([206.205.246.17] helo=detainee ident=kevin) by taurus.lunarpages.com with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1A6z4R-0005JT-7f; Tue, 07 Oct 2003 14:08:39 -0700 Date: Tue, 7 Oct 2003 17:08:23 -0400 From: Kevin Dwyer To: Casey Carter Cc: Casey Carter , netdev@oss.sgi.com, linux-ha@lists.linux-ha.org Subject: Re: Strange UDP binding behavior (SO_BINDTODEVICE) Message-Id: <20031007170823.41ef2ff9.kevin@pheared.net> In-Reply-To: <3F83276D.3070700@cs.uiuc.edu> References: <20031005130154.5bd9d182.kevin@pheared.net> <3F81F1CD.8050803@Carter.net> <20031006210600.37da62c9.kevin@pheared.net> <3F83276D.3070700@cs.uiuc.edu> X-Mailer: Sylpheed version 0.9.5claws28 (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Signature=_Tue__7_Oct_2003_17_08_23_-0400_oFn8zMF28kT3g8jy" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - taurus.lunarpages.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - pheared.net X-archive-position: 619 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kevin@pheared.net Precedence: bulk X-list: netdev --Signature=_Tue__7_Oct_2003_17_08_23_-0400_oFn8zMF28kT3g8jy Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit On Tue, 07 Oct 2003 15:51:57 -0500 Casey Carter wrote: > IMHO, the delivery should weigh sk_bound_dev_if much more strongly (7 > instead of 2), so that if-bound sockets are always favored over > non-if-bound. I would be happy to submit the (trivial) patch to do so > if the networking gurus agree? Any possibility of getting this behavior into 2.4 as well? Albeit, without the scoring since that's obviously a new concept introduced by 2.6. (Which I prefer; well done.) I confess that I don't know who to talk to about such a change. -- - kpd "If at first you don't succeed, redefine success." - Anonymous --Signature=_Tue__7_Oct_2003_17_08_23_-0400_oFn8zMF28kT3g8jy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/gytHN4rbBhHCVDkRAo6BAJ0RHd8TaDctV+UZxdG0hjamdFLcFACfbtte 8tsq4QQLj8PpGSOmciRBHsU= =EgKz -----END PGP SIGNATURE----- --Signature=_Tue__7_Oct_2003_17_08_23_-0400_oFn8zMF28kT3g8jy-- From Casey@Carter.net Tue Oct 7 14:49:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 14:50:13 -0700 (PDT) Received: from c000.snv.cp.net (h008.c000.snv.cp.net [209.228.32.72]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Lnd25015449 for ; Tue, 7 Oct 2003 14:49:40 -0700 Received: (cpmta 22378 invoked from network); 7 Oct 2003 14:49:39 -0700 Received: from 12.221.64.39 (HELO Carter.net) by smtp.carter.net (209.228.32.72) with SMTP; 7 Oct 2003 14:49:38 -0700 X-Sent: 7 Oct 2003 21:49:38 GMT Message-ID: <3F8334F0.4060205@Carter.net> Date: Tue, 07 Oct 2003 16:49:36 -0500 From: Casey Carter User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Dwyer CC: Casey Carter , netdev@oss.sgi.com, linux-ha@lists.linux-ha.org Subject: Re: Strange UDP binding behavior (SO_BINDTODEVICE) References: <20031005130154.5bd9d182.kevin@pheared.net> <3F81F1CD.8050803@Carter.net> <20031006210600.37da62c9.kevin@pheared.net> <3F83276D.3070700@cs.uiuc.edu> <20031007170823.41ef2ff9.kevin@pheared.net> In-Reply-To: <20031007170823.41ef2ff9.kevin@pheared.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 620 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Casey@Carter.net Precedence: bulk X-list: netdev Kevin Dwyer wrote: >On Tue, 07 Oct 2003 15:51:57 -0500 >Casey Carter wrote: > > > >>IMHO, the delivery should weigh sk_bound_dev_if much more strongly (7 >>instead of 2), so that if-bound sockets are always favored over >>non-if-bound. I would be happy to submit the (trivial) patch to do so >>if the networking gurus agree? >> >> > >Any possibility of getting this behavior into 2.4 as well? Albeit, >without the scoring since that's obviously a new concept introduced by >2.6. (Which I prefer; well done.) > >I confess that I don't know who to talk to about such a change. > > There is actually a similar ranking algorithm in 2.4, with a similar fix. I'll work up a patch and resubmit to netdev in hopes that one of the gurus will pick it up. -- Casey Carter Casey@Carter.net ccarter@cs.uiuc.edu AIM: cartec69 From romieu@fr.zoreil.com Tue Oct 7 14:59:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 14:59:52 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97LxG25015960 for ; Tue, 7 Oct 2003 14:59:18 -0700 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.8/8.12.1) with ESMTP id h97LmhJo005547; Tue, 7 Oct 2003 23:48:43 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h97LmgCY005527; Tue, 7 Oct 2003 23:48:42 +0200 Date: Tue, 7 Oct 2003 23:48:42 +0200 From: Francois Romieu To: Andi Kleen Cc: ncorbic@sangoma.com, netdev@oss.sgi.com, davem@redhat.com Subject: Re: [PATCH] Fix 64bit bugs in dscc4.c Message-ID: <20031007234842.A5234@electric-eye.fr.zoreil.com> References: <20031007175953.GA1802@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031007175953.GA1802@averell>; from ak@muc.de on Tue, Oct 07, 2003 at 07:59:53PM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 621 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 Andi Kleen : [...] > ioremap_nocache returns unsigned long, not u32. This makes a difference > on 64bit hosts. No 64 bit host to test the patch but it looks fine. -- Ueimor - happily maintaining dscc4 driver since 2.4.3 From Casey@Carter.net Tue Oct 7 15:16:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 15:17:00 -0700 (PDT) Received: from c000.snv.cp.net (h007.c000.snv.cp.net [209.228.32.71]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97MGR25016697 for ; Tue, 7 Oct 2003 15:16:27 -0700 Received: (cpmta 6406 invoked from network); 7 Oct 2003 15:16:26 -0700 Received: from 12.221.64.39 (HELO Carter.net) by smtp.carter.net (209.228.32.71) with SMTP; 7 Oct 2003 15:16:26 -0700 X-Sent: 7 Oct 2003 22:16:26 GMT Message-ID: <3F833B39.4020606@Carter.net> Date: Tue, 07 Oct 2003 17:16:25 -0500 From: Casey Carter User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: [PATCH] Make SO_BINDTODEVICE bind very tightly Content-Type: multipart/mixed; boundary="------------050702070405010702030306" X-archive-position: 622 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Casey@Carter.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050702070405010702030306 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In the presence of both sockets that are and sockets that are not bound to a specific interface, those bound to the interface should always be favored for packet delivery over those not so bound. Attached patch (against 2.6.0-test6) enforces these semantics by a slight adjustment to udp_v4_lookup_longway in net/ipv4/udp.c The consequence of this change is to make SO_BINDTODEVICE bind more tightly than simple bind(). -- Casey Carter Casey@Carter.net ccarter@cs.uiuc.edu AIM: cartec69 --------------050702070405010702030306 Content-Type: text/plain; name="udp.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="udp.c.diff" --- linux-2.6.0-test6/net/ipv4/udp.c 2003-09-27 19:50:10.000000000 -0500 +++ linux-2.6.0-test6-patch/net/ipv4/udp.c 2003-10-07 17:08:10.000000000 -0500 @@ -246,9 +246,9 @@ if (sk->sk_bound_dev_if) { if (sk->sk_bound_dev_if != dif) continue; - score+=2; + score+=8; } - if(score == 9) { + if(score == 15) { result = sk; break; } else if(score > badness) { --------------050702070405010702030306-- From joe@perches.com Tue Oct 7 16:34:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 16:35:23 -0700 (PDT) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97NYk25021672 for ; Tue, 7 Oct 2003 16:34:49 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id RAA02687; Tue, 7 Oct 2003 17:10:52 -0700 Subject: Re: comment on [NET]: Delete support for old-style protocols, no longer necessary. From: Joe Perches To: David S Miller Cc: davem@nuts.ninka.net, linux-net@vger.kernel.org, netdev@oss.sgi.com In-Reply-To: <20031007115244.14a887ed.davem@redhat.com> References: <1065551829.2340.9.camel@localhost.localdomain> <20031007115244.14a887ed.davem@redhat.com> Content-Type: text/plain Message-Id: <1065569620.2340.19.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 07 Oct 2003 16:33:40 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 623 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 On Tue, 2003-10-07 at 11:52, David S. Miller wrote: > On Tue, 07 Oct 2003 11:37:09 -0700 > Joe Perches wrote: > > > - void *af_packet_priv; > > + struct sock *sk; /* appropriate comment: socket copy? */ > > AF_PACKET is the only user of this private field, and > I want people to be aware of this and not try to use it > for other stuff. > > Nobody else can use it for something different, the code > in net/core/dev.c does specific things when it's non-NULL > knowing that this non-NULL value means that it's an > AF_PACKET packet_type being passed to it. > > So we won't make your suggested change. Even so, why not call it a struct sock*? It is after all and is used as one. From dank@kegel.com Tue Oct 7 16:47:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 16:47:35 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h97Nl125022220 for ; Tue, 7 Oct 2003 16:47:01 -0700 Received: (qmail 7531 invoked from network); 7 Oct 2003 23:47:00 -0000 Received: from c-24-126-73-164.we.client2.attbi.com (HELO kegel.com) (24.126.73.164) by relay.pair.com with SMTP; 7 Oct 2003 23:47:00 -0000 X-pair-Authenticated: 24.126.73.164 Message-ID: <3F8358CA.1010101@kegel.com> Date: Tue, 07 Oct 2003 17:22:34 -0700 From: Dan Kegel User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: de-de, en MIME-Version: 1.0 To: Joe Perches CC: David S Miller , davem@nuts.ninka.net, linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: comment on [NET]: Delete support for old-style protocols, no longer necessary. References: <1065551829.2340.9.camel@localhost.localdomain> <20031007115244.14a887ed.davem@redhat.com> <1065569620.2340.19.camel@localhost.localdomain> In-Reply-To: <1065569620.2340.19.camel@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 624 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dank@kegel.com Precedence: bulk X-list: netdev Joe Perches wrote: >>>- void *af_packet_priv; >>>+ struct sock *sk; /* appropriate comment: socket copy? */ >> >>AF_PACKET is the only user of this private field, and >>I want people to be aware of this and not try to use it >>for other stuff. >> >>Nobody else can use it for something different, the code >>in net/core/dev.c does specific things when it's non-NULL >>knowing that this non-NULL value means that it's an >>AF_PACKET packet_type being passed to it. >> >>So we won't make your suggested change. > > Even so, why not call it a struct sock*? > It is after all and is used as one. To discourage other modules from using it, and to keep programmers who aren't working on AF_PACKET from thinking about it. It's SOP to use opaque cookies when you want to make data private. - Dan -- Dan Kegel http://www.kegel.com http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045 From shemminger@osdl.org Tue Oct 7 17:23:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 17:24:04 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h980NV25023298 for ; Tue, 7 Oct 2003 17:23:32 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h980NI106713; Tue, 7 Oct 2003 17:23:18 -0700 Date: Tue, 7 Oct 2003 17:22:57 -0700 From: Stephen Hemminger To: Gerd Knorr Cc: video4linux-list@redhat.com, netdev@oss.sgi.com Subject: [PATCH] dvb-net -- allocate network device structures Message-Id: <20031007172257.7dff3075.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 625 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 patch to 2.6.0-test6 converts the DVB net driver to allocate network devices structures in a manner similar to other network devices in 2.6 by using alloc_netdev. Instead of an array of structures, and array of pointers is used. This solves the problem of OOPS when the following is done. rmmod dvb_net hard_header_cache = NULL; dev->flags |= IFF_NOARP; - - return 0; } static int get_if(struct dvb_net *dvbnet) @@ -495,7 +493,6 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid) { struct net_device *net; - struct dmx_demux *demux; struct dvb_net_priv *priv; int result; int if_num; @@ -503,25 +500,20 @@ if ((if_num = get_if(dvbnet)) < 0) return -EINVAL; - net=&dvbnet->device[if_num]; - demux=dvbnet->demux; + net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb", + dvb_net_setup); + if (!net) + return -ENOMEM; - memset(net, 0, sizeof(struct net_device)); + sprintf(net->name, "dvb%d_%d", dvbnet->dvbdev->adapter->num, if_num); - memcpy(net->name, "dvb0_0", 7); - net->name[3] = dvbnet->dvbdev->adapter->num + '0'; - net->name[5] = if_num + '0'; - net->addr_len = 6; + net->addr_len = 6; memcpy(net->dev_addr, dvbnet->dvbdev->adapter->proposed_mac, 6); - net->next = NULL; - net->init = dvb_net_init_dev; - - if (!(net->priv = kmalloc(sizeof(struct dvb_net_priv), GFP_KERNEL))) - return -ENOMEM; + dvbnet->device[if_num] = net; + priv = net->priv; - memset(priv, 0, sizeof(struct dvb_net_priv)); - priv->demux = demux; + priv->demux = dvbnet->demux; priv->pid = pid; priv->rx_mode = RX_MODE_UNI; @@ -531,6 +523,7 @@ net->base_addr = pid; if ((result = register_netdev(net)) < 0) { + kfree(net); return result; } @@ -540,18 +533,20 @@ static int dvb_net_remove_if(struct dvb_net *dvbnet, int num) { - struct dvb_net_priv *priv = dvbnet->device[num].priv; + struct net_device *net = dvbnet->device[num]; + struct dvb_net_priv *priv = net->priv; if (!dvbnet->state[num]) return -EINVAL; if (priv->in_use) return -EBUSY; - dvb_net_stop(&dvbnet->device[num]); + dvb_net_stop(net); flush_scheduled_work(); - kfree(priv); - unregister_netdev(&dvbnet->device[num]); + unregister_netdev(net); dvbnet->state[num]=0; + free_netdev(net); + return 0; } diff -urN -X dontdiff linux-2.5/drivers/media/dvb/dvb-core/dvb_net.h linux-2.5-net/drivers/media/dvb/dvb-core/dvb_net.h --- linux-2.5/drivers/media/dvb/dvb-core/dvb_net.h 2003-09-30 13:53:57.000000000 -0700 +++ linux-2.5-net/drivers/media/dvb/dvb-core/dvb_net.h 2003-09-05 12:50:57.000000000 -0700 @@ -35,7 +35,7 @@ struct dvb_net { struct dvb_device *dvbdev; - struct net_device device[DVB_NET_DEVICES_MAX]; + struct net_device *device[DVB_NET_DEVICES_MAX]; int state[DVB_NET_DEVICES_MAX]; struct dmx_demux *demux; }; From aris@cathedrallabs.org Tue Oct 7 18:02:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 18:02:37 -0700 (PDT) Received: from panda.sul.com.br (panda.sul.com.br [200.219.150.4]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9811r25024371 for ; Tue, 7 Oct 2003 18:01:59 -0700 Received: from cathedrallabs.org (2-073.ctame701-3.telepar.net.br [200.181.173.73]) by panda.sul.com.br (Postfix) with ESMTP id 46BD4327EA; Tue, 7 Oct 2003 21:54:53 -0300 (EST) Received: by cathedrallabs.org (Postfix, from userid 1000) id 2C5C9237DD; Tue, 7 Oct 2003 21:27:16 -0300 (BRT) Date: Tue, 7 Oct 2003 21:27:16 -0300 To: jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [patch] 3c509: don't return if request_region fails Message-ID: <20031008002715.GA31225@cathedrallabs.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline From: aris@cathedrallabs.org (Aristeu Sergio Rozanski Filho) X-archive-position: 626 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aris@cathedrallabs.org Precedence: bulk X-list: netdev --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline hi, this makes el3_probe don't return if request_region fails while trying to detect pnp cards. it would leave the other pnp cards attached. -- aris --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="3c509-pnpprobe.patch" # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1375 -> 1.1376 # drivers/net/3c509.c 1.43 -> 1.44 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/07 aris@cathedrallabs.org 1.1376 # o 3c509: don't return if request_region fails # -------------------------------------------- # diff -Nru a/drivers/net/3c509.c b/drivers/net/3c509.c --- a/drivers/net/3c509.c Tue Oct 7 21:19:05 2003 +++ b/drivers/net/3c509.c Tue Oct 7 21:19:05 2003 @@ -404,7 +404,7 @@ ioaddr = pnp_port_start(idev, 0); if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509 PnP")) { pnp_device_detach(idev); - return -EBUSY; + continue; } irq = pnp_irq(idev, 0); if (el3_debug > 3) --gBBFr7Ir9EOA20Yy-- From jt@bougret.hpl.hp.com Tue Oct 7 19:33:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 19:34:02 -0700 (PDT) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h982XI25029010 for ; Tue, 7 Oct 2003 19:33:18 -0700 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel13.hp.com (Postfix) with ESMTP id 885FA1C01610; Tue, 7 Oct 2003 19:03:35 -0700 (PDT) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_28810+JAGae91741+JAGae92668)/8.9.3 HPLabs Timeshare Server) with ESMTP id TAA05180; Tue, 7 Oct 2003 19:03:35 -0700 (PDT) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1A73fr-0004y0-00; Tue, 07 Oct 2003 19:03:35 -0700 Date: Tue, 7 Oct 2003 19:03:31 -0700 To: Stephen Hemminger Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] spinlock badness in last dongle changes. Message-ID: <20031008020331.GA19007@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20031006222631.1934f8e1.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031006222631.1934f8e1.shemminger@osdl.org> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-archive-position: 627 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@bougret.hpl.hp.com Precedence: bulk X-list: netdev On Mon, Oct 06, 2003 at 10:26:31PM -0700, Stephen Hemminger wrote: > On 2.6.0-test6 bk latest, rmmod of irda hangs on SMP... > > A couple of locking problems happened when converted from using > hashbin lock outside of irqueue. First, the lock was never initialized; > Second, the lock was being unlocked after the hashbin was free. > > Since the hashbin of dongles should be empty (ie all dongle unregistered) > don't really need locking there, so just warn if we find anything... I've recompiled my kernel with this patch and the trouble modprobing the dongle driver went away. Thanks ! Jean From scott.feldman@intel.com Tue Oct 7 22:58:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 07 Oct 2003 22:58:47 -0700 (PDT) Received: from caduceus.jf.intel.com (fmr06.intel.com [134.134.136.7]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h985wB25005411 for ; Tue, 7 Oct 2003 22:58:12 -0700 Received: from talaria.jf.intel.com (talaria.jf.intel.com [10.7.209.7]) by caduceus.jf.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h985wEqU018609 for ; Wed, 8 Oct 2003 05:58:14 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by talaria.jf.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h985Fi727191 for ; Wed, 8 Oct 2003 05:15:44 GMT Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003100722580505082 ; Tue, 07 Oct 2003 22:58:05 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 7 Oct 2003 22:58:05 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: e1000 close (NAPI) Date: Tue, 7 Oct 2003 22:58:05 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: e1000 close (NAPI) Thread-Index: AcOMz2HPbQwJmg7UQ5+TPIbpCTOuWwAkn0oQ From: "Feldman, Scott" To: "Robert Olsson" Cc: "Jeff Garzik" , X-OriginalArrivalTime: 08 Oct 2003 05:58:05.0550 (UTC) FILETIME=[243800E0:01C38D61] X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h985wB25005411 X-archive-position: 628 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev > - if(work_done < work_to_do) { > + if(work_done < work_to_do || !netif_running(netdev)) { > netif_rx_complete(netdev); > e1000_irq_enable(adapter); > } Is e1000 unique in this regard, or do the other NAPI-enabled drivers have the same issue? -scott From a.ranu@ugrad.unimelb.edu.au Wed Oct 8 00:03:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 00:04:08 -0700 (PDT) Received: from cassius.its.unimelb.edu.au (IDENT:1@cassius.its.unimelb.edu.au [128.250.6.200]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9873W25011571 for ; Wed, 8 Oct 2003 00:03:33 -0700 Received: (from webmail@localhost) by cassius.its.unimelb.edu.au (8.12.10/8.12.8) id h9873Rpm005797; Wed, 8 Oct 2003 17:03:27 +1000 (AEST) Message-Id: <200310080703.h9873Rpm005797@cassius.its.unimelb.edu.au> Content-Type: text/plain Content-Disposition: inline Mime-Version: 1.0 X-Mailer: MIME-tools 4.104 (Entity 4.117) From: a.ranu@ugrad.unimelb.edu.au Date: Wed, 08 Oct 2003 17:03:27 +1000 To: linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: window scaling X-archive-position: 629 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: a.ranu@ugrad.unimelb.edu.au Precedence: bulk X-list: netdev hi... i am writing a module that modifies the advertised window in every outgoing packet with the help of ip connection tracking, if it is larger than the window i calculated (say x - not scaled, just in bytes) would the following code be correct? x_scaled = x >> (*pskb)->sk->tp_pinfo.af_tcp.rcv_wscale; window_already_in_pkt = ntohs((*pskb)->h.th->window); if (window_already_in_pkt > x_scaled) tcph->window = x_scaled; a reply would be really appreciated Asmeet. -- a.ranu@ugrad.unimelb.edu.au From tommy.christensen@tpack.net Wed Oct 8 01:09:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 01:10:09 -0700 (PDT) Received: from mail.tpack.net ([213.173.228.18]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9889V25018233 for ; Wed, 8 Oct 2003 01:09:32 -0700 Received: (qmail 20771 invoked from network); 8 Oct 2003 08:09:25 -0000 Received: from cyan.cph.tpack.net (192.168.3.101) by 0 with SMTP; 8 Oct 2003 08:09:25 -0000 Subject: Re: [Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged{I,AR}P packets From: Tommy Christensen To: Christian Darnell Cc: "'Linux 802.1Q VLAN'" , Bart De Schuymer , netdev@oss.sgi.com, bridge In-Reply-To: <5B537508CDBED3118403009027745A210B8C1499@knant18.kna.flextronics.com> References: <5B537508CDBED3118403009027745A210B8C1499@knant18.kna.flextronics.com> Content-Type: text/plain Organization: Message-Id: <1065600565.2572.209.camel@cyan.cph.tpack.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 08 Oct 2003 10:09:25 +0200 Content-Transfer-Encoding: 7bit X-archive-position: 630 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev On Tue, 2003-10-07 at 11:06, Christian Darnell wrote: > Hi Ben and all others, > > Just to clarify for other who hasn't been a part of this discussion before. > > ---- 8< ---- > When trying to grab a packet with pcap when using VLAN the beginning of the > packet is corrupt an the VLAN TCI bits are missing. This is only a problem > when sniffing on incoming traffic not outgoing. > > 00 60 08 50 00 60 08 50 26 2a 00 60 08 6a b4 53 xx xx xx xx 08 00 45 00 > ^^^^^^^^^^^ ^^^^^^^^^^^^ > Where does these bytes come from? Bytes missing (VLAN header)? > > The correct MAC addresses here are: > 00 60 08 50 26 2a and 00 60 08 6a b4 53 > ---- 8< ---- This is because the VLAN code is mangling shared data. You need to do something like this: --- linux-2.4/net/8021q/vlan_dev.c.org 2003-02-25 15:23:09.000000000 +0100 +++ linux-2.4/net/8021q/vlan_dev.c 2003-10-07 16:01:29.000000000 +0200 @@ -75,7 +75,12 @@ static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb) { if (VLAN_DEV_INFO(skb->dev)->flags & 1) { - skb = skb_share_check(skb, GFP_ATOMIC); + if (skb_shared(skb) || skb_cloned(skb)) { + struct sk_buff *nskb; + nskb = skb_copy(skb, GFP_ATOMIC); + kfree_skb(skb); + skb = nskb; + } if (skb) { /* Lifted from Gleb's VLAN code... */ memmove(skb->data - ETH_HLEN, Christian, could you try this out? Regarding sharing, the following should be applied as well. The VLAN code is handed shared sk_buff's, but doesn't handle them as such. --- linux-2.4/net/8021q/vlan.c.org 2003-02-25 15:23:09.000000000 +0100 +++ linux-2.4/net/8021q/vlan.c 2003-10-07 16:02:52.000000000 +0200 @@ -67,7 +67,7 @@ type: __constant_htons(ETH_P_8021Q), dev: NULL, func: vlan_skb_recv, /* VLAN receive method */ - data: (void *)(-1), /* Set here '(void *)1' when this code can SHARE SKBs */ + data: NULL, /* Set here '(void *)1' when this code can SHARE SKBs */ next: NULL }; I guess this is a special case of "off-by-one" ;-) -Tommy From Christian.Darnell@se.flextronics.com Wed Oct 8 01:21:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 01:22:22 -0700 (PDT) Received: from nic-outside.fw2.se.flextronics.com (fw2.flextronics.se [195.67.90.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h988Lm26018796 for ; Wed, 8 Oct 2003 01:21:49 -0700 Received: from knant116.se.flextronics.com by nic-outside.fw2.se.flextronics.com via smtpd (for oss.sgi.com [192.48.159.27]) with SMTP; 8 Oct 2003 08:15:37 UT Received: from nic-dmz3.fw2.se.flextronics.com ([10.210.134.173]) by knant116.se.flextronics.com with SMTP id M2003100810221713856 ; Wed, 08 Oct 2003 10:22:17 +0200 Received: from eukna204.kna.flextronics.com by nic-dmz3.fw2.se.flextronics.com via smtpd (for smtp-eu1.flextronics.com [10.211.33.20]) with SMTP; 8 Oct 2003 08:15:22 UT Received: by eukna204.europe.ad.flextronics.com with Internet Mail Service (5.5.2653.19) id <4NZ5ZRPZ>; Wed, 8 Oct 2003 10:21:33 +0200 Message-ID: <5B537508CDBED3118403009027745A210B8C14A1@knant18.kna.flextronics.com> From: Christian Darnell To: "'Tommy Christensen'" Cc: "'Linux 802.1Q VLAN'" , Bart De Schuymer , netdev@oss.sgi.com, bridge Subject: RE: [Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged{I,AR}P packets Date: Wed, 8 Oct 2003 10:18:26 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-archive-position: 631 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Christian.Darnell@se.flextronics.com Precedence: bulk X-list: netdev -----Original Message----- >From: Tommy Christensen [mailto:tommy.christensen@tpack.net] >Sent: Wednesday, October 08, 2003 10:09 AM >To: Christian Darnell >Cc: 'Linux 802.1Q VLAN'; Bart De Schuymer; netdev@oss.sgi.com; bridge >Subject: Re: [Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables >"see" bridged VLAN tagged{I,AR}P packets > > > >This is because the VLAN code is mangling shared data. >You need to do something like this: > > >--- linux-2.4/net/8021q/vlan_dev.c.org 2003-02-25 15:23:09.000000000 >+0100 >+++ linux-2.4/net/8021q/vlan_dev.c 2003-10-07 16:01:29.000000000 +0200 >@@ -75,7 +75,12 @@ > static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff >*skb) > { > if (VLAN_DEV_INFO(skb->dev)->flags & 1) { >- skb = skb_share_check(skb, GFP_ATOMIC); >+ if (skb_shared(skb) || skb_cloned(skb)) { >+ struct sk_buff *nskb; >+ nskb = skb_copy(skb, GFP_ATOMIC); >+ kfree_skb(skb); >+ skb = nskb; >+ } > if (skb) { > /* Lifted from Gleb's VLAN code... */ > memmove(skb->data - ETH_HLEN, > > >Christian, could you try this out? Thanks Tommy! I tried this (on kernel 2.4.22) and it works great! Best Regards, Christian Darnell From ja@ssi.bg Wed Oct 8 01:33:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 01:33:56 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h988XG25019387 for ; Wed, 8 Oct 2003 01:33:18 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h9889Kq05907; Wed, 8 Oct 2003 11:09:22 +0300 Date: Wed, 8 Oct 2003 11:09:20 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: Wensong Zhang , Rusty Russell , Subject: [2.6 PATCH] ipvs - avoid returning NF_DROP from the packet schedulers Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1607745702-1839944973-1065600560=:5889" X-archive-position: 632 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --1607745702-1839944973-1065600560=:5889 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, It seems my NF_DROP approach leads to new bugs. So, better free skb, return NF_STOLEN and add some comments. If someone wants to fix it in another way, go ahead. Regards -- Julian Anastasov --1607745702-1839944973-1065600560=:5889 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="drop-1.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Better return NF_STOLEN Content-Disposition: attachment; filename="drop-1.diff" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTUwMSAgLT4gMS4xNTAyIA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX2NvcmUuYwkxLjUgICAgIC0+IDEuNiAgICAN CiMJIGluY2x1ZGUvbmV0L2lwX3ZzLmgJMS42ICAgICAtPiAxLjcgICAgDQoj CW5ldC9pcHY0L2lwdnMvaXBfdnNfeG1pdC5jCTEuMyAgICAgLT4gMS40ICAg IA0KIw0KIyBUaGUgZm9sbG93aW5nIGlzIHRoZSBCaXRLZWVwZXIgQ2hhbmdl U2V0IExvZw0KIyAtLS0tLS0tLS0tLS0t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TEVOOw0KIH0NCiANCiANCkBAIC01MTUsNiArNTIxLDcgQEANCiAJCQlyYyA9 IGNwLT5wYWNrZXRfeG1pdChza2IsIGNwLCBwcCk7DQogCQllbHNlDQogCQkJ cmMgPSBORl9BQ0NFUFQ7DQorCQkvKiBkbyBub3QgdG91Y2ggc2tiIGFueW1v cmUgKi8NCiAJCWF0b21pY19pbmMoJmNwLT5pbl9wa3RzKTsNCiAJCV9faXBf dnNfY29ubl9wdXQoY3ApOw0KIAkJZ290byBvdXQ7DQo= --1607745702-1839944973-1065600560=:5889-- From Robert.Olsson@data.slu.se Wed Oct 8 02:16:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 02:16:49 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h989GA25021347 for ; Wed, 8 Oct 2003 02:16:11 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.9.3+/8.9.3) with ESMTP id LAA17595; Wed, 8 Oct 2003 11:16:00 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id 1DE07EC22F; Wed, 8 Oct 2003 11:16:02 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16259.54738.75122.134408@robur.slu.se> Date: Wed, 8 Oct 2003 11:16:02 +0200 To: "Feldman, Scott" Cc: "Robert Olsson" , "Jeff Garzik" , Subject: RE: e1000 close (NAPI) In-Reply-To: References: X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 633 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 Feldman, Scott writes: > > - if(work_done < work_to_do) { > > + if(work_done < work_to_do || !netif_running(netdev)) { > > netif_rx_complete(netdev); > > e1000_irq_enable(adapter); > > } > > Is e1000 unique in this regard, or do the other NAPI-enabled drivers > have the same issue? Hello! Other drivers may have the same issue. This was spotted while stress-testing tulip. Patch was sent here some days ago. It's only seen if trying to close device under extreme loads. See the syncing code in dev_close() You may try the e100 as well. We update the docs when see that this is OK. Cheers. --ro From davem@pizda.ninka.net Wed Oct 8 04:55:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 04:55:46 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Bt725030985 for ; Wed, 8 Oct 2003 04:55:11 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA07963; Wed, 8 Oct 2003 04:49:48 -0700 Date: Wed, 8 Oct 2003 04:49:48 -0700 From: "David S. Miller" To: Casey Carter Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Make SO_BINDTODEVICE bind very tightly Message-Id: <20031008044948.4e3bdf3c.davem@redhat.com> In-Reply-To: <3F833B39.4020606@Carter.net> References: <3F833B39.4020606@Carter.net> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 634 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 On Tue, 07 Oct 2003 17:16:25 -0500 Casey Carter wrote: > In the presence of both sockets that are and sockets that are not bound > to a specific interface, those bound to the interface should always be > favored for packet delivery over those not so bound. No, the fix made in the original posting of this thread is the correct one. One may not have some sockets with SO_BINDTODEVICE and some with not bound at the same time to the same identity. Therefore the fix should be a bind() time. From davem@pizda.ninka.net Wed Oct 8 05:12:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 05:13:14 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98CCb25031683 for ; Wed, 8 Oct 2003 05:12:37 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id FAA08068; Wed, 8 Oct 2003 05:07:20 -0700 Date: Wed, 8 Oct 2003 05:07:20 -0700 From: "David S. Miller" To: Robert Olsson Cc: scott.feldman@intel.com, Robert.Olsson@data.slu.se, jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: e1000 close (NAPI) Message-Id: <20031008050720.7d65bd88.davem@redhat.com> In-Reply-To: <16259.54738.75122.134408@robur.slu.se> References: <16259.54738.75122.134408@robur.slu.se> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 635 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 On Wed, 8 Oct 2003 11:16:02 +0200 Robert Olsson wrote: > Feldman, Scott writes: > > > - if(work_done < work_to_do) { > > > + if(work_done < work_to_do || !netif_running(netdev)) { > > > netif_rx_complete(netdev); > > > e1000_irq_enable(adapter); > > > } > > > > Is e1000 unique in this regard, or do the other NAPI-enabled drivers > > have the same issue? > > Other drivers may have the same issue. This was spotted while stress-testing > tulip. Patch was sent here some days ago. It's only seen if trying to close > device under extreme loads. See the syncing code in dev_close() > > You may try the e100 as well. We update the docs when see that this is OK. We should just fix all the NAPI drivers in this regard at one time. Undoubtedly tg3 needs this change too. From toby@cbcg.net Wed Oct 8 05:44:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 05:45:16 -0700 (PDT) Received: from hoggle.dreamhost.com (postfix@hoggle.dreamhost.com [66.33.197.5]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Cib25032710 for ; Wed, 8 Oct 2003 05:44:37 -0700 Received: from 6-allhosts (209-71-0-86.lata228-vz-1.voicenet.com [209.71.0.86]) by hoggle.dreamhost.com (Postfix) with ESMTP id 8746F53831; Wed, 8 Oct 2003 05:44:34 -0700 (PDT) Subject: [PATCH] kfree_skb() bug in 2.4.22 From: Tobias DiPasquale To: netdev@oss.sgi.com Cc: linux-net@vger.kernel.org, linux-kernel@vger.kernel.org, coreteam@netfilter.org, netfilter@lists.netfilter.org, akpm@zip.com.au, jgarzik@pobox.com, davem@redhat.com, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@intercode.com.au, yoshfuji@linux-ipv6.org Content-Type: text/plain Message-Id: <1065617075.1514.29.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 08 Oct 2003 08:44:35 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 636 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: toby@cbcg.net Precedence: bulk X-list: netdev Hi all, I was debugging one of my iptables/netfilter modules yesterday and I came across this bug in kfree_skb(). One of my functions returns a struct skbuff * on success and NULL on failure. When it failed, the code calling said function attempted to free the struct skbuff *, which at that point was NULL. This produced a kernel panic. I investigated the problem and found that, not only should I be checking for a NULL pointer when freeing the struct skbuff *, but the actual cause of the panic was because kfree_skb() and kfree_skb_fast() do not check for skb==NULL, either. They immediately attempt to dereference the users field of the struct skbuff * in order to decrement that reference counter. I have come up with a patch that applies to both the 2.4.22 pristine source tree and the 2.4.23-pre6 source tree that solves this issue (see below). I tried to follow Documentation/SubmittingPatches to the letter; please let me know if I failed this in some way. Thanks :) P.S. I wasn't sure who exactly maintains this particular code; that's why I just sent it to everyone listed in MAINTAINERS remotely associated with include/linux/skbuff.h ;) --- include/linux/skbuff.h.orig 2003-10-08 07:52:31.000000000 -0400 +++ include/linux/skbuff.h 2003-10-08 07:52:52.000000000 -0400 @@ -293,6 +293,8 @@ static inline void kfree_skb(struct sk_buff *skb) { + if (!skb) + return; if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users)) __kfree_skb(skb); } @@ -300,6 +302,8 @@ /* Use this if you didn't touch the skb state [for fast switching] */ static inline void kfree_skb_fast(struct sk_buff *skb) { + if (!skb) + return; if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users)) kfree_skbmem(skb); } From chas@cmf.nrl.navy.mil Wed Oct 8 05:46:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 05:47:04 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98CkU25000476 for ; Wed, 8 Oct 2003 05:46:30 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h98CkPkT028970 for ; Wed, 8 Oct 2003 08:46:25 -0400 (EDT) Message-Id: <200310081246.h98CkPkT028970@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Subject: [RFC][0/2] remove atm_find_ci(); convert vcc_sklist to hash Reply-To: chas3@users.sourceforge.net Date: Wed, 08 Oct 2003 08:46:26 -0400 From: chas williams X-Spam-Score: (**) hits=2.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 637 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev the following two patches (which should be applied to a current 2.6 tree) obseletes atm_find_ci() which races the vpi/vci allocation (since the actual allocation is delayed until after the entering the drivers open() routine). all drivers now use the built-in find_ci(). to address performance issues the second patch converts the vcc_sklist to a hash based on the lower 5 bits in the vci. should this be tunable via config? for most users (< 100 vccs) this should be fairly efficient. on a side note, signalling/ilmi/control vccs are all in bucket 0. the control vccs probably should be given a non-zero vci to make this 'better'. From chas@cmf.nrl.navy.mil Wed Oct 8 05:47:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 05:47:38 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Cl525000616 for ; Wed, 8 Oct 2003 05:47:05 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h98CkvkT028983 for ; Wed, 8 Oct 2003 08:46:57 -0400 (EDT) Message-Id: <200310081246.h98CkvkT028983@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Subject: [RFC][1/2] remove atm_find_ci(); convert vcc_sklist to hash Reply-To: chas3@users.sourceforge.net Date: Wed, 08 Oct 2003 08:46:58 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 638 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1435 -> 1.1436 # drivers/atm/he.c 1.28 -> 1.29 # drivers/atm/eni.c 1.29 -> 1.30 # net/atm/proc.c 1.34 -> 1.35 # drivers/atm/atmtcp.c 1.25 -> 1.26 # net/atm/signaling.c 1.24 -> 1.25 # include/linux/atmdev.h 1.37 -> 1.38 # drivers/atm/fore200e.c 1.26 -> 1.27 # net/atm/common.c 1.59 -> 1.60 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/08 chas@relax.cmf.nrl.navy.mil 1.1436 # [ATM]: convert vcc list to hash # -------------------------------------------- # diff -Nru a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c --- a/drivers/atm/atmtcp.c Wed Oct 8 08:29:48 2003 +++ b/drivers/atm/atmtcp.c Wed Oct 8 08:29:48 2003 @@ -158,6 +158,7 @@ struct atm_vcc *vcc; struct hlist_node *node; struct sock *s; + int i; if (cmd != ATM_SETCIRANGE) return -ENOIOCTLCMD; if (copy_from_user(&ci,(void *) arg,sizeof(ci))) return -EFAULT; @@ -166,14 +167,18 @@ if (ci.vpi_bits > MAX_VPI_BITS || ci.vpi_bits < 0 || ci.vci_bits > MAX_VCI_BITS || ci.vci_bits < 0) return -EINVAL; read_lock(&vcc_sklist_lock); - sk_for_each(s, node, &vcc_sklist) { - vcc = atm_sk(s); - if (vcc->dev != dev) - continue; - if ((vcc->vpi >> ci.vpi_bits) || - (vcc->vci >> ci.vci_bits)) { - read_unlock(&vcc_sklist_lock); - return -EBUSY; + for(i = 0; i < VCC_HTABLE_SIZE; ++i) { + struct hlist_head *head = &vcc_hash[i]; + + sk_for_each(s, node, head) { + vcc = atm_sk(s); + if (vcc->dev != dev) + continue; + if ((vcc->vpi >> ci.vpi_bits) || + (vcc->vci >> ci.vci_bits)) { + read_unlock(&vcc_sklist_lock); + return -EBUSY; + } } } read_unlock(&vcc_sklist_lock); @@ -244,6 +249,7 @@ struct sock *s; struct hlist_node *node; struct atm_vcc *walk; + int i; atmtcp_dev = (struct atm_dev *) vcc->dev_data; dev_data = PRIV(atmtcp_dev); @@ -254,11 +260,15 @@ shutdown_atm_dev(atmtcp_dev); vcc->dev_data = NULL; read_lock(&vcc_sklist_lock); - sk_for_each(s, node, &vcc_sklist) { - walk = atm_sk(s); - if (walk->dev != atmtcp_dev) - continue; - wake_up(walk->sk->sk_sleep); + for(i = 0; i < VCC_HTABLE_SIZE; ++i) { + struct hlist_head *head = &vcc_hash[i]; + + sk_for_each(s, node, head) { + walk = atm_sk(s); + if (walk->dev != atmtcp_dev) + continue; + wake_up(walk->sk->sk_sleep); + } } read_unlock(&vcc_sklist_lock); } @@ -272,7 +282,7 @@ struct hlist_node *node; struct atm_vcc *out_vcc = NULL; struct sk_buff *new_skb; - int result = 0; + int i, result = 0; if (!skb->len) return 0; dev = vcc->dev_data; @@ -283,14 +293,18 @@ goto done; } read_lock(&vcc_sklist_lock); - sk_for_each(s, node, &vcc_sklist) { - out_vcc = atm_sk(s); - if (out_vcc->dev != dev) - continue; - if (out_vcc->vpi == ntohs(hdr->vpi) && - out_vcc->vci == ntohs(hdr->vci) && - out_vcc->qos.rxtp.traffic_class != ATM_NONE) - break; + for(i = 0; i < VCC_HTABLE_SIZE; ++i) { + struct hlist_head *head = &vcc_hash[i]; + + sk_for_each(s, node, head) { + out_vcc = atm_sk(s); + if (out_vcc->dev != dev) + continue; + if (out_vcc->vpi == ntohs(hdr->vpi) && + out_vcc->vci == ntohs(hdr->vci) && + out_vcc->qos.rxtp.traffic_class != ATM_NONE) + break; + } } read_unlock(&vcc_sklist_lock); if (!out_vcc) { diff -Nru a/drivers/atm/eni.c b/drivers/atm/eni.c --- a/drivers/atm/eni.c Wed Oct 8 08:29:48 2003 +++ b/drivers/atm/eni.c Wed Oct 8 08:29:48 2003 @@ -2147,30 +2147,34 @@ skb_queue_len(&tx->backlog)); } read_lock(&vcc_sklist_lock); - sk_for_each(s, node, &vcc_sklist) { - struct eni_vcc *eni_vcc; - int length; + for(i = 0; i < VCC_HTABLE_SIZE; ++i) { + struct hlist_head *head = &vcc_hash[i]; - vcc = atm_sk(s); - if (vcc->dev != dev) - continue; - eni_vcc = ENI_VCC(vcc); - if (--left) continue; - length = sprintf(page,"vcc %4d: ",vcc->vci); - if (eni_vcc->rx) { - length += sprintf(page+length,"0x%06lx-0x%06lx " - "(%6ld bytes)", - eni_vcc->recv-eni_dev->ram, - eni_vcc->recv-eni_dev->ram+eni_vcc->words*4-1, - eni_vcc->words*4); - if (eni_vcc->tx) length += sprintf(page+length,", "); + sk_for_each(s, node, head) { + struct eni_vcc *eni_vcc; + int length; + + vcc = atm_sk(s); + if (vcc->dev != dev) + continue; + eni_vcc = ENI_VCC(vcc); + if (--left) continue; + length = sprintf(page,"vcc %4d: ",vcc->vci); + if (eni_vcc->rx) { + length += sprintf(page+length,"0x%06lx-0x%06lx " + "(%6ld bytes)", + eni_vcc->recv-eni_dev->ram, + eni_vcc->recv-eni_dev->ram+eni_vcc->words*4-1, + eni_vcc->words*4); + if (eni_vcc->tx) length += sprintf(page+length,", "); + } + if (eni_vcc->tx) + length += sprintf(page+length,"tx[%d], txing %d bytes", + eni_vcc->tx->index,eni_vcc->txing); + page[length] = '\n'; + read_unlock(&vcc_sklist_lock); + return length+1; } - if (eni_vcc->tx) - length += sprintf(page+length,"tx[%d], txing %d bytes", - eni_vcc->tx->index,eni_vcc->txing); - page[length] = '\n'; - read_unlock(&vcc_sklist_lock); - return length+1; } read_unlock(&vcc_sklist_lock); for (i = 0; i < eni_dev->free_len; i++) { diff -Nru a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c --- a/drivers/atm/fore200e.c Wed Oct 8 08:29:48 2003 +++ b/drivers/atm/fore200e.c Wed Oct 8 08:29:48 2003 @@ -1071,14 +1071,16 @@ struct sock *s; struct atm_vcc* vcc; struct hlist_node *node; + int i; read_lock(&vcc_sklist_lock); - sk_for_each(s, node, &vcc_sklist) { + + sk_for_each(s, node, &vcc_hash[rpd->atm_header.vci & (VCC_HTABLE_SIZE-1)]) { vcc = atm_sk(s); if (vcc->dev != fore200e->atm_dev) - continue; + continue; if (vcc->vpi == rpd->atm_header.vpi && vcc->vci == rpd->atm_header.vci) { - read_unlock(&vcc_sklist_lock); + read_unlock(&vcc_sklist_lock); return vcc; } } @@ -2606,7 +2608,7 @@ struct sock *s; struct hlist_node *node; struct fore200e* fore200e = FORE200E_DEV(dev); - int len, left = *pos; + int i, len, left = *pos; if (!left--) { @@ -2852,15 +2854,18 @@ " VCCs:\n address\tVPI.VCI:AAL\t(min/max tx PDU size) (min/max rx PDU size)\n"); read_lock(&vcc_sklist_lock); - sk_for_each(s, node, &vcc_sklist) { - vcc = atm_sk(s); + for(i = 0; i < VCC_HTABLE_SIZE; ++i) { + struct hlist_head *head = &vcc_hash[i]; - if (vcc->dev != fore200e->atm_dev) + sk_for_each(s, node, head) { + vcc = atm_sk(s); + + if (vcc->dev != fore200e->atm_dev) continue; - fore200e_vcc = FORE200E_VCC(vcc); + fore200e_vcc = FORE200E_VCC(vcc); - len += sprintf(page + len, + len += sprintf(page + len, " %x\t%d.%d:%d\t\t(%d/%d)\t(%d/%d)\n", (u32)(unsigned long)vcc, vcc->vpi, vcc->vci, fore200e_atm2fore_aal(vcc->qos.aal), @@ -2869,6 +2874,7 @@ fore200e_vcc->rx_min_pdu > 0xFFFF ? 0 : fore200e_vcc->rx_min_pdu, fore200e_vcc->rx_max_pdu ); + } } read_unlock(&vcc_sklist_lock); diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c Wed Oct 8 08:29:48 2003 +++ b/drivers/atm/he.c Wed Oct 8 08:29:48 2003 @@ -328,6 +328,7 @@ static __inline__ struct atm_vcc* __find_vcc(struct he_dev *he_dev, unsigned cid) { + struct hlist_head *head; struct atm_vcc *vcc; struct hlist_node *node; struct sock *s; @@ -336,8 +337,9 @@ vpi = cid >> he_dev->vcibits; vci = cid & ((1 << he_dev->vcibits) - 1); + head = &vcc_hash[vci & (VCC_HTABLE_SIZE -1)]; - sk_for_each(s, node, &vcc_sklist) { + sk_for_each(s, node, head) { vcc = atm_sk(s); if (vcc->dev == he_dev->atm_dev && vcc->vci == vci && vcc->vpi == vpi && diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h Wed Oct 8 08:29:48 2003 +++ b/include/linux/atmdev.h Wed Oct 8 08:29:48 2003 @@ -380,7 +380,9 @@ unsigned long atm_options; /* ATM layer options */ }; -extern struct hlist_head vcc_sklist; +#define VCC_HTABLE_SIZE 32 + +extern struct hlist_head vcc_hash[VCC_HTABLE_SIZE]; extern rwlock_t vcc_sklist_lock; #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Wed Oct 8 08:29:48 2003 +++ b/net/atm/common.c Wed Oct 8 08:29:48 2003 @@ -38,13 +38,16 @@ #define DPRINTK(format,args...) #endif - -HLIST_HEAD(vcc_sklist); +struct hlist_head vcc_hash[VCC_HTABLE_SIZE]; rwlock_t vcc_sklist_lock = RW_LOCK_UNLOCKED; void __vcc_insert_socket(struct sock *sk) { - sk_add_node(sk, &vcc_sklist); + struct atm_vcc *vcc = atm_sk(sk); + struct hlist_head *head = &vcc_hash[vcc->vci & + (VCC_HTABLE_SIZE - 1)]; + sk->sk_hashent = vcc->vci & (VCC_HTABLE_SIZE - 1); + sk_add_node(sk, head); } void vcc_insert_socket(struct sock *sk) @@ -80,7 +83,7 @@ } -EXPORT_SYMBOL(vcc_sklist); +EXPORT_SYMBOL(vcc_hash); EXPORT_SYMBOL(vcc_sklist_lock); EXPORT_SYMBOL(vcc_insert_socket); EXPORT_SYMBOL(vcc_remove_socket); @@ -250,11 +253,13 @@ static int check_ci(struct atm_vcc *vcc, short vpi, int vci) { + struct hlist_head *head = &vcc_hash[vci & + (VCC_HTABLE_SIZE - 1)]; struct hlist_node *node; struct sock *s; struct atm_vcc *walk; - sk_for_each(s, node, &vcc_sklist) { + sk_for_each(s, node, head) { walk = atm_sk(s); if (walk->dev != vcc->dev) continue; diff -Nru a/net/atm/proc.c b/net/atm/proc.c --- a/net/atm/proc.c Wed Oct 8 08:29:48 2003 +++ b/net/atm/proc.c Wed Oct 8 08:29:48 2003 @@ -64,6 +64,7 @@ } struct vcc_state { + int bucket; struct sock *sk; int family; }; @@ -75,19 +76,30 @@ return !family || (vcc->sk->sk_family == family); } -static int __vcc_walk(struct sock **sock, int family, loff_t l) +static int __vcc_walk(struct sock **sock, int family, int *bucket, loff_t l) { struct sock *sk = *sock; if (sk == (void *)1) { - sk = hlist_empty(&vcc_sklist) ? NULL : __sk_head(&vcc_sklist); + for (*bucket = 0; *bucket < VCC_HTABLE_SIZE; ++*bucket) { + struct hlist_head *head = &vcc_hash[*bucket]; + + sk = hlist_empty(head) ? NULL : __sk_head(head); + if (sk) + break; + } l--; } +try_again: for (; sk; sk = sk_next(sk)) { l -= compare_family(sk, family); if (l < 0) goto out; } + if (!sk && ++*bucket < VCC_HTABLE_SIZE) { + sk = sk_head(&vcc_hash[*bucket]); + goto try_again; + } sk = (void *)1; out: *sock = sk; @@ -96,7 +108,7 @@ static inline void *vcc_walk(struct vcc_state *state, loff_t l) { - return __vcc_walk(&state->sk, state->family, l) ? + return __vcc_walk(&state->sk, state->family, &state->bucket, l) ? state : NULL; } @@ -207,9 +219,10 @@ default: seq_printf(seq, "%3d", vcc->sk->sk_family); } - seq_printf(seq, " %04lx %5d %7d/%7d %7d/%7d\n", vcc->flags, vcc->sk->sk_err, + seq_printf(seq, " %04lx %5d %7d/%7d %7d/%7d [%d] 0x%x\n", vcc->flags, vcc->sk->sk_err, atomic_read(&vcc->sk->sk_wmem_alloc),vcc->sk->sk_sndbuf, - atomic_read(&vcc->sk->sk_rmem_alloc),vcc->sk->sk_rcvbuf); + atomic_read(&vcc->sk->sk_rmem_alloc),vcc->sk->sk_rcvbuf, + atomic_read(&vcc->sk->sk_refcnt), vcc->sk->sk_hashent); } static void svc_info(struct seq_file *seq, struct atm_vcc *vcc) diff -Nru a/net/atm/signaling.c b/net/atm/signaling.c --- a/net/atm/signaling.c Wed Oct 8 08:29:48 2003 +++ b/net/atm/signaling.c Wed Oct 8 08:29:48 2003 @@ -216,6 +216,7 @@ { struct hlist_node *node; struct sock *s; + int i; DPRINTK("sigd_close\n"); sigd = NULL; @@ -224,11 +225,15 @@ skb_queue_purge(&vcc->sk->sk_receive_queue); read_lock(&vcc_sklist_lock); - sk_for_each(s, node, &vcc_sklist) { - struct atm_vcc *vcc = atm_sk(s); + for(i = 0; i < VCC_HTABLE_SIZE; ++i) { + struct hlist_head *head = &vcc_hash[i]; - if (vcc->dev) - purge_vcc(vcc); + sk_for_each(s, node, head) { + struct atm_vcc *vcc = atm_sk(s); + + if (vcc->dev) + purge_vcc(vcc); + } } read_unlock(&vcc_sklist_lock); } From chas@cmf.nrl.navy.mil Wed Oct 8 05:50:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 05:51:01 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98CoR25001374 for ; Wed, 8 Oct 2003 05:50:28 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h98CoHkT029036 for ; Wed, 8 Oct 2003 08:50:17 -0400 (EDT) Message-Id: <200310081250.h98CoHkT029036@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Subject: [RFC][2/2] remove atm_find_ci(); convert vcc_sklist to hash Reply-To: chas3@users.sourceforge.net Date: Wed, 08 Oct 2003 08:50:18 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 639 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev [please note i got parts 1 and 2 out of order just like me] # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1434 -> 1.1435 # drivers/atm/horizon.c 1.17 -> 1.18 # drivers/atm/ambassador.c 1.19 -> 1.20 # drivers/atm/firestream.c 1.28 -> 1.29 # drivers/atm/he.c 1.27 -> 1.28 # drivers/atm/nicstar.c 1.22 -> 1.23 # net/atm/atm_misc.c 1.14 -> 1.15 # drivers/atm/eni.c 1.28 -> 1.29 # drivers/atm/zatm.c 1.23 -> 1.24 # drivers/atm/lanai.c 1.30 -> 1.31 # drivers/atm/idt77252.c 1.28 -> 1.29 # drivers/atm/atmtcp.c 1.24 -> 1.25 # include/linux/atmdev.h 1.36 -> 1.37 # drivers/atm/iphase.c 1.30 -> 1.31 # drivers/atm/fore200e.c 1.25 -> 1.26 # drivers/usb/misc/speedtch.c 1.97 -> 1.98 # net/atm/common.c 1.58 -> 1.59 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/07 chas@relax.cmf.nrl.navy.mil 1.1435 # [ATM]: eliminate atm_find_ci() # -------------------------------------------- # diff -Nru a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c --- a/drivers/atm/ambassador.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/ambassador.c Wed Oct 8 08:48:46 2003 @@ -1064,7 +1064,8 @@ /********** Open a VC **********/ -static int amb_open (struct atm_vcc * atm_vcc, short vpi, int vci) { +static int amb_open (struct atm_vcc * atm_vcc) +{ int error; struct atm_qos * qos; @@ -1077,6 +1078,8 @@ amb_dev * dev = AMB_DEV(atm_vcc->dev); amb_vcc * vcc; unsigned char pool = -1; // hush gcc + short vpi = atm_vcc->vpi; + int vci = atm_vcc->vci; PRINTD (DBG_FLOW|DBG_VCC, "amb_open %x %x", vpi, vci); @@ -1088,14 +1091,6 @@ } #endif - // deal with possibly wildcarded VCs - error = atm_find_ci (atm_vcc, &vpi, &vci); - if (error) { - PRINTD (DBG_WARN|DBG_VCC, "atm_find_ci failed!"); - return error; - } - PRINTD (DBG_VCC, "atm_find_ci gives %x %x", vpi, vci); - if (!(0 <= vpi && vpi < (1<rxer[vci] = atm_vcc; up (&dev->vcc_sf); } - - // set elements of vcc - atm_vcc->vpi = vpi; // 0 - atm_vcc->vci = vci; // indicate readiness set_bit(ATM_VF_READY,&atm_vcc->flags); diff -Nru a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c --- a/drivers/atm/atmtcp.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/atmtcp.c Wed Oct 8 08:48:46 2003 @@ -115,10 +115,12 @@ } -static int atmtcp_v_open(struct atm_vcc *vcc,short vpi,int vci) +static int atmtcp_v_open(struct atm_vcc *vcc) { struct atmtcp_control msg; int error; + short vpi = vcc->vpi; + int vci = vcc->vci; memset(&msg,0,sizeof(msg)); msg.addr.sap_family = AF_ATMPVC; @@ -126,8 +128,6 @@ msg.addr.sap_addr.vpi = vpi; msg.hdr.vci = htons(vci); msg.addr.sap_addr.vci = vci; - error = atm_find_ci(vcc,&msg.addr.sap_addr.vpi,&msg.addr.sap_addr.vci); - if (error) return error; if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC) return 0; msg.type = ATMTCP_CTRL_OPEN; msg.qos = vcc->qos; diff -Nru a/drivers/atm/eni.c b/drivers/atm/eni.c --- a/drivers/atm/eni.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/eni.c Wed Oct 8 08:48:46 2003 @@ -1881,80 +1881,18 @@ } -static int get_ci(struct atm_vcc *vcc,short *vpi,int *vci) -{ - struct sock *s; - struct hlist_node *node; - struct atm_vcc *walk; - - read_lock(&vcc_sklist_lock); - if (*vpi == ATM_VPI_ANY) *vpi = 0; - if (*vci == ATM_VCI_ANY) { - for (*vci = ATM_NOT_RSV_VCI; *vci < NR_VCI; (*vci)++) { - if (vcc->qos.rxtp.traffic_class != ATM_NONE && - ENI_DEV(vcc->dev)->rx_map[*vci]) - continue; - if (vcc->qos.txtp.traffic_class != ATM_NONE) { - sk_for_each(s, node, &vcc_sklist) { - walk = atm_sk(s); - if (walk->dev != vcc->dev) - continue; - if (test_bit(ATM_VF_ADDR,&walk->flags) - && walk->vci == *vci && - walk->qos.txtp.traffic_class != - ATM_NONE) - break; - } - if (node) - continue; - } - break; - } - read_unlock(&vcc_sklist_lock); - return *vci == NR_VCI ? -EADDRINUSE : 0; - } - if (*vci == ATM_VCI_UNSPEC) { - read_unlock(&vcc_sklist_lock); - return 0; - } - if (vcc->qos.rxtp.traffic_class != ATM_NONE && - ENI_DEV(vcc->dev)->rx_map[*vci]) { - read_unlock(&vcc_sklist_lock); - return -EADDRINUSE; - } - if (vcc->qos.txtp.traffic_class == ATM_NONE) { - read_unlock(&vcc_sklist_lock); - return 0; - } - sk_for_each(s, node, &vcc_sklist) { - walk = atm_sk(s); - if (walk->dev != vcc->dev) - continue; - if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vci == *vci && - walk->qos.txtp.traffic_class != ATM_NONE) { - read_unlock(&vcc_sklist_lock); - return -EADDRINUSE; - } - } - read_unlock(&vcc_sklist_lock); - return 0; -} - - -static int eni_open(struct atm_vcc *vcc,short vpi,int vci) +static int eni_open(struct atm_vcc *vcc) { struct eni_dev *eni_dev; struct eni_vcc *eni_vcc; int error; + short vpi = vcc->vpi; + int vci = vcc->vci; DPRINTK(">eni_open\n"); EVENT("eni_open\n",0,0); if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) ENI_VCC(vcc) = NULL; eni_dev = ENI_DEV(vcc->dev); - error = get_ci(vcc,&vpi,&vci); - if (error) return error; - vcc->vpi = vpi; - vcc->vci = vci; if (vci != ATM_VPI_UNSPEC && vpi != ATM_VCI_UNSPEC) set_bit(ATM_VF_ADDR,&vcc->flags); if (vcc->qos.aal != ATM_AAL0 && vcc->qos.aal != ATM_AAL5) diff -Nru a/drivers/atm/firestream.c b/drivers/atm/firestream.c --- a/drivers/atm/firestream.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/firestream.c Wed Oct 8 08:48:46 2003 @@ -854,7 +854,7 @@ #define DO_DIRECTION(tp) ((tp)->traffic_class != ATM_NONE) -static int fs_open(struct atm_vcc *atm_vcc, short vpi, int vci) +static int fs_open(struct atm_vcc *atm_vcc) { struct fs_dev *dev; struct fs_vcc *vcc; @@ -867,6 +867,8 @@ int bfp; int to; unsigned short tmc0; + short vpi = atm_vcc->vpi; + int vci = atm_vcc->vci; func_enter (); @@ -874,14 +876,6 @@ fs_dprintk (FS_DEBUG_OPEN, "fs: open on dev: %p, vcc at %p\n", dev, atm_vcc); - error = atm_find_ci(atm_vcc, &vpi, &vci); - if (error) { - fs_dprintk (FS_DEBUG_OPEN, "fs: find_ci failed.\n"); - return error; - } - - atm_vcc->vpi = vpi; - atm_vcc->vci = vci; if (vci != ATM_VPI_UNSPEC && vpi != ATM_VCI_UNSPEC) set_bit(ATM_VF_ADDR, &atm_vcc->flags); diff -Nru a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c --- a/drivers/atm/fore200e.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/fore200e.c Wed Oct 8 08:48:46 2003 @@ -1351,56 +1351,6 @@ } -static int -fore200e_walk_vccs(struct atm_vcc *vcc, short *vpi, int *vci) -{ - struct atm_vcc* walk; - struct sock *s; - struct hlist_node *node; - - /* find a free VPI */ - - read_lock(&vcc_sklist_lock); - - if (*vpi == ATM_VPI_ANY) { - - *vpi = 0; -restart_vpi_search: - sk_for_each(s, node, &vcc_sklist) { - walk = atm_sk(s); - if (walk->dev != vcc->dev) - continue; - - if ((walk->vci == *vci) && (walk->vpi == *vpi)) { - (*vpi)++; - goto restart_vpi_search; - } - } - } - - /* find a free VCI */ - if (*vci == ATM_VCI_ANY) { - - *vci = ATM_NOT_RSV_VCI; -restart_vci_search: - sk_for_each(s, node, &vcc_sklist) { - walk = atm_sk(s); - if (walk->dev != vcc->dev) - continue; - - if ((walk->vpi = *vpi) && (walk->vci == *vci)) { - *vci = walk->vci + 1; - goto restart_vci_search; - } - } - } - - read_unlock(&vcc_sklist_lock); - - return 0; -} - - #define FORE200E_MAX_BACK2BACK_CELLS 255 /* XXX depends on CDVT */ static void @@ -1420,17 +1370,13 @@ static int -fore200e_open(struct atm_vcc *vcc, short vpi, int vci) +fore200e_open(struct atm_vcc *vcc) { struct fore200e* fore200e = FORE200E_DEV(vcc->dev); struct fore200e_vcc* fore200e_vcc; + short vpi = vcc->vpi; + int vci = vcc->vci; - /* find a free VPI/VCI */ - fore200e_walk_vccs(vcc, &vpi, &vci); - - vcc->vpi = vpi; - vcc->vci = vci; - /* ressource checking only? */ if (vci == ATM_VCI_UNSPEC || vpi == ATM_VPI_UNSPEC) return 0; diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/he.c Wed Oct 8 08:48:46 2003 @@ -135,7 +135,7 @@ /* declarations */ -static int he_open(struct atm_vcc *vcc, short vpi, int vci); +static int he_open(struct atm_vcc *vcc); static void he_close(struct atm_vcc *vcc); static int he_send(struct atm_vcc *vcc, struct sk_buff *skb); static int he_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg); @@ -2342,23 +2342,18 @@ } static int -he_open(struct atm_vcc *vcc, short vpi, int vci) +he_open(struct atm_vcc *vcc) { unsigned long flags; struct he_dev *he_dev = HE_DEV(vcc->dev); struct he_vcc *he_vcc; int err = 0; unsigned cid, rsr0, rsr1, rsr4, tsr0, tsr0_aal, tsr4, period, reg, clock; + short vpi = vcc->vpi; + int vci = vcc->vci; - - if ((err = atm_find_ci(vcc, &vpi, &vci))) { - HPRINTK("atm_find_ci err = %d\n", err); - return err; - } if (vci == ATM_VCI_UNSPEC || vpi == ATM_VPI_UNSPEC) return 0; - vcc->vpi = vpi; - vcc->vci = vci; HPRINTK("open vcc %p %d.%d\n", vcc, vpi, vci); diff -Nru a/drivers/atm/horizon.c b/drivers/atm/horizon.c --- a/drivers/atm/horizon.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/horizon.c Wed Oct 8 08:48:46 2003 @@ -2174,7 +2174,8 @@ /********** open VC **********/ -static int hrz_open (struct atm_vcc * atm_vcc, short vpi, int vci) { +static int hrz_open (struct atm_vcc *atm_vcc) +{ int error; u16 channel; @@ -2185,6 +2186,8 @@ hrz_dev * dev = HRZ_DEV(atm_vcc->dev); hrz_vcc vcc; hrz_vcc * vccp; // allocated late + short vpi = atm_vcc->vpi; + int vci = atm_vcc->vci; PRINTD (DBG_FLOW|DBG_VCC, "hrz_open %x %x", vpi, vci); #ifdef ATM_VPI_UNSPEC @@ -2195,14 +2198,6 @@ } #endif - // deal with possibly wildcarded VCs - error = atm_find_ci (atm_vcc, &vpi, &vci); - if (error) { - PRINTD (DBG_WARN|DBG_VCC, "atm_find_ci failed!"); - return error; - } - PRINTD (DBG_VCC, "atm_find_ci gives %x %x", vpi, vci); - error = vpivci_to_channel (&channel, vpi, vci); if (error) { PRINTD (DBG_WARN|DBG_VCC, "VPI/VCI out of range: %hd/%d", vpi, vci); @@ -2557,8 +2552,6 @@ } // success, set elements of atm_vcc - atm_vcc->vpi = vpi; - atm_vcc->vci = vci; atm_vcc->dev_data = (void *) vccp; // indicate readiness diff -Nru a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c --- a/drivers/atm/idt77252.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/idt77252.c Wed Oct 8 08:48:46 2003 @@ -122,7 +122,7 @@ * ATM Interface. */ static void idt77252_dev_close(struct atm_dev *dev); -static int idt77252_open(struct atm_vcc *vcc, short vpi, int vci); +static int idt77252_open(struct atm_vcc *vcc); static void idt77252_close(struct atm_vcc *vcc); static int idt77252_send(struct atm_vcc *vcc, struct sk_buff *skb); static int idt77252_send_oam(struct atm_vcc *vcc, void *cell, @@ -2402,50 +2402,7 @@ } static int -idt77252_find_vcc(struct atm_vcc *vcc, short *vpi, int *vci) -{ - struct sock *s; - struct atm_vcc *walk; - - read_lock(&vcc_sklist_lock); - if (*vpi == ATM_VPI_ANY) { - *vpi = 0; - s = sk_head(&vcc_sklist); - while (s) { - walk = atm_sk(s); - if (walk->dev != vcc->dev) - continue; - if ((walk->vci == *vci) && (walk->vpi == *vpi)) { - (*vpi)++; - s = sk_head(&vcc_sklist); - continue; - } - s = sk_next(s); - } - } - - if (*vci == ATM_VCI_ANY) { - *vci = ATM_NOT_RSV_VCI; - s = sk_head(&vcc_sklist); - while (s) { - walk = atm_sk(s); - if (walk->dev != vcc->dev) - continue; - if ((walk->vci == *vci) && (walk->vpi == *vpi)) { - (*vci)++; - s = sk_head(&vcc_sklist); - continue; - } - s = sk_next(s); - } - } - - read_unlock(&vcc_sklist_lock); - return 0; -} - -static int -idt77252_open(struct atm_vcc *vcc, short vpi, int vci) +idt77252_open(struct atm_vcc *vcc) { struct atm_dev *dev = vcc->dev; struct idt77252_dev *card = dev->dev_data; @@ -2453,8 +2410,8 @@ unsigned int index; unsigned int inuse; int error; - - idt77252_find_vcc(vcc, &vpi, &vci); + int vci = vcc->vci; + short vpi = vcc->vpi; if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC) return 0; @@ -2469,8 +2426,6 @@ return -EINVAL; } - vcc->vpi = vpi; - vcc->vci = vci; set_bit(ATM_VF_ADDR, &vcc->flags); down(&card->mutex); diff -Nru a/drivers/atm/iphase.c b/drivers/atm/iphase.c --- a/drivers/atm/iphase.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/iphase.c Wed Oct 8 08:48:46 2003 @@ -2676,7 +2676,7 @@ return; } -static int ia_open(struct atm_vcc *vcc, short vpi, int vci) +static int ia_open(struct atm_vcc *vcc) { IADEV *iadev; struct ia_vcc *ia_vcc; @@ -2687,15 +2687,7 @@ INPH_IA_VCC(vcc) = NULL; } iadev = INPH_IA_DEV(vcc->dev); - error = atm_find_ci(vcc, &vpi, &vci); - if (error) - { - printk("iadev: atm_find_ci returned error %d\n", error); - return error; - } - vcc->vpi = vpi; - vcc->vci = vci; - if (vci != ATM_VPI_UNSPEC && vpi != ATM_VCI_UNSPEC) + if (vcc->vci != ATM_VPI_UNSPEC && vcc->vpi != ATM_VCI_UNSPEC) { IF_EVENT(printk("iphase open: unspec part\n");) set_bit(ATM_VF_ADDR,&vcc->flags); diff -Nru a/drivers/atm/lanai.c b/drivers/atm/lanai.c --- a/drivers/atm/lanai.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/lanai.c Wed Oct 8 08:48:46 2003 @@ -2350,11 +2350,13 @@ } /* open a vcc on the card to vpi/vci */ -static int lanai_open(struct atm_vcc *atmvcc, short vpi, int vci) +static int lanai_open(struct atm_vcc *atmvcc) { struct lanai_dev *lanai; struct lanai_vcc *lvcc; int result = 0; + int vci = atmvcc->vci; + short vpi = atmvcc->vpi; /* we don't support partial open - it's not really useful anyway */ if ((test_bit(ATM_VF_PARTIAL, &atmvcc->flags)) || (vpi == ATM_VPI_UNSPEC) || (vci == ATM_VCI_UNSPEC)) @@ -2363,8 +2365,6 @@ result = lanai_normalize_ci(lanai, atmvcc, &vpi, &vci); if (unlikely(result != 0)) goto out; - atmvcc->vpi = vpi; - atmvcc->vci = vci; set_bit(ATM_VF_ADDR, &atmvcc->flags); if (atmvcc->qos.aal != ATM_AAL0 && atmvcc->qos.aal != ATM_AAL5) return -EINVAL; diff -Nru a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c --- a/drivers/atm/nicstar.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/nicstar.c Wed Oct 8 08:48:46 2003 @@ -221,7 +221,7 @@ static void push_rxbufs(ns_dev *card, u32 type, u32 handle1, u32 addr1, u32 handle2, u32 addr2); static irqreturn_t ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs); -static int ns_open(struct atm_vcc *vcc, short vpi, int vci); +static int ns_open(struct atm_vcc *vcc); static void ns_close(struct atm_vcc *vcc); static void fill_tst(ns_dev *card, int n, vc_map *vc); static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb); @@ -1371,11 +1371,10 @@ -static int ns_open(struct atm_vcc *vcc, short vpi, int vci) +static int ns_open(struct atm_vcc *vcc) { ns_dev *card; vc_map *vc; - int error; unsigned long tmpl, modl; int tcr, tcra; /* target cell rate, and absolute value */ int n = 0; /* Number of entries in the TST. Initialized to remove @@ -1386,6 +1385,8 @@ tell which variables can truly be used uninitialized... */ int inuse; /* tx or rx vc already in use by another vcc */ + short vpi = vcc->vpi; + int vci = vcc->vci; card = (ns_dev *) vcc->dev->dev_data; PRINTK("nicstar%d: opening vpi.vci %d.%d \n", card->index, (int) vpi, vci); @@ -1395,14 +1396,7 @@ return -EINVAL; } - if ((error = atm_find_ci(vcc, &vpi, &vci))) - { - PRINTK("nicstar%d: error in atm_find_ci().\n", card->index); - return error; - } vc = &(card->vcmap[vpi << card->vcibits | vci]); - vcc->vpi = vpi; - vcc->vci = vci; vcc->dev_data = vc; inuse = 0; diff -Nru a/drivers/atm/zatm.c b/drivers/atm/zatm.c --- a/drivers/atm/zatm.c Wed Oct 8 08:48:46 2003 +++ b/drivers/atm/zatm.c Wed Oct 8 08:48:46 2003 @@ -1373,19 +1373,17 @@ } -static int zatm_open(struct atm_vcc *vcc,short vpi,int vci) +static int zatm_open(struct atm_vcc *vcc) { struct zatm_dev *zatm_dev; struct zatm_vcc *zatm_vcc; + short vpi = vcc->vpi; + int vci = vcc->vci; int error; DPRINTK(">zatm_open\n"); zatm_dev = ZATM_DEV(vcc->dev); if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) ZATM_VCC(vcc) = NULL; - error = atm_find_ci(vcc,&vpi,&vci); - if (error) return error; - vcc->vpi = vpi; - vcc->vci = vci; if (vci != ATM_VPI_UNSPEC && vpi != ATM_VCI_UNSPEC) set_bit(ATM_VF_ADDR,&vcc->flags); if (vcc->qos.aal != ATM_AAL5) return -EINVAL; /* @@@ AAL0 */ diff -Nru a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c --- a/drivers/usb/misc/speedtch.c Wed Oct 8 08:48:46 2003 +++ b/drivers/usb/misc/speedtch.c Wed Oct 8 08:48:46 2003 @@ -264,7 +264,7 @@ /* ATM */ static void udsl_atm_dev_close (struct atm_dev *dev); -static int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci); +static int udsl_atm_open (struct atm_vcc *vcc); static void udsl_atm_close (struct atm_vcc *vcc); static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void *arg); static int udsl_atm_send (struct atm_vcc *vcc, struct sk_buff *skb); @@ -867,10 +867,12 @@ return 0; } -static int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci) +static int udsl_atm_open (struct atm_vcc *vcc) { struct udsl_instance_data *instance = vcc->dev->dev_data; struct udsl_vcc_data *new; + int vci = vcc->vci; + short vpi = vcc->vpi; dbg ("udsl_atm_open: vpi %hd, vci %d", vpi, vci); @@ -879,9 +881,6 @@ return -ENODEV; } - if ((vpi == ATM_VPI_ANY) || (vci == ATM_VCI_ANY)) - return -EINVAL; - /* only support AAL5 */ if ((vcc->qos.aal != ATM_AAL5) || (vcc->qos.rxtp.max_sdu < 0) || (vcc->qos.rxtp.max_sdu > ATM_MAX_AAL5_PDU)) return -EINVAL; @@ -910,8 +909,6 @@ new->max_pdu = max (1, UDSL_NUM_CELLS (vcc->qos.rxtp.max_sdu)) * ATM_CELL_PAYLOAD; vcc->dev_data = new; - vcc->vpi = vpi; - vcc->vci = vci; tasklet_disable (&instance->receive_tasklet); list_add (&new->list, &instance->vcc_list); diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h Wed Oct 8 08:48:46 2003 +++ b/include/linux/atmdev.h Wed Oct 8 08:48:46 2003 @@ -351,7 +351,7 @@ struct atmdev_ops { /* only send is required */ void (*dev_close)(struct atm_dev *dev); - int (*open)(struct atm_vcc *vcc,short vpi,int vci); + int (*open)(struct atm_vcc *vcc); void (*close)(struct atm_vcc *vcc); int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void *arg); int (*getsockopt)(struct atm_vcc *vcc,int level,int optname, @@ -443,7 +443,6 @@ int atm_charge(struct atm_vcc *vcc,int truesize); struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, int gfp_flags); -int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci); int atm_pcr_goal(struct atm_trafprm *tp); void vcc_release_async(struct atm_vcc *vcc, int reply); diff -Nru a/net/atm/atm_misc.c b/net/atm/atm_misc.c --- a/net/atm/atm_misc.c Wed Oct 8 08:48:46 2003 +++ b/net/atm/atm_misc.c Wed Oct 8 08:48:46 2003 @@ -45,76 +45,6 @@ } -static int check_ci(struct atm_vcc *vcc,short vpi,int vci) -{ - struct hlist_node *node; - struct sock *s; - struct atm_vcc *walk; - - sk_for_each(s, node, &vcc_sklist) { - walk = atm_sk(s); - if (walk->dev != vcc->dev) - continue; - if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vpi == vpi && - walk->vci == vci && ((walk->qos.txtp.traffic_class != - ATM_NONE && vcc->qos.txtp.traffic_class != ATM_NONE) || - (walk->qos.rxtp.traffic_class != ATM_NONE && - vcc->qos.rxtp.traffic_class != ATM_NONE))) - return -EADDRINUSE; - } - /* allow VCCs with same VPI/VCI iff they don't collide on - TX/RX (but we may refuse such sharing for other reasons, - e.g. if protocol requires to have both channels) */ - return 0; -} - - -int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci) -{ - static short p; /* poor man's per-device cache */ - static int c; - short old_p; - int old_c; - int err; - - read_lock(&vcc_sklist_lock); - if (*vpi != ATM_VPI_ANY && *vci != ATM_VCI_ANY) { - err = check_ci(vcc,*vpi,*vci); - read_unlock(&vcc_sklist_lock); - return err; - } - /* last scan may have left values out of bounds for current device */ - if (*vpi != ATM_VPI_ANY) p = *vpi; - else if (p >= 1 << vcc->dev->ci_range.vpi_bits) p = 0; - if (*vci != ATM_VCI_ANY) c = *vci; - else if (c < ATM_NOT_RSV_VCI || c >= 1 << vcc->dev->ci_range.vci_bits) - c = ATM_NOT_RSV_VCI; - old_p = p; - old_c = c; - do { - if (!check_ci(vcc,p,c)) { - *vpi = p; - *vci = c; - read_unlock(&vcc_sklist_lock); - return 0; - } - if (*vci == ATM_VCI_ANY) { - c++; - if (c >= 1 << vcc->dev->ci_range.vci_bits) - c = ATM_NOT_RSV_VCI; - } - if ((c == ATM_NOT_RSV_VCI || *vci != ATM_VCI_ANY) && - *vpi == ATM_VPI_ANY) { - p++; - if (p >= 1 << vcc->dev->ci_range.vpi_bits) p = 0; - } - } - while (old_p != p || old_c != c); - read_unlock(&vcc_sklist_lock); - return -EADDRINUSE; -} - - /* * atm_pcr_goal returns the positive PCR if it should be rounded up, the * negative PCR if it should be rounded down, and zero if the maximum available @@ -170,7 +100,6 @@ EXPORT_SYMBOL(atm_charge); EXPORT_SYMBOL(atm_alloc_charge); -EXPORT_SYMBOL(atm_find_ci); EXPORT_SYMBOL(atm_pcr_goal); EXPORT_SYMBOL(sonet_copy_stats); EXPORT_SYMBOL(sonet_subtract_stats); diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Wed Oct 8 08:48:46 2003 +++ b/net/atm/common.c Wed Oct 8 08:48:46 2003 @@ -248,7 +248,78 @@ } -static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, int vpi, +static int check_ci(struct atm_vcc *vcc, short vpi, int vci) +{ + struct hlist_node *node; + struct sock *s; + struct atm_vcc *walk; + + sk_for_each(s, node, &vcc_sklist) { + walk = atm_sk(s); + if (walk->dev != vcc->dev) + continue; + if (test_bit(ATM_VF_ADDR, &walk->flags) && walk->vpi == vpi && + walk->vci == vci && ((walk->qos.txtp.traffic_class != + ATM_NONE && vcc->qos.txtp.traffic_class != ATM_NONE) || + (walk->qos.rxtp.traffic_class != ATM_NONE && + vcc->qos.rxtp.traffic_class != ATM_NONE))) + return -EADDRINUSE; + } + + /* allow VCCs with same VPI/VCI iff they don't collide on + TX/RX (but we may refuse such sharing for other reasons, + e.g. if protocol requires to have both channels) */ + + return 0; +} + + +static int find_ci(struct atm_vcc *vcc, short *vpi, int *vci) +{ + static short p; /* poor man's per-device cache */ + static int c; + short old_p; + int old_c; + int err; + + if (*vpi != ATM_VPI_ANY && *vci != ATM_VCI_ANY) { + err = check_ci(vcc, *vpi, *vci); + return err; + } + /* last scan may have left values out of bounds for current device */ + if (*vpi != ATM_VPI_ANY) + p = *vpi; + else if (p >= 1 << vcc->dev->ci_range.vpi_bits) + p = 0; + if (*vci != ATM_VCI_ANY) + c = *vci; + else if (c < ATM_NOT_RSV_VCI || c >= 1 << vcc->dev->ci_range.vci_bits) + c = ATM_NOT_RSV_VCI; + old_p = p; + old_c = c; + do { + if (!check_ci(vcc, p, c)) { + *vpi = p; + *vci = c; + return 0; + } + if (*vci == ATM_VCI_ANY) { + c++; + if (c >= 1 << vcc->dev->ci_range.vci_bits) + c = ATM_NOT_RSV_VCI; + } + if ((c == ATM_NOT_RSV_VCI || *vci != ATM_VCI_ANY) && + *vpi == ATM_VPI_ANY) { + p++; + if (p >= 1 << vcc->dev->ci_range.vpi_bits) p = 0; + } + } + while (old_p != p || old_c != c); + return -EADDRINUSE; +} + + +static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, short vpi, int vci) { int error; @@ -260,8 +331,18 @@ if (vci > 0 && vci < ATM_NOT_RSV_VCI && !capable(CAP_NET_BIND_SERVICE)) return -EPERM; error = 0; + if (!try_module_get(dev->ops->owner)) + return -ENODEV; vcc->dev = dev; - vcc_insert_socket(vcc->sk); + write_lock_irq(&vcc_sklist_lock); + if ((error = find_ci(vcc, &vpi, &vci))) { + write_unlock_irq(&vcc_sklist_lock); + goto fail_module_put; + } + vcc->vpi = vpi; + vcc->vci = vci; + __vcc_insert_socket(vcc->sk); + write_unlock_irq(&vcc_sklist_lock); switch (vcc->qos.aal) { case ATM_AAL0: error = atm_init_aal0(vcc); @@ -291,21 +372,17 @@ vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu); DPRINTK(" RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.traffic_class, vcc->qos.rxtp.min_pcr,vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu); - if (!try_module_get(dev->ops->owner)) { - error = -ENODEV; - goto fail; - } if (dev->ops->open) { - if ((error = dev->ops->open(vcc,vpi,vci))) - goto put_module_fail; + if ((error = dev->ops->open(vcc))) + goto fail; } return 0; -put_module_fail: - module_put(dev->ops->owner); fail: vcc_remove_socket(vcc->sk); +fail_module_put: + module_put(dev->ops->owner); /* ensure we get dev module ref count correct */ vcc->dev = NULL; return error; From ookhoi@humilis.net Wed Oct 8 06:13:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 06:13:58 -0700 (PDT) Received: from favonius.humilis.net (ookhoi.xs4all.nl [213.84.114.66]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98DDN25002205 for ; Wed, 8 Oct 2003 06:13:23 -0700 Received: by favonius.humilis.net (Postfix, from userid 1000) id 951D6B071C; Wed, 8 Oct 2003 15:13:20 +0200 (CEST) Date: Wed, 8 Oct 2003 15:13:20 +0200 From: ookhoi@humilis.net To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: why does netfilter make upload very slow? (was: Re: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction) Message-ID: <20031008131320.GD16964@favonius> Reply-To: ookhoi@humilis.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Uptime: 12:10:55 up 120 days, 12:12, 37 users, load average: 2.11, 2.02, 2.46 User-Agent: Mutt/1.5.4i X-archive-position: 640 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ookhoi@humilis.net Precedence: bulk X-list: netdev Ookhoi wrote (ao): # Ookhoi wrote (ao): # > Florian Zwoch wrote (ao): # > > issue seems to partly solved. the e1000 driver seems to be ok! # > > i reconfigured my kernel and intentionally left out netfilter options. # > > after that my network performance was back to normal. # > > # > > netfilter was only compiled in the kernel. it was not used with any rules! # > > # > > so my wild guess would be that something with the netfilter code (i am # > > not 100% sure it was netfilter.. _maybe_ it was some small odd kernel # > > option i accidently enabled/disabled) is broken since test3 (again # > > uncertified. but i firstly noticed this switching from test3 to test4). # # > I have netfilter enabled, and will try another -test6 kernel with # > netfilter not compiled in to see if that indeed makes a difference. # # I can confirm now that disabling netfilter in 2.6.0-test6 makes the nic # perform oke wrt upload. # I (just like Florian) had no iptables rules active in the former # 2.6.0-test6 kernel, but netfilter was compiled in. Would somebody like to explain why netfilter (in kernel, but not in use) makes upload go very slow? I am by no means a network guru, but eager to learn :-) From davem@pizda.ninka.net Wed Oct 8 06:58:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 06:58:39 -0700 (PDT) Received: from pizda.ninka.net (pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Dvf25003461 for ; Wed, 8 Oct 2003 06:57:54 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id GAA08349; Wed, 8 Oct 2003 06:47:35 -0700 Date: Wed, 8 Oct 2003 06:47:35 -0700 From: "David S. Miller" To: Jeff Garzik Cc: toby@cbcg.net, netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org, coreteam@netfilter.org, netfilter@lists.netfilter.org, akpm@zip.com.au, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@intercode.com.au, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] kfree_skb() bug in 2.4.22 Message-Id: <20031008064735.7373227b.davem@redhat.com> In-Reply-To: <3F840C9C.9050704@pobox.com> References: <1065617075.1514.29.camel@localhost> <3F840C9C.9050704@pobox.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 641 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 On Wed, 08 Oct 2003 09:09:48 -0400 Jeff Garzik wrote: > I would prefer that you fix your code instead, to not pass NULL to > kfree_skb()... Absolutely, there is no valid reason to pass NULL into these routines. From davem@pizda.ninka.net Wed Oct 8 07:05:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 07:05:35 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98E4e25003961 for ; Wed, 8 Oct 2003 07:04:50 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id GAA08390; Wed, 8 Oct 2003 06:58:44 -0700 Date: Wed, 8 Oct 2003 06:58:44 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFC][0/2] remove atm_find_ci(); convert vcc_sklist to hash Message-Id: <20031008065844.48fb53ae.davem@redhat.com> In-Reply-To: <200310081246.h98CkPkT028970@ginger.cmf.nrl.navy.mil> References: <200310081246.h98CkPkT028970@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 642 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 On Wed, 08 Oct 2003 08:46:26 -0400 chas williams wrote: > the following two patches (which should be applied to a current 2.6 tree) > obseletes atm_find_ci() which races the vpi/vci allocation (since the > actual allocation is delayed until after the entering the drivers open() > routine). all drivers now use the built-in find_ci(). to address > performance issues the second patch converts the vcc_sklist to a hash > based on the lower 5 bits in the vci. These changes look fine, I'll add them to my tree. > should this be tunable via config? I don't think so, at least not now. My advice is, keep it a constant for now and if people run into perf problems and the hash table size is determined to be the cause you can investigate how to choose different hash table sizes. This is exactly what we did with the TCP hashes. From toby@cbcg.net Wed Oct 8 07:11:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 07:12:22 -0700 (PDT) Received: from dydimus.dreamhost.com (postfix@dydimus.dreamhost.com [66.33.197.17]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98EBh25004470 for ; Wed, 8 Oct 2003 07:11:44 -0700 Received: from 6-allhosts (209-71-0-86.lata228-vz-1.voicenet.com [209.71.0.86]) by dydimus.dreamhost.com (Postfix) with ESMTP id 3713E4F892; Wed, 8 Oct 2003 07:11:39 -0700 (PDT) Subject: Re: [PATCH] kfree_skb() bug in 2.4.22 From: Tobias DiPasquale To: Jeff Garzik Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org, coreteam@netfilter.org, netfilter@lists.netfilter.org, akpm@zip.com.au, davem@redhat.com, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@intercode.com.au, yoshfuji@linux-ipv6.org In-Reply-To: <3F840C9C.9050704@pobox.com> References: <1065617075.1514.29.camel@localhost> <3F840C9C.9050704@pobox.com> Content-Type: text/plain Message-Id: <1065622303.1512.41.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 08 Oct 2003 10:11:43 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 643 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: toby@cbcg.net Precedence: bulk X-list: netdev On Wed, 2003-10-08 at 09:09, Jeff Garzik wrote: > Tobias DiPasquale wrote: > > Hi all, > > > > I was debugging one of my iptables/netfilter modules yesterday and I > > came across this bug in kfree_skb(). One of my functions returns a > > struct skbuff * on success and NULL on failure. When it failed, the code > > calling said function attempted to free the struct skbuff *, which at > > that point was NULL. This produced a kernel panic. I investigated the > > problem and found that, not only should I be checking for a NULL pointer > > when freeing the struct skbuff *, but the actual cause of the panic was > > because kfree_skb() and kfree_skb_fast() do not check for skb==NULL, > > either. They immediately attempt to dereference the users field of the > > struct skbuff * in order to decrement that reference counter. > > > I would prefer that you fix your code instead, to not pass NULL to > kfree_skb()... > Well, I certainly have done that already ;-) But I have checked kfree() and vfree() and they have a sanity check for NULL before processing, as well as those are also the well-known semantics for the userspace free() call. It seems to me (and I recognize that my understanding is limited) that it could do no harm and may even help in certain cases. Am I missing something in why it would be preferable _not_ to check for NULL in kfree_skb()? Is it a performance issue associated with the extra overhead of having to check for NULL on every kfree_skb[_fast]() call? And, if so, could we possibly document in the source code and/or kernel documentation in order to let less experienced programmers know that they should under no circumstances pass NULL into these functions? I certainly didn't know that, since I was working off of the semantics of the other kernel *free() functions. Help me understand my error in judgement. Thanks :) From davem@pizda.ninka.net Wed Oct 8 07:20:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 07:21:14 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98EKN25004991 for ; Wed, 8 Oct 2003 07:20:33 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA08454; Wed, 8 Oct 2003 07:11:59 -0700 Date: Wed, 8 Oct 2003 07:11:59 -0700 From: "David S. Miller" To: Tobias DiPasquale Cc: jgarzik@pobox.com, netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org, coreteam@netfilter.org, netfilter@lists.netfilter.org, akpm@zip.com.au, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@intercode.com.au, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] kfree_skb() bug in 2.4.22 Message-Id: <20031008071159.586c5d3c.davem@redhat.com> In-Reply-To: <1065622303.1512.41.camel@localhost> References: <1065617075.1514.29.camel@localhost> <3F840C9C.9050704@pobox.com> <1065622303.1512.41.camel@localhost> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 644 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 On Wed, 08 Oct 2003 10:11:43 -0400 Tobias DiPasquale wrote: > Well, I certainly have done that already ;-) But I have checked kfree() > and vfree() and they have a sanity check for NULL before processing, as > well as those are also the well-known semantics for the userspace free() > call. So what? Those are totally different APIs and they in no way determine how other interfaces should behave. Passing NULL pointers around usually indicates poorly designed software anyways (unless the NULL pointer is being returned by a routine to indicate an allocation failure). This isn't even worth discussing anymore. From Marc.Herbert@ens-lyon.fr Wed Oct 8 07:48:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 07:48:49 -0700 (PDT) Received: from mailhost.ens-lyon.fr (pluvier.ens-lyon.fr [140.77.167.5]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98EmF25005903 for ; Wed, 8 Oct 2003 07:48:16 -0700 Received: by mailhost.ens-lyon.fr with scanned-ok (Exim 3.35 #1 (Debian)) id 1A7Fbq-0006sk-00 for ; Wed, 08 Oct 2003 16:48:14 +0200 Received: from mailhost.ens-lyon.fr ([127.0.0.1]) by localhost (pluvier [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25217-03 for ; Wed, 8 Oct 2003 16:48:13 +0200 (CEST) Received: from bologna.cri2000.ens-lyon.fr ([140.77.13.93]) by mailhost.ens-lyon.fr with esmtp (Exim 3.35 #1 (Debian)) id 1A7Fbp-0006sS-00 for ; Wed, 08 Oct 2003 16:48:13 +0200 Date: Wed, 8 Oct 2003 16:48:13 +0200 (CEST) From: Marc.Herbert@ens-lyon.fr X-X-Sender: mherbert@bologna To: netdev@oss.sgi.com Subject: ethtool + tg3 v2.2 + set_pauseparam() = kernel 2.6-t6 segfault Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ens-lyon.fr Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by oss.sgi.com id h98EmF25005903 X-archive-position: 645 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Marc.Herbert@ens-lyon.fr Precedence: bulk X-list: netdev ethtool + tg3 v2.2 + set_pauseparam() = kernel 2.6-t6 segfault Please find below the log. Complete log (since boot) available on: http://marc.herbert.free.fr/linux/tg3_set_pauseparam_ethtool_segfault_kern.log Seems quite reproductible, whatever the ethtool -A options passed. (you'll forgive me for not trying every combination). First ethtool invocation segfaults, second call hangs forever. Still possible to login, even remotely, but most commands hang forever, and reboot also hangs. tg3 v1.9 (kernel 2.6-t3) was ok. Errr, at least did not crash, but not sure yet the flow control was working. 2.4 + bcm5700 + flow control works perfectly on same hardware (thanks to "modprobe bcm5700 tx_flow_control=X blabla") I am not subscribed to the list. Enjoy. Oct 7 10:55:08 cluster31 kernel: Linux version 2.6.0-test6 (mherbert@cluster31) (gcc version 2.95.4 20011002 (Debian prerelease)) #1 SMP Mon Oct 6 17:05:54 CEST 2003 Oct 7 10:56:47 cluster31 kernel: tg3.c:v2.2 (August 24, 2003) Oct 7 10:56:47 cluster31 kernel: eth1: Tigon3 [partno(none) rev 7100 PHY(5401)] (PCI:66MHz:64-bit) 10/100/1000BaseT Ethernet 00:b0:d0:f3:66:4e Oct 7 10:56:56 cluster31 kernel: tg3: eth1: Link is up at 1000 Mbps, full duplex. Oct 7 10:56:56 cluster31 kernel: tg3: eth1: Flow control is off for TX and off for RX. Oct 7 10:59:13 cluster31 kernel: tg3: eth1: Link is down. Oct 7 10:59:16 cluster31 kernel: tg3: eth1: Link is up at 1000 Mbps, full duplex. Oct 7 10:59:16 cluster31 kernel: tg3: eth1: Flow control is off for TX and off for RX. Oct 7 10:59:38 cluster31 kernel: tg3: eth1: Link is down. Oct 7 10:59:41 cluster31 kernel: tg3: eth1: Link is up at 1000 Mbps, full duplex. Oct 7 10:59:41 cluster31 kernel: tg3: eth1: Flow control is off for TX and off for RX. Oct 7 10:59:48 cluster31 kernel: tg3: eth1: Link is down. Oct 7 10:59:51 cluster31 kernel: tg3: eth1: Link is up at 1000 Mbps, full duplex. Oct 7 10:59:51 cluster31 kernel: tg3: eth1: Flow control is off for TX and off for RX. Oct 7 11:03:26 cluster31 kernel: tg3: eth1: Link is down. Oct 7 11:03:39 cluster31 kernel: tg3.c:v2.2 (August 24, 2003) Oct 7 11:03:40 cluster31 kernel: eth1: Tigon3 [partno(none) rev 7100 PHY(5401)] (PCI:66MHz:64-bit) 10/100/1000BaseT Ethernet 00:b0:d0:f3:66:4e Oct 7 11:36:10 cluster31 kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000000 Oct 7 11:36:10 cluster31 kernel: printing eip: Oct 7 11:36:10 cluster31 kernel: e08fb55c Oct 7 11:36:10 cluster31 kernel: *pde = 00000000 Oct 7 11:36:10 cluster31 kernel: Oops: 0002 [#1] Oct 7 11:36:10 cluster31 kernel: CPU: 0 Oct 7 11:36:10 cluster31 kernel: EIP: 0060:[] Not tainted Oct 7 11:36:10 cluster31 kernel: EFLAGS: 00010046 Oct 7 11:36:10 cluster31 kernel: EIP is at tg3_abort_hw+0x244/0x24c [tg3] Oct 7 11:36:10 cluster31 kernel: eax: 00000000 ebx: 00000000 ecx: 00000014 edx: 00000000 Oct 7 11:36:10 cluster31 kernel: esi: de14d200 edi: 00000000 ebp: de14d000 esp: dd361e88 Oct 7 11:36:10 cluster31 kernel: ds: 007b es: 007b ss: 0068 Oct 7 11:36:10 cluster31 kernel: Process ethtool (pid: 482, threadinfo=dd360000 task=de3506b0) Oct 7 11:36:10 cluster31 kernel: Stack: dd360000 00000005 e08fb7ca de14d200 de14d200 dd360000 de14d200 00000005 Oct 7 11:36:10 cluster31 kernel: 00000247 e08fe8ad de14d200 00000000 de14d000 00000000 dd361ee0 c01b7f1b Oct 7 11:36:10 cluster31 kernel: de14d000 dd361ee0 0805a8f0 de14d000 dd361f0c 00000000 00000013 00000000 Oct 7 11:36:10 cluster31 kernel: Call Trace: Oct 7 11:36:10 cluster31 kernel: [] tg3_halt+0x16/0xc8 [tg3] Oct 7 11:36:10 cluster31 kernel: [] tg3_set_pauseparam+0xd5/0x16c [tg3] Oct 7 11:36:10 cluster31 kernel: [] ethtool_set_pauseparam+0x77/0x8c Oct 7 11:36:10 cluster31 kernel: [] dev_ethtool+0x1df/0x2d8 Oct 7 11:36:10 cluster31 kernel: [] dev_ioctl+0x1a4/0x338 Oct 7 11:36:10 cluster31 kernel: [] inet_ioctl+0xd0/0xdc Oct 7 11:36:10 cluster31 kernel: [] sock_ioctl+0x243/0x274 Oct 7 11:36:10 cluster31 kernel: [] sys_ioctl+0x219/0x260 Oct 7 11:36:10 cluster31 kernel: [] error_code+0x2d/0x38 Oct 7 11:36:10 cluster31 kernel: [] syscall_call+0x7/0xb Oct 7 11:36:10 cluster31 kernel: Oct 7 11:36:10 cluster31 kernel: Code: f3 ab 89 d8 5b 5f c3 90 83 ec 04 57 56 53 8b 5c 24 14 8d 7c Oct 7 11:41:26 cluster31 kernel: Kernel logging (proc) stopped. Oct 7 11:41:26 cluster31 kernel: Kernel log daemon terminating. Oct 7 13:43:30 cluster31 kernel: klogd 1.4.1#10, log source = /proc/kmsg started. Oct 7 13:43:30 cluster31 kernel: Cannot find map file. Oct 7 13:43:30 cluster31 kernel: No module symbols loaded - kernel modules not enabled. Oct 7 13:43:30 cluster31 kernel: Linux version 2.6.0-test3 (mherbert@cluster31) (gcc version 2.95.4 20011002 (Debian prerelease)) #1 SMP lun aoû 18 11:29:59 CEST 2003 Oct 7 13:43:30 cluster31 kernel: Video mode to be used for restore is f00 Oct 7 13:43:30 cluster31 kernel: BIOS-provided physical RAM map: Oct 7 13:43:30 cluster31 kernel: BIOS-e820: 0000000000000000 - 00000000000a0000 (usable) From davem@redhat.com Wed Oct 8 07:55:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 07:56:05 -0700 (PDT) Received: from rth.ninka.net (rth.ninka.net [216.101.162.244]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98EtF25006274 for ; Wed, 8 Oct 2003 07:55:22 -0700 Received: from rth.ninka.net (localhost.localdomain [127.0.0.1]) by rth.ninka.net (8.12.8/8.12.8) with SMTP id h98Esf72005712; Wed, 8 Oct 2003 07:54:41 -0700 Date: Wed, 8 Oct 2003 07:54:41 -0700 From: "David S. Miller" To: ookhoi@humilis.net Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: why does netfilter make upload very slow? (was: Re: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction) Message-Id: <20031008075441.4c6820b7.davem@redhat.com> In-Reply-To: <20031008131320.GD16964@favonius> References: <20031008131320.GD16964@favonius> X-Mailer: Sylpheed version 0.9.6 (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: 646 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 On Wed, 8 Oct 2003 15:13:20 +0200 ookhoi@humilis.net wrote: > Would somebody like to explain why netfilter (in kernel, but not in use) > makes upload go very slow? I am by no means a network guru, but eager to > learn :-) It'll likely happen much quicker if you actually report this to the netfilter lists, which is where the people who can help you are paying attention. From laforge@netfilter.org Wed Oct 8 08:45:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 08:46:07 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98FjT25010625 for ; Wed, 8 Oct 2003 08:45:30 -0700 Received: from [192.168.200.2] (helo=sunbeam.gnumonks.org) by coruscant.gnumonks.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.22) id 1A7GVC-0002qN-TT; Wed, 08 Oct 2003 17:45:27 +0200 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.20) id 1A7GIn-0001y5-LR; Wed, 08 Oct 2003 17:32:37 +0200 Date: Wed, 8 Oct 2003 17:32:37 +0200 From: Harald Welte To: ookhoi@humilis.net Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, Netfilter Development Mailinglist Subject: Re: why does netfilter make upload very slow? (was: Re: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction) Message-ID: <20031008153237.GC25743@sunbeam.de.gnumonks.org> Mail-Followup-To: Harald Welte , ookhoi@humilis.net, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, Netfilter Development Mailinglist References: <20031008131320.GD16964@favonius> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PYvLm/IFaQmMAfx6" Content-Disposition: inline In-Reply-To: <20031008131320.GD16964@favonius> X-Operating-system: Linux sunbeam 2.6.0-test5-nftest X-Date: Today is Sweetmorn, the 62nd day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-Spam-Score: -7.5 (-------) X-archive-position: 647 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 --PYvLm/IFaQmMAfx6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 08, 2003 at 03:13:20PM +0200, ookhoi@humilis.net wrote: > # > I have netfilter enabled, and will try another -test6 kernel with > # > netfilter not compiled in to see if that indeed makes a difference. > #=20 > # I can confirm now that disabling netfilter in 2.6.0-test6 makes the nic > # perform oke wrt upload. > # I (just like Florian) had no iptables rules active in the former > # 2.6.0-test6 kernel, but netfilter was compiled in. >=20 > Would somebody like to explain why netfilter (in kernel, but not in use) > makes upload go very slow? I am by no means a network guru, but eager to > learn :-) let's get this straight. There are five possible cases a) CONFIG_NETFILTER disabled. you won't even have the netfilter hooks in the network stack (so certainly no netfilter-using modules loaded) b) CONFIG_NETFILTER enabled, but _no_ modules (iptable_filter, ip_conntrack, ...) attached to the netfilter hook c) CONFIG_NETFILTER enabled and iptable_filter.o (which pulls ip_tables.o) loaded, NO RULES in the table d) CONFIG_NETFILTER enabled and iptable_filter.o (which pulls ip_tables.o) loaded, RULES in the table e) CONFIG_NETFILTER enabled and ip_conntrack.o loaded, iptable_filter loaded or not, rules or not So if you want to give us an idea about where the bottleneck might be, please clearly indicate between which of the two cases you see this performance penalty.=20 This way we can isolate the culprit. --=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 --PYvLm/IFaQmMAfx6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/hC4VXaXGVTD0i/8RAtDsAKCcLd+EGsxbMYkHYiIukVc+l2gcVQCfTZu2 4lV2QGVAuIXbm8LdGSvQVGQ= =MeeS -----END PGP SIGNATURE----- --PYvLm/IFaQmMAfx6-- From davem@pizda.ninka.net Wed Oct 8 08:47:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 08:47:59 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98FlP25010904 for ; Wed, 8 Oct 2003 08:47:25 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA08869; Wed, 8 Oct 2003 08:42:05 -0700 Date: Wed, 8 Oct 2003 08:42:05 -0700 From: "David S. Miller" To: Andi Kleen Cc: ncorbic@sangoma.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit bugs in dscc44.c Message-Id: <20031008084205.5c81faac.davem@redhat.com> In-Reply-To: <20031007175953.GA1802@averell> References: <20031007175953.GA1802@averell> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 648 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 On Tue, 7 Oct 2003 19:59:53 +0200 Andi Kleen wrote: > ioremap_nocache returns unsigned long, not u32. This makes a difference > on 64bit hosts. Incorrect, like ioremap() it returns "void *". Even your x86_64 implementation does this. From davem@pizda.ninka.net Wed Oct 8 08:49:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 08:49:47 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98FnE25011377 for ; Wed, 8 Oct 2003 08:49:14 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA08918; Wed, 8 Oct 2003 08:43:46 -0700 Date: Wed, 8 Oct 2003 08:43:46 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: kraxel@bytesex.org, video4linux-list@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] dvb-net -- allocate network device structures Message-Id: <20031008084346.457e927b.davem@redhat.com> In-Reply-To: <20031007172257.7dff3075.shemminger@osdl.org> References: <20031007172257.7dff3075.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 649 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 On Tue, 7 Oct 2003 17:22:57 -0700 Stephen Hemminger wrote: > This patch to 2.6.0-test6 converts the DVB net driver to allocate network > devices structures in a manner similar to other network devices in 2.6 by > using alloc_netdev. Instead of an array of structures, and array of pointers > is used. Applied, thanks. From davem@pizda.ninka.net Wed Oct 8 08:53:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 08:54:28 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Frs25011810 for ; Wed, 8 Oct 2003 08:53:54 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA08988; Wed, 8 Oct 2003 08:48:34 -0700 Date: Wed, 8 Oct 2003 08:48:33 -0700 From: "David S. Miller" To: Julian Anastasov Cc: wensong@linux-vs.org, rusty@rustcorp.com.au, netdev@oss.sgi.com Subject: Re: [2.6 PATCH] ipvs - avoid returning NF_DROP from the packet schedulers Message-Id: <20031008084833.0efcc4e1.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 650 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 On Wed, 8 Oct 2003 11:09:20 +0300 (EEST) Julian Anastasov wrote: > It seems my NF_DROP approach leads to new bugs. So, better > free skb, return NF_STOLEN and add some comments. If someone > wants to fix it in another way, go ahead. Applied, thanks. From davem@pizda.ninka.net Wed Oct 8 09:04:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 09:05:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98G4Q25012744 for ; Wed, 8 Oct 2003 09:04:26 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA09039; Wed, 8 Oct 2003 08:58:59 -0700 Date: Wed, 8 Oct 2003 08:58:59 -0700 From: "David S. Miller" To: Tommy Christensen Cc: Christian.Darnell@se.flextronics.com, vlan@wanfear.com, bdschuym@pandora.be, netdev@oss.sgi.com, bridge@osdl.org Subject: Re: [Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged{I,AR}P packets Message-Id: <20031008085859.28750553.davem@redhat.com> In-Reply-To: <1065600565.2572.209.camel@cyan.cph.tpack.net> References: <5B537508CDBED3118403009027745A210B8C1499@knant18.kna.flextronics.com> <1065600565.2572.209.camel@cyan.cph.tpack.net> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 652 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 On 08 Oct 2003 10:09:25 +0200 Tommy Christensen wrote: > This is because the VLAN code is mangling shared data. > You need to do something like this: This fix is definitely needed and correct, patch applied thanks. From Christian.Darnell@se.flextronics.com Wed Oct 8 09:04:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 09:05:01 -0700 (PDT) Received: from nic-outside.fw2.se.flextronics.com (fw2.flextronics.se [195.67.90.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98G4Q26012743 for ; Wed, 8 Oct 2003 09:04:27 -0700 Received: from knant117.se.flextronics.com by nic-outside.fw2.se.flextronics.com via smtpd (for oss.sgi.com [192.48.159.27]) with SMTP; 8 Oct 2003 15:58:15 UT Received: from nic-dmz3.fw2.se.flextronics.com ([10.210.134.173]) by knant117.se.flextronics.com with SMTP id M2003100815160828108 ; Wed, 08 Oct 2003 15:16:08 +0200 Received: from eukna204.kna.flextronics.com by nic-dmz3.fw2.se.flextronics.com via smtpd (for smtp-eu1.flextronics.com [10.211.33.20]) with SMTP; 8 Oct 2003 13:06:18 UT Received: by eukna204.europe.ad.flextronics.com with Internet Mail Service (5.5.2653.19) id <4NZ55BJZ>; Wed, 8 Oct 2003 15:12:30 +0200 Message-ID: <5B537508CDBED3118403009027745A210B8C14A2@knant18.kna.flextronics.com> From: Christian Darnell To: "'Linux 802.1Q VLAN'" , "'Tommy Christensen'" Cc: netdev@oss.sgi.com, bridge Subject: RE: [Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged{I,AR}P packets Date: Wed, 8 Oct 2003 15:09:21 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-archive-position: 651 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Christian.Darnell@se.flextronics.com Precedence: bulk X-list: netdev >-----Original Message----- >From: Christian Darnell [mailto:Christian.Darnell@se.flextronics.com] >Sent: Wednesday, October 08, 2003 10:18 AM >To: 'Tommy Christensen' >Cc: netdev@oss.sgi.com; 'Linux 802.1Q VLAN'; bridge >Subject: RE: [Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables >"see" bridged VLAN tagged{I,AR}P packets > > > >-----Original Message----- >>From: Tommy Christensen [mailto:tommy.christensen@tpack.net] >>Sent: Wednesday, October 08, 2003 10:09 AM >>To: Christian Darnell >>Cc: 'Linux 802.1Q VLAN'; Bart De Schuymer; netdev@oss.sgi.com; bridge >>Subject: Re: [Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables >>"see" bridged VLAN tagged{I,AR}P packets >> >> >> >>This is because the VLAN code is mangling shared data. >>You need to do something like this: >> >> >>--- linux-2.4/net/8021q/vlan_dev.c.org 2003-02-25 15:23:09.000000000 >>+0100 >>+++ linux-2.4/net/8021q/vlan_dev.c 2003-10-07 16:01:29.000000000 +0200 >>@@ -75,7 +75,12 @@ >> static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff >>*skb) >> { >> if (VLAN_DEV_INFO(skb->dev)->flags & 1) { >>- skb = skb_share_check(skb, GFP_ATOMIC); >>+ if (skb_shared(skb) || skb_cloned(skb)) { >>+ struct sk_buff *nskb; >>+ nskb = skb_copy(skb, GFP_ATOMIC); >>+ kfree_skb(skb); >>+ skb = nskb; >>+ } >> if (skb) { >> /* Lifted from Gleb's VLAN code... */ >> memmove(skb->data - ETH_HLEN, >> >> >>Christian, could you try this out? > > >Thanks Tommy! I tried this (on kernel 2.4.22) and it works great! > > Hi again, when the problem with VLAN and pcap was solved I found a bug in pcap. The problem is that pcap_setfilter doesn't work correctly when using vlan x. The problem is that pcap don't mask VID. This results in that for packets with priority (802.1q) set to 0 the vlan x filter works fine, but when the packet has a priority != 0 the vlan x fails. An example: If one have a vlan with VID = 2 and sniffing using the filter "vlan 2" packets with priority = 0 will be shown. Changing to priority = 1 the packets wont appear, if one changes the filter to "vlan 8194" the packets will appear. Fixing so pcap will mask the TCI field with "& 0xfff " to get the VID should probably fix this problem. I have try to locate where this check is performed in the pcap code but with no success. I think gencode.c::gen_vlan(vlan_num) has something to do with... Is there someone who knows the pcap code and know where this check is done? I have tried with tcpdump-workers@tcpdump.org before without any response, is there anyone who knows how to contact the maintainers of the libpcap? Best regards, Christian Darnell From davem@pizda.ninka.net Wed Oct 8 09:06:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 09:07:27 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98G6p25013477 for ; Wed, 8 Oct 2003 09:06:51 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA09081; Wed, 8 Oct 2003 09:01:32 -0700 Date: Wed, 8 Oct 2003 09:01:32 -0700 From: "David S. Miller" To: Andi Kleen Cc: ak@muc.de, ncorbic@sangoma.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit bugs in dscc44.c Message-Id: <20031008090132.2b58c067.davem@redhat.com> In-Reply-To: <20031008155548.GB16937@wotan.suse.de> References: <20031007175953.GA1802@averell> <20031008084205.5c81faac.davem@redhat.com> <20031008155548.GB16937@wotan.suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 653 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 On Wed, 8 Oct 2003 17:55:48 +0200 Andi Kleen wrote: > I agree it would have been better to write: > "ioremap and ioremap_nocache return pointers and that should > be stored in a pointer variable. However when you really want > to store them in a integer variable for unknown reasons always > use unsigned long, not u32 or int" > > However that was just too long, so I didn't write it. Don't replace one error with a new warning, just add the cast to the ioremap() call or something like that. From davem@pizda.ninka.net Wed Oct 8 09:16:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 09:16:42 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98GG825014027 for ; Wed, 8 Oct 2003 09:16:09 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA09125; Wed, 8 Oct 2003 09:10:50 -0700 Date: Wed, 8 Oct 2003 09:10:50 -0700 From: "David S. Miller" To: Andi Kleen Cc: ak@suse.de, ak@muc.de, ncorbic@sangoma.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit bugs in dscc44.c II Message-Id: <20031008091050.11b2acb7.davem@redhat.com> In-Reply-To: <20031008161149.GA8134@wotan.suse.de> References: <20031007175953.GA1802@averell> <20031008084205.5c81faac.davem@redhat.com> <20031008155548.GB16937@wotan.suse.de> <20031008090132.2b58c067.davem@redhat.com> <20031008160859.GD16937@wotan.suse.de> <20031008161149.GA8134@wotan.suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 654 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 > BTW my change fixed the warning. I know, but it added a new one. > It's somewhat ugly to store pointers in unsigned long I agree, I have _NO_ problem with this, all I'm asking you to do is: - foo = ioremap_nocache(...); + foo = (unsigned long) ioremap_nocache(...); From ak@suse.de Wed Oct 8 09:20:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 09:20:54 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98GKA25014457 for ; Wed, 8 Oct 2003 09:20:10 -0700 Received: from Hermes.suse.de (Hermes.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 5420016C68A8; Wed, 8 Oct 2003 17:55:49 +0200 (CEST) Date: Wed, 8 Oct 2003 17:55:48 +0200 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , ncorbic@sangoma.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit bugs in dscc44.c Message-ID: <20031008155548.GB16937@wotan.suse.de> References: <20031007175953.GA1802@averell> <20031008084205.5c81faac.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031008084205.5c81faac.davem@redhat.com> X-archive-position: 655 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 Wed, Oct 08, 2003 at 08:42:05AM -0700, David S. Miller wrote: > On Tue, 7 Oct 2003 19:59:53 +0200 > Andi Kleen wrote: > > > ioremap_nocache returns unsigned long, not u32. This makes a difference > > on 64bit hosts. > > Incorrect, like ioremap() it returns "void *". I knew someone would nit pick this ;-) I agree it would have been better to write: "ioremap and ioremap_nocache return pointers and that should be stored in a pointer variable. However when you really want to store them in a integer variable for unknown reasons always use unsigned long, not u32 or int" However that was just too long, so I didn't write it. -Andi From ak@suse.de Wed Oct 8 09:31:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 09:31:57 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98GVC25015000 for ; Wed, 8 Oct 2003 09:31:13 -0700 Received: from Hermes.suse.de (Hermes.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 545F016C6A81; Wed, 8 Oct 2003 18:08:59 +0200 (CEST) Date: Wed, 8 Oct 2003 18:08:59 +0200 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , ak@muc.de, ncorbic@sangoma.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit bugs in dscc44.c Message-ID: <20031008160859.GD16937@wotan.suse.de> References: <20031007175953.GA1802@averell> <20031008084205.5c81faac.davem@redhat.com> <20031008155548.GB16937@wotan.suse.de> <20031008090132.2b58c067.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031008090132.2b58c067.davem@redhat.com> X-archive-position: 656 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 Wed, Oct 08, 2003 at 09:01:32AM -0700, David S. Miller wrote: > On Wed, 8 Oct 2003 17:55:48 +0200 > Andi Kleen wrote: > > > I agree it would have been better to write: > > "ioremap and ioremap_nocache return pointers and that should > > be stored in a pointer variable. However when you really want > > to store them in a integer variable for unknown reasons always > > use unsigned long, not u32 or int" > > > > However that was just too long, so I didn't write it. > > Don't replace one error with a new warning, just add the cast > to the ioremap() call or something like that. I don't particularly care about the warning, just that it will obviously crash on a 64bit box when loaded. My change was the simplest possible fix for that. I have no plans to rewrite this driver or something. -Andi From greearb@candelatech.com Wed Oct 8 09:34:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 09:35:01 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98GYS25015407 for ; Wed, 8 Oct 2003 09:34:29 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h98GYKme021776; Wed, 8 Oct 2003 09:34:21 -0700 Message-ID: <3F843C8C.4030100@candelatech.com> Date: Wed, 08 Oct 2003 09:34:20 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Linux 802.1Q VLAN" CC: "'Tommy Christensen'" , netdev@oss.sgi.com, bridge Subject: Re: [Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged{I,AR}P packets References: <5B537508CDBED3118403009027745A210B8C14A1@knant18.kna.flextronics.com> In-Reply-To: <5B537508CDBED3118403009027745A210B8C14A1@knant18.kna.flextronics.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 657 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Christian Darnell wrote: > -----Original Message----- > >>From: Tommy Christensen [mailto:tommy.christensen@tpack.net] >>Sent: Wednesday, October 08, 2003 10:09 AM >>To: Christian Darnell >>Cc: 'Linux 802.1Q VLAN'; Bart De Schuymer; netdev@oss.sgi.com; bridge >>Subject: Re: [Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables >>"see" bridged VLAN tagged{I,AR}P packets >> >> >> >>This is because the VLAN code is mangling shared data. >>You need to do something like this: >> >> >>--- linux-2.4/net/8021q/vlan_dev.c.org 2003-02-25 15:23:09.000000000 >>+0100 >>+++ linux-2.4/net/8021q/vlan_dev.c 2003-10-07 16:01:29.000000000 +0200 >>@@ -75,7 +75,12 @@ >>static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff >>*skb) >>{ >> if (VLAN_DEV_INFO(skb->dev)->flags & 1) { >>- skb = skb_share_check(skb, GFP_ATOMIC); >>+ if (skb_shared(skb) || skb_cloned(skb)) { >>+ struct sk_buff *nskb; >>+ nskb = skb_copy(skb, GFP_ATOMIC); >>+ kfree_skb(skb); >>+ skb = nskb; >>+ } Thanks for catching that! So, what good is skb_share_check then? Maybe we should have a skb_share_or_cloned_check() ? Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From davem@pizda.ninka.net Wed Oct 8 09:37:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 09:37:44 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98GbB25015931 for ; Wed, 8 Oct 2003 09:37:12 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA09260; Wed, 8 Oct 2003 09:31:53 -0700 Date: Wed, 8 Oct 2003 09:31:53 -0700 From: "David S. Miller" To: Andi Kleen Cc: ak@suse.de, ak@muc.de, ncorbic@sangoma.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit bugs in dscc44.c II Message-Id: <20031008093153.3daaa6b3.davem@redhat.com> In-Reply-To: <20031008163345.GA28793@wotan.suse.de> References: <20031007175953.GA1802@averell> <20031008084205.5c81faac.davem@redhat.com> <20031008155548.GB16937@wotan.suse.de> <20031008090132.2b58c067.davem@redhat.com> <20031008160859.GD16937@wotan.suse.de> <20031008161149.GA8134@wotan.suse.de> <20031008091050.11b2acb7.davem@redhat.com> <20031008163345.GA28793@wotan.suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 658 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 On Wed, 8 Oct 2003 18:33:45 +0200 Andi Kleen wrote: > Just do that then when you apply the patch. Would have been faster > than to write all these emails ;-) I deleted the original patch, so you have to resend it to me anyways, so please make the fix I've suggested as you do this. When I ask you to do these small fixes, I don't do it to make your life miserable, I do it because it allows me to review and apply patches at a higher rate and scale better. From davem@pizda.ninka.net Wed Oct 8 09:39:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 09:39:51 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98GdH25016550 for ; Wed, 8 Oct 2003 09:39:17 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA09280; Wed, 8 Oct 2003 09:33:54 -0700 Date: Wed, 8 Oct 2003 09:33:54 -0700 From: "David S. Miller" To: Ben Greear Cc: vlan@wanfear.com, tommy.christensen@tpack.net, netdev@oss.sgi.com, bridge@osdl.org Subject: Re: [Bridge] RE: [VLAN] Re: [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged{I,AR}P packets Message-Id: <20031008093354.265b34a5.davem@redhat.com> In-Reply-To: <3F843C8C.4030100@candelatech.com> References: <5B537508CDBED3118403009027745A210B8C14A1@knant18.kna.flextronics.com> <3F843C8C.4030100@candelatech.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 659 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 On Wed, 08 Oct 2003 09:34:20 -0700 Ben Greear wrote: > So, what good is skb_share_check then? > Maybe we should have a skb_share_or_cloned_check() ? What input handlers are supposed to do is first: skb = skb_share_check(...); then look at packet contents etc., then if they need to write to the header do something like skb_cow(). The best example, as usual, is ipv4 input. Look at how ip_rcv() makes sure it can safely get at the packet header parts it needs to parse, then look at ip_forward and how it cows the IPV4 header so it can modify the TTL field. From ak@suse.de Wed Oct 8 09:41:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 09:41:53 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Gf925016930 for ; Wed, 8 Oct 2003 09:41:09 -0700 Received: from Hermes.suse.de (Hermes.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 A90E116C6AA9; Wed, 8 Oct 2003 18:11:49 +0200 (CEST) Date: Wed, 8 Oct 2003 18:11:49 +0200 From: Andi Kleen To: Andi Kleen Cc: "David S. Miller" , ak@muc.de, ncorbic@sangoma.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit bugs in dscc44.c II Message-ID: <20031008161149.GA8134@wotan.suse.de> References: <20031007175953.GA1802@averell> <20031008084205.5c81faac.davem@redhat.com> <20031008155548.GB16937@wotan.suse.de> <20031008090132.2b58c067.davem@redhat.com> <20031008160859.GD16937@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031008160859.GD16937@wotan.suse.de> X-archive-position: 660 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 > I don't particularly care about the warning, just that it will > obviously crash on a 64bit box when loaded. My change was the simplest > possible fix for that. I have no plans to rewrite this driver > or something. BTW my change fixed the warning. It's somewhat ugly to store pointers in unsigned long I agree, but it's hard to blame the driver author when this cruft is even enshrined in fundamental interfaces (__get_free_pages/__free_pages) -Andi From ak@suse.de Wed Oct 8 10:00:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 10:00:59 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98H0F25017705 for ; Wed, 8 Oct 2003 10:00:16 -0700 Received: from Hermes.suse.de (Hermes.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 6AF5E16C6DA5; Wed, 8 Oct 2003 18:33:45 +0200 (CEST) Date: Wed, 8 Oct 2003 18:33:45 +0200 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , ak@muc.de, ncorbic@sangoma.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit bugs in dscc44.c II Message-ID: <20031008163345.GA28793@wotan.suse.de> References: <20031007175953.GA1802@averell> <20031008084205.5c81faac.davem@redhat.com> <20031008155548.GB16937@wotan.suse.de> <20031008090132.2b58c067.davem@redhat.com> <20031008160859.GD16937@wotan.suse.de> <20031008161149.GA8134@wotan.suse.de> <20031008091050.11b2acb7.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031008091050.11b2acb7.davem@redhat.com> X-archive-position: 661 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 Wed, Oct 08, 2003 at 09:10:50AM -0700, David S. Miller wrote: > > BTW my change fixed the warning. > > I know, but it added a new one. > > > It's somewhat ugly to store pointers in unsigned long I agree, > > I have _NO_ problem with this, all I'm asking you to do is: > > - foo = ioremap_nocache(...); > + foo = (unsigned long) ioremap_nocache(...); Just do that then when you apply the patch. Would have been faster than to write all these emails ;-) -Andi From ak@suse.de Wed Oct 8 10:01:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 10:01:44 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98H1925017747 for ; Wed, 8 Oct 2003 10:01:09 -0700 Received: from Hermes.suse.de (Hermes.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 EF7A216C47DF; Wed, 8 Oct 2003 19:00:09 +0200 (CEST) Date: Wed, 8 Oct 2003 19:00:05 +0200 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , ak@muc.de, ncorbic@sangoma.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit bugs in dscc44.c II Message-ID: <20031008170005.GB28793@wotan.suse.de> References: <20031007175953.GA1802@averell> <20031008084205.5c81faac.davem@redhat.com> <20031008155548.GB16937@wotan.suse.de> <20031008090132.2b58c067.davem@redhat.com> <20031008160859.GD16937@wotan.suse.de> <20031008161149.GA8134@wotan.suse.de> <20031008091050.11b2acb7.davem@redhat.com> <20031008163345.GA28793@wotan.suse.de> <20031008093153.3daaa6b3.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031008093153.3daaa6b3.davem@redhat.com> X-archive-position: 662 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 Wed, Oct 08, 2003 at 09:31:53AM -0700, David S. Miller wrote: > On Wed, 8 Oct 2003 18:33:45 +0200 > Andi Kleen wrote: > > > Just do that then when you apply the patch. Would have been faster > > than to write all these emails ;-) > > I deleted the original patch, so you have to resend it to > me anyways, so please make the fix I've suggested as you > do this. > > When I ask you to do these small fixes, I don't do it to make your > life miserable, I do it because it allows me to review and apply > patches at a higher rate and scale better. At least for such one liner changes it doesn't look like an effective method (I bet you could have done the change quicker than typing the first mail). I checked the code and the code was already using a unsigned long cast, so no changes are needed. Just the variable it stored the pointer in was wrong. Here's the patch again. --------------------------- Fix 64bit issues in dscc4 diff -u linux-2.5-cleanup/drivers/net/wan/dscc4.c-o linux-2.5-cleanup/drivers/net/wan/dscc4.c --- linux-2.5-cleanup/drivers/net/wan/dscc4.c-o 2003-12-01 14:04:34.000000000 +0100 +++ linux-2.5-cleanup/drivers/net/wan/dscc4.c 2003-12-02 16:55:14.298508864 +0100 @@ -980,7 +980,7 @@ * * This code doesn't need to be efficient. Keep It Simple */ -static void dscc4_pci_reset(struct pci_dev *pdev, u32 ioaddr) +static void dscc4_pci_reset(struct pci_dev *pdev, unsigned long ioaddr) { int i; @@ -1461,7 +1461,8 @@ struct dscc4_dev_priv *root = token; struct dscc4_pci_priv *priv; struct net_device *dev; - u32 ioaddr, state; + unsigned long ioaddr; + u32 state; unsigned long flags; int i, handled = 1; @@ -1613,7 +1614,7 @@ goto try; } if (state & Xpr) { - u32 scc_addr, ring; + unsigned long scc_addr, ring; int i; /* @@ -1954,7 +1955,7 @@ { struct dscc4_pci_priv *ppriv; struct dscc4_dev_priv *root; - u32 ioaddr; + unsigned long ioaddr; int i; ppriv = pci_get_drvdata(pdev); From davem@pizda.ninka.net Wed Oct 8 10:04:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 10:05:17 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98H4i25018478 for ; Wed, 8 Oct 2003 10:04:45 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA09437; Wed, 8 Oct 2003 09:59:26 -0700 Date: Wed, 8 Oct 2003 09:59:26 -0700 From: "David S. Miller" To: Andi Kleen Cc: ak@suse.de, ak@muc.de, ncorbic@sangoma.com, netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit bugs in dscc44.c II Message-Id: <20031008095926.190e7fa5.davem@redhat.com> In-Reply-To: <20031008170005.GB28793@wotan.suse.de> References: <20031007175953.GA1802@averell> <20031008084205.5c81faac.davem@redhat.com> <20031008155548.GB16937@wotan.suse.de> <20031008090132.2b58c067.davem@redhat.com> <20031008160859.GD16937@wotan.suse.de> <20031008161149.GA8134@wotan.suse.de> <20031008091050.11b2acb7.davem@redhat.com> <20031008163345.GA28793@wotan.suse.de> <20031008093153.3daaa6b3.davem@redhat.com> <20031008170005.GB28793@wotan.suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 663 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 On Wed, 8 Oct 2003 19:00:05 +0200 Andi Kleen wrote: > Here's the patch again. Applied, thanks Andi. From Marc.Herbert@ens-lyon.fr Wed Oct 8 10:08:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 10:09:14 -0700 (PDT) Received: from mailhost.ens-lyon.fr (pluvier.ens-lyon.fr [140.77.167.5]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98H8d25018941 for ; Wed, 8 Oct 2003 10:08:40 -0700 Received: by mailhost.ens-lyon.fr with scanned-ok (Exim 3.35 #1 (Debian)) id 1A7Gzu-0006J1-00 for ; Wed, 08 Oct 2003 18:17:10 +0200 Received: from mailhost.ens-lyon.fr ([127.0.0.1]) by localhost (pluvier [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23028-07 for ; Wed, 8 Oct 2003 18:17:09 +0200 (CEST) Received: from bologna.cri2000.ens-lyon.fr ([140.77.13.93]) by mailhost.ens-lyon.fr with esmtp (Exim 3.35 #1 (Debian)) id 1A7Gzp-0006H7-00 for ; Wed, 08 Oct 2003 18:17:05 +0200 Date: Wed, 8 Oct 2003 18:17:05 +0200 (CEST) From: Marc.Herbert@ens-lyon.fr X-X-Sender: mherbert@bologna To: netdev@oss.sgi.com Subject: tg3 set_pauseframe() crash : some reproducibility Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ens-lyon.fr X-archive-position: 664 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Marc.Herbert@ens-lyon.fr Precedence: bulk X-list: netdev After crashing some more machines, I got a better understanding of how to reproduce the tg3.ko kernel segfault reported a few minutes ago. Sorry for sending two messages for this. I also discovered the command "reboot -f", which is great :-) I was wrong when comparing kernel versions: it finally seems to me that they do not matter. The key factor is apparently "ifconfig up|down" When the interface is down, the tg3 module being freshly loaded, then any ethtool -A eth1 whatever does segfaults (in kernel). If the interface is up, then it rolls. Cheers, Marc. PS: still not subscribed to the list. I will read it on the web, though. Just like the good old Usenet actually, only less convenient. From johnip@sgi.com Wed Oct 8 10:12:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 10:13:03 -0700 (PDT) Received: from tolkor.sgi.com (tolkor.SGI.COM [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98HCU25019404 for ; Wed, 8 Oct 2003 10:12:31 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h98HUDHc012554 for ; Wed, 8 Oct 2003 12:30:13 -0500 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h98HCPcc11996260; Wed, 8 Oct 2003 12:12:25 -0500 (CDT) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h98HCORn293407607; Wed, 8 Oct 2003 12:12:24 -0500 (CDT) Message-ID: <3F844578.40306@sgi.com> Date: Wed, 08 Oct 2003 12:12:24 -0500 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030905 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com CC: John Partridge , Jeff Garzik , "David S. Miller" , Jes Sorensen Subject: Tigon3 5701 PCI-X recv performance problem Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 665 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev I am seeing a problem with PCI-X recv performance on the Broadcom 5701 cards. This is due to a known PCI-X errata with the DMA engine when buffers are non zero offset aligned. As well as performance problems there are also a lot of kernel unaligned access messages in the system log (hundereds of them) :- kernel unaligned access to 0xe0000030174f382e, ip=0xe0000000047d1f80 This affects both 2.4x and 2.6x tg3.o drivers Measure of performance WITHOUT fix :- mig125:~ # nttcp -r -T -l262144 -w1024 -n1000 10.50.1.130 -l262144 -w1024 Bytes Real s CPU s Real-MBit/s CPU-MBit/s Calls Real-C/s CPU-C/s l2621440000 118.36 43.24 177.1846 484.9782 1818304 15362.52 42049.3 12621440000 118.34 12.70 177.2167 1651.3857 10000 84.50 787.4 I then applied a fix to the driver :- line 2260 of linux-2.6.0-test6/drivers/net/tg3.c - if (len > RX_COPY_THRESHOLD) { + if (len > RX_COPY_THRESHOLD && tp->rx_offset == 2) { Then I loaded a tg3.o module which has the fix, and ran the test again Measure of performance WITH fix :- mig125:~ # nttcp -r -T -l262144 -w1024 -n1000 10.50.1.130 -l262144 -w1024 Bytes Real s CPU s Real-MBit/s CPU-MBit/s Calls Real-C/s CPU-C/s l262144000 2.23 1.64 940.6910 1277.5033 35082 15736.26 21370.6 1262144000 2.22 1.43 944.0677 1470.4690 1000 450.17 701.2 This ONLY affects Broadcom 5701 based Gigabit Ethernet cards 5704 cards do not have the same errata. I confirmed that the fix did not affect the performance or functionality of 5704 cards, actually the fix ensures that the 5701 cards don't go through the same code path as 5704 (becuase tp->rx_offset is 0 for 5701 so we always align the buffers for the 5701 card). John -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From davem@pizda.ninka.net Wed Oct 8 10:16:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 10:16:47 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98HGD25020134 for ; Wed, 8 Oct 2003 10:16:14 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id KAA09531; Wed, 8 Oct 2003 10:10:46 -0700 Date: Wed, 8 Oct 2003 10:10:46 -0700 From: "David S. Miller" To: johnip@sgi.com Cc: netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031008101046.376abc3b.davem@redhat.com> In-Reply-To: <3F844578.40306@sgi.com> References: <3F844578.40306@sgi.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 666 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 Oh yeah? What are your numbers like if you just disable the ia64 kernel unaligned access printk()? From johnip@sgi.com Wed Oct 8 10:53:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 10:53:42 -0700 (PDT) Received: from tolkor.sgi.com (tolkor.SGI.COM [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Hr625021134 for ; Wed, 8 Oct 2003 10:53:06 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h98IAnHc029760 for ; Wed, 8 Oct 2003 13:10:49 -0500 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h98Hqwcc11968779; Wed, 8 Oct 2003 12:52:58 -0500 (CDT) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h98HqvRn283869808; Wed, 8 Oct 2003 12:52:58 -0500 (CDT) Message-ID: <3F844EF9.9090901@sgi.com> Date: Wed, 08 Oct 2003 12:52:57 -0500 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030905 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> In-Reply-To: <20031008101046.376abc3b.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 667 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev Not too much different mig125:~ # nttcp -r -T -l262144 -w1024 -n1000 10.50.1.130 -l262144 -w1024 Bytes Real s CPU s Real-MBit/s CPU-MBit/s Calls Real-C/s CPU-C/s l318341120 10.00 9.96 254.6131 255.6215 22500 2249.47 2258.4 1318341120 10.00 0.41 254.6825 6156.0247 19430 1943.07 46966.7 David S. Miller wrote: > Oh yeah? What are your numbers like if you just disable the ia64 > kernel unaligned access printk()? -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From modica@sgi.com Wed Oct 8 11:21:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 11:22:32 -0700 (PDT) Received: from rj.sgi.com (mtvcafw.SGI.COM [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98ILv25022129 for ; Wed, 8 Oct 2003 11:21:58 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by rj.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h98GPlOO001203 for ; Wed, 8 Oct 2003 09:25:47 -0700 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h98ILpcc12014415; Wed, 8 Oct 2003 13:21:51 -0500 (CDT) Received: from sgi.com (eagdhcp-232-154.americas.sgi.com [128.162.232.154]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h98ILpRn316854150; Wed, 8 Oct 2003 13:21:51 -0500 (CDT) Message-ID: <3F8455BE.8080300@sgi.com> Date: Wed, 08 Oct 2003 13:21:50 -0500 From: Steve Modica Organization: SGI User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> In-Reply-To: <20031008101046.376abc3b.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 668 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev David S. Miller wrote: > Oh yeah? What are your numbers like if you just disable the ia64 > kernel unaligned access printk()? Hi David, it's definitely not the printk. They have that throttled so it only prints once for a large number of occurances. The problem is that on the Altix platform they have to deal with unaligned accesses via an exception handler. This causes them to run through hundreds of instructions. There's evidntally another mechanism in the cpu that's more efficient in daling with unaligned accesses, but we can't use that for some reason (atomicity I think, but I don't recall). This extra memcpy when the buffer is not unaligned currently only impacts 5701 (since it's the only chip for which the 2 byte pad is omitted) although the alignment issue would bite us no matter what the chip if the 2 byte pad is omitted. Steve -- Steve Modica work: 651-683-3224 MTS-Technical Lead "Give a man a fish, and he will eat for a day, hit him with a fish and he leaves you alone" - me From mashirle@us.ibm.com Wed Oct 8 11:23:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 11:24:30 -0700 (PDT) Received: from linux2.suntekindustrial.com (wbar1.sjo1-4-4-004-065.sjo1.dsl-verizon.net [4.4.4.65]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98INu25022411 for ; Wed, 8 Oct 2003 11:23:56 -0700 Received: from ibm-mxl (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated bits=0) by linux2.suntekindustrial.com (8.12.8/8.12.8) with ESMTP id h98IYGo7028596; Wed, 8 Oct 2003 11:34:18 -0700 Content-Type: text/plain; charset="iso-2022-jp" From: Shirley Ma Organization: IBM Linux To: davem@redhat.com, kuznet@ms2.inr.ac.ru Subject: Re: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable Date: Wed, 8 Oct 2003 11:23:14 -0700 User-Agent: KMail/1.4.3 Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org References: In-Reply-To: MIME-Version: 1.0 Message-Id: <200310081121.02222.mashirle@us.ibm.com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h98INu25022411 X-archive-position: 669 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Thanks for all your comments. Here is the new patch. This patch is against linux-2.6.0-test6-bk8. This patch has been tested. Please review this again. Thanks Shirley Ma IBM Linux Technology Center ------------------------------------------- diff -urN linux-2.6.0-test6/include/linux/rtnetlink.h linux-2.6.0-test6-ipv6mib4/include/linux/rtnetlink.h --- linux-2.6.0-test6/include/linux/rtnetlink.h 2003-09-27 17:50:40.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/include/linux/rtnetlink.h 2003-10-07 23:37:29.000000000 -0700 @@ -352,8 +352,10 @@ struct ifa_cacheinfo { - __s32 ifa_prefered; - __s32 ifa_valid; + __u32 ifa_prefered; + __u32 ifa_valid; + __u32 cstamp; /* created timestamp, hundredths of seconds */ + __u32 tstamp; /* updated timestamp, hundredths of seconds */ }; diff -urN linux-2.6.0-test6/include/linux/time.h linux-2.6.0-test6-ipv6mib4/include/linux/time.h --- linux-2.6.0-test6/include/linux/time.h 2003-09-27 17:50:30.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/include/linux/time.h 2003-10-07 23:37:29.000000000 -0700 @@ -55,6 +55,7 @@ * at _least_ "jiffies" - so "jiffies+1" had better still * be positive. */ +#define MAX_JIFFIES (~0) #define MAX_JIFFY_OFFSET ((~0UL >> 1)-1) /* Parameters used to convert the timespec values */ diff -urN linux-2.6.0-test6/include/net/if_inet6.h linux-2.6.0-test6-ipv6mib4/include/net/if_inet6.h --- linux-2.6.0-test6/include/net/if_inet6.h 2003-09-27 17:51:07.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/include/net/if_inet6.h 2003-10-07 23:37:29.000000000 -0700 @@ -34,7 +34,8 @@ __u32 valid_lft; __u32 prefered_lft; - unsigned long tstamp; + unsigned long cstamp; /* created timestamp */ + unsigned long tstamp; /* updated timestamp */ atomic_t refcnt; spinlock_t lock; @@ -111,6 +112,8 @@ atomic_t mca_refcnt; spinlock_t mca_lock; unsigned char mca_crcount; + unsigned long mca_cstamp; + unsigned long mca_tstamp; }; /* Anycast stuff */ @@ -130,6 +133,8 @@ int aca_users; atomic_t aca_refcnt; spinlock_t aca_lock; + unsigned long aca_cstamp; + unsigned long aca_tstamp; }; #define IFA_HOST IPV6_ADDR_LOOPBACK diff -urN linux-2.6.0-test6/net/ipv6/addrconf.c linux-2.6.0-test6-ipv6mib4/net/ipv6/addrconf.c --- linux-2.6.0-test6/net/ipv6/addrconf.c 2003-09-27 17:51:02.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/addrconf.c 2003-10-07 23:58:39.000000000 -0700 @@ -92,6 +92,8 @@ #define ADBG(x) #endif +#define INFINITY_LIFE_TIME 0xFFFFFFFF + #ifdef CONFIG_SYSCTL static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p); static void addrconf_sysctl_unregister(struct ipv6_devconf *p); @@ -505,6 +507,7 @@ ifa->scope = scope; ifa->prefix_len = pfxlen; ifa->flags = flags | IFA_F_TENTATIVE; + ifa->cstamp = ifa->tstamp = jiffies; read_lock(&addrconf_lock); if (idev->dead) { @@ -707,6 +710,7 @@ ift->ifpub = ifp; ift->valid_lft = tmp_valid_lft; ift->prefered_lft = tmp_prefered_lft; + ift->cstamp = ifp->cstamp; ift->tstamp = ifp->tstamp; spin_unlock_bh(&ift->lock); addrconf_dad_start(ift, 0); @@ -1412,6 +1416,7 @@ } update_lft = create = 1; + ifp->cstamp = jiffies; addrconf_dad_start(ifp, RTF_ADDRCONF|RTF_PREFIX_RT); } @@ -2447,14 +2452,103 @@ if (!(ifa->flags&IFA_F_PERMANENT)) { ci.ifa_prefered = ifa->prefered_lft; ci.ifa_valid = ifa->valid_lft; - if (ci.ifa_prefered != 0xFFFFFFFF) { + if (ci.ifa_prefered != INFINITY_LIFE_TIME) { long tval = (jiffies - ifa->tstamp)/HZ; ci.ifa_prefered -= tval; - if (ci.ifa_valid != 0xFFFFFFFF) + if (ci.ifa_valid != INFINITY_LIFE_TIME) ci.ifa_valid -= tval; } - RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + } else { + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; } + if (ifa->cstamp < INITIAL_JIFFIES) + ci.cstamp = (ifa->cstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ * 100; + else + ci.cstamp = (ifa->cstamp - INITIAL_JIFFIES) / HZ * 100; + if (ifa->tstamp < INITIAL_JIFFIES) + ci.tstamp = (ifa->tstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ * 100; + else + ci.tstamp = (ifa->tstamp - INITIAL_JIFFIES) / HZ * 100; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifmca->mca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifmca->idev->dev->ifindex; + RTA_PUT(skb, IFA_ADDRESS, 16, &ifmca->mca_addr); + if (ifmca->mca_cstamp < INITIAL_JIFFIES) + ci.cstamp = (ifmca->mca_cstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ * 100; + else + ci.cstamp = (ifmca->mca_cstamp - INITIAL_JIFFIES) / HZ * 100; + if (ifmca->mca_tstamp < INITIAL_JIFFIES) + ci.tstamp = (ifmca->mca_tstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ * 100; + else + ci.tstamp = (ifmca->mca_tstamp - INITIAL_JIFFIES) / HZ * 100; + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifacaddr(struct sk_buff *skb, struct ifacaddr6 *ifaca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifaca->aca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifaca->aca_idev->dev->ifindex; + RTA_PUT(skb, IFA_ADDRESS, 16, &ifaca->aca_addr); + if (ifaca->aca_cstamp < INITIAL_JIFFIES) + ci.cstamp = (ifaca->aca_cstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ * 100; + else + ci.cstamp = (ifaca->aca_cstamp - INITIAL_JIFFIES) / HZ * 100; + if (ifaca->aca_tstamp < INITIAL_JIFFIES) + ci.tstamp = (ifaca->aca_tstamp + MAX_JIFFIES - INITIAL_JIFFIES) / HZ * 100; + else + ci.tstamp = (ifaca->aca_tstamp - INITIAL_JIFFIES) / HZ * 100; + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); nlh->nlmsg_len = skb->tail - b; return skb->len; @@ -2468,33 +2562,79 @@ { int idx, ip_idx; int s_idx, s_ip_idx; - struct inet6_ifaddr *ifa; - + int err = 1; + struct net_device *dev; + struct inet6_dev *idev = NULL; + struct inet6_ifaddr *ifa; + struct ifmcaddr6 *ifmca; + struct ifacaddr6 *ifaca; + s_idx = cb->args[0]; s_ip_idx = ip_idx = cb->args[1]; - - for (idx=0; idx < IN6_ADDR_HSIZE; idx++) { + read_lock(&dev_base_lock); + + for (dev = dev_base, idx = 0; dev; dev = dev->next, idx++) { if (idx < s_idx) continue; if (idx > s_idx) s_ip_idx = 0; - read_lock_bh(&addrconf_hash_lock); - for (ifa=inet6_addr_lst[idx], ip_idx = 0; ifa; - ifa = ifa->lst_next, ip_idx++) { + ip_idx = 0; + if ((idev = in6_dev_get(dev)) == NULL) + continue; + read_lock_bh(&idev->lock); + /* unicast address */ + for (ifa = idev->addr_list; ifa; + ifa = ifa->if_next, ip_idx++) { if (ip_idx < s_ip_idx) continue; - if (inet6_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR) <= 0) { - read_unlock_bh(&addrconf_hash_lock); + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) goto done; - } } - read_unlock_bh(&addrconf_hash_lock); + /* temp addr */ +#ifdef CONFIG_IPV6_PRIVACY + for (ifa = idev->tempaddr_list; ifa; + ifa = ifua->tmp_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } +#endif + /* multicast address */ + for (ifmca = idev->mc_list; ifmca; + ifmca = ifmca->next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifmcaddr(skb, ifmca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } + /* anycast address */ + for (ifaca = idev->ac_list; ifaca; + ifaca = ifaca->aca_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifacaddr(skb, ifaca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } + read_unlock_bh(&idev->lock); + in6_dev_put(idev); } done: + if (err <= 0) { + read_unlock_bh(&idev->lock); + in6_dev_put(idev); + } + read_unlock(&dev_base_lock); cb->args[0] = idx; cb->args[1] = ip_idx; - return skb->len; } diff -urN linux-2.6.0-test6/net/ipv6/anycast.c linux-2.6.0-test6-ipv6mib4/net/ipv6/anycast.c --- linux-2.6.0-test6/net/ipv6/anycast.c 2003-09-27 17:50:06.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/anycast.c 2003-10-07 23:37:29.000000000 -0700 @@ -343,6 +343,8 @@ ipv6_addr_copy(&aca->aca_addr, addr); aca->aca_idev = idev; aca->aca_users = 1; + /* aca_tstamp should be updated upon changes */ + aca->aca_cstamp = aca->aca_tstamp = jiffies; atomic_set(&aca->aca_refcnt, 2); aca->aca_lock = SPIN_LOCK_UNLOCKED; diff -urN linux-2.6.0-test6/net/ipv6/mcast.c linux-2.6.0-test6-ipv6mib4/net/ipv6/mcast.c --- linux-2.6.0-test6/net/ipv6/mcast.c 2003-09-27 17:50:53.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/mcast.c 2003-10-07 23:37:29.000000000 -0700 @@ -830,6 +830,8 @@ ipv6_addr_copy(&mc->mca_addr, addr); mc->idev = idev; mc->mca_users = 1; + /* mca_stamp should be updated upon changes */ + mc->mca_cstamp = mc->mca_tstamp = jiffies; atomic_set(&mc->mca_refcnt, 2); mc->mca_lock = SPIN_LOCK_UNLOCKED; From davem@pizda.ninka.net Wed Oct 8 11:32:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 11:33:07 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98IWL25023027 for ; Wed, 8 Oct 2003 11:32:33 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA09858; Wed, 8 Oct 2003 11:26:58 -0700 Date: Wed, 8 Oct 2003 11:26:57 -0700 From: "David S. Miller" To: johnip@sgi.com Cc: netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031008112657.2adddeb6.davem@redhat.com> In-Reply-To: <3F844EF9.9090901@sgi.com> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F844EF9.9090901@sgi.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 670 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 On Wed, 08 Oct 2003 12:52:57 -0500 John Partridge wrote: > Not too much different The problem is that your change is arch-dependant yet you make it run on all platforms. On x86 we don't want to do what your change is doing, the unaligned accesses are cheap enough. We need to abstract this, probably in the same way it is done in the Tulip and other drivers which have similar issues. From davem@pizda.ninka.net Wed Oct 8 11:35:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 11:35:52 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98IZI25023445 for ; Wed, 8 Oct 2003 11:35:18 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA09874; Wed, 8 Oct 2003 11:29:57 -0700 Date: Wed, 8 Oct 2003 11:29:57 -0700 From: "David S. Miller" To: Steve Modica Cc: johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031008112957.43394f3d.davem@redhat.com> In-Reply-To: <3F8455BE.8080300@sgi.com> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 671 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 On Wed, 08 Oct 2003 13:21:50 -0500 Steve Modica wrote: > The problem is that on the Altix platform they have to deal with unaligned > accesses via an exception handler. You mean, ia64. Has anyone optimized the unaligned trap handler on ia64 (perhaps coding it in raw assembler) to see what the situation looks like then? Nobody wants to ever comment on this... > This extra memcpy when the buffer is not unaligned currently only impacts 5701 But it affects all platforms, not just ones that ia64 which have the unaligned trap cost. For example, we _DEFINITELY_ don't want to do what your patch causes to happen on x86. From xma@us.ibm.com Wed Oct 8 11:56:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 11:57:21 -0700 (PDT) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Iuf25024623 for ; Wed, 8 Oct 2003 11:56:48 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h98Itqxu504276; Wed, 8 Oct 2003 14:55:52 -0400 Received: from d03nm124.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h98ItpgD160132; Wed, 8 Oct 2003 12:55:52 -0600 Importance: Normal Sensitivity: Subject: Re: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable To: mashirle@us.ibm.com Cc: davem@redhat.com, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: Shirley Ma Date: Wed, 8 Oct 2003 11:55:49 -0700 X-MIMETrack: Serialize by Router on D03NM124/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 10/08/2003 12:55:51 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 672 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xma@us.ibm.com Precedence: bulk X-list: netdev I think it's better to define MAX_JIFFIES unsigned long. #define MAX_JIFFIES (~0UL) Should I resent the whole patch again? Thanks Shirley Ma IBM Linux Technology Center 15300 SW Koll Parkway Beaverton, OR 97006-6063 Phone: (503) 578-7638 FAX: (503) 578-3228 From ak@suse.de Wed Oct 8 12:00:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 12:00:55 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98J0B25025011 for ; Wed, 8 Oct 2003 12:00:12 -0700 Received: from Hermes.suse.de (Hermes.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 4221A16C7E66; Wed, 8 Oct 2003 20:37:43 +0200 (CEST) Date: Wed, 8 Oct 2003 20:37:42 +0200 From: Andi Kleen To: Steve Modica Cc: "David S. Miller" , johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-ID: <20031008183742.GA24822@wotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F8455BE.8080300@sgi.com> X-archive-position: 673 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 > The problem is that on the Altix platform they have to deal with unaligned > accesses via an exception handler. This causes them to run through > hundreds of instructions. There's evidntally another mechanism in the cpu > that's more efficient in daling with unaligned accesses, but we can't use > that for some reason (atomicity I think, but I don't recall). Atomicity should not be needed to access a private skb. Maybe you didn't want to change the core stack to use the unaligned access mechanism? In that case it may be better to fix the stack with some macro that expands to the unaligned access on IA64 and a normal load on other architectures. -Andi From johnip@sgi.com Wed Oct 8 12:03:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 12:03:43 -0700 (PDT) Received: from tolkor.sgi.com (tolkor.SGI.COM [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98J3A25025420 for ; Wed, 8 Oct 2003 12:03:11 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h98JKrHc028767 for ; Wed, 8 Oct 2003 14:20:53 -0500 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h98J35cc12015208; Wed, 8 Oct 2003 14:03:05 -0500 (CDT) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h98J2vRn311093413; Wed, 8 Oct 2003 14:03:01 -0500 (CDT) Message-ID: <3F845F61.9080002@sgi.com> Date: Wed, 08 Oct 2003 14:02:57 -0500 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030905 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F844EF9.9090901@sgi.com> <20031008112657.2adddeb6.davem@redhat.com> In-Reply-To: <20031008112657.2adddeb6.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 674 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev OK, fair enough, you mean like :- #if defined(__ia64__) if (len > RX_COPY_THRESHOLD && tp->rx_offset == 2) { #else if (len > RX_COPY_THRESHOLD) { #endif David S. Miller wrote: > On Wed, 08 Oct 2003 12:52:57 -0500 > John Partridge wrote: > > >>Not too much different > > > The problem is that your change is arch-dependant yet you make it > run on all platforms. > > On x86 we don't want to do what your change is doing, the unaligned > accesses are cheap enough. > > We need to abstract this, probably in the same way it is done in > the Tulip and other drivers which have similar issues. -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From modica@sgi.com Wed Oct 8 12:11:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 12:12:28 -0700 (PDT) Received: from rj.sgi.com (mtvcafw.SGI.COM [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98JBs25025942 for ; Wed, 8 Oct 2003 12:11:54 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by rj.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h98HFhOO006008 for ; Wed, 8 Oct 2003 10:15:43 -0700 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h98JBmcc12021654; Wed, 8 Oct 2003 14:11:48 -0500 (CDT) Received: from sgi.com (eagdhcp-232-154.americas.sgi.com [128.162.232.154]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h98JBlRn316819579; Wed, 8 Oct 2003 14:11:47 -0500 (CDT) Message-ID: <3F846173.9090107@sgi.com> Date: Wed, 08 Oct 2003 14:11:47 -0500 From: Steve Modica Organization: SGI User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: johnip@sgi.com CC: "David S. Miller" , netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F844EF9.9090901@sgi.com> <20031008112657.2adddeb6.davem@redhat.com> <3F845F61.9080002@sgi.com> In-Reply-To: <3F845F61.9080002@sgi.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 675 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev I think it'd be better to create some macro like this: #ifdef FORCE_SKB_ALIGNMENT # define SKB_COPY_CHECK(len) len > RX_COPY_THRESHOLD && tp->rx_offset == 2 #else # define SKB_COPY_CHECK(len) len > RX_COPY_THRESHOLD #endif Then replace the code in the if with the new macro. We can define FORCE_SKB_ALIGNMENT in our build environment as can others if necessary. otherwise, everyone does what they did before. Steve John Partridge wrote: > OK, fair enough, you mean like :- > > #if defined(__ia64__) > if (len > RX_COPY_THRESHOLD && tp->rx_offset == 2) { > #else > if (len > RX_COPY_THRESHOLD) { > #endif > > > > David S. Miller wrote: > >> On Wed, 08 Oct 2003 12:52:57 -0500 >> John Partridge wrote: >> >> >>> Not too much different >> >> >> >> The problem is that your change is arch-dependant yet you make it >> run on all platforms. >> >> On x86 we don't want to do what your change is doing, the unaligned >> accesses are cheap enough. >> >> We need to abstract this, probably in the same way it is done in >> the Tulip and other drivers which have similar issues. > > -- Steve Modica work: 651-683-3224 MTS-Technical Lead "Give a man a fish, and he will eat for a day, hit him with a fish and he leaves you alone" - me From davem@pizda.ninka.net Wed Oct 8 12:20:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 12:21:22 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98JKm25029194 for ; Wed, 8 Oct 2003 12:20:48 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA10059; Wed, 8 Oct 2003 12:15:24 -0700 Date: Wed, 8 Oct 2003 12:15:24 -0700 From: "David S. Miller" To: Steve Modica Cc: johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031008121524.2faa23c4.davem@redhat.com> In-Reply-To: <3F846173.9090107@sgi.com> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F844EF9.9090901@sgi.com> <20031008112657.2adddeb6.davem@redhat.com> <3F845F61.9080002@sgi.com> <3F846173.9090107@sgi.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 676 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 On Wed, 08 Oct 2003 14:11:47 -0500 Steve Modica wrote: > I think it'd be better to create some macro like this: Please, do this right. Make a "CONFIG_UNALIGNED_VERY_SLOW" or something that platforms can define, and then drivers can ifdef upon. From davem@pizda.ninka.net Wed Oct 8 12:27:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 12:28:28 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98JRr25029662 for ; Wed, 8 Oct 2003 12:27:53 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA10106; Wed, 8 Oct 2003 12:22:23 -0700 Date: Wed, 8 Oct 2003 12:22:23 -0700 From: "David S. Miller" To: Andi Kleen Cc: modica@sgi.com, johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031008122223.1ba5ac79.davem@redhat.com> In-Reply-To: <20031008183742.GA24822@wotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 677 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 On Wed, 8 Oct 2003 20:37:42 +0200 Andi Kleen wrote: > Maybe you didn't want to change the core stack to use the unaligned > access mechanism? > > In that case it may be better to fix the stack with some macro > that expands to the unaligned access on IA64 and a normal load > on other architectures. I have a very strong feeling that we'd really need both options to arrive at an optimal implementation on all platforms. Something that makes drivers copy packets, and something else that traps packet header accesses. But I don't like any of these solutions (and I know Linus will never accept a set of changes that puts netdev_get_unaligned() macro usage all over the entire networking layer). Instead, we should do what you proposed long ago. Seperating the protocol headers from the packet data. Then we need only align the protocol headers. In fact, I can suggest a very efficient implementation: 1) Driver allocates paged SKBs. There is ~128 bytes of skb->data buffer area, and pages are chopped up into MTU'ish sized chunks and hung onto SKBs in the frag list. 2) The device is given the page buffers to receive packets into. 3) On RX, align skb->data (ie. skb_reserve(skb, 2) for ethernet drivers) and copy the first N bytes from the head of the paged buffer to skb->data, point the fraglist entry for the page at offset "N" into the page chunk buffer. Problem solved. From davem@pizda.ninka.net Wed Oct 8 13:05:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 13:06:20 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98K5e25030783 for ; Wed, 8 Oct 2003 13:05:41 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA10333; Wed, 8 Oct 2003 13:00:16 -0700 Date: Wed, 8 Oct 2003 13:00:16 -0700 From: "David S. Miller" To: Shirley Ma Cc: mashirle@us.ibm.com, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] Implementation for IPv6 MIB:ipv6AddressTable Message-Id: <20031008130016.559b8047.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 678 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 On Wed, 8 Oct 2003 11:55:49 -0700 Shirley Ma wrote: > I think it's better to define MAX_JIFFIES unsigned long. > > #define MAX_JIFFIES (~0UL) > > Should I resent the whole patch again? I think this is still incorrect, MAX_JIFFIES is "(~0UL >> 1)" From davem@pizda.ninka.net Wed Oct 8 13:29:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 13:30:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98KTQ25031654 for ; Wed, 8 Oct 2003 13:29:26 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA10457; Wed, 8 Oct 2003 13:24:02 -0700 Date: Wed, 8 Oct 2003 13:24:02 -0700 From: "David S. Miller" To: Andi Kleen Cc: ak@suse.de, modica@sgi.com, johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031008132402.64984528.davem@redhat.com> In-Reply-To: <20031008202248.GA15611@oldwotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 679 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 On Wed, 8 Oct 2003 22:22:48 +0200 Andi Kleen wrote: > It's not that it's a new problem - we had this since the Alpha port > and it hasn't gotten more urgent suddenly. Frankly, I just want to shut all the ia64 users up because they keep barking due to the kernel unaligned trap message that port spits out. > Hmm - you mean it allocates a full page and does suballocation by itself? We could write some helper routines. > The suballocation would need to be per CPU to be SMP efficient I guess, > which would complicate it. Andi, stop right there, we're talking about mitigating the horrible performance some $6.00 USD Taiwaneese network cards get on expensive ia64 systems. How much effort do you think we should drain into optimizing this? :-) From ak@suse.de Wed Oct 8 13:33:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 13:33:47 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98KXC25032066 for ; Wed, 8 Oct 2003 13:33:13 -0700 Received: from Hermes.suse.de (Hermes.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 979B716C7EE1; Wed, 8 Oct 2003 22:33:07 +0200 (CEST) Date: Wed, 8 Oct 2003 22:33:06 +0200 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , modica@sgi.com, johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-ID: <20031008203306.GB15611@oldwotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <20031008132402.64984528.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031008132402.64984528.davem@redhat.com> X-archive-position: 680 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 > > The suballocation would need to be per CPU to be SMP efficient I guess, > > which would complicate it. > > Andi, stop right there, we're talking about mitigating the horrible > performance some $6.00 USD Taiwaneese network cards get on expensive > ia64 systems. How much effort do you think we should drain into > optimizing this? :-) Well, this thread was about the tigon3 and I don't see that as an el cheapo card. If SGI uses it on the Altix I guess they want it to perform well with many CPUs. Anyways, it was just a brain dump regarding your idea. I personally think it's better to just use slab to implement it, allocating pages doesn't seem to have any advantages to me. -Andi From davem@redhat.com Wed Oct 8 13:33:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 13:34:23 -0700 (PDT) Received: from rth.ninka.net (rth.ninka.net [216.101.162.244]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98KXn25032099 for ; Wed, 8 Oct 2003 13:33:49 -0700 Received: from rth.ninka.net (localhost.localdomain [127.0.0.1]) by rth.ninka.net (8.12.8/8.12.8) with SMTP id h98KXj72006231; Wed, 8 Oct 2003 13:33:46 -0700 Date: Wed, 8 Oct 2003 13:33:45 -0700 From: "David S. Miller" To: acme@conectiva.com.br Cc: netdev@oss.sgi.com Subject: Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR Message-Id: <20031008133345.49f71991.davem@redhat.com> X-Mailer: Sylpheed version 0.9.6 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Wed__8_Oct_2003_13_33_45_-0700_ojs+lkjOa6soFJIR" X-archive-position: 681 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 This is a multi-part message in MIME format. --Multipart=_Wed__8_Oct_2003_13_33_45_-0700_ojs+lkjOa6soFJIR Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Arnaldo, I think this is another piece of fallout from the struct sock splitup you did ages ago. I think it's dereferencing inet_sk(sk) for a time-wait socket, so we probably need a TCP_TIME_WAIT test plus some additional logic here? Better check tcp_ipv6.c too. Begin forwarded message: Date: Wed, 8 Oct 2003 16:04:09 -0400 From: Dan Merillat To: linux-kernel@vger.kernel.org Subject: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR I can't provide a stacktrace because it hardlocks the system, but it's trivial to reproduce. Swap back and forth between apache2 and apache a few times, and it hardlocks at bind. From what I copied down and backtraced we crash at tcp_v4_get_port + 0x378/390, which is in tcp_ipv4.c:194 (inline tcp_bind_conflict) struct inet_opt *inet2 = inet_sk(sk2); if (!inet2->rcv_saddr || !inet->rcv_saddr || inet2->rcv_saddr == inet->rcv_saddr) break; 468: 0f b6 40 49 movzbl 0x49(%eax),%eax 46c: 83 e0 20 and $0x20,%eax 46f: 84 c0 test %al,%al In fact, I believe the problem to be with SO_REUSEADDR. It only manifests if the port has gotten traffic and there's sockets in TIME_WAIT. I suppose a trivial test would be to bind to a port, connect to it, disconnect, close the socket, create a socket with SO_REUSEADDR and rebind to it. Pow. I can't get UML 2.6.0 working so I can't test very well, but it's a helluva showstopper. The strace of apache starting up when it crashed: socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3 fcntl64(3, F_DUPFD, 15) = 20 close(3) = 0 setsockopt(20, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 setsockopt(20, SOL_SOCKET, SO_KEEPALIVE, [1], 4 (oopsed in bind so strace never saw it) --Dan --Multipart=_Wed__8_Oct_2003_13_33_45_-0700_ojs+lkjOa6soFJIR Content-Type: application/pgp-signature; name="00000002.mimetmp" Content-Disposition: attachment; filename="00000002.mimetmp" Content-Transfer-Encoding: base64 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlENERCUUUvaEcyNWt5Y1NjRXhSZ3NnUkF1 OGtBSmo1V1dodW5LRTE0dDhxeGdyTDVjOVRKeHJKQUtDRjd6dUMKM0VNZTZLNnNKQ0hzb3JmQ0NH R2R0Zz09Cj1tUitpCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQoK --Multipart=_Wed__8_Oct_2003_13_33_45_-0700_ojs+lkjOa6soFJIR-- From davem@pizda.ninka.net Wed Oct 8 13:38:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 13:38:50 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98KcH25000375 for ; Wed, 8 Oct 2003 13:38:17 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA10541; Wed, 8 Oct 2003 13:32:48 -0700 Date: Wed, 8 Oct 2003 13:32:48 -0700 From: "David S. Miller" To: Andi Kleen Cc: ak@suse.de, modica@sgi.com, johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031008133248.1583ddcf.davem@redhat.com> In-Reply-To: <20031008203306.GB15611@oldwotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <20031008132402.64984528.davem@redhat.com> <20031008203306.GB15611@oldwotan.suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 682 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 On Wed, 8 Oct 2003 22:33:06 +0200 Andi Kleen wrote: > Well, this thread was about the tigon3 and I don't see that as an el cheapo > card. If SGI uses it on the Altix I guess they want it to perform well > with many CPUs. It's one of the oldest variants of the tg3 chip and it's full of hardware bugs when used in PCI-X. > I personally think it's better to just use slab to implement it, > allocating pages doesn't seem to have any advantages to me. The page chunk allocator is meant to make it easier to put the non-header parts in the frag list of the SKB, see? It means we don't need to do anything special in the networking, all the receive paths handle frag'd RX packets properly. We can't take pages SLAB is using and attach them to the fraglist of the SKB, kfree_skb() is going to try and put_page() on them. If we used slab, we'd need to do something like: 1) skb->h.raw or whatever have special meaning and point to different buffers. 2) There's a skb->data2 or something like that. Both are a lot of work compared to my suggestion. From ak@suse.de Wed Oct 8 13:46:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 13:47:00 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98KkP25001001 for ; Wed, 8 Oct 2003 13:46:25 -0700 Received: from Hermes.suse.de (Hermes.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 A76ED16C8E51; Wed, 8 Oct 2003 22:46:19 +0200 (CEST) Date: Wed, 8 Oct 2003 22:46:18 +0200 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , modica@sgi.com, johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-ID: <20031008204618.GC15611@oldwotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <20031008132402.64984528.davem@redhat.com> <20031008203306.GB15611@oldwotan.suse.de> <20031008133248.1583ddcf.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031008133248.1583ddcf.davem@redhat.com> X-archive-position: 683 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 Wed, Oct 08, 2003 at 01:32:48PM -0700, David S. Miller wrote: > On Wed, 8 Oct 2003 22:33:06 +0200 > Andi Kleen wrote: > > > Well, this thread was about the tigon3 and I don't see that as an el cheapo > > card. If SGI uses it on the Altix I guess they want it to perform well > > with many CPUs. > > It's one of the oldest variants of the tg3 chip and it's full > of hardware bugs when used in PCI-X. Ok. Why do we care about it then? Copying should be fine for that. > > > I personally think it's better to just use slab to implement it, > > allocating pages doesn't seem to have any advantages to me. > > The page chunk allocator is meant to make it easier to put the > non-header parts in the frag list of the SKB, see? It means we > don't need to do anything special in the networking, all the > receive paths handle frag'd RX packets properly. Sure, but to handle the sub allocation you need a destructor per fragment. (otherwise how do you want to share a page between different packets) And when you have a destructor you can as well allocate from slab and convert the virtual pointer to (struct page *, offset) If you don't want to share pages between different packets: I don't like this because it would increase memory use of networking with 1.5k MTU by factor 2. I don't think that would be a good path to go down, Linux networking is already too bloated. BTW I think this all should be also ifdefed with CONFIG_SLOW_UNALIGNMENT. I certainly don't want any of this on x86-64 where unalignment cost one cycle only. Another BTW Actually this technique would allow socket buffers in highmem, but it's not really needed yet and all 32bit architecture which have high mem usually have fast unalignment handling. -Andi From ak@suse.de Wed Oct 8 13:52:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 13:52:56 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98KqB25001483 for ; Wed, 8 Oct 2003 13:52:11 -0700 Received: from Hermes.suse.de (Hermes.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 E558E16C8B78; Wed, 8 Oct 2003 22:22:50 +0200 (CEST) Date: Wed, 8 Oct 2003 22:22:48 +0200 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , modica@sgi.com, johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-ID: <20031008202248.GA15611@oldwotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031008122223.1ba5ac79.davem@redhat.com> X-archive-position: 684 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 > But I don't like any of these solutions (and I know Linus will never > accept a set of changes that puts netdev_get_unaligned() macro usage > all over the entire networking layer). Instead, we should do what > you proposed long ago. Seperating the protocol headers from the > packet data. Then we need only align the protocol headers. I agree that it would be the best solution, but isn't it a bit late in 2.6 now for that? Sounds more like a great 2.7.0 project. It's not that it's a new problem - we had this since the Alpha port and it hasn't gotten more urgent suddenly. For 2.6 short term probably some bandaid like the CONFIG_UNALIGNMENT_COSTLY and doing driver copies is better. > > In fact, I can suggest a very efficient implementation: > > 1) Driver allocates paged SKBs. There is ~128 bytes of skb->data > buffer area, and pages are chopped up into MTU'ish sized chunks > and hung onto SKBs in the frag list. Hmm - you mean it allocates a full page and does suballocation by itself? The suballocation would need to be per CPU to be SMP efficient I guess, which would complicate it. Another drawback that the page allocators per CPU allocator is not as strong as slabs, so it may perform not as good. And it would require the skb driver accessible destructor that was resisted against for so long to manage the suballocation lists ;-) But with such a destructor you would actually not need to do own allocation, because you could just convert the memory areas returned by slab to (struct page *, offset) -Andi From davem@pizda.ninka.net Wed Oct 8 13:56:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 13:57:30 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Kuu25001946 for ; Wed, 8 Oct 2003 13:56:56 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA10631; Wed, 8 Oct 2003 13:50:30 -0700 Date: Wed, 8 Oct 2003 13:50:30 -0700 From: "David S. Miller" To: Andi Kleen Cc: ak@suse.de, modica@sgi.com, johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031008135030.3dad33f9.davem@redhat.com> In-Reply-To: <20031008204618.GC15611@oldwotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <20031008132402.64984528.davem@redhat.com> <20031008203306.GB15611@oldwotan.suse.de> <20031008133248.1583ddcf.davem@redhat.com> <20031008204618.GC15611@oldwotan.suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 685 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 On Wed, 8 Oct 2003 22:46:18 +0200 Andi Kleen wrote: > On Wed, Oct 08, 2003 at 01:32:48PM -0700, David S. Miller wrote: > > The page chunk allocator is meant to make it easier to put the > > non-header parts in the frag list of the SKB, see? It means we > > don't need to do anything special in the networking, all the > > receive paths handle frag'd RX packets properly. > > Sure, but to handle the sub allocation you need a destructor per fragment. > (otherwise how do you want to share a page between different packets) Aha, no you don't, this is the beauty of it. Let's say we've packed 4 packets into a page (or 10 in 2 pages, whatever the optimal packing is), as you attach each chunk to a SKB you up the page count (if the buffer straddles 2 or more pages you use one frag entry for each of those pages and bump the count as approprise). As far as the networking is concerned, it's some page cache page or whatever, it doesn't care. Then kfree_skb(skb) just does the right thing by putting all the pages, when the page count goes to zero it's free'd up. > BTW I think this all should be also ifdefed with CONFIG_SLOW_UNALIGNMENT. > I certainly don't want any of this on x86-64 where unalignment cost > one cycle only. I agree, I don't even want this rediculious crap on sparc64 where I can make the unaligned trap handler 30 or 40 cycles or even less. BTW, your highmem example is interesting, but even more interesting are the cards that do the magic multiple-TCP-packet coalescing so that the data parts are all page aligned. They want infrastructure like this. From pe1rxq@amsat.org Wed Oct 8 14:44:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 14:45:33 -0700 (PDT) Received: from amsfep16-int.chello.nl (amsfep16-int.chello.nl [213.46.243.26]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Liw25003792 for ; Wed, 8 Oct 2003 14:44:59 -0700 Received: from mail.chello.nl ([212.83.83.7]) by amsfep16-int.chello.nl (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with SMTP id <20031008214451.QUIM6863.amsfep16-int.chello.nl@mail.chello.nl>; Wed, 8 Oct 2003 23:44:51 +0200 Date: Wed, 8 Oct 2003 23:51:50 +0200 From: Jeroen Vreeken To: "David S . Miller" Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] (resend) fix sock_raw behaviour Message-ID: <20031008235150.A207@jeroen.pe1rxq.ampr.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="AWniW0JNca5xppdA" Content-Transfer-Encoding: 8bit X-Mailer: Balsa 1.1.0 Lines: 125 X-archive-position: 686 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pe1rxq@amsat.org Precedence: bulk X-list: netdev --AWniW0JNca5xppdA Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Hi, This is a resend of a patch from some weeks ago that doesn't appear to have made it in yet... It fixes the behaviour of SOCK_RAW for ax25. (Current 2.6.0 behaviour is wrong, has a locking problem and reports the wrong address back) Please apply... Thanks, Jeroen --AWniW0JNca5xppdA Content-Type: application/octet-stream; charset=us-ascii Content-Disposition: attachment; filename="sock-raw.diff" --- linux-2.6.0-test5/net/ax25/af_ax25.c.org 2003-09-23 23:26:17.000000000 +0200 +++ linux-2.6.0-test5/net/ax25/af_ax25.c 2003-09-24 23:33:32.000000000 +0200 @@ -231,42 +231,29 @@ /* * Look for any matching address - RAW sockets can bind to arbitrary names */ -struct sock *ax25_addr_match(ax25_address *addr) +void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto) { - struct sock *sk = NULL; + struct sock *sk; ax25_cb *s; + struct sk_buff *copy; struct hlist_node *node; spin_lock_bh(&ax25_list_lock); ax25_for_each(s, node, &ax25_list) { if (s->sk != NULL && ax25cmp(&s->source_addr, addr) == 0 && - s->sk->sk_type == SOCK_RAW) { + s->sk->sk_type == SOCK_RAW && + s->sk->sk_protocol == proto && + (!s->ax25_dev || s->ax25_dev->dev == skb->dev)) { sk = s->sk; - lock_sock(sk); - break; + bh_lock_sock(sk); + if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf && + (copy = skb_clone(skb, GFP_ATOMIC)) != NULL) + if (sock_queue_rcv_skb(sk, copy) != 0) + kfree_skb(copy); + bh_unlock_sock(sk); } } - spin_unlock_bh(&ax25_list_lock); - - return sk; -} - -void ax25_send_to_raw(struct sock *sk, struct sk_buff *skb, int proto) -{ - struct sk_buff *copy; - struct hlist_node *node; - - sk_for_each_from(sk, node) - if (sk->sk_type == SOCK_RAW && - sk->sk_protocol == proto && - atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) { - if ((copy = skb_clone(skb, GFP_ATOMIC)) == NULL) - return; - - if (sock_queue_rcv_skb(sk, copy) != 0) - kfree_skb(copy); - } } /* @@ -1633,16 +1620,16 @@ if (msg->msg_namelen != 0) { struct sockaddr_ax25 *sax = (struct sockaddr_ax25 *)msg->msg_name; ax25_digi digi; - ax25_address dest; + ax25_address src; - ax25_addr_parse(skb->mac.raw+1, skb->data-skb->mac.raw-1, NULL, &dest, &digi, NULL, NULL); + ax25_addr_parse(skb->mac.raw+1, skb->data-skb->mac.raw-1, &src, NULL, &digi, NULL, NULL); sax->sax25_family = AF_AX25; /* We set this correctly, even though we may not let the application know the digi calls further down (because it did NOT ask to know them). This could get political... **/ sax->sax25_ndigis = digi.ndigi; - sax->sax25_call = dest; + sax->sax25_call = src; if (sax->sax25_ndigis != 0) { int ct; --- linux-2.6.0-test5/include/net/ax25.h.org 2003-09-24 23:21:27.000000000 +0200 +++ linux-2.6.0-test5/include/net/ax25.h 2003-09-24 23:21:55.000000000 +0200 @@ -227,8 +227,7 @@ struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int); struct sock *ax25_get_socket(ax25_address *, ax25_address *, int); extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); -extern struct sock *ax25_addr_match(ax25_address *); -extern void ax25_send_to_raw(struct sock *, struct sk_buff *, int); +extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); extern void ax25_destroy_socket(ax25_cb *); extern ax25_cb *ax25_create_cb(void); extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); --- linux-2.6.0-test5/include/net/ax25.h.org 2003-09-24 23:21:27.000000000 +0200 +++ linux-2.6.0-test5/include/net/ax25.h 2003-09-24 23:21:55.000000000 +0200 @@ -227,8 +227,7 @@ struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int); struct sock *ax25_get_socket(ax25_address *, ax25_address *, int); extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); -extern struct sock *ax25_addr_match(ax25_address *); -extern void ax25_send_to_raw(struct sock *, struct sk_buff *, int); +extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); extern void ax25_destroy_socket(ax25_cb *); extern ax25_cb *ax25_create_cb(void); extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); --AWniW0JNca5xppdA-- From pe1rxq@amsat.org Wed Oct 8 14:49:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 14:50:16 -0700 (PDT) Received: from amsfep11-int.chello.nl (amsfep11-int.chello.nl [213.46.243.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h98Lnf25004266 for ; Wed, 8 Oct 2003 14:49:42 -0700 Received: from mail.chello.nl ([212.83.83.7]) by amsfep11-int.chello.nl (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with SMTP id <20031008214935.QVFU25501.amsfep11-int.chello.nl@mail.chello.nl>; Wed, 8 Oct 2003 23:49:35 +0200 Date: Wed, 8 Oct 2003 23:56:34 +0200 From: Jeroen Vreeken To: Jeff Garzik Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] (resend) Message-ID: <20031008235634.C207@jeroen.pe1rxq.ampr.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="+fexcqMh/evT6CrY" Content-Transfer-Encoding: 8bit X-Mailer: Balsa 1.1.0 Lines: 63 X-archive-position: 687 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pe1rxq@amsat.org Precedence: bulk X-list: netdev --+fexcqMh/evT6CrY Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Hi, These patches don't seem to have made it into the mainstream kernel yet.... Can you please apply them? The first is a fix for the probe function of the scc driver which now uses an uninitialised scc struct for requesting an io region. The Second removes a verry old debug line from the bpqethernet driver that only fills logs. Thanks, Jeroen --+fexcqMh/evT6CrY Content-Type: application/octet-stream; charset=us-ascii Content-Disposition: attachment; filename="scc-2.6.0.t5.rxq.diff" --- linux-2.6.0-test5/drivers/net/hamradio/scc.c Mon Sep 8 21:50:22 2003 +++ linux-2.6.0-test5.rxq/drivers/net/hamradio/scc.c Tue Sep 16 22:41:36 2003 @@ -1767,7 +1767,7 @@ #ifndef SCC_DONT_CHECK - if(request_region(scc->ctrl, 1, "scc-probe")) + if(request_region(hwcfg.ctrl_a, 1, "scc-probe")) { disable_irq(hwcfg.irq); Outb(hwcfg.ctrl_a, 0); @@ -1779,7 +1779,7 @@ if (InReg(hwcfg.ctrl_a,R13) != 0x55) found = 0; enable_irq(hwcfg.irq); - release_region(scc->ctrl, 1); + release_region(hwcfg.ctrl_a, 1); } else found = 0; --+fexcqMh/evT6CrY Content-Type: application/octet-stream; charset=us-ascii Content-Disposition: attachment; filename="bpqether-2.6.0.t5.rxq.diff" --- linux-2.6.0-test5/drivers/net/hamradio/bpqether.c Mon Sep 8 21:50:03 2003 +++ linux-2.6.0-test5.rxq/drivers/net/hamradio/bpqether.c Mon Sep 15 15:40:16 2003 @@ -189,10 +189,8 @@ bpq = (struct bpqdev *)dev->priv; - if (!(bpq->acpt_addr[0] & 0x01) && memcmp(eth->h_source, bpq->acpt_addr, ETH_ALEN)) { - printk(KERN_DEBUG "bpqether: wrong dest %s\n", bpq_print_ethaddr(eth->h_source)); + if (!(bpq->acpt_addr[0] & 0x01) && memcmp(eth->h_source, bpq->acpt_addr, ETH_ALEN)) goto drop; - } len = skb->data[0] + skb->data[1] * 256 - 5; --+fexcqMh/evT6CrY-- From mashirle@us.ibm.com Wed Oct 8 17:06:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 08 Oct 2003 17:07:23 -0700 (PDT) Received: from linux2.suntekindustrial.com (wbar1.sjo1-4-4-004-065.sjo1.dsl-verizon.net [4.4.4.65]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9906e25011743 for ; Wed, 8 Oct 2003 17:06:48 -0700 Received: from ibm-mxl (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated bits=0) by linux2.suntekindustrial.com (8.12.8/8.12.8) with ESMTP id h990HEo7030307; Wed, 8 Oct 2003 17:17:15 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shirley Ma Organization: IBM Linux To: "David S. Miller" , kuznet@ms2.inr.ac.ru Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable Date: Wed, 8 Oct 2003 17:06:09 -0700 User-Agent: KMail/1.4.3 References: <20031008130016.559b8047.davem@redhat.com> In-Reply-To: <20031008130016.559b8047.davem@redhat.com> Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org MIME-Version: 1.0 Message-Id: <200310081706.09485.mashirle@us.ibm.com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h9906e25011743 X-archive-position: 688 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev You are right for MAX_JIFFIES. My intention using MAX_JIFFIES was to calculate the right address creation timestamp with the INITIAL_JIFFIES set when system boot up. Now I create a new patch to avoid using the MAX_JIFFIES. The patch has been tested against linux-2.6.0-test6-bk8. Thanks Shirley Ma IBM Linux Technology Center ---------------------------------------------- diff -urN linux-2.6.0-test6/include/linux/rtnetlink.h linux-2.6.0-test6-ipv6mib4/include/linux/rtnetlink.h --- linux-2.6.0-test6/include/linux/rtnetlink.h 2003-09-27 17:50:40.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/include/linux/rtnetlink.h 2003-10-08 00:15:38.000000000 -0700 @@ -352,8 +352,10 @@ struct ifa_cacheinfo { - __s32 ifa_prefered; - __s32 ifa_valid; + __u32 ifa_prefered; + __u32 ifa_valid; + __u32 cstamp; /* created timestamp, hundredths of seconds */ + __u32 tstamp; /* updated timestamp, hundredths of seconds */ }; diff -urN linux-2.6.0-test6/include/net/if_inet6.h linux-2.6.0-test6-ipv6mib4/include/net/if_inet6.h --- linux-2.6.0-test6/include/net/if_inet6.h 2003-09-27 17:51:07.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/include/net/if_inet6.h 2003-10-08 00:15:38.000000000 -0700 @@ -34,7 +34,8 @@ __u32 valid_lft; __u32 prefered_lft; - unsigned long tstamp; + unsigned long cstamp; /* created timestamp */ + unsigned long tstamp; /* updated timestamp */ atomic_t refcnt; spinlock_t lock; @@ -111,6 +112,8 @@ atomic_t mca_refcnt; spinlock_t mca_lock; unsigned char mca_crcount; + unsigned long mca_cstamp; + unsigned long mca_tstamp; }; /* Anycast stuff */ @@ -130,6 +133,8 @@ int aca_users; atomic_t aca_refcnt; spinlock_t aca_lock; + unsigned long aca_cstamp; + unsigned long aca_tstamp; }; #define IFA_HOST IPV6_ADDR_LOOPBACK diff -urN linux-2.6.0-test6/net/ipv6/addrconf.c linux-2.6.0-test6-ipv6mib4/net/ipv6/addrconf.c --- linux-2.6.0-test6/net/ipv6/addrconf.c 2003-09-27 17:51:02.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/addrconf.c 2003-10-08 16:32:05.000000000 -0700 @@ -92,6 +92,9 @@ #define ADBG(x) #endif +#define INFINITY_LIFE_TIME 0xFFFFFFFF +#define TIME_DELTA(a,b) ((unsigned long)((long)(a) - (long)(b))) + #ifdef CONFIG_SYSCTL static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p); static void addrconf_sysctl_unregister(struct ipv6_devconf *p); @@ -505,6 +508,7 @@ ifa->scope = scope; ifa->prefix_len = pfxlen; ifa->flags = flags | IFA_F_TENTATIVE; + ifa->cstamp = ifa->tstamp = jiffies; read_lock(&addrconf_lock); if (idev->dead) { @@ -707,6 +711,7 @@ ift->ifpub = ifp; ift->valid_lft = tmp_valid_lft; ift->prefered_lft = tmp_prefered_lft; + ift->cstamp = ifp->cstamp; ift->tstamp = ifp->tstamp; spin_unlock_bh(&ift->lock); addrconf_dad_start(ift, 0); @@ -1412,6 +1417,7 @@ } update_lft = create = 1; + ifp->cstamp = jiffies; addrconf_dad_start(ifp, RTF_ADDRCONF|RTF_PREFIX_RT); } @@ -2447,14 +2453,85 @@ if (!(ifa->flags&IFA_F_PERMANENT)) { ci.ifa_prefered = ifa->prefered_lft; ci.ifa_valid = ifa->valid_lft; - if (ci.ifa_prefered != 0xFFFFFFFF) { + if (ci.ifa_prefered != INFINITY_LIFE_TIME) { long tval = (jiffies - ifa->tstamp)/HZ; ci.ifa_prefered -= tval; - if (ci.ifa_valid != 0xFFFFFFFF) + if (ci.ifa_valid != INFINITY_LIFE_TIME) ci.ifa_valid -= tval; } - RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + } else { + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; } + ci.cstamp = (__u32)(TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) / HZ * 100); + ci.tstamp = (__u32)(TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) / HZ * 100); + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifmca->mca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifmca->idev->dev->ifindex; + RTA_PUT(skb, IFA_ADDRESS, 16, &ifmca->mca_addr); + ci.cstamp = (__u32)(TIME_DELTA(ifmca->mca_cstamp, INITIAL_JIFFIES) / HZ * 100); + ci.tstamp = (__u32)(TIME_DELTA(ifmca->mca_tstamp, INITIAL_JIFFIES) / HZ * 100); + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifacaddr(struct sk_buff *skb, struct ifacaddr6 *ifaca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifaca->aca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifaca->aca_idev->dev->ifindex; + RTA_PUT(skb, IFA_ADDRESS, 16, &ifaca->aca_addr); + ci.cstamp = (__u32)(TIME_DELTA(ifaca->aca_cstamp, INITIAL_JIFFIES) / HZ * 100); + ci.tstamp = (__u32)(TIME_DELTA(ifaca->aca_tstamp, INITIAL_JIFFIES) / HZ * 100); + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); nlh->nlmsg_len = skb->tail - b; return skb->len; @@ -2468,33 +2545,79 @@ { int idx, ip_idx; int s_idx, s_ip_idx; - struct inet6_ifaddr *ifa; - + int err = 1; + struct net_device *dev; + struct inet6_dev *idev = NULL; + struct inet6_ifaddr *ifa; + struct ifmcaddr6 *ifmca; + struct ifacaddr6 *ifaca; + s_idx = cb->args[0]; s_ip_idx = ip_idx = cb->args[1]; - - for (idx=0; idx < IN6_ADDR_HSIZE; idx++) { + read_lock(&dev_base_lock); + + for (dev = dev_base, idx = 0; dev; dev = dev->next, idx++) { if (idx < s_idx) continue; if (idx > s_idx) s_ip_idx = 0; - read_lock_bh(&addrconf_hash_lock); - for (ifa=inet6_addr_lst[idx], ip_idx = 0; ifa; - ifa = ifa->lst_next, ip_idx++) { + ip_idx = 0; + if ((idev = in6_dev_get(dev)) == NULL) + continue; + read_lock_bh(&idev->lock); + /* unicast address */ + for (ifa = idev->addr_list; ifa; + ifa = ifa->if_next, ip_idx++) { if (ip_idx < s_ip_idx) continue; - if (inet6_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR) <= 0) { - read_unlock_bh(&addrconf_hash_lock); + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) goto done; - } } - read_unlock_bh(&addrconf_hash_lock); + /* temp addr */ +#ifdef CONFIG_IPV6_PRIVACY + for (ifa = idev->tempaddr_list; ifa; + ifa = ifua->tmp_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } +#endif + /* multicast address */ + for (ifmca = idev->mc_list; ifmca; + ifmca = ifmca->next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifmcaddr(skb, ifmca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } + /* anycast address */ + for (ifaca = idev->ac_list; ifaca; + ifaca = ifaca->aca_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifacaddr(skb, ifaca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } + read_unlock_bh(&idev->lock); + in6_dev_put(idev); } done: + if (err <= 0) { + read_unlock_bh(&idev->lock); + in6_dev_put(idev); + } + read_unlock(&dev_base_lock); cb->args[0] = idx; cb->args[1] = ip_idx; - return skb->len; } diff -urN linux-2.6.0-test6/net/ipv6/anycast.c linux-2.6.0-test6-ipv6mib4/net/ipv6/anycast.c --- linux-2.6.0-test6/net/ipv6/anycast.c 2003-09-27 17:50:06.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/anycast.c 2003-10-08 00:15:38.000000000 -0700 @@ -343,6 +343,8 @@ ipv6_addr_copy(&aca->aca_addr, addr); aca->aca_idev = idev; aca->aca_users = 1; + /* aca_tstamp should be updated upon changes */ + aca->aca_cstamp = aca->aca_tstamp = jiffies; atomic_set(&aca->aca_refcnt, 2); aca->aca_lock = SPIN_LOCK_UNLOCKED; diff -urN linux-2.6.0-test6/net/ipv6/mcast.c linux-2.6.0-test6-ipv6mib4/net/ipv6/mcast.c --- linux-2.6.0-test6/net/ipv6/mcast.c 2003-09-27 17:50:53.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/mcast.c 2003-10-08 00:15:38.000000000 -0700 @@ -830,6 +830,8 @@ ipv6_addr_copy(&mc->mca_addr, addr); mc->idev = idev; mc->mca_users = 1; + /* mca_stamp should be updated upon changes */ + mc->mca_cstamp = mc->mca_tstamp = jiffies; atomic_set(&mc->mca_refcnt, 2); mc->mca_lock = SPIN_LOCK_UNLOCKED; From mustafa.solmaz@uk.thalesgroup.com Thu Oct 9 07:29:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 07:29:43 -0700 (PDT) Received: from ntsc0033.int.rdel.co.uk (mail.uk.thalesgroup.com [194.128.85.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h99ET825005686 for ; Thu, 9 Oct 2003 07:29:09 -0700 Received: from mail.uk.thalesgroup.com (lisc0021.int.rdel.co.uk) by ntsc0033.int.rdel.co.uk (Content Technologies SMTPRS 4.2.10) with ESMTP id ; Thu, 9 Oct 2003 15:29:01 +0100 Received: from mail.tms-ltd.com ([193.150.182.140]) by mail.uk.thalesgroup.com (8.12.8/8.12.8) with ESMTP id h99ESxaV016380; Thu, 9 Oct 2003 15:29:00 +0100 Received: by mail.tms-ltd.com with Internet Mail Service (5.5.2653.19) id ; Thu, 9 Oct 2003 15:28:58 +0100 Message-ID: <41DD7618430DD411870400D0B746EDED0DC82C4F@mail.tms-ltd.com> From: Solmaz Mustafa To: netdev@oss.sgi.com Cc: linux-net@vger.kernel.org Subject: Atomic.h for PPC Date: Thu, 9 Oct 2003 15:28:50 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-archive-position: 689 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mustafa.solmaz@uk.thalesgroup.com Precedence: bulk X-list: netdev Hello, I am trying to develop a program on PowerPC and as trying to use LOKI's smart pointers I had some problems of compilation. Loki's headers use atomic_inc_and_test() and atomic_dec_and_test() atomic operations for multi-threaded purpose. Those methods are available in many of Linux Kernel APIs but in the one for Power PCs. Almost all /usr/include/asm/atomic.h files have those methods well defined but on Power PCs. My atomic.h is 11th version and that it has atomic_inc_return() method which I suppose will be used later as atomic_inc_and_test() method. Would you please show me a way to sort out this problem? I can write my own methods using the current atomic.h but I just do not know how to implement it in a safe way. Best regards, Mustafa SOLMAZ Thales Underwater Systems United Kingdom +441963 372 152 This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify Thales Underwater Systems on +44 1963 370 551. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. From dank@kegel.com Thu Oct 9 08:23:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 08:24:05 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h99FNQ25011947 for ; Thu, 9 Oct 2003 08:23:27 -0700 Received: (qmail 43872 invoked from network); 9 Oct 2003 15:23:25 -0000 Received: from c-24-126-73-164.we.client2.attbi.com (HELO kegel.com) (24.126.73.164) by relay.pair.com with SMTP; 9 Oct 2003 15:23:25 -0000 X-pair-Authenticated: 24.126.73.164 Message-ID: <3F8585EC.3040908@kegel.com> Date: Thu, 09 Oct 2003 08:59:40 -0700 From: Dan Kegel User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: de-de, en MIME-Version: 1.0 To: Solmaz Mustafa CC: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Atomic.h for PPC References: <41DD7618430DD411870400D0B746EDED0DC82C4F@mail.tms-ltd.com> In-Reply-To: <41DD7618430DD411870400D0B746EDED0DC82C4F@mail.tms-ltd.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 690 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dank@kegel.com Precedence: bulk X-list: netdev Solmaz Mustafa wrote: > I am trying to develop a program on PowerPC and as trying to use LOKI's > smart pointers I had some problems of compilation. > Loki's headers use atomic_inc_and_test() and atomic_dec_and_test() atomic > operations for multi-threaded purpose. Those methods are available in many > of Linux Kernel APIs but in the one for Power PCs. Almost all > /usr/include/asm/atomic.h files have those methods well defined but on Power > PCs. > > My atomic.h is 11th version and that it has atomic_inc_return() method which > I suppose will be used later as atomic_inc_and_test() method. > Would you please show me a way to sort out this problem? I can write my own > methods using the current atomic.h but I just do not know how to implement > it in a safe way. This is off-topic for linux-net. Please try posting your question on a more appropriate group, e.g. one of the lists at http://lists.linuxppc.org/ I have a feeling you're writing a user-mode program, so you shouldn't care about the kernel's atomic operations. Since you seem to be using c++, I'd suggest having a look at http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html#Thread%20safety and maybe searching the archives of the gcc or libstdc++ mailing lists for similar questions. - Dan -- Dan Kegel http://www.kegel.com http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045 From shemminger@osdl.org Thu Oct 9 09:38:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 09:39:19 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h99Gch25014918 for ; Thu, 9 Oct 2003 09:38:44 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h99GcBo21007; Thu, 9 Oct 2003 09:38:11 -0700 Date: Thu, 9 Oct 2003 09:37:52 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] memory leak in irda/sa1100_ir.c Message-Id: <20031009093752.01a374bc.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 691 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 driver seems confused about what get done for it on module exit. It needs to free the network device it created. Patch against 2.6.0-test7 diff -urN -X dontdiff linux-2.5/drivers/net/irda/sa1100_ir.c linux-2.5-net/drivers/net/irda/sa1100_ir.c --- linux-2.5/drivers/net/irda/sa1100_ir.c 2003-09-30 13:53:58.000000000 -0700 +++ linux-2.5-net/drivers/net/irda/sa1100_ir.c 2003-09-17 15:49:30.000000000 -0700 @@ -1132,12 +1132,8 @@ release_mem_region(__PREG(Ser2HSCR0), 0x1c); release_mem_region(__PREG(Ser2UTCR0), 0x24); - /* - * We now know that the netdevice is no longer in use, and all - * references to our driver have been removed. The only structure - * which may still be present is the netdevice, which will get - * cleaned up by net/core/dev.c - */ + if(dev) + free_netdev(dev); } static int __init sa1100ir_setup(char *line) From harik@chaos.ao.net Thu Oct 9 10:03:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 10:04:34 -0700 (PDT) Received: from chaos.ao.net (root@chaos.ao.net [65.205.176.185]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h99H3q25015970 for ; Thu, 9 Oct 2003 10:03:54 -0700 Received: from chaos.ao.net (harik@localhost [127.0.0.1]) by chaos.ao.net (8.12.9/8.12.9/Debian-5) with ESMTP id h99H3pip001790 for ; Thu, 9 Oct 2003 13:03:51 -0400 Received: (from harik@localhost) by chaos.ao.net (8.12.9/8.12.9/Debian-5) id h99H3puD001789 for netdev@oss.sgi.com; Thu, 9 Oct 2003 13:03:51 -0400 Date: Thu, 9 Oct 2003 13:03:51 -0400 From: Dan Merillat To: netdev@oss.sgi.com Subject: Re: Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR Message-ID: <20031009170350.GA1582@chaos.ao.net> References: <20031008133345.49f71991.davem@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gKMricLos+KVdGMg" Content-Disposition: inline In-Reply-To: <20031008133345.49f71991.davem@redhat.com> User-Agent: Mutt/1.5.4i X-archive-position: 692 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dmerillat@sequiam.com Precedence: bulk X-list: netdev --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, 08 Oct 2003, David S. Miller wrote: > Arnaldo, I think this is another piece of fallout > from the struct sock splitup you did ages ago. >=20 > I think it's dereferencing inet_sk(sk) for a time-wait > socket, so we probably need a TCP_TIME_WAIT test plus > some additional logic here? Better check tcp_ipv6.c too. Found some more on this, it's been entered into the kernel bug-tracker http://bugme.osdl.org/show_bug.cgi?id=3D1271 He managed to get an oops out of his: Unable to handle kernel NULL pointer dereference at virtual address 00000049 printing eip: c030b346 *pde =3D 00000000 Oops: 0000 [#1] CPU: 1 EIP: 0060:[] Not tainted EFLAGS: 00010246 EIP is at tcp_v4_get_port+0x3c6/0x3e0 eax: 00000000 ebx: f74ff380 ecx: f667ff40 edx: f667ff50 esi: 00000002 edi: 00002151 ebp: f66097c0 esp: f6b0be68 ds: 007b es: 007b ss: 0068 Process perl (pid: 3433, threadinfo=3Df6b0a000 task=3Df6b0d900) Stack: 00000000 00000000 00000000 f66270d0 00000000 00000000 00000001 f6609= 908=20 00000000 00000000 00000000 00000001 f7c90a88 f66097c0 ffffffea f6609= 908=20 f6b0bee8 c031f215 f66097c0 00002151 c02d568d 00000003 21511818 f6612= 740=20 Call Trace: [] inet_bind+0x1d5/0x300 [] move_addr_to_kernel+0x8d/0xa0 [] sys_bind+0x7b/0xb0 [] do_page_fault+0x23c/0x44f [] sockfd_lookup+0x1c/0x80 [] sys_setsockopt+0x78/0xc0 [] sys_socketcall+0xc8/0x2b0 [] sysenter_past_esp+0x52/0x71 Code: 0f b6 40 49 24 20 84 c0 75 97 eb 89 89 14 24 e8 06 51 e1 ff=20 <0>Kernel panic: Fatal exception in interrupt In interrupt handler - not syncing --gKMricLos+KVdGMg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iD8DBQE/hZT2kycScExRgsgRAnXrAJ9ttKjS7RuZCSWpKpx4aYBXkRy/KwCfSQYA ngJBt1xWL4yLp0PU4a/dHjY= =RCwu -----END PGP SIGNATURE----- --gKMricLos+KVdGMg-- From krishnakumar@naturesoft.net Thu Oct 9 10:46:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 10:47:02 -0700 (PDT) Received: from naturesoft.net ([203.145.184.221]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h99HkQ25017603 for ; Thu, 9 Oct 2003 10:46:28 -0700 Received: from [192.168.0.80] (helo=interogator.naturesoft.com) by naturesoft.net with esmtp (Exim 3.35 #1) id 1A7ezV-0006vg-00; Thu, 09 Oct 2003 23:24:21 +0530 From: "Krishnakumar. R" Reply-To: krishnakumar@naturesoft.net Organization: Naturesoft To: jgarzik@pobox.com Subject: [PATCH] 8139too.c Network interface messages Date: Thu, 9 Oct 2003 12:41:26 +0530 User-Agent: KMail/1.5 Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310091241.26027.krishnakumar@naturesoft.net> X-archive-position: 693 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krishnakumar@naturesoft.net Precedence: bulk X-list: netdev Hi, This patch enables the network interface message settings in the Realtek 8139 driver - 8139too.c. The patch is against 2.6.0-test6 kernel. It introduces the new variable in the private structure of the 8139too (msg_enable) and various debug printks can be activated and deactivated (using the ethtool) after the patch is applied. The following kernel apis for the Network interface logging has been introduced into the 8139too.c by this patch. 1. netif_msg_link 2. netif_msg_ifdown 3. netif_msg_ifup 4. netif_msg_rx_err 5. netif_msg_tx_err 6. netif_msg_tx_queued 7. netif_msg_intr 8. netif_msg_rx_status From this I have tested the 1,2,3,6,7 and 8 with the ethtool. Regards KK diffstat output: -------------------- 8139too.c | 50 ++++++++++++++++++++++++++++++++------------------ 1 files changed, 32 insertions(+), 18 deletions(-) The patch --------------- --- linux-2.6.0-test6/drivers/net/8139too.orig.c 2003-09-28 06:20:05.000000000 +0530 +++ linux-2.6.0-test6/drivers/net/8139too.c 2003-10-09 12:12:40.787777240 +0530 @@ -117,6 +117,11 @@ #define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION #define PFX DRV_NAME ": " +/* Default Message level */ +#define RTL8139_DEF_MSG_ENABLE (NETIF_MSG_DRV | \ + NETIF_MSG_PROBE | \ + NETIF_MSG_LINK) + /* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */ #ifdef CONFIG_8139TOO_PIO @@ -557,6 +562,7 @@ int drv_flags; struct pci_dev *pci_dev; u32 pci_state[16]; + u32 msg_enable; struct net_device_stats stats; unsigned char *rx_ring; unsigned int cur_rx; /* Index into the Rx buffer of next Rx pkt. */ @@ -983,6 +989,7 @@ /* note: tp->chipset set in rtl8139_init_board */ tp->drv_flags = board_info[ent->driver_data].hw_flags; tp->mmio_addr = ioaddr; + tp->msg_enable = (debug < 0 ? RTL8139_DEF_MSG_ENABLE : debug); spin_lock_init (&tp->lock); init_waitqueue_head (&tp->thr_wait); init_completion (&tp->thr_exited); @@ -1285,9 +1292,7 @@ { struct rtl8139_private *tp = dev->priv; int retval; -#ifdef RTL8139_DEBUG void *ioaddr = tp->mmio_addr; -#endif retval = request_irq (dev->irq, rtl8139_interrupt, SA_SHIRQ, dev->name, dev); if (retval) @@ -1317,7 +1322,8 @@ rtl8139_init_ring (dev); rtl8139_hw_start (dev); - DPRINTK ("%s: rtl8139_open() ioaddr %#lx IRQ %d" + if (netif_msg_ifup(tp)) + printk(KERN_DEBUG "%s: rtl8139_open() ioaddr %#lx IRQ %d" " GP Pins %2.2x %s-duplex.\n", dev->name, pci_resource_start (tp->pci_dev, 1), dev->irq, RTL_R8 (MediaStatus), @@ -1334,7 +1340,7 @@ struct rtl8139_private *tp = dev->priv; if (tp->phys[0] >= 0) { - mii_check_media(&tp->mii, 1, init_media); + mii_check_media(&tp->mii, netif_msg_link(tp), init_media); } } @@ -1717,8 +1723,9 @@ netif_stop_queue (dev); spin_unlock_irq(&tp->lock); - DPRINTK ("%s: Queued Tx packet size %u to slot %d.\n", - dev->name, len, entry); + if (netif_msg_tx_queued(tp)) + printk (KERN_DEBUG "%s: Queued Tx packet size %u to slot %d.\n", + dev->name, len, entry); return 0; } @@ -1748,8 +1755,9 @@ /* Note: TxCarrierLost is always asserted at 100mbps. */ if (txstatus & (TxOutOfWindow | TxAborted)) { /* There was an major error, log it. */ - DPRINTK ("%s: Transmit error, Tx status %8.8x.\n", - dev->name, txstatus); + if (netif_msg_tx_err(tp)) + printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n", + dev->name, txstatus); tp->stats.tx_errors++; if (txstatus & TxAborted) { tp->stats.tx_aborted_errors++; @@ -1804,8 +1812,9 @@ int tmp_work; #endif - DPRINTK ("%s: Ethernet frame had errors, status %8.8x.\n", - dev->name, rx_status); + if (netif_msg_rx_err (tp)) + printk(KERN_DEBUG "%s: Ethernet frame had errors, status %8.8x.\n", + dev->name, rx_status); tp->stats.rx_errors++; if (!(rx_status & RxStatusOK)) { if (rx_status & RxTooLong) { @@ -1909,8 +1918,9 @@ rx_size = rx_status >> 16; pkt_size = rx_size - 4; - DPRINTK ("%s: rtl8139_rx() status %4.4x, size %4.4x," - " cur %4.4x.\n", dev->name, rx_status, + if (netif_msg_rx_status(tp)) + printk(KERN_DEBUG "%s: rtl8139_rx() status %4.4x, size %4.4x," + " cur %4.4x.\n", dev->name, rx_status, rx_size, cur_rx); #if RTL8139_DEBUG > 2 { @@ -2071,8 +2081,9 @@ ackstat = status & ~(RxAckBits | TxErr); RTL_W16 (IntrStatus, ackstat); - DPRINTK ("%s: interrupt status=%#4.4x ackstat=%#4.4x new intstat=%#4.4x.\n", - dev->name, status, ackstat, RTL_R16 (IntrStatus)); + if (netif_msg_intr(tp)) + printk (KERN_DEBUG "%s: interrupt status=%#4.4x ackstat=%#4.4x new intstat=%#4.4x.\n", + dev->name, status, ackstat, RTL_R16 (IntrStatus)); if (netif_running (dev) && (status & RxAckBits)) rtl8139_rx_interrupt (dev, tp, ioaddr); @@ -2127,8 +2138,9 @@ } wait_for_completion (&tp->thr_exited); } - - DPRINTK ("%s: Shutting down ethercard, status was 0x%4.4x.\n", + + if (netif_msg_ifdown(tp)) + printk(KERN_DEBUG "%s: Shutting down ethercard, status was 0x%4.4x.\n", dev->name, RTL_R16 (IntrStatus)); spin_lock_irqsave (&tp->lock, flags); @@ -2286,12 +2298,14 @@ static u32 rtl8139_get_msglevel(struct net_device *dev) { - return debug; + struct rtl8139_private *np = dev->priv; + return np->msg_enable; } static void rtl8139_set_msglevel(struct net_device *dev, u32 datum) { - debug = datum; + struct rtl8139_private *np = dev->priv; + np->msg_enable = datum; } /* TODO: we are too slack to do reg dumping for pio, for now */ From shemminger@osdl.org Thu Oct 9 11:27:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 11:28:15 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h99IRe25018895 for ; Thu, 9 Oct 2003 11:27:41 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h99IRXo15125; Thu, 9 Oct 2003 11:27:33 -0700 Date: Thu, 9 Oct 2003 11:27:14 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] cosa -- incorrect comparison for register_netdev Message-Id: <20031009112714.18742308.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 694 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 If register_netdev fails this driver will be in trouble because the return values are things like -EIO or -EEXIST, not just -1. diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c --- a/drivers/net/wan/cosa.c Thu Oct 9 11:24:39 2003 +++ b/drivers/net/wan/cosa.c Thu Oct 9 11:24:39 2003 @@ -615,7 +615,7 @@ d->get_stats = cosa_net_stats; d->tx_timeout = cosa_sppp_timeout; d->watchdog_timeo = TX_TIMEOUT; - if (register_netdev(d) == -1) { + if (register_netdev(d)) { printk(KERN_WARNING "%s: register_netdev failed.\n", d->name); sppp_detach(chan->pppdev.dev); free_netdev(chan->pppdev.dev); From maxk@qualcomm.com Thu Oct 9 11:47:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 11:48:14 -0700 (PDT) Received: from ithilien.qualcomm.com (ithilien.qualcomm.com [129.46.51.59]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h99Ilc25022493 for ; Thu, 9 Oct 2003 11:47:39 -0700 Received: from crowley.qualcomm.com (crowley.qualcomm.com [129.46.61.151]) by ithilien.qualcomm.com (8.12.10/8.12.5/1.0) with ESMTP id h99IjY4t019283; Thu, 9 Oct 2003 11:45:34 -0700 (PDT) Received: from MAXK.qualcomm.com (maxk.qualcomm.com [129.46.88.152]) by crowley.qualcomm.com (8.12.10/8.12.5/1.0) with ESMTP id h99IjVhk013704; Thu, 9 Oct 2003 11:45:32 -0700 (PDT) Message-Id: <5.1.0.14.2.20031009110604.05a541b0@unixmail.qualcomm.com> X-Sender: maxk@unixmail.qualcomm.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 09 Oct 2003 11:45:31 -0700 To: Stephen Hemminger From: Max Krasnyansky Subject: Re: [PATCH] tun driver use private linked list. Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20030812100259.7d557bf3.shemminger@osdl.org> References: <5.1.0.14.2.20030812092213.08dc6ea0@unixmail.qualcomm.com> <20030808113404.0e9e1e6d.shemminger@osdl.org> <200308051630.28552.bellucda@tiscali.it> <20030805090647.691daa7e.shemminger@osdl.org> <200308051910.55823.bellucda@tiscali.it> <20030807154524.4794ad45.shemminger@osdl.org> <20030807155901.49f1a424.davem@redhat.com> <20030808113404.0e9e1e6d.shemminger@osdl.org> <5.1.0.14.2.20030812092213.08dc6ea0@unixmail.qualcomm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-archive-position: 695 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: maxk@qualcomm.com Precedence: bulk X-list: netdev Hi Stephen, I just realized that I didn't reply to this one sorry. At 10:02 AM 8/12/2003, Stephen Hemminger wrote: >On Tue, 12 Aug 2003 09:48:50 -0700 >Max Krasnyansky wrote: > >> At 01:18 AM 8/9/2003, David S. Miller wrote: >> >On Fri, 8 Aug 2003 11:34:04 -0700 >> >Stephen Hemminger wrote: >> > >> >> Less grotty version, applies over earlier patch. >> >> - keep a private list. >> >> - fix debug format strings. >> >> - drop the name entry in the private data structure since it already >> >> has a pointer to netdev that has name. >> > >> >Applied, thanks for following up on this Stephen. >> >> Folks, >> >> Sorry for jumping in late. >> I didn't implement cleanup logic in module_exit() because TUN module is not supposed >> to be unloaded if it has network devices, _even if those devices are down_. >> TUN registers net device only when user application asks for it. >> fd = open("/dev/net/tun") -> ioctl(fd, CREATE_TUN_DEV) -> read(fd)/write(fd); >> Net device must not be destroyed while fd is open. >> >> So instead of cleaning up in tun_module_exit() we should fix misc driver to do refcounting >> for misc devices so that we could bump ref count for tun driver when application creates >> net device. > >Not necessary to change anything. If user process has /dev/net/tun open, then the owner >field in the fops causes the module reference count to correctly increment. Verified this >and it works. The issue is that it is possible to create TUN devices with TUN_PERSIST >set and they have to be cleaned up upon. module_exit. The fix is even simpler then. Basically MOD_INC_USE_COUNT should've been replaced with __module_get(THIS_MODULE). We don't have to keep list of devices. Actually in case of persistent devices we can not let the module go away. Because it has important info like user id of the owner and stuff which is not stored anywhere else. It also provides device name reservation, UML folks use it for example to reserve certain devices to a certain users. If module goes away admin will have to recreate those devices again. TUN/TAP devices are created in ioctl and since vfs layer already holds a reference, like you said, it's safe for us to just do __module_get()/module_put(). I'll make a new patch. I have some other patches for TUN driver that I wanted to apply anyway. Thanks Max From shemminger@osdl.org Thu Oct 9 13:00:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 13:01:00 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h99K0125027098 for ; Thu, 9 Oct 2003 13:00:22 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h99Jxmo01630; Thu, 9 Oct 2003 12:59:48 -0700 Date: Thu, 9 Oct 2003 12:59:29 -0700 From: Stephen Hemminger To: Max Krasnyansky Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] tun driver use private linked list. Message-Id: <20031009125929.6f2d99f9.shemminger@osdl.org> In-Reply-To: <5.1.0.14.2.20031009110604.05a541b0@unixmail.qualcomm.com> References: <5.1.0.14.2.20030812092213.08dc6ea0@unixmail.qualcomm.com> <20030808113404.0e9e1e6d.shemminger@osdl.org> <200308051630.28552.bellucda@tiscali.it> <20030805090647.691daa7e.shemminger@osdl.org> <200308051910.55823.bellucda@tiscali.it> <20030807154524.4794ad45.shemminger@osdl.org> <20030807155901.49f1a424.davem@redhat.com> <20030808113404.0e9e1e6d.shemminger@osdl.org> <5.1.0.14.2.20030812092213.08dc6ea0@unixmail.qualcomm.com> <5.1.0.14.2.20031009110604.05a541b0@unixmail.qualcomm.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 696 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 On Thu, 09 Oct 2003 11:45:31 -0700 Max Krasnyansky wrote: > Hi Stephen, > > I just realized that I didn't reply to this one sorry. > > At 10:02 AM 8/12/2003, Stephen Hemminger wrote: > >On Tue, 12 Aug 2003 09:48:50 -0700 > >Max Krasnyansky wrote: > > > >> At 01:18 AM 8/9/2003, David S. Miller wrote: > >> >On Fri, 8 Aug 2003 11:34:04 -0700 > >> >Stephen Hemminger wrote: > >> > > >> >> Less grotty version, applies over earlier patch. > >> >> - keep a private list. > >> >> - fix debug format strings. > >> >> - drop the name entry in the private data structure since it already > >> >> has a pointer to netdev that has name. > >> > > >> >Applied, thanks for following up on this Stephen. > >> > >> Folks, > >> > >> Sorry for jumping in late. > >> I didn't implement cleanup logic in module_exit() because TUN module is not supposed > >> to be unloaded if it has network devices, _even if those devices are down_. > >> TUN registers net device only when user application asks for it. > >> fd = open("/dev/net/tun") -> ioctl(fd, CREATE_TUN_DEV) -> read(fd)/write(fd); > >> Net device must not be destroyed while fd is open. > >> > >> So instead of cleaning up in tun_module_exit() we should fix misc driver to do refcounting > >> for misc devices so that we could bump ref count for tun driver when application creates > >> net device. > > > >Not necessary to change anything. If user process has /dev/net/tun open, then the owner > >field in the fops causes the module reference count to correctly increment. Verified this > >and it works. The issue is that it is possible to create TUN devices with TUN_PERSIST > >set and they have to be cleaned up upon. module_exit. > The fix is even simpler then. Basically MOD_INC_USE_COUNT should've been replaced with > __module_get(THIS_MODULE). We don't have to keep list of devices. > > Actually in case of persistent devices we can not let the module go away. Because it has > important info like user id of the owner and stuff which is not stored anywhere else. > It also provides device name reservation, UML folks use it for example to reserve certain > devices to a certain users. If module goes away admin will have to recreate those devices > again. TUN/TAP devices are created in ioctl and since vfs layer already holds a reference, > like you said, it's safe for us to just do __module_get()/module_put(). I think letting the admin do what he requests is the right thing. The philosophy of module unload has changed: with 2.4 it was "don't let admin unload the network element if anything is using it"; now it is "let the admin unload any module and cleanup as necessary". From mashirle@us.ibm.com Thu Oct 9 13:18:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 13:18:36 -0700 (PDT) Received: from linux2.suntekindustrial.com (wbar1.sjo1-4-4-004-065.sjo1.dsl-verizon.net [4.4.4.65]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h99KHt25029681 for ; Thu, 9 Oct 2003 13:18:02 -0700 Received: from ibm-mxl (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated bits=0) by linux2.suntekindustrial.com (8.12.8/8.12.8) with ESMTP id h99KSio7004069; Thu, 9 Oct 2003 13:28:46 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shirley Ma Organization: IBM Linux To: "David S. Miller" , kuznet@ms2.inr.ac.ru Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable Date: Thu, 9 Oct 2003 13:17:35 -0700 User-Agent: KMail/1.4.3 Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org References: <20031008130016.559b8047.davem@redhat.com> <200310081706.09485.mashirle@us.ibm.com> In-Reply-To: <200310081706.09485.mashirle@us.ibm.com> MIME-Version: 1.0 Message-Id: <200310091317.35164.mashirle@us.ibm.com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h99KHt25029681 X-archive-position: 697 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Hi, David, There is possible loss of precision in the new patch for the timestamp. I have two solutions. Which one do you think is better. This one is too much math. ci.cstamp = (__u32)(TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) / HZ * 100 + TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); ci.tstamp = (__u32)(TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) / HZ * 100 + TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); This one might overflow. ci.cstamp = (__u32)(TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) *100 ) / HZ; ci.tstamp = (__u32)(TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) * 100) / HZ; Thanks Shirley Ma IBM Linux Technology Center -------------------------------------------- From shemminger@osdl.org Thu Oct 9 15:53:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 15:54:02 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h99MrR25001090 for ; Thu, 9 Oct 2003 15:53:28 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h99MrLo06539; Thu, 9 Oct 2003 15:53:21 -0700 Date: Thu, 9 Oct 2003 15:53:02 -0700 From: Stephen Hemminger To: linux-net@vger.kernel.org Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: 2.6.0-test7-netx1 Message-Id: <20031009155302.4f2fe835.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 698 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 http://developer.osdl.org/shemminger/netx/2.6/2.6.0-test7/2.6.0-test7-netx1/ This is the first of a hopefuly continuing series of network related experimental kernels. This patch set will contain things like new network drivers, protocols and infrastructure changes that are not related to the stability goal for the mainline kernel tree. The initial installment includes: * ISA device probing changes * SimTel 4200 IRDA dongle (originally by Paul Stewart) * IRDA hashbin cleanup * WAN device bugfixes and cleanups * TCP Vegas (from Dave Miller) I am interested in receiving patches for network related stuff like: * drivers for new hardware * rework of old drives (will put in new e100 driver next time). * TCP tuning options * support for 1000's of network devices * network async i/o * per cpu network statistics From acme@conectiva.com.br Thu Oct 9 19:28:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 19:29:19 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9A2Si25008865 for ; Thu, 9 Oct 2003 19:28:46 -0700 Received: from [200.181.170.102] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A7nCH-0002f6-00; Thu, 09 Oct 2003 23:40:06 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id A77A6F70F; Fri, 10 Oct 2003 02:36:45 +0000 (UTC) Date: Thu, 9 Oct 2003 23:36:44 -0300 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: netdev@oss.sgi.com, Dan Merillat Subject: Re: Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR Message-ID: <20031010023644.GA8365@conectiva.com.br> References: <20031008133345.49f71991.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031008133345.49f71991.davem@redhat.com> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 699 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 Em Wed, Oct 08, 2003 at 01:33:45PM -0700, David S. Miller escreveu: > Arnaldo, I think this is another piece of fallout > from the struct sock splitup you did ages ago. > > I think it's dereferencing inet_sk(sk) for a time-wait > socket, so we probably need a TCP_TIME_WAIT test plus > some additional logic here? Better check tcp_ipv6.c too. Dan, could you please try with this patch? - Arnaldo ===== net/ipv4/tcp_ipv4.c 1.69 vs edited ===== --- 1.69/net/ipv4/tcp_ipv4.c Wed Oct 8 12:27:40 2003 +++ edited/net/ipv4/tcp_ipv4.c Thu Oct 9 23:23:38 2003 @@ -186,7 +186,8 @@ int reuse = sk->sk_reuse; sk_for_each_bound(sk2, node, &tb->owners) { - if (sk != sk2 && + if (likely(sk->sk_state != TCP_TIME_WAIT) && + sk != sk2 && !ipv6_only_sock(sk2) && (!sk->sk_bound_dev_if || !sk2->sk_bound_dev_if || ===== net/ipv6/tcp_ipv6.c 1.74 vs edited ===== --- 1.74/net/ipv6/tcp_ipv6.c Wed Oct 8 12:27:40 2003 +++ edited/net/ipv6/tcp_ipv6.c Thu Oct 9 23:23:45 2003 @@ -101,7 +101,8 @@ /* We must walk the whole port owner list in this case. -DaveM */ sk_for_each_bound(sk2, node, &tb->owners) { - if (sk != sk2 && + if (likely(sk->sk_state != TCP_TIME_WAIT) && + sk != sk2 && (!sk->sk_bound_dev_if || !sk2->sk_bound_dev_if || sk->sk_bound_dev_if == sk2->sk_bound_dev_if) && From acme@conectiva.com.br Thu Oct 9 20:14:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 20:15:18 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9A3Eg25010022 for ; Thu, 9 Oct 2003 20:14:43 -0700 Received: from [200.181.170.102] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A7nup-0003PM-00; Fri, 10 Oct 2003 00:26:08 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 17FAAF70F; Fri, 10 Oct 2003 03:22:45 +0000 (UTC) Date: Fri, 10 Oct 2003 00:22:44 -0300 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: netdev@oss.sgi.com, Dan Merillat Subject: [RFT] Re: Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR Message-ID: <20031010032244.GB8365@conectiva.com.br> References: <20031008133345.49f71991.davem@redhat.com> <20031010023644.GA8365@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031010023644.GA8365@conectiva.com.br> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 700 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 Em Thu, Oct 09, 2003 at 11:36:44PM -0300, Arnaldo C. Melo escreveu: > Em Wed, Oct 08, 2003 at 01:33:45PM -0700, David S. Miller escreveu: > > Arnaldo, I think this is another piece of fallout > > from the struct sock splitup you did ages ago. > > > > I think it's dereferencing inet_sk(sk) for a time-wait > > socket, so we probably need a TCP_TIME_WAIT test plus > > some additional logic here? Better check tcp_ipv6.c too. > > Dan, could you please try with this patch? Better, try with this one, it has an extra check that can catch other places where we have a struct tcp_tw_bucket being used as a struct sock... Tested here on a dual p100, no problems so far, i.e. using the kernel with the patch below, not doing the apache tests. - Arnaldo ===== include/linux/ip.h 1.10 vs edited ===== --- 1.10/include/linux/ip.h Fri May 16 18:02:36 2003 +++ edited/include/linux/ip.h Thu Oct 9 23:36:06 2003 @@ -157,7 +157,13 @@ struct inet_opt inet; }; +#if 0 #define inet_sk(__sk) (&((struct inet_sock *)__sk)->inet) +#else +#include +#define inet_sk(__sk) ({ WARN_ON(__sk->sk_state == TCP_TIME_WAIT); \ + (&((struct inet_sock *)__sk)->inet); }) +#endif #endif ===== net/ipv4/tcp_ipv4.c 1.69 vs edited ===== --- 1.69/net/ipv4/tcp_ipv4.c Wed Oct 8 12:27:40 2003 +++ edited/net/ipv4/tcp_ipv4.c Thu Oct 9 23:23:38 2003 @@ -186,7 +186,8 @@ int reuse = sk->sk_reuse; sk_for_each_bound(sk2, node, &tb->owners) { - if (sk != sk2 && + if (likely(sk->sk_state != TCP_TIME_WAIT) && + sk != sk2 && !ipv6_only_sock(sk2) && (!sk->sk_bound_dev_if || !sk2->sk_bound_dev_if || ===== net/ipv6/tcp_ipv6.c 1.74 vs edited ===== --- 1.74/net/ipv6/tcp_ipv6.c Wed Oct 8 12:27:40 2003 +++ edited/net/ipv6/tcp_ipv6.c Thu Oct 9 23:23:45 2003 @@ -101,7 +101,8 @@ /* We must walk the whole port owner list in this case. -DaveM */ sk_for_each_bound(sk2, node, &tb->owners) { - if (sk != sk2 && + if (likely(sk->sk_state != TCP_TIME_WAIT) && + sk != sk2 && (!sk->sk_bound_dev_if || !sk2->sk_bound_dev_if || sk->sk_bound_dev_if == sk2->sk_bound_dev_if) && From davem@pizda.ninka.net Thu Oct 9 21:20:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 21:20:49 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9A4KF25014948 for ; Thu, 9 Oct 2003 21:20:15 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id VAA26869; Thu, 9 Oct 2003 21:14:37 -0700 Date: Thu, 9 Oct 2003 21:14:37 -0700 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com, dmerillat@sequiam.com Subject: Re: [RFT] Re: Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR Message-Id: <20031009211437.2cf87a4f.davem@redhat.com> In-Reply-To: <20031010032244.GB8365@conectiva.com.br> References: <20031008133345.49f71991.davem@redhat.com> <20031010023644.GA8365@conectiva.com.br> <20031010032244.GB8365@conectiva.com.br> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 701 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 Even if they make the OOPS go away, all of these patches are not correct. You have to consider the timewait sockets just like established sockets in the bind conflict test. Therefore in the most inner part of this chain of if's you need to have something like: u32 rcv_saddr; if (sk->sk_state == TCP_TIME_WAIT) { struct tcp_tw_bucket *tw = tcptw_sk(sk2); rcv_saddr = tw->tw_rcv_saddr; } else { struct inet_sock *inet = inet_sk(sk2); rcv_saddr = inet->rcv_saddr; } if (!rcv_saddr || !sk->rcv_saddr || sk->rcv_saddr == rcv_saddr) ... blah blah blah ... From davem@pizda.ninka.net Thu Oct 9 23:59:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 09 Oct 2003 23:59:49 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9A6xD25018423 for ; Thu, 9 Oct 2003 23:59:13 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA27383; Thu, 9 Oct 2003 23:53:39 -0700 Date: Thu, 9 Oct 2003 23:53:38 -0700 From: "David S. Miller" To: Jeroen Vreeken Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] (resend) fix sock_raw behaviour Message-Id: <20031009235338.7335b635.davem@redhat.com> In-Reply-To: <20031008235150.A207@jeroen.pe1rxq.ampr.org> References: <20031008235150.A207@jeroen.pe1rxq.ampr.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 702 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 On Wed, 8 Oct 2003 23:51:50 +0200 Jeroen Vreeken wrote: > This is a resend of a patch from some weeks ago that doesn't appear to have > made it in yet... It doesn't apply, that's why. You patch ax25.h twice the same exact way which causes the patch to not apply. While we're talking about this, who is going to maintain AX25 in 2.6.x? I don't want to be taking bug fixes and other changes to AX25 from random people, I'd like to have a single contact that will review the AX25 patches from other people and then forward them off to me. From davem@pizda.ninka.net Fri Oct 10 00:06:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 00:07:31 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9A76u25019012 for ; Fri, 10 Oct 2003 00:06:56 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA27468; Fri, 10 Oct 2003 00:01:19 -0700 Date: Fri, 10 Oct 2003 00:01:19 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jt@bougret.hpl.hp.com, irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] memory leak in irda/sa1100_ir.c Message-Id: <20031010000119.4a3017e0.davem@redhat.com> In-Reply-To: <20031009093752.01a374bc.shemminger@osdl.org> References: <20031009093752.01a374bc.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 703 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 On Thu, 9 Oct 2003 09:37:52 -0700 Stephen Hemminger wrote: > This driver seems confused about what get done for it on module exit. > It needs to free the network device it created. Applied, thanks Stephen. From davem@pizda.ninka.net Fri Oct 10 00:07:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 00:08:07 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9A77W25019046 for ; Fri, 10 Oct 2003 00:07:33 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA27493; Fri, 10 Oct 2003 00:01:58 -0700 Date: Fri, 10 Oct 2003 00:01:58 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] cosa -- incorrect comparison for register_netdev Message-Id: <20031010000158.2dc9ce78.davem@redhat.com> In-Reply-To: <20031009112714.18742308.shemminger@osdl.org> References: <20031009112714.18742308.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 704 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 On Thu, 9 Oct 2003 11:27:14 -0700 Stephen Hemminger wrote: > If register_netdev fails this driver will be in trouble because > the return values are things like -EIO or -EEXIST, not just -1. Applied, thanks Stephen. From davem@pizda.ninka.net Fri Oct 10 00:09:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 00:10:31 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9A79o25019714 for ; Fri, 10 Oct 2003 00:09:50 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA27510; Fri, 10 Oct 2003 00:04:13 -0700 Date: Fri, 10 Oct 2003 00:04:13 -0700 From: "David S. Miller" To: Shirley Ma Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable Message-Id: <20031010000413.7935be3c.davem@redhat.com> In-Reply-To: <200310091317.35164.mashirle@us.ibm.com> References: <20031008130016.559b8047.davem@redhat.com> <200310081706.09485.mashirle@us.ibm.com> <200310091317.35164.mashirle@us.ibm.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 705 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 On Thu, 9 Oct 2003 13:17:35 -0700 Shirley Ma wrote: > Which one do you think is better. > > This one is too much math. > > ci.cstamp = (__u32)(TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) / HZ * 100 > + TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); > ci.tstamp = (__u32)(TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) / HZ * 100 > + TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); Why are you using jiffies for timestamps? I guess these values are measured "since bootup" or something like that? Anyways, I prefer the "too much math" because 1) it isn't a lot of math, most of these things are constants which make the expressions easy to compute 2) it's only done when someone asks for the information. From davem@pizda.ninka.net Fri Oct 10 01:53:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 01:54:33 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9A8rw25026688 for ; Fri, 10 Oct 2003 01:53:59 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA27917; Fri, 10 Oct 2003 01:48:22 -0700 Date: Fri, 10 Oct 2003 01:48:22 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: linux-net@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.6.0-test7-netx1 Message-Id: <20031010014822.0130ca61.davem@redhat.com> In-Reply-To: <20031009155302.4f2fe835.shemminger@osdl.org> References: <20031009155302.4f2fe835.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 706 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 On Thu, 9 Oct 2003 15:53:02 -0700 Stephen Hemminger wrote: > * TCP Vegas (from Dave Miller) Please don't use a config option for this, that is why the sysctl is there and off by default. From pe1rxq@amsat.org Fri Oct 10 04:14:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 04:15:33 -0700 (PDT) Received: from amsfep13-int.chello.nl (amsfep13-int.chello.nl [213.46.243.24]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ABEv25032506 for ; Fri, 10 Oct 2003 04:14:58 -0700 Received: from mail.chello.nl ([212.83.83.7]) by amsfep13-int.chello.nl (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with SMTP id <20031010111450.GOLR27961.amsfep13-int.chello.nl@mail.chello.nl>; Fri, 10 Oct 2003 13:14:50 +0200 Date: Fri, 10 Oct 2003 13:21:57 +0200 From: Jeroen Vreeken To: "David S . Miller" Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com, ralf@linux-mips.org Subject: Re: [PATCH] (resend) fix sock_raw behaviour Message-ID: <20031010132157.A4188@jeroen.pe1rxq.ampr.org> References: <20031008235150.A207@jeroen.pe1rxq.ampr.org> <20031009235338.7335b635.davem@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="AWniW0JNca5xppdA" Content-Transfer-Encoding: 8bit In-Reply-To: <20031009235338.7335b635.davem@redhat.com>; from davem@redhat.com on Fri, Oct 10, 2003 at 08:53:38 +0200 X-Mailer: Balsa 1.1.0 Lines: 125 X-archive-position: 707 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pe1rxq@amsat.org Precedence: bulk X-list: netdev --AWniW0JNca5xppdA Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit On 2003.10.10 08:53:38 +0200 David S. Miller wrote: > On Wed, 8 Oct 2003 23:51:50 +0200 > Jeroen Vreeken wrote: > > > This is a resend of a patch from some weeks ago that doesn't appear to > have > > made it in yet... > > It doesn't apply, that's why. You patch ax25.h twice the same > exact way which causes the patch to not apply. I seem to have pasted that part twice... Attached is a corrected version > While we're talking about this, who is going to maintain AX25 > in 2.6.x? I don't want to be taking bug fixes and other changes > to AX25 from random people, I'd like to have a single contact > that will review the AX25 patches from other people and then > forward them off to me. The official maintainer for ax25 and netrom is Ralf Baechle. but he seems to have some problems fitting it into his schedule.... Jeroen --AWniW0JNca5xppdA Content-Type: application/octet-stream; charset=us-ascii Content-Disposition: attachment; filename="sock-raw.diff" --- linux-2.6.0-test5/net/ax25/af_ax25.c.org 2003-09-23 23:26:17.000000000 +0200 +++ linux-2.6.0-test5/net/ax25/af_ax25.c 2003-09-24 23:33:32.000000000 +0200 @@ -231,42 +231,29 @@ /* * Look for any matching address - RAW sockets can bind to arbitrary names */ -struct sock *ax25_addr_match(ax25_address *addr) +void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto) { - struct sock *sk = NULL; + struct sock *sk; ax25_cb *s; + struct sk_buff *copy; struct hlist_node *node; spin_lock_bh(&ax25_list_lock); ax25_for_each(s, node, &ax25_list) { if (s->sk != NULL && ax25cmp(&s->source_addr, addr) == 0 && - s->sk->sk_type == SOCK_RAW) { + s->sk->sk_type == SOCK_RAW && + s->sk->sk_protocol == proto && + (!s->ax25_dev || s->ax25_dev->dev == skb->dev)) { sk = s->sk; - lock_sock(sk); - break; + bh_lock_sock(sk); + if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf && + (copy = skb_clone(skb, GFP_ATOMIC)) != NULL) + if (sock_queue_rcv_skb(sk, copy) != 0) + kfree_skb(copy); + bh_unlock_sock(sk); } } - spin_unlock_bh(&ax25_list_lock); - - return sk; -} - -void ax25_send_to_raw(struct sock *sk, struct sk_buff *skb, int proto) -{ - struct sk_buff *copy; - struct hlist_node *node; - - sk_for_each_from(sk, node) - if (sk->sk_type == SOCK_RAW && - sk->sk_protocol == proto && - atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) { - if ((copy = skb_clone(skb, GFP_ATOMIC)) == NULL) - return; - - if (sock_queue_rcv_skb(sk, copy) != 0) - kfree_skb(copy); - } } /* @@ -1633,16 +1620,16 @@ if (msg->msg_namelen != 0) { struct sockaddr_ax25 *sax = (struct sockaddr_ax25 *)msg->msg_name; ax25_digi digi; - ax25_address dest; + ax25_address src; - ax25_addr_parse(skb->mac.raw+1, skb->data-skb->mac.raw-1, NULL, &dest, &digi, NULL, NULL); + ax25_addr_parse(skb->mac.raw+1, skb->data-skb->mac.raw-1, &src, NULL, &digi, NULL, NULL); sax->sax25_family = AF_AX25; /* We set this correctly, even though we may not let the application know the digi calls further down (because it did NOT ask to know them). This could get political... **/ sax->sax25_ndigis = digi.ndigi; - sax->sax25_call = dest; + sax->sax25_call = src; if (sax->sax25_ndigis != 0) { int ct; --- linux-2.6.0-test5/include/net/ax25.h.org 2003-09-24 23:21:27.000000000 +0200 +++ linux-2.6.0-test5/include/net/ax25.h 2003-09-24 23:21:55.000000000 +0200 @@ -227,8 +227,7 @@ struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int); struct sock *ax25_get_socket(ax25_address *, ax25_address *, int); extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); -extern struct sock *ax25_addr_match(ax25_address *); -extern void ax25_send_to_raw(struct sock *, struct sk_buff *, int); +extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); extern void ax25_destroy_socket(ax25_cb *); extern ax25_cb *ax25_create_cb(void); extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); --AWniW0JNca5xppdA-- From davem@pizda.ninka.net Fri Oct 10 04:22:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 04:22:50 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ABMF25003856 for ; Fri, 10 Oct 2003 04:22:15 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA28551; Fri, 10 Oct 2003 04:16:33 -0700 Date: Fri, 10 Oct 2003 04:16:33 -0700 From: "David S. Miller" To: Jeroen Vreeken Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com, ralf@linux-mips.org Subject: Re: [PATCH] (resend) fix sock_raw behaviour Message-Id: <20031010041633.3274c654.davem@redhat.com> In-Reply-To: <20031010132157.A4188@jeroen.pe1rxq.ampr.org> References: <20031008235150.A207@jeroen.pe1rxq.ampr.org> <20031009235338.7335b635.davem@redhat.com> <20031010132157.A4188@jeroen.pe1rxq.ampr.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 708 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 On Fri, 10 Oct 2003 13:21:57 +0200 Jeroen Vreeken wrote: > On 2003.10.10 08:53:38 +0200 David S. Miller wrote: > > While we're talking about this, who is going to maintain AX25 > > in 2.6.x? I don't want to be taking bug fixes and other changes > > to AX25 from random people, I'd like to have a single contact > > that will review the AX25 patches from other people and then > > forward them off to me. > > The official maintainer for ax25 and netrom is Ralf Baechle. but he seems > to have some problems fitting it into his schedule.... If that's the case why don't we have someone like you take care of things until he is less busy? From ioe-lkml@rameria.de Fri Oct 10 05:57:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 05:57:37 -0700 (PDT) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [62.67.200.156]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ACv125008077 for ; Fri, 10 Oct 2003 05:57:02 -0700 Received: (qmail 15912 invoked from network); 10 Oct 2003 12:57:00 -0000 Received: from unknown (HELO bertha.s4u) (696817@[80.145.46.109]) (envelope-sender ) by smtprelay01.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 10 Oct 2003 12:57:00 -0000 From: Ingo Oeser To: "David S. Miller" Subject: Re: [PATCH] kfree_skb() bug in 2.4.22 Date: Fri, 10 Oct 2003 14:53:44 +0200 User-Agent: KMail/1.5.4 Cc: toby@cbcg.net, netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org, coreteam@netfilter.org, netfilter@lists.netfilter.org, akpm@zip.com.au, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@intercode.com.au, yoshfuji@linux-ipv6.org, Jeff Garzik References: <1065617075.1514.29.camel@localhost> <3F840C9C.9050704@pobox.com> <20031008064735.7373227b.davem@redhat.com> In-Reply-To: <20031008064735.7373227b.davem@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310101453.44353.ioe-lkml@rameria.de> X-archive-position: 709 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ioe-lkml@rameria.de Precedence: bulk X-list: netdev On Wednesday 08 October 2003 15:47, David S. Miller wrote: > On Wed, 08 Oct 2003 09:09:48 -0400 > > Jeff Garzik wrote: > > I would prefer that you fix your code instead, to not pass NULL to > > kfree_skb()... > > Absolutely, there is no valid reason to pass NULL into these > routines. Would you mind __attribute_nonnull__ for these functions, if we enable GCC 3.3 support for this[1]? [1] Which includes editing the compiler.h and gcc3-compiler.h and so on. Regards Ingo Oeser From davem@pizda.ninka.net Fri Oct 10 06:07:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 06:08:02 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AD7R25008755 for ; Fri, 10 Oct 2003 06:07:27 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id GAA07612; Fri, 10 Oct 2003 06:00:50 -0700 Date: Fri, 10 Oct 2003 06:00:50 -0700 From: "David S. Miller" To: Ingo Oeser Cc: toby@cbcg.net, netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org, coreteam@netfilter.org, netfilter@lists.netfilter.org, akpm@zip.com.au, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@intercode.com.au, yoshfuji@linux-ipv6.org, jgarzik@pobox.com Subject: Re: [PATCH] kfree_skb() bug in 2.4.22 Message-Id: <20031010060050.057aab50.davem@redhat.com> In-Reply-To: <200310101453.44353.ioe-lkml@rameria.de> References: <1065617075.1514.29.camel@localhost> <3F840C9C.9050704@pobox.com> <20031008064735.7373227b.davem@redhat.com> <200310101453.44353.ioe-lkml@rameria.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 710 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 On Fri, 10 Oct 2003 14:53:44 +0200 Ingo Oeser wrote: > On Wednesday 08 October 2003 15:47, David S. Miller wrote: > > On Wed, 08 Oct 2003 09:09:48 -0400 > > > > Jeff Garzik wrote: > > > I would prefer that you fix your code instead, to not pass NULL to > > > kfree_skb()... > > > > Absolutely, there is no valid reason to pass NULL into these > > routines. > > Would you mind __attribute_nonnull__ for these functions, if we > enable GCC 3.3 support for this[1]? I would say yes, but why? All this attribute does is optimize away tests for NULL which surprise surprise we don't have any of in kfree_skb(). From acme@conectiva.com.br Fri Oct 10 08:32:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 08:33:17 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AFWh25021416 for ; Fri, 10 Oct 2003 08:32:44 -0700 Received: from [200.181.170.102] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A7zR6-0004sa-00; Fri, 10 Oct 2003 12:44:12 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id A7DF5F70F; Fri, 10 Oct 2003 15:40:52 +0000 (UTC) Date: Fri, 10 Oct 2003 12:40:52 -0300 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: netdev@oss.sgi.com, dmerillat@sequiam.com Subject: Re: [RFT] Re: Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR Message-ID: <20031010154052.GA11366@conectiva.com.br> References: <20031008133345.49f71991.davem@redhat.com> <20031010023644.GA8365@conectiva.com.br> <20031010032244.GB8365@conectiva.com.br> <20031009211437.2cf87a4f.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031009211437.2cf87a4f.davem@redhat.com> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 711 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 Em Thu, Oct 09, 2003 at 09:14:37PM -0700, David S. Miller escreveu: > > Even if they make the OOPS go away, all of these patches are > not correct. > > You have to consider the timewait sockets just like established > sockets in the bind conflict test. > > Therefore in the most inner part of this chain of if's you need > to have something like: > > u32 rcv_saddr; > > if (sk->sk_state == TCP_TIME_WAIT) { > struct tcp_tw_bucket *tw = tcptw_sk(sk2); > rcv_saddr = tw->tw_rcv_saddr; > } else { > struct inet_sock *inet = inet_sk(sk2); > rcv_saddr = inet->rcv_saddr; > } > if (!rcv_saddr || !sk->rcv_saddr || > sk->rcv_saddr == rcv_saddr) > ... blah blah blah ... Gotcha, I'm working on this now, creating inet_rcv_saddr and inet6_rcv_saddr inline functions, and in the process I'm finding what seems like a bug in ipv6_rcv_saddr_equal, look at this: if (sk2->sk_family == AF_INET6 && !ipv6_addr_cmp(&np->rcv_saddr, (sk2->sk_state != TCP_TIME_WAIT ? &inet6_sk(sk2)->rcv_saddr : &tcptw_sk(sk)->tw_v6_rcv_saddr))) ^^ ^^ shouldn't the tcp_tw_sk(sk) be tcp_tw_sk(sk2)? And in this function we have the guard against it being a tcp_tw_bucket, but not in all places... Anyway, I'll be posting patches today. - Arnaldo From ioe-lkml@rameria.de Fri Oct 10 08:47:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 08:47:38 -0700 (PDT) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [62.67.200.156]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AFl225021996 for ; Fri, 10 Oct 2003 08:47:04 -0700 Received: (qmail 12758 invoked from network); 10 Oct 2003 15:47:01 -0000 Received: from unknown (HELO bertha.s4u) (696817@[80.145.46.109]) (envelope-sender ) by smtprelay01.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 10 Oct 2003 15:47:01 -0000 From: Ingo Oeser To: "David S. Miller" Subject: Re: [PATCH] kfree_skb() bug in 2.4.22 Date: Fri, 10 Oct 2003 17:43:48 +0200 User-Agent: KMail/1.5.4 Cc: toby@cbcg.net, netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org, coreteam@netfilter.org, netfilter@lists.netfilter.org, akpm@zip.com.au, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@intercode.com.au, yoshfuji@linux-ipv6.org, jgarzik@pobox.com References: <1065617075.1514.29.camel@localhost> <200310101453.44353.ioe-lkml@rameria.de> <20031010060050.057aab50.davem@redhat.com> In-Reply-To: <20031010060050.057aab50.davem@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310101743.48483.ioe-lkml@rameria.de> X-archive-position: 712 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ioe-lkml@rameria.de Precedence: bulk X-list: netdev On Friday 10 October 2003 15:00, David S. Miller wrote: > Ingo Oeser wrote: > > Would you mind __attribute_nonnull__ for these functions, if we > > enable GCC 3.3 support for this[1]? > > I would say yes, but why? All this attribute does is optimize > away tests for NULL which surprise surprise we don't have any > of in kfree_skb(). And it wouldn't warn about passing NULL to these functions? That's bad... But maybe sparse/smatch are better for this... From dank@kegel.com Fri Oct 10 09:21:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 09:21:53 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AGLJ25031953 for ; Fri, 10 Oct 2003 09:21:19 -0700 Received: (qmail 56455 invoked from network); 10 Oct 2003 16:21:17 -0000 Received: from c-24-126-73-164.we.client2.attbi.com (HELO kegel.com) (24.126.73.164) by relay.pair.com with SMTP; 10 Oct 2003 16:21:17 -0000 X-pair-Authenticated: 24.126.73.164 Message-ID: <3F86E516.7070004@kegel.com> Date: Fri, 10 Oct 2003 09:57:58 -0700 From: Dan Kegel User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: de-de, en MIME-Version: 1.0 To: Ingo Oeser CC: "David S. Miller" , toby@cbcg.net, netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org, coreteam@netfilter.org, netfilter@lists.netfilter.org, akpm@zip.com.au, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@intercode.com.au, yoshfuji@linux-ipv6.org, jgarzik@pobox.com Subject: Re: [PATCH] kfree_skb() bug in 2.4.22 References: <1065617075.1514.29.camel@localhost> <200310101453.44353.ioe-lkml@rameria.de> <20031010060050.057aab50.davem@redhat.com> <200310101743.48483.ioe-lkml@rameria.de> In-Reply-To: <200310101743.48483.ioe-lkml@rameria.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 713 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dank@kegel.com Precedence: bulk X-list: netdev Ingo Oeser wrote: > On Friday 10 October 2003 15:00, David S. Miller wrote: > >>Ingo Oeser wrote: >> >>>Would you mind __attribute_nonnull__ for these functions, if we >>>enable GCC 3.3 support for this[1]? >> >>I would say yes, but why? All this attribute does is optimize >>away tests for NULL which surprise surprise we don't have any >>of in kfree_skb(). > > > And it wouldn't warn about passing NULL to these functions? That's bad... > But maybe sparse/smatch are better for this... Things like smatch, sparse, and checker can use the __attribute_nonnull__. I'd say it's a good idea. Should I submit the patch, then, since I'm the one who like the idea? - Dan -- Dan Kegel http://www.kegel.com http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045 From olh@suse.de Fri Oct 10 09:23:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 09:23:44 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AGN925032295 for ; Fri, 10 Oct 2003 09:23:10 -0700 Received: from Hermes.suse.de (Hermes.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 57B6D16D5E07; Fri, 10 Oct 2003 18:23:03 +0200 (CEST) Date: Fri, 10 Oct 2003 18:23:02 +0200 From: Olaf Hering To: Marcelo Tosatti Cc: linux-kernel@vger.kernel.org, irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: Linux 2.4.23-pre7 (irda compile fixes) Message-ID: <20031010162302.GA1526@suse.de> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="V0207lvV8h4k8FAm" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 X-archive-position: 714 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 --V0207lvV8h4k8FAm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Oct 09, Marcelo Tosatti wrote: > > Hi, > > Here goes -pre7... The attached patch converts all printk(__FUNCTION__); to printk("%s", __FUNCTION__); gcc34 doesnt accept the current code anymore, irda doesnt compile. please apply. drivers/net/irda/act200l.c | 14 +- drivers/net/irda/irda-usb.c | 4 drivers/net/irda/ma600.c | 26 ++-- drivers/net/irda/mcp2120.c | 6 drivers/net/irda/nsc-ircc.c | 2 net/irda/af_irda.c | 208 +++++++++++++++------------------- net/irda/ircomm/ircomm_core.c | 45 +++---- net/irda/ircomm/ircomm_event.c | 12 - net/irda/ircomm/ircomm_lmp.c | 30 ++-- net/irda/ircomm/ircomm_param.c | 33 ++--- net/irda/ircomm/ircomm_ttp.c | 26 ++-- net/irda/ircomm/ircomm_tty_attach.c | 79 ++++++------ net/irda/ircomm/ircomm_tty_ioctl.c | 18 +- net/irda/irda_device.c | 47 +++---- net/irda/irias_object.c | 34 ++--- net/irda/irlan/irlan_client.c | 50 ++++---- net/irda/irlan/irlan_client_event.c | 65 +++++----- net/irda/irlan/irlan_common.c | 70 +++++------ net/irda/irlan/irlan_eth.c | 16 +- net/irda/irlan/irlan_event.c | 4 net/irda/irlan/irlan_filter.c | 4 net/irda/irlan/irlan_provider.c | 30 ++-- net/irda/irlan/irlan_provider_event.c | 16 +- net/irda/irlap_event.c | 144 ++++++++++------------- net/irda/irlap_frame.c | 67 +++++----- net/irda/irlmp_frame.c | 42 +++--- net/irda/irnet/irnet.h | 10 - net/irda/irqueue.c | 10 - net/irda/irttp.c | 113 ++++++++---------- net/irda/parameters.c | 51 ++++---- net/irda/qos.c | 24 +-- net/irda/wrapper.c | 23 +-- 32 files changed, 633 insertions(+), 690 deletions(-) -- USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG --V0207lvV8h4k8FAm Content-Type: application/x-bzip2 Content-Disposition: attachment; filename="irda.__FUNCTION__.2.4.23-pre7.patch.bz2" Content-Transfer-Encoding: base64 QlpoOTFBWSZTWURA6UEA8I9/gH42AgB7/////////r////9glZ33n1wAAUGgAADwPvGkklUN WvZTvYRr7AY+GQ+8+29onL483a8q6M0DatbJ9DB0r3LVGB0AoDW+71Jee8Y3mAz2NeR9PrT7 2ezDywd7fc3TdlegAG64HrX173caADoeQSnYd883a8ATpgbuoPIPgAAHg9Jd9eu98yU8+8b7 ll64Hvds+686ezes3YHQOgdBQ0IwdgNBuu7Hyfd92+H0+gdeunWgeu57tClVO2iujqo7KYcj YTro613j3ezaE3rKN26xXLnWy723expzyMKoq97UXc7e5me4B17baC53fe8BvDQ9R7nOOR9e eZ7tWEcy2tsLWNMlBu6S7Cj1TF7rew3l3Wturs7tSHcdCJddsleZ172oTdzqdkTa650no7rb OqZOp5t33m98X12AzRqEsbZND67j57zr0M1Yse2pfbI1gV6bTN3O4bqCRICAITJoCaEyaGTV NT9NTN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1LCsiyMRYiCkYglKZkpYREgWI0kYsTmBeORVGDhQdC6+x gat8rem95YF2F9ZS6yMA4EwRjj2HRxhN5DaIHozn5mQ/tcXi/2Md7+TOfA1sv7iTjr+5w4uL /WmnTRxfnAcOcGvndjsTU9fCgqkVZD1LZatlLZatniE9QfXtprsjotdXMUzK7RahIQkISSRG hIO/KPbve+9rjN0Q5LLheOf6bslhPVPPe6JugkUWojIHn4nnPqFTndPu+Yyc315uvJvYcZZt i7GuuNNMvNOYtvDEyBU4+UmcwS/i7CYeZZqCw68hpkoYY+eBRVnNGj6ZEPUTUdHmb8NnQsU2 EFEZX2TIdnp6HRMYUboAViR9mAbGTAF6LJQSIKeqCli0WDUXR1CijXUwAJb4R2EH2fS22qWr V81VjUbYqjGrAgH5oIBSf+lkCowfl8X55YXCgyL9TW0Vrv7NO0WqK3aa1wYopMxoKrNf/i7k inChIIiB0oI= --V0207lvV8h4k8FAm-- From shemminger@osdl.org Fri Oct 10 10:32:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 10:33:16 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AHWc25001422 for ; Fri, 10 Oct 2003 10:32:39 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9AHWKo19285; Fri, 10 Oct 2003 10:32:20 -0700 Date: Fri, 10 Oct 2003 10:32:02 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: [PATCH] synclink -- incorrect check of register_netdev return val. Message-Id: <20031010103202.1c6ef5f2.shemminger@osdl.org> In-Reply-To: <20031010000158.2dc9ce78.davem@redhat.com> References: <20031009112714.18742308.shemminger@osdl.org> <20031010000158.2dc9ce78.davem@redhat.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 715 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 The synclink family of drivers all check for register_netdev returning -1 when in fact it will return -EIO or -EEXIST. diff -Nru a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c --- a/drivers/char/pcmcia/synclink_cs.c Fri Oct 10 10:00:46 2003 +++ b/drivers/char/pcmcia/synclink_cs.c Fri Oct 10 10:00:46 2003 @@ -4232,7 +4232,7 @@ d->tx_timeout = mgslpc_sppp_tx_timeout; d->watchdog_timeo = 10*HZ; - if (register_netdev(d) == -1) { + if (register_netdev(d)) { printk(KERN_WARNING "%s: register_netdev failed.\n", d->name); sppp_detach(info->netdev); return; diff -Nru a/drivers/char/synclink.c b/drivers/char/synclink.c --- a/drivers/char/synclink.c Fri Oct 10 10:00:46 2003 +++ b/drivers/char/synclink.c Fri Oct 10 10:00:46 2003 @@ -7847,7 +7847,7 @@ d->tx_timeout = mgsl_sppp_tx_timeout; d->watchdog_timeo = 10*HZ; - if (register_netdev(d) == -1) { + if (register_netdev(d)) { printk(KERN_WARNING "%s: register_netdev failed.\n", d->name); sppp_detach(info->netdev); return; diff -Nru a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c --- a/drivers/char/synclinkmp.c Fri Oct 10 10:00:46 2003 +++ b/drivers/char/synclinkmp.c Fri Oct 10 10:00:46 2003 @@ -1653,7 +1653,7 @@ d->tx_timeout = sppp_cb_tx_timeout; d->watchdog_timeo = 10*HZ; - if (register_netdev(d) == -1) { + if (register_netdev(d)) { printk(KERN_WARNING "%s: register_netdev failed.\n", d->name); sppp_detach(info->netdev); return; From shemminger@osdl.org Fri Oct 10 10:32:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 10:33:33 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AHWw25001432 for ; Fri, 10 Oct 2003 10:32:58 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9AHWjo19551; Fri, 10 Oct 2003 10:32:45 -0700 Date: Fri, 10 Oct 2003 10:32:25 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: [PATCH] hostess -- return value check for register_netdev Message-Id: <20031010103225.2177d385.shemminger@osdl.org> In-Reply-To: <20031010000158.2dc9ce78.davem@redhat.com> References: <20031009112714.18742308.shemminger@osdl.org> <20031010000158.2dc9ce78.davem@redhat.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 716 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 Another driver that checks for register_netdev returing -1 when it can return -EIO or -EEXIST. diff -Nru a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c --- a/drivers/net/wan/hostess_sv11.c Fri Oct 10 09:58:31 2003 +++ b/drivers/net/wan/hostess_sv11.c Fri Oct 10 09:58:31 2003 @@ -337,7 +337,7 @@ d->neigh_setup = hostess_neigh_setup_dev; d->set_mac_address = NULL; - if(register_netdev(d)==-1) + if(register_netdev(d)) { printk(KERN_ERR "%s: unable to register device.\n", d->name); From scott.feldman@intel.com Fri Oct 10 11:46:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 11:46:38 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AIjx25007037 for ; Fri, 10 Oct 2003 11:46:00 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h9AIg0GC028717 for ; Fri, 10 Oct 2003 18:42:00 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h9AIeLd12070 for ; Fri, 10 Oct 2003 18:40:22 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003101011455213849 ; Fri, 10 Oct 2003 11:45:52 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Fri, 10 Oct 2003 11:45:52 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: e1000 close (NAPI) Date: Fri, 10 Oct 2003 11:45:52 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: e1000 close (NAPI) Thread-Index: AcONfNBCtjL6tUINRRuMDPwf1uFoGwB4qlSw From: "Feldman, Scott" To: "Robert Olsson" Cc: "Jeff Garzik" , X-OriginalArrivalTime: 10 Oct 2003 18:45:52.0939 (UTC) FILETIME=[BB5937B0:01C38F5E] X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h9AIjx25007037 X-archive-position: 717 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev Robert Olsson wrote: > Other drivers may have the same issue. This was spotted > while stress-testing tulip. Patch was sent here some days > ago. It's only seen if trying to close device under extreme > loads. See the syncing code in dev_close() Got it, thanks. From modica@sgi.com Fri Oct 10 12:05:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 12:06:19 -0700 (PDT) Received: from rj.sgi.com (mtvcafw.SGI.COM [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AJ5g25007812 for ; Fri, 10 Oct 2003 12:05:42 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by rj.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h9AH9cOO013373 for ; Fri, 10 Oct 2003 10:09:38 -0700 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h9AJ5acc12102428; Fri, 10 Oct 2003 14:05:36 -0500 (CDT) Received: from sgi.com (eagdhcp-232-154.americas.sgi.com [128.162.232.154]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h9AJ5aRn321168941; Fri, 10 Oct 2003 14:05:36 -0500 (CDT) Message-ID: <3F8702FF.70500@sgi.com> Date: Fri, 10 Oct 2003 14:05:35 -0500 From: Steve Modica Organization: SGI User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andi Kleen CC: "David S. Miller" , johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> In-Reply-To: <20031008202248.GA15611@oldwotan.suse.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 718 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev Andi Kleen wrote: > > For 2.6 short term probably some bandaid like the CONFIG_UNALIGNMENT_COSTLY > and doing driver copies is better. > Question. Is there a way for us to create a CONFIG entry like this, but also allow for a modules.conf argument? (perhaps "options tg3 unalignment_costly") Customers running Suse on Altix have to edit modules.conf anyhow so they use the tg3 module (instead of bcm). So when they do this, we could easily have them add an argument to the modules.conf line and we avoid a kernel build. This let's us run with a standard ia64 kernel. Steve -- Steve Modica work: 651-683-3224 MTS-Technical Lead "Give a man a fish, and he will eat for a day, hit him with a fish and he leaves you alone" - me From shemminger@osdl.org Fri Oct 10 12:49:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 12:49:54 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AJnG25012014 for ; Fri, 10 Oct 2003 12:49:16 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9AJn7o17875; Fri, 10 Oct 2003 12:49:07 -0700 Date: Fri, 10 Oct 2003 12:48:49 -0700 From: Stephen Hemminger To: Pete Clements , netdev@oss.sgi.com Subject: Re: Second 3c509 missing (2.5.71 thru 2.6.0-t7) Message-Id: <20031010124849.5ae48bd9.shemminger@osdl.org> In-Reply-To: <200310100126.VAA21162@clem.clem-digital.net> References: <200310100126.VAA21162@clem.clem-digital.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 719 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 On Thu, 9 Oct 2003 21:26:01 -0400 (EDT) Pete Clements wrote: > Since things are moving into fixes... > > I use 3c509 compiled in. Second card not detected. This has been the > case with the stock kernel since 2.5.71. Have been replacing the > code for all kernels since .70. Have not tried as modules. Try this. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Fri Oct 10 10:03:42 2003 +++ b/drivers/net/Space.c Fri Oct 10 10:03:42 2003 @@ -433,17 +433,15 @@ #ifdef CONFIG_SBNI for (num = 0; num < 8; ++num) - if (sbni_probe(num)) - break; + sbni_probe(num); #endif #ifdef CONFIG_TR for (num = 0; num < 8; ++num) - if (trif_probe(num)) - break; + trif_probe(num); #endif for (num = 0; num < 8; ++num) - if (ethif_probe(num)) - break; + ethif_probe(num); + #ifdef CONFIG_COPS cops_probe(0); cops_probe(1); From ak@suse.de Fri Oct 10 12:52:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 12:52:54 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AJqB25012392 for ; Fri, 10 Oct 2003 12:52:11 -0700 Received: from Hermes.suse.de (Hermes.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 BDA8D16D7CEF; Fri, 10 Oct 2003 21:20:36 +0200 (CEST) Date: Fri, 10 Oct 2003 21:20:36 +0200 From: Andi Kleen To: Steve Modica Cc: Andi Kleen , "David S. Miller" , johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-ID: <20031010192036.GA31727@wotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F8702FF.70500@sgi.com> X-archive-position: 720 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 > Customers running Suse on Altix have to edit modules.conf anyhow so they > use the tg3 module (instead of bcm). So when they do this, we could easily > have them add an argument to the modules.conf line and we avoid a kernel > build. This let's us run with a standard ia64 kernel. Doesn't it already have a rx_copy_break argument? If yes just set it to zero and it will always copy. If not add it. -Andi From rddunlap@osdl.org Fri Oct 10 14:25:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 14:26:27 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ALPr25025223 for ; Fri, 10 Oct 2003 14:25:53 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9ALPko04019; Fri, 10 Oct 2003 14:25:46 -0700 Date: Fri, 10 Oct 2003 14:16:46 -0700 From: "Randy.Dunlap" To: lkml Cc: netdev@oss.sgi.com Subject: patches for PROC_FS=n (2.6.0-test7) Message-Id: <20031010141646.779f10bb.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 721 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev drivers/char/toshiba.c and net/atm/clip.c don't build if PROC_FS=n. Patches for them are available at: http://developer.osdl.org/rddunlap/patches/toshiba_inline_260t7.patch http://developer.osdl.org/rddunlap/patches/atmprocfs_260t7.patch There are several other drivers/protocols that don't build with PROC_FS=n, like arlan, siimage, ipx, llc, and bluetooth. -- ~Randy From xma@us.ibm.com Fri Oct 10 14:45:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 14:46:13 -0700 (PDT) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ALjU25026281 for ; Fri, 10 Oct 2003 14:45:37 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9ALgexu358258; Fri, 10 Oct 2003 17:42:41 -0400 Received: from d03nm124.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9ALgSSx174620; Fri, 10 Oct 2003 15:42:29 -0600 Importance: Normal Sensitivity: Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable To: "David S. Miller" Cc: mashirle@us.ibm.com, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: Shirley Ma Date: Fri, 10 Oct 2003 14:42:26 -0700 X-MIMETrack: Serialize by Router on D03NM124/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 10/10/2003 15:42:39 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 723 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xma@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 346 Lines: 18 > Why are you using jiffies for timestamps? I guess these values are measured "since bootup" or something like that? Yes. The timestamp is the value of sysUpTime at the time this entry was created. Thanks Shirley Ma IBM Linux Technology Center 15300 SW Koll Parkway Beaverton, OR 97006-6063 Phone: (503) 578-7638 FAX: (503) 578-3228 From clem@clem.clem-digital.net Fri Oct 10 15:39:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 15:40:18 -0700 (PDT) Received: from clem.clem-digital.net (clem.clem-digital.net [68.16.168.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AMdh25027600 for ; Fri, 10 Oct 2003 15:39:43 -0700 Received: (from clem@localhost) by clem.clem-digital.net (8.9.3p2/8.9.3) id SAA02061; Fri, 10 Oct 2003 18:39:34 -0400 From: Pete Clements Message-Id: <200310102239.SAA02061@clem.clem-digital.net> Subject: Re: Second 3c509 missing (2.5.71 thru 2.6.0-t7) In-Reply-To: <20031010124849.5ae48bd9.shemminger@osdl.org> from Stephen Hemminger at "Oct 10, 2003 12:48:49 pm" To: shemminger@osdl.org (Stephen Hemminger) Date: Fri, 10 Oct 2003 18:39:34 -0400 (EDT) Cc: clem@clem.clem-digital.net, netdev@oss.sgi.com X-Mailer: ELM [version 2.4ME+ PL48 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 724 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: clem@clem.clem-digital.net Precedence: bulk X-list: netdev Content-Length: 999 Lines: 38 Quoting Stephen Hemminger Tried, but does not fix, result is same. Thanks. > > > > I use 3c509 compiled in. Second card not detected. This has been the > > case with the stock kernel since 2.5.71. Have been replacing the > > code for all kernels since .70. Have not tried as modules. > > Try this. > > diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c > --- a/drivers/net/Space.c Fri Oct 10 10:03:42 2003 > +++ b/drivers/net/Space.c Fri Oct 10 10:03:42 2003 > @@ -433,17 +433,15 @@ > > #ifdef CONFIG_SBNI > for (num = 0; num < 8; ++num) > - if (sbni_probe(num)) > - break; > + sbni_probe(num); > #endif > #ifdef CONFIG_TR > for (num = 0; num < 8; ++num) > - if (trif_probe(num)) > - break; > + trif_probe(num); > #endif > for (num = 0; num < 8; ++num) > - if (ethif_probe(num)) > - break; > + ethif_probe(num); > + > #ifdef CONFIG_COPS > cops_probe(0); > cops_probe(1); > -- Pete Clements From shemminger@osdl.org Fri Oct 10 16:06:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 16:07:13 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9AN6a25028824 for ; Fri, 10 Oct 2003 16:06:37 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9AN6To23765; Fri, 10 Oct 2003 16:06:29 -0700 Date: Fri, 10 Oct 2003 16:06:11 -0700 From: Stephen Hemminger To: linux-net@vger.kernel.org Cc: netdev@oss.sgi.com, John Heffner , "Feldman, Scott" Subject: 2.6.0-test7-netx2 Message-Id: <20031010160611.2fba3cf7.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 726 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 Content-Length: 2272 Lines: 105 http://developer.osdl.org/shemminger/netx/2.6/2.6.0-test7/2.6.0-test7-netx2/ This patch set contains experimental network protocols and drivers. Changes since last installment: + bugfixes accepted are in linus.net * TCP Vegas not a config option + more WAN driver cleanup + High Speed TCP patch + New e100 driver (from Scott Feldman) + ISA TokenRing probing changes + VLAN using hlist and RCU TCP includes two alternative congestion mechanism. Both are compiled in, but not enabled. Vegas => /proc/sys/net/tcp_vegas_cong_avoid got this from David Miller, but more info at http://flophouse.com/~neal/uw/linux-vegas/ Sally Floyd High Speed TCP => /proc/sys/net/tcp_altAIMD see http://www.hep.ucl.ac.uk/~ytl/tcpip/hstcp/index.html Auto tuning receive and send buffers is enabled by default via /proc/sys/net/tcp_rcvbuf_mode from John Heffner There is also a new algorithm for sharing memory among lots of connections also from John. ====================================================================== linus.net netx.patch # # Bug fixes # hostess-retval.patch synclink-retval.patch probe-regression.patch syncppp-if-ptr.patch sealevel-if-ptr.patch # # ISA ethernet device probing # probe2.patch de620-probe2.patch ni65-probe2.patch ni52-probe2.patch ni5010-probe2.patch sk16-probe2.patch 3c505-probe2.patch 3c507-probe2.patch arlan-probe2.patch wavelan-probe2.patch 3c501-probe2.patch 82596-probe2.patch # # ISA Tokenring device probing # probe2-tokenring.patch smctr-probe2.patch proteon-probe2.patch #probe2-skisa.patch #probe2-ibmtr.patch # # New devices # stir4200.patch e100-3.0.6_dev.patch # # IRDA cleanups # hashbin-inlist.patch hashbin-const.patch hashbin-no-sorted.patch hashbin-no-unused.patch hashbin-hlist.patch irda-usb.patch # # WAN device cleanup # sbni-request-region.patch cosa-major.patch cosa-name.patch cosa-alloc-netdev.patch hostess_sv11-nomodinc.patch hostess_sv11-allocnetdev.patch lmc-pci_ids.patch lmc-nomodinc.patch lmc-pcidev.patch lmc-allocnetdev.patch farsync-nomodinc.patch pc300-nomodinc.patch # # Janitor cleanups # tms380tr-nomodstub.patch wan-dev-get.patch nfs-seq-file.patch dev-alloc-deprecated.patch vlan-hlist.patch # # TCP Enhancements # tcp-vegas.patch tcp-hstcp.patch tcp-auto-tune.patch From tommy.christensen@tpack.net Fri Oct 10 16:36:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 16:36:34 -0700 (PDT) Received: from mail.tpack.net ([213.173.228.18]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ANa025032444 for ; Fri, 10 Oct 2003 16:36:01 -0700 Received: (qmail 14548 invoked from network); 10 Oct 2003 23:35:54 -0000 Received: from dhcp-216.cph.tpack.net (HELO tpack.net) (192.168.0.216) by 0 with SMTP; 10 Oct 2003 23:35:54 -0000 Message-ID: <3F87430D.2040000@tpack.net> Date: Sat, 11 Oct 2003 01:38:53 +0200 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ben Greear , netdev@oss.sgi.com Subject: [PATCH] Handle shared SKBs in VLAN receive code Content-Type: multipart/mixed; boundary="------------000107050007030202030904" X-archive-position: 727 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------000107050007030202030904 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit As noted by Jonas Munsin, the vlan patch that went into 2.6.0-test7 did a kfree() rather than a kfree_skb(). Hmm. Instead of just fixing this up, I suggest we do things the right way: The VLAN code have long been claiming to handle shared SKBs, without actually doing so. I have now added the call to skb_share_check(). This enables us to simply do a skb_unshare() when mangling the ethernet header. Patch is against linux-2.6.0-test7 (applies to 2.4.23-pre7 as well). -Tommy --------------000107050007030202030904 Content-Type: text/plain; name="vlan_dev.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="vlan_dev.c.patch" diff -ru linux-2.6.0-test7/net/8021q/vlan_dev.c linux-2.6/net/8021q/vlan_dev.c --- linux-2.6.0-test7/net/8021q/vlan_dev.c Wed Oct 8 21:24:44 2003 +++ linux-2.6/net/8021q/vlan_dev.c Sat Oct 11 00:45:28 2003 @@ -74,11 +74,7 @@ static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb) { if (VLAN_DEV_INFO(skb->dev)->flags & 1) { - if (skb_shared(skb) || skb_cloned(skb)) { - struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC); - kfree(skb); - skb = nskb; - } + skb = skb_unshare(skb, GFP_ATOMIC); if (skb) { /* Lifted from Gleb's VLAN code... */ memmove(skb->data - ETH_HLEN, @@ -121,6 +117,7 @@ struct net_device_stats *stats; unsigned short vlan_TCI; unsigned short proto; + struct net_device *vlan_dev; /* vlan_TCI = ntohs(get_unaligned(&vhdr->h_vlan_TCI)); */ vlan_TCI = ntohs(vhdr->h_vlan_TCI); @@ -144,8 +141,8 @@ */ spin_lock_bh(&vlan_group_lock); - skb->dev = __find_vlan_dev(dev, vid); - if (!skb->dev) { + vlan_dev = __find_vlan_dev(dev, vid); + if (!vlan_dev) { spin_unlock_bh(&vlan_group_lock); #ifdef VLAN_DEBUG @@ -156,10 +153,18 @@ return -1; } - skb->dev->last_rx = jiffies; + vlan_dev->last_rx = jiffies; + stats = vlan_dev_get_stats(vlan_dev); + + skb = skb_share_check(skb, GFP_ATOMIC); + if (!skb) { + spin_unlock_bh(&vlan_group_lock); + stats->rx_dropped++; + return NET_RX_DROP; + } + skb->dev = vlan_dev; /* Bump the rx counters for the VLAN device. */ - stats = vlan_dev_get_stats(skb->dev); stats->rx_packets++; stats->rx_bytes += skb->len; --------------000107050007030202030904-- From greearb@candelatech.com Fri Oct 10 16:52:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 16:53:24 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ANqn25000624 for ; Fri, 10 Oct 2003 16:52:50 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h9ANqhme001083; Fri, 10 Oct 2003 16:52:43 -0700 Message-ID: <3F87464B.1020908@candelatech.com> Date: Fri, 10 Oct 2003 16:52:43 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tommy Christensen CC: netdev@oss.sgi.com Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code References: <3F87430D.2040000@tpack.net> In-Reply-To: <3F87430D.2040000@tpack.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 728 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Tommy Christensen wrote: > As noted by Jonas Munsin, the vlan patch that went into 2.6.0-test7 did a > kfree() rather than a kfree_skb(). Hmm. > > Instead of just fixing this up, I suggest we do things the right way: > > The VLAN code have long been claiming to handle shared SKBs, without > actually > doing so. I have now added the call to skb_share_check(). > > This enables us to simply do a skb_unshare() when mangling the ethernet > header. > > > Patch is against linux-2.6.0-test7 (applies to 2.4.23-pre7 as well). > > -Tommy > > > ------------------------------------------------------------------------ > > diff -ru linux-2.6.0-test7/net/8021q/vlan_dev.c linux-2.6/net/8021q/vlan_dev.c > --- linux-2.6.0-test7/net/8021q/vlan_dev.c Wed Oct 8 21:24:44 2003 > +++ linux-2.6/net/8021q/vlan_dev.c Sat Oct 11 00:45:28 2003 > @@ -74,11 +74,7 @@ > static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb) > { > if (VLAN_DEV_INFO(skb->dev)->flags & 1) { > - if (skb_shared(skb) || skb_cloned(skb)) { > - struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC); > - kfree(skb); > - skb = nskb; > - } > + skb = skb_unshare(skb, GFP_ATOMIC); On 2.4.22, at least, skb_unshare only checks skb_cloned(), so do we also need to check skb_shared()? Or was that check in the old patch above not needed? Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From tommy.christensen@tpack.net Fri Oct 10 17:06:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 10 Oct 2003 17:07:02 -0700 (PDT) Received: from mail.tpack.net ([213.173.228.18]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9B06R25001307 for ; Fri, 10 Oct 2003 17:06:27 -0700 Received: (qmail 18952 invoked from network); 11 Oct 2003 00:06:21 -0000 Received: from dhcp-216.cph.tpack.net (HELO tpack.net) (192.168.0.216) by 0 with SMTP; 11 Oct 2003 00:06:21 -0000 Message-ID: <3F874A30.6010700@tpack.net> Date: Sat, 11 Oct 2003 02:09:20 +0200 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ben Greear CC: netdev@oss.sgi.com Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code References: <3F87430D.2040000@tpack.net> <3F87464B.1020908@candelatech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 729 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Ben Greear wrote: >> - if (skb_shared(skb) || skb_cloned(skb)) { >> - struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC); >> - kfree(skb); >> - skb = nskb; >> - } >> + skb = skb_unshare(skb, GFP_ATOMIC); > > > On 2.4.22, at least, skb_unshare only checks skb_cloned(), so do we > also need to check skb_shared()? Or was that check in the old patch above > not needed? skb_shared() is now taken care of by skb_share_check(), called earlier in the receive routine. Admittedly, the naming is not very helpful. skb_share_check() handles shared sk_buff's, while skb_unshare() handles cloned sk_buff's. Well ... -Tommy From modica@sgi.com Sat Oct 11 06:14:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 06:15:35 -0700 (PDT) Received: from tolkor.sgi.com (tolkor.SGI.COM [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BDEu25026121 for ; Sat, 11 Oct 2003 06:14:56 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h9BDWnHc018623 for ; Sat, 11 Oct 2003 08:32:49 -0500 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h9BDEocc12159108; Sat, 11 Oct 2003 08:14:50 -0500 (CDT) Received: from sgi.com (cf-vpn-sw-corp-64-26.corp.sgi.com [134.15.64.26]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h9BDEnRn300220986; Sat, 11 Oct 2003 08:14:49 -0500 (CDT) Message-ID: <3F8802E6.5030601@sgi.com> Date: Sat, 11 Oct 2003 08:17:26 -0500 From: Steve Modica User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andi Kleen CC: "David S. Miller" , johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> In-Reply-To: <20031010192036.GA31727@wotan.suse.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 730 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev Andi Kleen wrote: >>Customers running Suse on Altix have to edit modules.conf anyhow so they >>use the tg3 module (instead of bcm). So when they do this, we could easily >>have them add an argument to the modules.conf line and we avoid a kernel >>build. This let's us run with a standard ia64 kernel. > > > Doesn't it already have a rx_copy_break argument? If yes just set it to > zero and it will always copy. If not add it. The problem with this solution is that it also impacts 5704 cards, which don't have the alignment issue. We are figuring all this out. We may just switch over completely and replace the 5701 cards. From ak@suse.de Sat Oct 11 06:41:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 06:41:57 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BDfB25026941 for ; Sat, 11 Oct 2003 06:41:12 -0700 Received: from Hermes.suse.de (Hermes.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 6B25516DE5E4; Sat, 11 Oct 2003 15:19:21 +0200 (CEST) Date: Sat, 11 Oct 2003 15:19:21 +0200 From: Andi Kleen To: Steve Modica Cc: Andi Kleen , "David S. Miller" , johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-ID: <20031011131921.GC21763@wotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F8802E6.5030601@sgi.com> X-archive-position: 731 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 Sat, Oct 11, 2003 at 08:17:26AM -0500, Steve Modica wrote: > Andi Kleen wrote: > > >>Customers running Suse on Altix have to edit modules.conf anyhow so they > >>use the tg3 module (instead of bcm). So when they do this, we could > >>easily have them add an argument to the modules.conf line and we avoid a > >>kernel build. This let's us run with a standard ia64 kernel. > > > > > >Doesn't it already have a rx_copy_break argument? If yes just set it to > >zero and it will always copy. If not add it. > > The problem with this solution is that it also impacts 5704 cards, which > don't have the alignment issue. We are figuring all this out. We may > just switch over completely and replace the 5701 cards. Then just don't set the argument to zero in modules.conf on the 5704cards. That could be even handled somewhere in user space. Switching over sounds best of course, because the performance with the copying won't be great -Andi From ja@ssi.bg Sat Oct 11 10:18:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 10:19:11 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BHIS25002095 for ; Sat, 11 Oct 2003 10:18:32 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h9BHIXG31895; Sat, 11 Oct 2003 20:18:35 +0300 Date: Sat, 11 Oct 2003 20:18:33 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: Wensong Zhang , Subject: [2.4/2.6 PATCHES] Change some ip_fragment checks to help IPVS Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 732 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Hello, The included changes help IPVS to correctly forward fragmented packets. The first problem is that IPVS relies on skb->nfcache to contain valid information in all hooks but ip_fragment does not copy this field, both in 2.4 and 2.6. I just realize that this is the cause for the problem one IPVS user reported for 2.4. The second problem is that 2.6 does not allow IPVS to transmit fragmented skbs, they are reassembled just because one of the frags has no owner. Now we add check to avoid the reassembling if the first skb is not owned and by this way we have reason to be happy with all recent non-linear handling changes. First is the nfcache patch for 2.4, followed by 2 csets for 2.6: --- linux/net/ipv4/ip_output.c.orig Mon Aug 25 22:06:13 2003 +++ linux/net/ipv4/ip_output.c Sat Oct 11 19:54:34 2003 @@ -879,6 +879,7 @@ #endif #ifdef CONFIG_NETFILTER skb2->nfmark = skb->nfmark; + skb2->nfcache = skb->nfcache; /* Connection association is same as pre-frag packet */ skb2->nfct = skb->nfct; nf_conntrack_get(skb2->nfct); === # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1502 -> 1.1503 # net/ipv4/ip_output.c 1.45 -> 1.46 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/11 ja@ssi.bg 1.1503 # [IPV4]: ip_copy_metadata must copy the nfcache field # -------------------------------------------- # diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c --- a/net/ipv4/ip_output.c Sat Oct 11 19:35:15 2003 +++ b/net/ipv4/ip_output.c Sat Oct 11 19:35:15 2003 @@ -412,6 +412,7 @@ #endif #ifdef CONFIG_NETFILTER to->nfmark = from->nfmark; + to->nfcache = from->nfcache; /* Connection association is same as pre-frag packet */ to->nfct = from->nfct; nf_conntrack_get(to->nfct); === # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1503 -> 1.1504 # net/ipv4/ip_output.c 1.46 -> 1.47 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/11 ja@ssi.bg 1.1504 # [IPV4]: ip_fragment should not reassemble if all frags do not have owner # -------------------------------------------- # diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c --- a/net/ipv4/ip_output.c Sat Oct 11 19:49:38 2003 +++ b/net/ipv4/ip_output.c Sat Oct 11 19:49:38 2003 @@ -493,7 +493,7 @@ goto slow_path; /* Correct socket ownership. */ - if (frag->sk == NULL) + if (frag->sk == NULL && skb->sk) goto slow_path; /* Partially cloned skb? */ === Regards -- Julian Anastasov From davem@pizda.ninka.net Sat Oct 11 10:56:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 10:57:26 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BHuo25002926 for ; Sat, 11 Oct 2003 10:56:51 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id KAA22690; Sat, 11 Oct 2003 10:50:54 -0700 Date: Sat, 11 Oct 2003 10:50:54 -0700 From: "David S. Miller" To: Andi Kleen Cc: modica@sgi.com, ak@suse.de, johnip@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031011105054.0e16a607.davem@redhat.com> In-Reply-To: <20031011131921.GC21763@wotan.suse.de> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 733 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 On Sat, 11 Oct 2003 15:19:21 +0200 Andi Kleen wrote: > Then just don't set the argument to zero in modules.conf on the 5704cards. > That could be even handled somewhere in user space. Switching over sounds > best of course, because the performance with the copying won't be great There is no "argument" we don't have a variable in the tg3 driver that determines the "copybreak", it's a hard-coded macro define. For them it's really easy to know when the 5701 hw bug case is present, so they can do something like: if (len > RX_COPY_THRESHOLD #ifdef CONFIG_UNALIGNED_EXPENSIVE || tp->rx_offset == 2 #endif ) { ... And then only their platform and only when the buggy chips are present, will get the desired change in behavior. From davem@pizda.ninka.net Sat Oct 11 11:13:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 11:13:51 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BIDI25003718 for ; Sat, 11 Oct 2003 11:13:18 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA22754; Sat, 11 Oct 2003 11:07:24 -0700 Date: Sat, 11 Oct 2003 11:07:24 -0700 From: "David S. Miller" To: Julian Anastasov Cc: wensong@linux-vs.org, netdev@oss.sgi.com Subject: Re: [2.4/2.6 PATCHES] Change some ip_fragment checks to help IPVS Message-Id: <20031011110724.242ff2d6.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 734 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 I don't read patches emailed privately to me, if you don't bother to at least CC: netdev on your patches (so that other people can review the patch, I'm actually quite busy right now) then I'm not going to bother reading your email. From davem@pizda.ninka.net Sat Oct 11 11:14:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 11:14:50 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BIEF25003859 for ; Sat, 11 Oct 2003 11:14:22 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA22760; Sat, 11 Oct 2003 11:08:18 -0700 Date: Sat, 11 Oct 2003 11:08:18 -0700 From: "David S. Miller" To: Julian Anastasov Cc: wensong@linux-vs.org, netdev@oss.sgi.com Subject: Re: [2.4/2.6 PATCHES] Change some ip_fragment checks to help IPVS Message-Id: <20031011110818.6219d2f0.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 735 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 My bad, I just saw netdev in the CC, sorry about that. I really do hate when people email me crap privately. Because even if I wanted to forward it to netdev I can't do that without asking their permission which takes even more time, so that's why I just chew people out when they make this mistake. Sorry again. From davem@pizda.ninka.net Sat Oct 11 11:59:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:00:27 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BIxo25005649 for ; Sat, 11 Oct 2003 11:59:50 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA22916; Sat, 11 Oct 2003 11:53:57 -0700 Date: Sat, 11 Oct 2003 11:53:57 -0700 From: "David S. Miller" To: Julian Anastasov Cc: wensong@linux-vs.org, netdev@oss.sgi.com Subject: Re: [2.4/2.6 PATCHES] Change some ip_fragment checks to help IPVS Message-Id: <20031011115357.0c756785.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 736 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 On Sat, 11 Oct 2003 20:18:33 +0300 (EEST) Julian Anastasov wrote: > # [IPV4]: ip_copy_metadata must copy the nfcache field I can't believe we missed this, I'll definitely apply these patches. Thanks. > # [IPV4]: ip_fragment should not reassemble if all frags do not have owner This one I have to think about some more. From greearb@candelatech.com Sat Oct 11 12:03:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:04:33 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BJ3x25006071 for ; Sat, 11 Oct 2003 12:03:59 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h9BJ3qme010968; Sat, 11 Oct 2003 12:03:53 -0700 Message-ID: <3F885418.3090407@candelatech.com> Date: Sat, 11 Oct 2003 12:03:52 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tommy Christensen CC: netdev@oss.sgi.com Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code References: <3F87430D.2040000@tpack.net> <3F87464B.1020908@candelatech.com> <3F874A30.6010700@tpack.net> In-Reply-To: <3F874A30.6010700@tpack.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 737 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Tommy Christensen wrote: > Ben Greear wrote: > >>> - if (skb_shared(skb) || skb_cloned(skb)) { >>> - struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC); >>> - kfree(skb); >>> - skb = nskb; >>> - } >>> + skb = skb_unshare(skb, GFP_ATOMIC); >> >> >> >> On 2.4.22, at least, skb_unshare only checks skb_cloned(), so do we >> also need to check skb_shared()? Or was that check in the old patch >> above >> not needed? > > > skb_shared() is now taken care of by skb_share_check(), called earlier > in the > receive routine. Maybe we should have a method called: skb_get_me_an_skb_that_I_can_modify(skb); Then the subtle differences between sharing, cloning, etc can be handled by the skb code internally... Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From davem@pizda.ninka.net Sat Oct 11 12:08:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:09:28 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BJ8t25006724 for ; Sat, 11 Oct 2003 12:08:55 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA22961; Sat, 11 Oct 2003 12:02:29 -0700 Date: Sat, 11 Oct 2003 12:02:28 -0700 From: "David S. Miller" To: Julian Anastasov Cc: wensong@linux-vs.org, netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: [2.4/2.6 PATCHES] Change some ip_fragment checks to help IPVS Message-Id: <20031011120228.74914c91.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 738 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 On Sat, 11 Oct 2003 20:18:33 +0300 (EEST) Julian Anastasov wrote: > /* Correct socket ownership. */ > - if (frag->sk == NULL) > + if (frag->sk == NULL && skb->sk) > goto slow_path; Alexey I think this piece of Julian's patch is OK and this is the test you meant to make in the first place. Right? From davem@pizda.ninka.net Sat Oct 11 12:09:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:10:04 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BJ9U25006938 for ; Sat, 11 Oct 2003 12:09:30 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA22968; Sat, 11 Oct 2003 12:03:39 -0700 Date: Sat, 11 Oct 2003 12:03:39 -0700 From: "David S. Miller" To: Ben Greear Cc: tommy.christensen@tpack.net, netdev@oss.sgi.com Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code Message-Id: <20031011120339.0da631e6.davem@redhat.com> In-Reply-To: <3F885418.3090407@candelatech.com> References: <3F87430D.2040000@tpack.net> <3F87464B.1020908@candelatech.com> <3F874A30.6010700@tpack.net> <3F885418.3090407@candelatech.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 739 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 On Sat, 11 Oct 2003 12:03:52 -0700 Ben Greear wrote: > Maybe we should have a method called: skb_get_me_an_skb_that_I_can_modify(skb); > > Then the subtle differences between sharing, cloning, etc can be handled > by the skb code internally... We can't create this routine, because it depends upon context. The current code is correct and handles shared SKBs properly, so I don't think it's worth playing around with this much more. From davem@pizda.ninka.net Sat Oct 11 12:14:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:15:20 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BJEh25007655 for ; Sat, 11 Oct 2003 12:14:43 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA23004; Sat, 11 Oct 2003 12:08:52 -0700 Date: Sat, 11 Oct 2003 12:08:52 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: patches for PROC_FS=n (2.6.0-test7) Message-Id: <20031011120852.13fa8ec4.davem@redhat.com> In-Reply-To: <20031010141646.779f10bb.rddunlap@osdl.org> References: <20031010141646.779f10bb.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 740 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 On Fri, 10 Oct 2003 14:16:46 -0700 "Randy.Dunlap" wrote: > http://developer.osdl.org/rddunlap/patches/atmprocfs_260t7.patch How can this be needed? When procfs is disabled then remove_proc_entry() is defined as "do { } while (0)", ie. a nop. From davem@pizda.ninka.net Sat Oct 11 12:18:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:19:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BJIR25008042 for ; Sat, 11 Oct 2003 12:18:27 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA23045; Sat, 11 Oct 2003 12:12:34 -0700 Date: Sat, 11 Oct 2003 12:12:34 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] hostess -- return value check for register_netdev Message-Id: <20031011121234.01bbe577.davem@redhat.com> In-Reply-To: <20031010103225.2177d385.shemminger@osdl.org> References: <20031009112714.18742308.shemminger@osdl.org> <20031010000158.2dc9ce78.davem@redhat.com> <20031010103225.2177d385.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 741 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 On Fri, 10 Oct 2003 10:32:25 -0700 Stephen Hemminger wrote: > Another driver that checks for register_netdev returing -1 when > it can return -EIO or -EEXIST. Applied, thanks Stephen. From davem@pizda.ninka.net Sat Oct 11 12:18:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:19:32 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BJIw25008055 for ; Sat, 11 Oct 2003 12:18:59 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA23067; Sat, 11 Oct 2003 12:13:08 -0700 Date: Sat, 11 Oct 2003 12:13:07 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] synclink -- incorrect check of register_netdev return val. Message-Id: <20031011121307.39df7c03.davem@redhat.com> In-Reply-To: <20031010103202.1c6ef5f2.shemminger@osdl.org> References: <20031009112714.18742308.shemminger@osdl.org> <20031010000158.2dc9ce78.davem@redhat.com> <20031010103202.1c6ef5f2.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 742 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 On Fri, 10 Oct 2003 10:32:02 -0700 Stephen Hemminger wrote: > The synclink family of drivers all check for register_netdev returning > -1 when in fact it will return -EIO or -EEXIST. Also applied, thanks. From davem@pizda.ninka.net Sat Oct 11 12:22:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:23:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BJMR25011472 for ; Sat, 11 Oct 2003 12:22:27 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA23129; Sat, 11 Oct 2003 12:16:35 -0700 Date: Sat, 11 Oct 2003 12:16:35 -0700 From: "David S. Miller" To: Olaf Hering Cc: marcelo.tosatti@cyclades.com, linux-kernel@vger.kernel.org, irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: Linux 2.4.23-pre7 (irda compile fixes) Message-Id: <20031011121635.4eb39ca6.davem@redhat.com> In-Reply-To: <20031010162302.GA1526@suse.de> References: <20031010162302.GA1526@suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 743 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 On Fri, 10 Oct 2003 18:23:02 +0200 Olaf Hering wrote: > The attached patch converts all printk(__FUNCTION__); to > printk("%s", __FUNCTION__); > gcc34 doesnt accept the current code anymore, irda doesnt compile. Applied, thanks Olaf. From sam@ravnborg.org Sat Oct 11 12:40:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:41:06 -0700 (PDT) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BJeB25012158 for ; Sat, 11 Oct 2003 12:40:32 -0700 Received: from mars.ravnborg.org (0x50a416f6.hrnxx9.adsl-dhcp.tele.dk [80.164.22.246]) by pasmtp.tele.dk (Postfix) with ESMTP id DDEB71EC394; Sat, 11 Oct 2003 21:40:09 +0200 (CEST) Received: by mars.ravnborg.org (Postfix, from userid 502) id D7412A4019; Sat, 11 Oct 2003 21:40:08 +0200 (CEST) Date: Sat, 11 Oct 2003 21:40:08 +0200 From: Sam Ravnborg To: "David S. Miller" Cc: "Randy.Dunlap" , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: patches for PROC_FS=n (2.6.0-test7) Message-ID: <20031011194008.GA2395@mars.ravnborg.org> Mail-Followup-To: "David S. Miller" , "Randy.Dunlap" , linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20031010141646.779f10bb.rddunlap@osdl.org> <20031011120852.13fa8ec4.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031011120852.13fa8ec4.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 744 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sam@ravnborg.org Precedence: bulk X-list: netdev On Sat, Oct 11, 2003 at 12:08:52PM -0700, David S. Miller wrote: > On Fri, 10 Oct 2003 14:16:46 -0700 > "Randy.Dunlap" wrote: > > > http://developer.osdl.org/rddunlap/patches/atmprocfs_260t7.patch > > How can this be needed? When procfs is disabled then > remove_proc_entry() is defined as "do { } while (0)", ie. a nop. Due to this - the real offender: from: net/atm/clip.c: #ifdef CONFIG_PROC_FS #include #include #endif Sam From davem@pizda.ninka.net Sat Oct 11 12:46:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:46:51 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BJkH25012595 for ; Sat, 11 Oct 2003 12:46:17 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA23223; Sat, 11 Oct 2003 12:40:25 -0700 Date: Sat, 11 Oct 2003 12:40:25 -0700 From: "David S. Miller" To: Sam Ravnborg Cc: rddunlap@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: patches for PROC_FS=n (2.6.0-test7) Message-Id: <20031011124025.6cc2ada8.davem@redhat.com> In-Reply-To: <20031011194008.GA2395@mars.ravnborg.org> References: <20031010141646.779f10bb.rddunlap@osdl.org> <20031011120852.13fa8ec4.davem@redhat.com> <20031011194008.GA2395@mars.ravnborg.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 745 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 On Sat, 11 Oct 2003 21:40:08 +0200 Sam Ravnborg wrote: > Due to this - the real offender: > > from: net/atm/clip.c: > #ifdef CONFIG_PROC_FS > #include > #include > #endif That makes a whole lot more sense, here is the fix I just checked in: # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1352 -> 1.1353 # net/atm/clip.c 1.26 -> 1.27 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/11 davem@nuts.ninka.net 1.1353 # [ATM]: Kill PROC_FS ifdef around includes. # -------------------------------------------- # diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Sat Oct 11 12:43:12 2003 +++ b/net/atm/clip.c Sat Oct 11 12:43:12 2003 @@ -24,10 +24,8 @@ #include /* for IFF_UP */ #include #include -#ifdef CONFIG_PROC_FS #include #include -#endif #include /* for struct rtable and routing */ #include /* icmp_send */ #include /* for HZ */ From greearb@candelatech.com Sat Oct 11 12:55:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 12:56:02 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BJtS25013079 for ; Sat, 11 Oct 2003 12:55:29 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h9BJtNme011460; Sat, 11 Oct 2003 12:55:23 -0700 Message-ID: <3F88602B.7020603@candelatech.com> Date: Sat, 11 Oct 2003 12:55:23 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com CC: tommy.christensen@tpack.net Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code References: <3F87430D.2040000@tpack.net> <3F87464B.1020908@candelatech.com> <3F874A30.6010700@tpack.net> <3F885418.3090407@candelatech.com> <20031011120339.0da631e6.davem@redhat.com> In-Reply-To: <20031011120339.0da631e6.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 746 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev David S. Miller wrote: > On Sat, 11 Oct 2003 12:03:52 -0700 > Ben Greear wrote: > > >>Maybe we should have a method called: skb_get_me_an_skb_that_I_can_modify(skb); >> >>Then the subtle differences between sharing, cloning, etc can be handled >>by the skb code internally... > > > We can't create this routine, because it depends upon context. I have read the sk_buf.h file repeatedly trying to get this all straight in my head, and I think I'm still missing things. Is there any other documentation around that describes in detail exactly the things you must do to handle shared skbs in all contexts? I have a question on linearize as well. Assuming I want to read the IP address in a packet. Do I have to linearize before I start looking at offsets in the skb? Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From davem@pizda.ninka.net Sat Oct 11 13:00:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 13:01:25 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BK0d25013526 for ; Sat, 11 Oct 2003 13:00:52 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA23260; Sat, 11 Oct 2003 12:54:26 -0700 Date: Sat, 11 Oct 2003 12:54:26 -0700 From: "David S. Miller" To: Ben Greear Cc: netdev@oss.sgi.com, tommy.christensen@tpack.net Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code Message-Id: <20031011125426.542e47f7.davem@redhat.com> In-Reply-To: <3F88602B.7020603@candelatech.com> References: <3F87430D.2040000@tpack.net> <3F87464B.1020908@candelatech.com> <3F874A30.6010700@tpack.net> <3F885418.3090407@candelatech.com> <20031011120339.0da631e6.davem@redhat.com> <3F88602B.7020603@candelatech.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 747 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 On Sat, 11 Oct 2003 12:55:23 -0700 Ben Greear wrote: > I have read the sk_buf.h file repeatedly trying to get this all straight > in my head, and I think I'm still missing things. Is there any other > documentation around that describes in detail exactly the things you must > do to handle shared skbs in all contexts? No there isn't, sorry. If you just want to read the IP address in a packet, or anything else in general you have two options: 1) if (pskb_may_pull(skb, len)) goto drop; After this call, it is guarenteed you may look at the all bytes up to 'len' from the start of the SKB using skb->data et al. 2) Use skb_peek_bits(). From davem@pizda.ninka.net Sat Oct 11 13:02:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 13:03:29 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9BK2r25013896 for ; Sat, 11 Oct 2003 13:02:54 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA23273; Sat, 11 Oct 2003 12:56:56 -0700 Date: Sat, 11 Oct 2003 12:56:56 -0700 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com, dmerillat@sequiam.com Subject: Re: [RFT] Re: Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR Message-Id: <20031011125656.322bd0ab.davem@redhat.com> In-Reply-To: <20031010154052.GA11366@conectiva.com.br> References: <20031008133345.49f71991.davem@redhat.com> <20031010023644.GA8365@conectiva.com.br> <20031010032244.GB8365@conectiva.com.br> <20031009211437.2cf87a4f.davem@redhat.com> <20031010154052.GA11366@conectiva.com.br> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 748 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 On Fri, 10 Oct 2003 12:40:52 -0300 Arnaldo Carvalho de Melo wrote: > ipv6_rcv_saddr_equal, look at this: > > if (sk2->sk_family == AF_INET6 && > !ipv6_addr_cmp(&np->rcv_saddr, > (sk2->sk_state != TCP_TIME_WAIT ? > &inet6_sk(sk2)->rcv_saddr : > &tcptw_sk(sk)->tw_v6_rcv_saddr))) > ^^ > ^^ > shouldn't the tcp_tw_sk(sk) be tcp_tw_sk(sk2)? Yes. > And in this function we have the guard against it being a tcp_tw_bucket, but > not in all places... It does guard in this spot, that's why it is checking the sk_state value. From rddunlap@osdl.org Sat Oct 11 20:26:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 11 Oct 2003 20:26:35 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9C3Q125029401 for ; Sat, 11 Oct 2003 20:26:02 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9C3Pfo12477; Sat, 11 Oct 2003 20:25:41 -0700 Date: Sat, 11 Oct 2003 20:24:33 -0700 From: "Randy.Dunlap" To: Sam Ravnborg Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: patches for PROC_FS=n (2.6.0-test7) Message-Id: <20031011202433.72fcbd38.rddunlap@osdl.org> In-Reply-To: <20031011194008.GA2395@mars.ravnborg.org> References: <20031010141646.779f10bb.rddunlap@osdl.org> <20031011120852.13fa8ec4.davem@redhat.com> <20031011194008.GA2395@mars.ravnborg.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (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: 749 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev On Sat, 11 Oct 2003 21:40:08 +0200 Sam Ravnborg wrote: | On Sat, Oct 11, 2003 at 12:08:52PM -0700, David S. Miller wrote: | > On Fri, 10 Oct 2003 14:16:46 -0700 | > "Randy.Dunlap" wrote: | > | > > http://developer.osdl.org/rddunlap/patches/atmprocfs_260t7.patch | > | > How can this be needed? When procfs is disabled then | > remove_proc_entry() is defined as "do { } while (0)", ie. a nop. | | Due to this - the real offender: | | from: net/atm/clip.c: | #ifdef CONFIG_PROC_FS | #include | #include | #endif ugh, thanks. -- ~Randy From tommy.christensen@tpack.net Sun Oct 12 02:57:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 02:57:49 -0700 (PDT) Received: from mail.tpack.net ([213.173.228.18]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9C9vE25010338 for ; Sun, 12 Oct 2003 02:57:15 -0700 Received: (qmail 22811 invoked from network); 12 Oct 2003 09:57:08 -0000 Received: from dhcp-179.cph.tpack.net (HELO tpack.net) (192.168.0.179) by 0 with SMTP; 12 Oct 2003 09:57:08 -0000 Message-ID: <3F892629.7090206@tpack.net> Date: Sun, 12 Oct 2003 12:00:09 +0200 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Ben Greear , netdev@oss.sgi.com Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code References: <3F87430D.2040000@tpack.net> <3F87464B.1020908@candelatech.com> <3F874A30.6010700@tpack.net> <3F885418.3090407@candelatech.com> <20031011120339.0da631e6.davem@redhat.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 750 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev David S. Miller wrote: > The current code is correct and handles shared SKBs properly, > so I don't think it's worth playing around with this much more. No, it is still not right. Bear with me, but this is how I understand it: - The sk_buff *structure* is read-only on a shared SKB. skb_share_check(skb) breaks the sharing, thus allowing updates of skb->dev, skb->len etc. But the SKB still points at the same data buffer. - The *data* buffer is read-only on a cloned SKB. skb_cow() or skb_copy() or ... gives us a writeable buffer. The tcpdump problem was caused by violating the second rule, this is now fixed. But the code still doesn't follow the first rule, which is what this patch fixes. -Tommy From jgarzik@pobox.com Sun Oct 12 03:55:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 03:56:21 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9CAth25011821 for ; Sun, 12 Oct 2003 03:55:44 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:35255 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A7E4o-0005d7-8W; Wed, 08 Oct 2003 14:10:02 +0100 Message-ID: <3F840C9C.9050704@pobox.com> Date: Wed, 08 Oct 2003 09:09:48 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tobias DiPasquale CC: netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org, coreteam@netfilter.org, netfilter@lists.netfilter.org, akpm@zip.com.au, davem@redhat.com, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@intercode.com.au, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] kfree_skb() bug in 2.4.22 References: <1065617075.1514.29.camel@localhost> In-Reply-To: <1065617075.1514.29.camel@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 751 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 Tobias DiPasquale wrote: > Hi all, > > I was debugging one of my iptables/netfilter modules yesterday and I > came across this bug in kfree_skb(). One of my functions returns a > struct skbuff * on success and NULL on failure. When it failed, the code > calling said function attempted to free the struct skbuff *, which at > that point was NULL. This produced a kernel panic. I investigated the > problem and found that, not only should I be checking for a NULL pointer > when freeing the struct skbuff *, but the actual cause of the panic was > because kfree_skb() and kfree_skb_fast() do not check for skb==NULL, > either. They immediately attempt to dereference the users field of the > struct skbuff * in order to decrement that reference counter. I would prefer that you fix your code instead, to not pass NULL to kfree_skb()... From scott.feldman@intel.com Sun Oct 12 04:02:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 04:02:58 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9CB2E25012308 for ; Sun, 12 Oct 2003 04:02:15 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h9CB23Jh021414 for ; Sun, 12 Oct 2003 11:02:03 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.py.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h9CB1OI28759 for ; Sun, 12 Oct 2003 11:01:24 GMT Received: from [134.134.3.171] ([134.134.3.171]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003101204020101630 ; Sun, 12 Oct 2003 04:02:01 -0700 Date: Sun, 12 Oct 2003 04:30:31 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik , cc: "Feldman, Scott" , Subject: [PATCH 2.6] ethtool_ops eeprom stuff Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 752 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev Finally got around to adding ethtool_ops to e100-3.0.x. I found a bug with get_eeprom() and it seems to work best if we add get_eeprom_len() to the ops list. Also moved check for offest + len < size into ethtool.c. I was able to test [GS]EEPROM, PHYS_ID, GSTATS, GSTRINGS, and TEST, and everything looks good. Should I send same for 2.4? ------------- --- linux-2.6.0-test7/net/core/ethtool.c.orig 2003-10-08 12:24:02.000000000 -0700 +++ linux-2.6.0-test7/net/core/ethtool.c 2003-10-12 04:18:38.000000000 -0700 @@ -122,7 +122,8 @@ info.n_stats = ops->get_stats_count(dev); if (ops->get_regs_len) info.regdump_len = ops->get_regs_len(dev); - /* XXX: eeprom? */ + if (ops->get_eeprom_len) + info.eedump_len = ops->get_eeprom_len(dev); if (copy_to_user(useraddr, &info, sizeof(info))) return -EFAULT; @@ -245,29 +246,34 @@ static int ethtool_get_eeprom(struct net_device *dev, void *useraddr) { struct ethtool_eeprom eeprom; + struct ethtool_ops *ops = dev->ethtool_ops; u8 *data; - int len, ret; + int ret; - if (!dev->ethtool_ops->get_eeprom) + if (!ops->get_eeprom || !ops->get_eeprom_len) return -EOPNOTSUPP; if (copy_from_user(&eeprom, useraddr, sizeof(eeprom))) return -EFAULT; - len = eeprom.len; /* Check for wrap and zero */ - if (eeprom.offset + len <= eeprom.offset) + if (eeprom.offset + eeprom.len <= eeprom.offset) + return -EINVAL; + + /* Check for exceeding total eeprom len */ + if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev)) return -EINVAL; - data = kmalloc(len, GFP_USER); + data = kmalloc(eeprom.len, GFP_USER); if (!data) return -ENOMEM; - if (copy_from_user(data, useraddr + sizeof(eeprom), len)) - return -EFAULT; + ret = -EFAULT; + if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len)) + goto out; - ret = dev->ethtool_ops->get_eeprom(dev, &eeprom, data); - if (!ret) + ret = ops->get_eeprom(dev, &eeprom, data); + if (ret) goto out; ret = -EFAULT; @@ -285,32 +291,37 @@ static int ethtool_set_eeprom(struct net_device *dev, void *useraddr) { struct ethtool_eeprom eeprom; + struct ethtool_ops *ops = dev->ethtool_ops; u8 *data; - int len, ret; + int ret; - if (!dev->ethtool_ops->set_eeprom) + if (!ops->set_eeprom || !ops->get_eeprom_len) return -EOPNOTSUPP; if (copy_from_user(&eeprom, useraddr, sizeof(eeprom))) return -EFAULT; - len = eeprom.len; /* Check for wrap and zero */ - if (eeprom.offset + len <= eeprom.offset) + if (eeprom.offset + eeprom.len <= eeprom.offset) + return -EINVAL; + + /* Check for exceeding total eeprom len */ + if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev)) return -EINVAL; - data = kmalloc(len, GFP_USER); + data = kmalloc(eeprom.len, GFP_USER); if (!data) return -ENOMEM; - if (copy_from_user(data, useraddr + sizeof(eeprom), len)) - return -EFAULT; + ret = -EFAULT; + if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len)) + goto out; - ret = dev->ethtool_ops->set_eeprom(dev, &eeprom, data); + ret = ops->set_eeprom(dev, &eeprom, data); if (ret) goto out; - if (copy_to_user(useraddr + sizeof(eeprom), data, len)) + if (copy_to_user(useraddr + sizeof(eeprom), data, eeprom.len)) ret = -EFAULT; out: --- linux-2.6.0-test7/include/linux/ethtool.h.orig 2003-10-08 12:24:03.000000000 -0700 +++ linux-2.6.0-test7/include/linux/ethtool.h 2003-10-12 04:18:20.000000000 -0700 @@ -307,14 +307,14 @@ * * get_eeprom: * Should fill in the magic field. Don't need to check len for zero - * or wraparound but must check offset + len < size. Fill in the data - * argument with the eeprom values from offset to offset + len. Update - * len to the amount read. Returns an error or zero. + * or wraparound. Fill in the data argument with the eeprom values + * from offset to offset + len. Update len to the amount read. + * Returns an error or zero. * * set_eeprom: * Should validate the magic field. Don't need to check len for zero - * or wraparound but must check offset + len < size. Update len to - * the amount written. Returns an error or zero. + * or wraparound. Update len to the amount written. Returns an error + * or zero. */ struct ethtool_ops { int (*get_settings)(struct net_device *, struct ethtool_cmd *); @@ -328,6 +328,7 @@ void (*set_msglevel)(struct net_device *, u32); int (*nway_reset)(struct net_device *); u32 (*get_link)(struct net_device *); + int (*get_eeprom_len)(struct net_device *); int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); From nebuchadnezzar@nerim.net Sun Oct 12 05:04:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 05:04:57 -0700 (PDT) Received: from zion.asgardr.info (zion.asgardr.org [213.41.153.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9CC4J25021890 for ; Sun, 12 Oct 2003 05:04:20 -0700 Received: from thorr.asgardr.info ([192.168.1.10] helo=localhost) by zion.asgardr.info with esmtp (Exim 4.22) id 1A8eyB-0002yq-1X for netdev@oss.sgi.com; Sun, 12 Oct 2003 14:05:07 +0200 Received: from localhost ([::1] helo=localhost.nerim.net) by localhost with esmtp (Exim 4.22) id 1A8exJ-00065z-0S for netdev@oss.sgi.com; Sun, 12 Oct 2003 14:04:13 +0200 To: Linux Net Subject: [IPV6] problem with xfrm6_tunnel_check_size From: "Daniel 'NebuchadnezzaR' Dehennin" Organisation: CaLviX Date: Sun, 12 Oct 2003 14:04:12 +0200 Message-ID: <87vfquslvn.fsf@nerim.net> User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 753 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nebuchadnezzar@nerim.net Precedence: bulk X-list: netdev Hello, I try to compile a 2.6.0-test7 with usagi 20031012 but I have the following error: net/built-in.o(.text+0x599f3): dans la fonction « xfrm_check_output »: : undefined reference to `xfrm6_tunnel_check_size' make[1]: *** [.tmp_vmlinux1] Erreur 1 make[1]: Leaving directory `/usr/src/linux-2.6.0-test7' make: *** [stamp-build] Erreur 2 I try to figure out the problem by myself but I don't manage to do it. Here is what I do: Search xfrm6_tunnel_check_size in net/: net/ipv6/ipv6_syms.c:EXPORT_SYMBOL(xfrm6_tunnel_check_size); net/ipv6/xfrm6_tunnel.c:int xfrm6_tunnel_check_size(struct sk_buff *skb) net/ipv6/xfrm6_tunnel.c: if ((err = xfrm6_tunnel_check_size(skb)) != 0) net/xfrm/xfrm_output.c: err = xfrm6_tunnel_check_size(skb); Search xfrm6_tunnel_check_size in include/: include/net/xfrm.h:extern int xfrm6_tunnel_check_size(struct sk_buff *skb); Search xfrm4_tunnel_check_size in net/: net/ipv4/xfrm4_tunnel.c:int xfrm4_tunnel_check_size(struct sk_buff *skb) net/ipv4/xfrm4_tunnel.c: if ((err = xfrm4_tunnel_check_size(skb)) != 0) net/xfrm/xfrm_export.c:EXPORT_SYMBOL(xfrm4_tunnel_check_size); net/xfrm/xfrm_output.c: err = xfrm4_tunnel_check_size(skb); Search xfrm4_tunnel_check_size in include/: include/net/xfrm.h:extern int xfrm4_tunnel_check_size(struct sk_buff *skb); I see that building xfrm we use xfrm_export in with xfrm4_tunnel_check_size is exported but xfrm6_tunnel_check_size is in ipv6/ip6_syms.c, is this a way to solve the problem ? Is there a reason to have an ipv6_syms and not an ipv4_syms ? Thanks. -- Daniel 'NebuchadnezzaR' Dehennin From acme@conectiva.com.br Sun Oct 12 06:05:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 06:06:10 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9CD5V25023496 for ; Sun, 12 Oct 2003 06:05:32 -0700 Received: from [200.181.170.102] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A8g5p-0000WL-00; Sun, 12 Oct 2003 11:17:05 -0200 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 7F988F70F; Sun, 12 Oct 2003 13:13:45 +0000 (UTC) Date: Sun, 12 Oct 2003 10:13:44 -0300 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: Linux Networking Development Mailing List Subject: [PATCH] fixing the cases where tcp_tw_bucket was accessed as a sock Message-ID: <20031012131344.GH16182@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://advogato.org/person/acme User-Agent: Mutt/1.5.4i X-archive-position: 754 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 Hi Dave, Please take a look and see if it is OK. The WARN_ON is just to be paranoid for a while, I should have done that a loooong time ago :-\ Best regards, - Arnaldo ===== include/linux/ip.h 1.10 vs edited ===== --- 1.10/include/linux/ip.h Fri May 16 18:02:36 2003 +++ edited/include/linux/ip.h Thu Oct 9 23:36:06 2003 @@ -157,7 +157,13 @@ struct inet_opt inet; }; +#if 0 #define inet_sk(__sk) (&((struct inet_sock *)__sk)->inet) +#else +#include +#define inet_sk(__sk) ({ WARN_ON(__sk->sk_state == TCP_TIME_WAIT); \ + (&((struct inet_sock *)__sk)->inet); }) +#endif #endif ===== include/net/tcp.h 1.51 vs edited ===== --- 1.51/include/net/tcp.h Wed Jul 9 23:18:02 2003 +++ edited/include/net/tcp.h Sat Oct 11 22:38:24 2003 @@ -267,6 +267,12 @@ #define tcptw_sk(__sk) ((struct tcp_tw_bucket *)(__sk)) +static inline const u32 inet_rcv_saddr(const struct sock *sk) +{ + return likely(sk->sk_state != TCP_TIME_WAIT) ? + inet_sk(sk)->rcv_saddr : tcptw_sk(sk)->tw_rcv_saddr; +} + extern kmem_cache_t *tcp_timewait_cachep; static inline void tcp_tw_put(struct tcp_tw_bucket *tw) ===== net/ipv4/tcp_ipv4.c 1.69 vs edited ===== --- 1.69/net/ipv4/tcp_ipv4.c Wed Oct 8 12:27:40 2003 +++ edited/net/ipv4/tcp_ipv4.c Fri Oct 10 13:16:57 2003 @@ -180,7 +180,7 @@ static inline int tcp_bind_conflict(struct sock *sk, struct tcp_bind_bucket *tb) { - struct inet_opt *inet = inet_sk(sk); + const u32 sk_rcv_saddr = inet_rcv_saddr(sk); struct sock *sk2; struct hlist_node *node; int reuse = sk->sk_reuse; @@ -193,9 +193,9 @@ sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) { if (!reuse || !sk2->sk_reuse || sk2->sk_state == TCP_LISTEN) { - struct inet_opt *inet2 = inet_sk(sk2); - if (!inet2->rcv_saddr || !inet->rcv_saddr || - inet2->rcv_saddr == inet->rcv_saddr) + const u32 sk2_rcv_saddr = inet_rcv_saddr(sk2); + if (!sk2_rcv_saddr || !sk_rcv_saddr || + sk2_rcv_saddr == sk_rcv_saddr) break; } } ===== net/ipv6/addrconf.c 1.68 vs edited ===== --- 1.68/net/ipv6/addrconf.c Fri Sep 12 21:25:13 2003 +++ edited/net/ipv6/addrconf.c Sat Oct 11 23:50:31 2003 @@ -963,38 +963,41 @@ return ifp; } +static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk) +{ + return likely(sk->sk_state != TCP_TIME_WAIT) ? + &inet6_sk(sk)->rcv_saddr : &tcptw_sk(sk)->tw_v6_rcv_saddr; +} + int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) { struct ipv6_pinfo *np = inet6_sk(sk); int addr_type = ipv6_addr_type(&np->rcv_saddr); - if (!inet_sk(sk2)->rcv_saddr && !ipv6_only_sock(sk)) + if (!inet_rcv_saddr(sk2) && !ipv6_only_sock(sk)) return 1; if (sk2->sk_family == AF_INET6 && - ipv6_addr_any(&inet6_sk(sk2)->rcv_saddr) && + ipv6_addr_any(inet6_rcv_saddr(sk2)) && !(ipv6_only_sock(sk2) && addr_type == IPV6_ADDR_MAPPED)) return 1; if (addr_type == IPV6_ADDR_ANY && (!ipv6_only_sock(sk) || !(sk2->sk_family == AF_INET6 ? - (ipv6_addr_type(&inet6_sk(sk2)->rcv_saddr) == IPV6_ADDR_MAPPED) : - 1))) + (ipv6_addr_type(inet6_rcv_saddr(sk2)) == IPV6_ADDR_MAPPED) : 1))) return 1; if (sk2->sk_family == AF_INET6 && !ipv6_addr_cmp(&np->rcv_saddr, - (sk2->sk_state != TCP_TIME_WAIT ? - &inet6_sk(sk2)->rcv_saddr : - &tcptw_sk(sk)->tw_v6_rcv_saddr))) + inet6_rcv_saddr(sk2))); return 1; if (addr_type == IPV6_ADDR_MAPPED && !ipv6_only_sock(sk2) && - (!inet_sk(sk2)->rcv_saddr || + (!inet_rcv_saddr(sk2) || !inet_sk(sk)->rcv_saddr || - inet_sk(sk)->rcv_saddr == inet_sk(sk2)->rcv_saddr)) + inet_sk(sk)->rcv_saddr == inet_rcv_saddr(sk2))) return 1; return 0; From amir.noam@intel.com Sun Oct 12 07:42:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 07:43:13 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9CEgb25026430 for ; Sun, 12 Oct 2003 07:42:38 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h9CEcek6016040 for ; Sun, 12 Oct 2003 14:38:40 GMT Received: from fmsmsxv041-1.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h9CEawM26564 for ; Sun, 12 Oct 2003 14:36:59 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxv041-1.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003101207422711470 ; Sun, 12 Oct 2003 07:42:28 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam To: jgarzik@pobox.com, davem@redhat.com Subject: [PATCH 2/10] [bonding 2.6] fix monitoring functions Date: Sun, 12 Oct 2003 16:42:26 +0200 User-Agent: KMail/1.4.3 Cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310121642.26285.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 755 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev Hi, This is a resend of the second patch of the propagations patch set sent on 2003/11/09. The rest of the set is already in 2.6 and this patch was left out only because it failed to reach Jeff the first time. (This patch is also in 2.4 since 2.4.23-pre3). Patch cleanly applies on 2.6.0-test7. Amir diff -Naurp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Sun Oct 12 15:19:27 2003 +++ b/drivers/net/bonding/bond_main.c Sun Oct 12 15:24:07 2003 @@ -2238,8 +2238,9 @@ out: static void bond_mii_monitor(struct net_device *master) { bonding_t *bond = (struct bonding *) master->priv; - slave_t *slave, *bestslave, *oldcurrent; + slave_t *slave, *oldcurrent; int slave_died = 0; + int do_failover = 0; read_lock(&bond->lock); @@ -2249,7 +2250,6 @@ static void bond_mii_monitor(struct net_ * program could monitor the link itself if needed. */ - bestslave = NULL; slave = (slave_t *)bond; read_lock(&bond->ptrlock); @@ -2257,8 +2257,6 @@ static void bond_mii_monitor(struct net_ read_unlock(&bond->ptrlock); while ((slave = slave->prev) != (slave_t *)bond) { - /* use updelay+1 to match an UP slave even when updelay is 0 */ - int mindelay = updelay + 1; struct net_device *dev = slave->dev; int link_state; u16 old_speed = slave->speed; @@ -2269,14 +2267,7 @@ static void bond_mii_monitor(struct net_ switch (slave->link) { case BOND_LINK_UP: /* the link was up */ if (link_state == BMSR_LSTATUS) { - /* link stays up, tell that this one - is immediately available */ - if (IS_UP(dev) && (mindelay > -2)) { - /* -2 is the best case : - this slave was already up */ - mindelay = -2; - bestslave = slave; - } + /* link stays up, nothing more to do */ break; } else { /* link going down */ @@ -2316,6 +2307,7 @@ static void bond_mii_monitor(struct net_ (bond_mode == BOND_MODE_8023AD)) { bond_set_slave_inactive_flags(slave); } + printk(KERN_INFO "%s: link status definitely down " "for interface %s, disabling it", @@ -2332,12 +2324,10 @@ static void bond_mii_monitor(struct net_ bond_alb_handle_link_change(bond, slave, BOND_LINK_DOWN); } - write_lock(&bond->ptrlock); - if (slave == bond->current_slave) { - /* find a new interface and be verbose */ - reselect_active_interface(bond); + if (slave == oldcurrent) { + do_failover = 1; } - write_unlock(&bond->ptrlock); + slave_died = 1; } else { slave->delay--; @@ -2352,13 +2342,6 @@ static void bond_mii_monitor(struct net_ master->name, (downdelay - slave->delay) * miimon, dev->name); - - if (IS_UP(dev) && (mindelay > -1)) { - /* -1 is a good case : this slave went - down only for a short time */ - mindelay = -1; - bestslave = slave; - } } break; case BOND_LINK_DOWN: /* the link was down */ @@ -2428,26 +2411,12 @@ static void bond_mii_monitor(struct net_ bond_alb_handle_link_change(bond, slave, BOND_LINK_UP); } - write_lock(&bond->ptrlock); - if ( (bond->primary_slave != NULL) - && (slave == bond->primary_slave) ) - reselect_active_interface(bond); - write_unlock(&bond->ptrlock); - } - else + if ((oldcurrent == NULL) || + (slave == bond->primary_slave)) { + do_failover = 1; + } + } else { slave->delay--; - - /* we'll also look for the mostly eligible slave */ - if (bond->primary_slave == NULL) { - if (IS_UP(dev) && (slave->delay < mindelay)) { - mindelay = slave->delay; - bestslave = slave; - } - } else if ( (IS_UP(bond->primary_slave->dev)) || - ( (!IS_UP(bond->primary_slave->dev)) && - (IS_UP(dev) && (slave->delay < mindelay)) ) ) { - mindelay = slave->delay; - bestslave = slave; } } break; @@ -2466,26 +2435,17 @@ static void bond_mii_monitor(struct net_ } /* end of while */ - /* - * if there's no active interface and we discovered that one - * of the slaves could be activated earlier, so we do it. - */ - read_lock(&bond->ptrlock); - oldcurrent = bond->current_slave; - read_unlock(&bond->ptrlock); + if (do_failover) { + write_lock(&bond->ptrlock); - /* no active interface at the moment or need to bring up the primary */ - if (oldcurrent == NULL) { /* no active interface at the moment */ - if (bestslave != NULL) { /* last chance to find one ? */ - write_lock(&bond->ptrlock); - change_active_interface(bond, bestslave); - write_unlock(&bond->ptrlock); - } else if (slave_died) { - /* print this message only once a slave has just died */ + reselect_active_interface(bond); + if (oldcurrent && !bond->current_slave) { printk(KERN_INFO "%s: now running without any active interface !\n", master->name); } + + write_unlock(&bond->ptrlock); } read_unlock(&bond->lock); @@ -2503,9 +2463,10 @@ static void bond_mii_monitor(struct net_ static void loadbalance_arp_monitor(struct net_device *master) { bonding_t *bond; - slave_t *slave; + slave_t *slave, *oldcurrent; int the_delta_in_ticks = arp_interval * HZ / 1000; int next_timer = jiffies + (arp_interval * HZ / 1000); + int do_failover = 0; bond = (struct bonding *) master->priv; if (master->priv == NULL) { @@ -2529,6 +2490,10 @@ static void loadbalance_arp_monitor(stru read_lock(&bond->lock); + read_lock(&bond->ptrlock); + oldcurrent = bond->current_slave; + read_unlock(&bond->ptrlock); + /* see if any of the previous devices are up now (i.e. they have * xmt and rcv traffic). the current_slave does not come into * the picture unless it is null. also, slave->jiffies is not needed @@ -2555,21 +2520,19 @@ static void loadbalance_arp_monitor(stru * current_slave being null after enslaving * is closed. */ - write_lock(&bond->ptrlock); - if (bond->current_slave == NULL) { + if (oldcurrent == NULL) { printk(KERN_INFO "%s: link status definitely up " "for interface %s, ", master->name, slave->dev->name); - reselect_active_interface(bond); + do_failover = 1; } else { printk(KERN_INFO "%s: interface %s is now up\n", master->name, slave->dev->name); } - write_unlock(&bond->ptrlock); } } else { /* slave->link == BOND_LINK_UP */ @@ -2592,11 +2555,9 @@ static void loadbalance_arp_monitor(stru master->name, slave->dev->name); - write_lock(&bond->ptrlock); - if (slave == bond->current_slave) { - reselect_active_interface(bond); + if (slave == oldcurrent) { + do_failover = 1; } - write_unlock(&bond->ptrlock); } } @@ -2610,6 +2571,19 @@ static void loadbalance_arp_monitor(stru if (IS_UP(slave->dev)) { arp_send_all(slave); } + } + + if (do_failover) { + write_lock(&bond->ptrlock); + + reselect_active_interface(bond); + if (oldcurrent && !bond->current_slave) { + printk(KERN_INFO + "%s: now running without any active interface !\n", + master->name); + } + + write_unlock(&bond->ptrlock); } read_unlock(&bond->lock); From shmulik.hen@intel.com Sun Oct 12 07:50:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 07:51:32 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9CEov25026921 for ; Sun, 12 Oct 2003 07:50:57 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h9CEl1k6010490 for ; Sun, 12 Oct 2003 14:47:01 GMT Received: from fmsmsxv041-1.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h9CEjJM28095 for ; Sun, 12 Oct 2003 14:45:19 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxv041-1.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003101207504709128 ; Sun, 12 Oct 2003 07:50:48 -0700 Content-Type: text/plain; charset="us-ascii" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "Jeff Garzik" , "Jay Vosburgh" Subject: [PATCH][bonding] Restore compatibilty with old ifenslave (resend) Date: Sun, 12 Oct 2003 16:50:46 +0200 User-Agent: KMail/1.4.3 Cc: , MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310121650.46755.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 756 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Hi, The patch below restores compatibility that was removed during the propagation set. That set added the ability to set the bond's hardware address in the conventional way using SIOCSIFHWADDR but also removed support for the very old way using BOND_SETHWADDR, which, although has been removed from the ifenslave code for years, turns out to still be in use in the ifenslave binary of recent distributions (we got the complaint from an RH9 user). The patch applies on 2.4.23-pre7. Jeff, please apply this patch soon so that 2.4.23 won't be released with a bug that breaks compatibility. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c 2003-10-12 16:24:42.000000000 +0200 +++ b/drivers/net/bonding/bond_main.c 2003-10-12 16:27:12.000000000 +0200 @@ -3048,6 +3048,10 @@ static int bond_ioctl(struct net_device case SIOCBONDRELEASE: ret = bond_release(master_dev, slave_dev); break; + case BOND_SETHWADDR_OLD: + case SIOCBONDSETHWADDR: + ret = bond_sethwaddr(master_dev, slave_dev); + break; case BOND_CHANGE_ACTIVE_OLD: case SIOCBONDCHANGEACTIVE: if (USES_PRIMARY(bond_mode)) { From shmulik.hen@intel.com Sun Oct 12 08:48:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 08:49:29 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9CFms25031235 for ; Sun, 12 Oct 2003 08:48:54 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h9CFivk6012261 for ; Sun, 12 Oct 2003 15:44:57 GMT Received: from fmsmsxv041-1.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h9CFhFM08614 for ; Sun, 12 Oct 2003 15:43:15 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxv041-1.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003101208484521343 ; Sun, 12 Oct 2003 08:48:46 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH SET][bonding 2.4] cleanup - take 3 Date: Sun, 12 Oct 2003 17:48:44 +0200 User-Agent: KMail/1.4.3 References: <200309251549.59177.shmulik.hen@intel.com> In-Reply-To: <200309251549.59177.shmulik.hen@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310121748.44673.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 757 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Hi, Here is another go with the bonding cleanup. This set is similar to the previous set I sent on 9/25, but it does not touch compatibility stuff and there are several bug fixes. This set is very comprehensive and touches almost all the code. The set is broken down to many patches for better tracking. It was already tested by me for functionality and is in the process of a more thorough set of testing by our QA group for any corner case bugs. This set applies on 2.4.23-pre7, after the compatibility bug fix patch I sent earlier today is accepted. It can be downloaded from: http://osdn.dl.sourceforge.net/sourceforge/bonding/bonding_cleanup_2-2.4.23-pre7.tar.bz2 This will update the following files: Documentation/networking/bonding.txt Documentation/networking/ifenslave.c drivers/net/bonding/bond_3ad.c drivers/net/bonding/bond_alb.c drivers/net/bonding/bond_alb.h drivers/net/bonding/bonding.h drivers/net/bonding/bond_main.c include/linux/if_bonding.h Description: patch 1 - ifenslave lite - No more IP settings to slaves, unified printing format, code re-org and broken to more functions. patch 2 - convert all debug prints to use the dprintk macro and consolidate format of all prints (e.g. "bonding: Error: ..."). patch 3 - death of typedef. eliminate bonding_t/slave_t types and consolidate casting. patch 4 - remove dead code and redundant checks. patch 5 - consolidate timers initialization, error checking and re-queuing. patch 6 - convert too long if-else to a switch-case. Fix all locations that handles bond->primary. patch 7 - eliminate the multicast_mode module param. settings are now done only according to mode. patch 8 - slave list iteration - bond is no longer part of the list, added cyclic list iteration macros. patch 9 - consolidate function declarations: o all functions begin with bond_ o return value, function name and all params are on the same line. o change some function names to be more descriptive. patch 10 - consolidate names of function params and variables (e.g. bond_dev instead of dev/master/master_dev). patch 11 - change names/types for some of the members in struct bonding. change position of members. patch 12 - consolidate return values of functions. patch 13 - put curly braces around all if, else, for, while, switch statements. change conditions to short format. e.g. (ptr == NULL) ==> (!ptr) patch 14 - consolidate error handling in all xmit functions. patch 15 - chomp all trailing white space. patch 16 - remove duplicate empty lines. add empty lines where needed to improve readability. patch 17 - fix indentations. patch 18 - code re-organization in bond_main.c according to context (e.g. module initialization, bond initialization, device entry points, monitoring, etc). -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From hadi@cyberus.ca Sun Oct 12 13:53:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 13:53:57 -0700 (PDT) Received: from mail.cyberus.ca (usraddb.cybersurf.com [209.197.145.21]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9CKrK25008031 for ; Sun, 12 Oct 2003 13:53:21 -0700 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 1A8nDL-00022u-Ka; Sun, 12 Oct 2003 16:53:19 -0400 Subject: Re: [RFC] nfmark modify extension to classifiers From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , Alexey , netdev@oss.sgi.com In-Reply-To: <1065988858.5373.11.camel@jzny.localdomain> References: <20031006002619.GC11250@rei.reeler.org> <1065479986.1102.3.camel@jzny.localdomain> <20031007012858.GF11250@rei.reeler.org> <1065988858.5373.11.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1065991952.1022.27.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 Oct 2003 16:52:32 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 758 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 sorry, setting nfmark already works by virtue that the target for doing it exists; i.e "action ipt -j mark --set-mark xxx" cheers, jamal On Sun, 2003-10-12 at 16:00, jamal wrote: > On Mon, 2003-10-06 at 21:28, Thomas Graf wrote: > > Hello > > > > > This is a bad idea. > > > Please consider using the tc action extensions. > > > > You mean TC_POLICE_NFMARK? This was actually my initial idea > > but I wanted to avoid a dependency mess. > > > > I meant this: > http://www.cyberus.ca/~hadi/patches/action/README > > so you can do: > tc filter add dev lo parent ffff: protocol ip prio 10 u32 match ip src \ > 127.0.0.1/32 flowid 1:1 .... > action metaset classid 1:14 nfmark 0x10 ... > > > cheers, > jamal From rddunlap@osdl.org Sun Oct 12 19:18:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 19:19:24 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9D2Il25019540 for ; Sun, 12 Oct 2003 19:18:48 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9D2Ieo14879; Sun, 12 Oct 2003 19:18:40 -0700 Date: Sun, 12 Oct 2003 19:17:25 -0700 From: "Randy.Dunlap" To: "Noah J. Misch" Cc: netdev@oss.sgi.com, davem@redhat.com, maxk@qualcomm.com Subject: Re: patches for PROC_FS=n (2.6.0-test7) Message-Id: <20031012191725.093139d5.rddunlap@osdl.org> In-Reply-To: References: Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (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: 759 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev On Fri, 10 Oct 2003 16:06:29 -0700 (PDT) "Noah J. Misch" wrote: | > There are several other drivers/protocols that don't build | > with PROC_FS=n, like arlan, siimage, ipx, llc, and bluetooth. | | I put in a patch for ipx yesterday, and I have patches for siimage and llc | pretty much ready to go. I noticed the others but I have not done much. ipx is merged. I'll leave siimage and llc to Noah. Patch below fixes af_bluetooth. Comments on it? -- ~Randy patch_name: bt_noprocfs.patch patch_version: 2003-10-12.19:11:03 author: Randy.Dunlap description: af_bluetooth uses/needs proc_bt when PROC_FS=n product: Linux product_versions: 2.6.0-test7 diffstat: = net/bluetooth/af_bluetooth.c | 2 -- 1 files changed, 2 deletions(-) diff -Naur ./net/bluetooth/af_bluetooth.c~btprocfs ./net/bluetooth/af_bluetooth.c --- ./net/bluetooth/af_bluetooth.c~btprocfs 2003-10-08 12:24:02.000000000 -0700 +++ ./net/bluetooth/af_bluetooth.c 2003-10-12 19:09:11.000000000 -0700 @@ -56,9 +56,7 @@ #define BT_DBG( A... ) #endif -#ifdef CONFIG_PROC_FS struct proc_dir_entry *proc_bt; -#endif /* Bluetooth sockets */ #define BT_MAX_PROTO 5 From rddunlap@osdl.org Sun Oct 12 20:14:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 12 Oct 2003 20:15:14 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9D3Ec25021000 for ; Sun, 12 Oct 2003 20:14:39 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9D3EUo21981; Sun, 12 Oct 2003 20:14:30 -0700 Date: Sun, 12 Oct 2003 20:13:16 -0700 From: "Randy.Dunlap" To: "Noah J. Misch" Cc: netdev@oss.sgi.com, davem@redhat.com, elmer@ylenurme.ee, Elmer.Joandi@ut.ee Subject: Re: patches for PROC_FS=n (2.6.0-test7) Message-Id: <20031012201316.7ecf73c8.rddunlap@osdl.org> In-Reply-To: References: Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (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: 760 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev On Fri, 10 Oct 2003 16:06:29 -0700 (PDT) "Noah J. Misch" wrote: | > There are several other drivers/protocols that don't build | > with PROC_FS=n, like arlan, siimage, ipx, llc, and bluetooth. Here's a patch for the wireless/arlan driver for PROC_FS=n. Currently it defines both a function and a macro for init_arlan_proc() if PROC_FS=n. This causes a bunch of compile-time errors. It looks to me like it should always call the init_arlan_proc() (and cleanup_arlan_proc()) functions since it inits some sysctl tables. Or am I misunderstanding it? Thanks, -- ~Randy patch_name: arlan_noprocfs.patch patch_version: 2003-10-12.19:46:24 author: Randy.Dunlap description: use init_arlan_proc() for sysctl inits product: Linux product_versions: 2.6.0-test7 diffstat: = drivers/net/wireless/arlan.h | 5 ----- 1 files changed, 5 deletions(-) diff -Naur ./drivers/net/wireless/arlan.h~arlanprocfs ./drivers/net/wireless/arlan.h --- ./drivers/net/wireless/arlan.h~arlanprocfs 2003-10-08 12:24:08.000000000 -0700 +++ ./drivers/net/wireless/arlan.h 2003-10-12 19:45:46.000000000 -0700 @@ -39,13 +39,8 @@ #define ARLAN_RCV_PROMISC 1 #define ARLAN_RCV_CONTROL 2 -#ifdef CONFIG_PROC_FS extern int init_arlan_proc(void); extern void cleanup_arlan_proc(void); -#else -#define init_arlan_proc() (0) -#define cleanup_arlan_proc() do { } while (0); -#endif extern struct net_device *arlan_device[MAX_ARLANS]; extern int arlan_debug; From hadi@cyberus.ca Mon Oct 13 03:11:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 03:11:36 -0700 (PDT) Received: from mail.cyberus.ca (usraddb.cybersurf.com [209.197.145.21]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DAAx25003686 for ; Mon, 13 Oct 2003 03:11:00 -0700 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 1A8mPQ-0008En-9X; Sun, 12 Oct 2003 16:01:44 -0400 Subject: Re: [RFC] nfmark modify extension to classifiers From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , Alexey , netdev@oss.sgi.com In-Reply-To: <20031007012858.GF11250@rei.reeler.org> References: <20031006002619.GC11250@rei.reeler.org> <1065479986.1102.3.camel@jzny.localdomain> <20031007012858.GF11250@rei.reeler.org> Content-Type: text/plain Organization: jamalopolis Message-Id: <1065988858.5373.11.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 Oct 2003 16:00:58 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 761 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 On Mon, 2003-10-06 at 21:28, Thomas Graf wrote: > Hello > > > This is a bad idea. > > Please consider using the tc action extensions. > > You mean TC_POLICE_NFMARK? This was actually my initial idea > but I wanted to avoid a dependency mess. > I meant this: http://www.cyberus.ca/~hadi/patches/action/README so you can do: tc filter add dev lo parent ffff: protocol ip prio 10 u32 match ip src \ 127.0.0.1/32 flowid 1:1 .... action metaset classid 1:14 nfmark 0x10 ... cheers, jamal From rddunlap@osdl.org Mon Oct 13 07:59:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 07:59:44 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DEx825023860 for ; Mon, 13 Oct 2003 07:59:09 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9DEwno27731; Mon, 13 Oct 2003 07:58:50 -0700 Date: Mon, 13 Oct 2003 07:49:29 -0700 From: "Randy.Dunlap" To: Elmer Cc: noah@caltech.edu, netdev@oss.sgi.com, davem@redhat.com Subject: Re: patches for PROC_FS=n (2.6.0-test7) Message-Id: <20031013074929.0edb73be.rddunlap@osdl.org> In-Reply-To: References: <20031012201316.7ecf73c8.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 762 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev On Mon, 13 Oct 2003 13:31:30 +0200 (EET) Elmer wrote: | | | arlan.c is ok without arlan-proc.c | as init_arlan_proc is in arlan-proc.c, it shoult be | OK, as long as radio parameters are saved into cards ROM. | | I have forgot a lot about that code, of course. Hi Elmer, Sure, I understand the last comment. I don't quite understand the first paragraph though. Could we try again? Currently arlan.c + arlan-proc.c does not build if CONFIG_PROC_FS=n. The Makefile always builds arlan-main.o and arlan-proc.o. Are you saying that this is incorrect? Should arlan-proc.o only be built/used when CONFIG_PROC_FS=y? Thanks. -- ~Randy From wensong@linux-vs.org Mon Oct 13 08:16:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 08:17:14 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DFGc25024594 for ; Mon, 13 Oct 2003 08:16:40 -0700 Received: from penguin.linux-vs.org ([211.136.72.123]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h9DFGBMP030210 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 13 Oct 2003 23:16:24 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h9DFFQ0G001260; Mon, 13 Oct 2003 23:15:26 +0800 Date: Mon, 13 Oct 2003 23:15:26 +0800 (CST) From: Wensong Zhang To: netdev@oss.sgi.com cc: "David S. Miller" , Julian Anastasov Subject: [2.6 PATCH] Fix IPVS sync state check Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463760943-416249943-1066058126=:1216" X-archive-position: 763 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463760943-416249943-1066058126=:1216 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, Here is a one-line fix in the sync state check for the connection to be synchronized. Since both the primay and the backup IPVS sync daemon can be started in a box at a time now, we must check if the MASTER bit is set in the sync state exactly. Please check and apply it. Thanks, Wensong ---1463760943-416249943-1066058126=:1216 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ipvs-sync-state.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="ipvs-sync-state.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIy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Yw0KLS0tIGEvbmV0 L2lwdjQvaXB2cy9pcF92c19jb3JlLmMJTW9uIE9jdCAxMyAyMzowNDo1MiAy MDAzDQorKysgYi9uZXQvaXB2NC9pcHZzL2lwX3ZzX2NvcmUuYwlNb24gT2N0 IDEzIDIzOjA0OjUyIDIwMDMNCkBAIC0xMDQ0LDcgKzEwNDQsNyBAQA0KIAkv KiBpbmNyZWFzZSBpdHMgcGFja2V0IGNvdW50ZXIgYW5kIGNoZWNrIGlmIGl0 IGlzIG5lZWRlZA0KIAkgICB0byBiZSBzeW5jaHJvbml6ZWQgKi8NCiAJYXRv bWljX2luYygmY3AtPmluX3BrdHMpOw0KLQlpZiAoaXBfdnNfc3luY19zdGF0 ZSA9PSBJUF9WU19TVEFURV9NQVNURVIgJiYNCisJaWYgKChpcF92c19zeW5j X3N0YXRlICYgSVBfVlNfU1RBVEVfTUFTVEVSKSAmJg0KIAkgICAgKGNwLT5w cm90b2NvbCAhPSBJUFBST1RPX1RDUCB8fA0KIAkgICAgIGNwLT5zdGF0ZSA9 PSBJUF9WU19UQ1BfU19FU1RBQkxJU0hFRCkgJiYNCiAJICAgIChhdG9taWNf cmVhZCgmY3AtPmluX3BrdHMpICUgc3lzY3RsX2lwX3ZzX3N5bmNfdGhyZXNo b2xkWzFdDQo= ---1463760943-416249943-1066058126=:1216-- From elmer@linking.ee Mon Oct 13 08:28:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 08:28:57 -0700 (PDT) Received: from linking.ee (11.ylenurme.ee [193.40.6.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DFS225027959 for ; Mon, 13 Oct 2003 08:28:23 -0700 Received: (qmail 22386 invoked by uid 64014); 13 Oct 2003 11:31:30 -0000 Received: from elmer@linking.ee by server by uid 64011 with qmail-scanner-1.16 ( Clear:. Processed in 0.011884 secs); 13 Oct 2003 11:31:30 -0000 Received: from mail.linking.sise ([10.110.0.21]) (envelope-sender ) by mail.linking.sise (qmail-ldap-1.03) with SMTP for ; 13 Oct 2003 11:31:30 -0000 Date: Mon, 13 Oct 2003 13:31:30 +0200 (EET) From: Elmer X-X-Sender: elmer@server To: "Randy.Dunlap" cc: "Noah J. Misch" , "netdev@oss.sgi.com" , "davem@redhat.com" Subject: Re: patches for PROC_FS=n (2.6.0-test7) In-Reply-To: <20031012201316.7ecf73c8.rddunlap@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 764 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: elmer@linking.ee Precedence: bulk X-list: netdev arlan.c is ok without arlan-proc.c as init_arlan_proc is in arlan-proc.c, it shoult be OK, as long as radio parameters are saved into cards ROM. I have forgot a lot about that code, of course. Elmer From wensong@linux-vs.org Mon Oct 13 09:00:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 09:01:24 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DG0k25029404 for ; Mon, 13 Oct 2003 09:00:47 -0700 Received: from penguin.linux-vs.org ([211.136.72.123]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h9DG0HMP000637 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 14 Oct 2003 00:00:32 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h9DFxY0G001780; Mon, 13 Oct 2003 23:59:34 +0800 Date: Mon, 13 Oct 2003 23:59:34 +0800 (CST) From: Wensong Zhang To: netdev@oss.sgi.com cc: "David S. Miller" , Julian Anastasov Subject: [PATCH] Fix IPVS to set the statistics of dest zero Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463760943-375973130-1066060774=:1216" X-archive-position: 765 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463760943-375973130-1066060774=:1216 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, Here is the slight patch for IPVS to fix to zero the statistics of dest when it is bound to a new service. It can make the statistics information more correct after removing/adding new servers. Please check the attached two patches and apply them to the kernel 2.4 and 2.6 respectively. Thanks, Wensong ---1463760943-375973130-1066060774=:1216 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="linux-2.4-ipvs-zero-dest.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="linux-2.4-ipvs-zero-dest.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTE4MyAgLT4gMS4xMTg0IA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX2N0bC5jCTEuMSAgICAgLT4gMS4yICAgIA0K Iw0KIyBUaGUgZm9sbG93aW5nIGlzIHRoZSBCaXRLZWVwZXIgQ2hhbmdlU2V0 IExvZw0KIyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLQ0KIyAwMy8xMC8xMwl3ZW5zb25nQGxpbnV4LXZzLm9yZwk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3ZjKGRlc3QsIHN2Yyk7DQogCQl9 DQogCX0NCkBAIC0xMjgyLDE1ICsxMjkyLDYgQEANCiAvKg0KICAqICBaZXJv IGNvdW50ZXJzIGluIGEgc2VydmljZSBvciBhbGwgc2VydmljZXMNCiAgKi8N Ci1zdGF0aWMgaW5saW5lIHZvaWQNCi1fX2lwX3ZzX3plcm9fc3RhdHMoc3Ry dWN0IGlwX3ZzX3N0YXRzICpzdGF0cykNCi17DQotCXNwaW5fbG9ja19iaCgm c3RhdHMtPmxvY2spOw0KLQltZW1zZXQoc3RhdHMsIDAsIChjaGFyICopJnN0 YXRzLT5sb2NrIC0gKGNoYXIgKilzdGF0cyk7DQotCXNwaW5fdW5sb2NrX2Jo KCZzdGF0cy0+bG9jayk7DQotCWlwX3ZzX3plcm9fZXN0aW1hdG9yKHN0YXRz KTsNCi19DQotDQogc3RhdGljIGludCBpcF92c196ZXJvX3NlcnZpY2Uoc3Ry dWN0IGlwX3ZzX3NlcnZpY2UgKnN2YykNCiB7DQogCXN0cnVjdCBsaXN0X2hl YWQgKmw7DQo= ---1463760943-375973130-1066060774=:1216 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="linux-2.6-ipvs-zero-dest.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="linux-2.6-ipvs-zero-dest.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTM0NyAgL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aCgmaXBfdnNfc3RhdHMubG9jayk7 DQo= ---1463760943-375973130-1066060774=:1216-- From davem@pizda.ninka.net Mon Oct 13 10:25:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 10:26:34 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DHPu25007024 for ; Mon, 13 Oct 2003 10:25:58 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id KAA25011; Mon, 13 Oct 2003 10:19:35 -0700 Date: Mon, 13 Oct 2003 10:19:35 -0700 From: "David S. Miller" To: Tommy Christensen Cc: greearb@candelatech.com, netdev@oss.sgi.com Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code Message-Id: <20031013101935.231fb1fd.davem@redhat.com> In-Reply-To: <3F892629.7090206@tpack.net> References: <3F87430D.2040000@tpack.net> <3F87464B.1020908@candelatech.com> <3F874A30.6010700@tpack.net> <3F885418.3090407@candelatech.com> <20031011120339.0da631e6.davem@redhat.com> <3F892629.7090206@tpack.net> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 766 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 On Sun, 12 Oct 2003 12:00:09 +0200 Tommy Christensen wrote: > Bear with me, but this is how I understand it: > > - The sk_buff *structure* is read-only on a shared SKB. > skb_share_check(skb) breaks the sharing, thus allowing > updates of skb->dev, skb->len etc. > But the SKB still points at the same data buffer. > > - The *data* buffer is read-only on a cloned SKB. > skb_cow() or skb_copy() or ... gives us a writeable buffer. skb_copy() makes both the struct sk_buff and the data it points to unique and yours alone to modify however you wish. From shemminger@osdl.org Mon Oct 13 11:10:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 11:11:12 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DIAS25002725 for ; Mon, 13 Oct 2003 11:10:39 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9DIADo09991; Mon, 13 Oct 2003 11:10:13 -0700 Date: Mon, 13 Oct 2003 11:09:57 -0700 From: Stephen Hemminger To: "David S. Miller" , Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (2/2) syncpp - sealevel fix regression Message-Id: <20031013110957.277c675c.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 768 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 My earlier change broke the if_ptr assumption used by SPPP drivers. This makes sealevel driver do if_ptr like it used to. This is a resend of an earlier patch which seems not to have been included. diff -Nru a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c --- a/drivers/net/wan/sealevel.c Fri Oct 3 11:28:36 2003 +++ b/drivers/net/wan/sealevel.c Fri Oct 3 11:28:36 2003 @@ -31,6 +31,7 @@ struct slvl_device { + void *if_ptr; /* General purpose pointer (used by SPPP) */ struct z8530_channel *chan; struct ppp_device pppdev; int channel; @@ -238,6 +239,7 @@ return NULL; sv = d->priv; + sv->if_ptr = &sv->pppdev; sv->pppdev.dev = d; d->base_addr = iobase; d->irq = irq; From shemminger@osdl.org Mon Oct 13 11:10:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 11:11:12 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DIAQ25002724 for ; Mon, 13 Oct 2003 11:10:39 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9DIAAo09985; Mon, 13 Oct 2003 11:10:10 -0700 Date: Mon, 13 Oct 2003 11:09:55 -0700 From: Stephen Hemminger To: "David S. Miller" , Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (1/2) syncppp wan device regression Message-Id: <20031013110955.688c1c5c.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 767 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 In 2.6.0-test6, I put in a patch which fixed sealevel driver, but broke all the other wan devices because it got rid of one level of indirection. This puts back the indirection, and hopefully prevents others from misreading it the same way. The SPPP drivers expect that netdev->priv points to device local structure whose first element is a pointer to the ppp device. This is a resend of an earlier patch which seems not to have been included. diff -Nru a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c --- a/drivers/net/wan/syncppp.c Fri Oct 3 11:28:23 2003 +++ b/drivers/net/wan/syncppp.c Fri Oct 3 11:28:23 2003 @@ -1069,6 +1069,9 @@ struct sppp *sp = &pd->sppp; unsigned long flags; + /* Make sure embedding is safe for sppp_of */ + BUG_ON(sppp_of(dev) != sp); + spin_lock_irqsave(&spppq_lock, flags); /* Initialize keepalive handler. */ if (! spppq) diff -Nru a/include/net/syncppp.h b/include/net/syncppp.h --- a/include/net/syncppp.h Fri Oct 3 11:28:23 2003 +++ b/include/net/syncppp.h Fri Oct 3 11:28:23 2003 @@ -59,8 +59,9 @@ static inline struct sppp *sppp_of(struct net_device *dev) { - struct ppp_device *ppp = dev->priv; - return &ppp->sppp; + struct ppp_device **ppp = dev->priv; + BUG_ON((*ppp)->dev != dev); + return &(*ppp)->sppp; } #define PP_KEEPALIVE 0x01 /* use keepalive protocol */ From davem@pizda.ninka.net Mon Oct 13 11:18:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 11:19:10 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DIIY25003496 for ; Mon, 13 Oct 2003 11:18:34 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA25270; Mon, 13 Oct 2003 11:12:12 -0700 Date: Mon, 13 Oct 2003 11:12:12 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] (1/2) syncppp wan device regression Message-Id: <20031013111212.174a2c92.davem@redhat.com> In-Reply-To: <20031013110955.688c1c5c.shemminger@osdl.org> References: <20031013110955.688c1c5c.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 769 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 On Mon, 13 Oct 2003 11:09:55 -0700 Stephen Hemminger wrote: > This is a resend of an earlier patch which seems not to have been included. Jeff seems to be really busy, so I'll take care of applying these patches. Thanks. From shemminger@osdl.org Mon Oct 13 11:49:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 11:49:57 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DInL25009271 for ; Mon, 13 Oct 2003 11:49:22 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9DInAo17236; Mon, 13 Oct 2003 11:49:10 -0700 Date: Mon, 13 Oct 2003 11:48:52 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] resolve probe difference Message-Id: <20031013114852.74b547d0.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 770 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 In the change to get rid of the list of ISA devices to programmatic probing of old devices, a behaviour change was introduced which might cause problems. Before, it was possible to specify a parameter on the boot line for a second device and skip the first, as in: netdev=4,0x280,0,0,eth1 Well, now we stop after eth0 if we don't find it.. Somebody, might depend on the old behaviour, so this patch restores it.. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Fri Oct 10 10:03:42 2003 +++ b/drivers/net/Space.c Fri Oct 10 10:03:42 2003 @@ -433,17 +433,15 @@ #ifdef CONFIG_SBNI for (num = 0; num < 8; ++num) - if (sbni_probe(num)) - break; + sbni_probe(num); #endif #ifdef CONFIG_TR for (num = 0; num < 8; ++num) - if (trif_probe(num)) - break; + trif_probe(num); #endif for (num = 0; num < 8; ++num) - if (ethif_probe(num)) - break; + ethif_probe(num); + #ifdef CONFIG_COPS cops_probe(0); cops_probe(1); From davem@pizda.ninka.net Mon Oct 13 12:32:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 12:32:49 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DJW025012862 for ; Mon, 13 Oct 2003 12:32:13 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA25668; Mon, 13 Oct 2003 12:25:40 -0700 Date: Mon, 13 Oct 2003 12:25:40 -0700 From: "David S. Miller" To: Wensong Zhang Cc: netdev@oss.sgi.com, ja@ssi.bg Subject: Re: [2.6 PATCH] Fix IPVS sync state check Message-Id: <20031013122540.0446f173.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 771 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 On Mon, 13 Oct 2003 23:15:26 +0800 (CST) Wensong Zhang wrote: > Here is a one-line fix in the sync state check for the connection to be > synchronized. Since both the primay and the backup IPVS sync daemon can be > started in a box at a time now, we must check if the MASTER bit is set in > the sync state exactly. > > Please check and apply it. Looks good, applied. Thanks. BTW, on the 2.4.x side the IPVS code still has the NF_DROP return which Julian changed in the 2.6.x version of the IPVS code. Maybe this 2.6.x NF_DROP change needs to be propagated into the 2.4.x code? From davem@pizda.ninka.net Mon Oct 13 12:39:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 12:39:52 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DJdI25013284 for ; Mon, 13 Oct 2003 12:39:19 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA25744; Mon, 13 Oct 2003 12:32:56 -0700 Date: Mon, 13 Oct 2003 12:32:56 -0700 From: "David S. Miller" To: Wensong Zhang Cc: netdev@oss.sgi.com, ja@ssi.bg Subject: Re: [PATCH] Fix IPVS to set the statistics of dest zero Message-Id: <20031013123256.0eaef28a.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 772 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 On Mon, 13 Oct 2003 23:59:34 +0800 (CST) Wensong Zhang wrote: > Here is the slight patch for IPVS to fix to zero the statistics of dest > when it is bound to a new service. It can make the statistics information > more correct after removing/adding new servers. > > Please check the attached two patches and apply them to the kernel 2.4 and > 2.6 respectively. Applied, thanks Wensong. From davem@pizda.ninka.net Mon Oct 13 12:52:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 12:52:35 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DJq125013892 for ; Mon, 13 Oct 2003 12:52:01 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA25893; Mon, 13 Oct 2003 12:45:45 -0700 Date: Mon, 13 Oct 2003 12:45:45 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] resolve probe difference Message-Id: <20031013124545.6939cb61.davem@redhat.com> In-Reply-To: <20031013114852.74b547d0.shemminger@osdl.org> References: <20031013114852.74b547d0.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 773 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 On Mon, 13 Oct 2003 11:48:52 -0700 Stephen Hemminger wrote: > In the change to get rid of the list of ISA devices to programmatic probing > of old devices, a behaviour change was introduced which might cause problems. > > Before, it was possible to specify a parameter on the boot line for a second > device and skip the first, as in: > netdev=4,0x280,0,0,eth1 > Well, now we stop after eth0 if we don't find it.. > Somebody, might depend on the old behaviour, so this patch restores it.. Looks good, applied. Thanks a lot Stephen. From johnip@sgi.com Mon Oct 13 12:54:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 12:55:02 -0700 (PDT) Received: from tolkor.sgi.com (tolkor.SGI.COM [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DJsQ25014241 for ; Mon, 13 Oct 2003 12:54:27 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h9DKCSHc013074 for ; Mon, 13 Oct 2003 15:12:28 -0500 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h9DJrtcc12226593; Mon, 13 Oct 2003 14:53:55 -0500 (CDT) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h9DJrsRn313680821; Mon, 13 Oct 2003 14:53:55 -0500 (CDT) Message-ID: <3F8B02D2.4020007@sgi.com> Date: Mon, 13 Oct 2003 14:53:54 -0500 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030905 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Andi Kleen , modica@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> In-Reply-To: <20031011105054.0e16a607.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 774 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev Could we create a module argument like "do_5701_align" and just give it a -1 default which does NOT do the copy but if we give the arg 1, 0, whatever it DOES to the copy to align the buffs ? Then inside the driver we define a macro to handle that ? That way all you need is to include "tg3 do_5701_align=1" in modules.conf That way all the default comiles work and no CONFIG option for people who compile all defaults and don't want to re compile the kernel for this issue. Is that acceptable ? John David S. Miller wrote: > On Sat, 11 Oct 2003 15:19:21 +0200 > Andi Kleen wrote: > > >>Then just don't set the argument to zero in modules.conf on the 5704cards. >>That could be even handled somewhere in user space. Switching over sounds >>best of course, because the performance with the copying won't be great > > > There is no "argument" we don't have a variable in the tg3 driver > that determines the "copybreak", it's a hard-coded macro define. > > For them it's really easy to know when the 5701 hw bug case is present, > so they can do something like: > > if (len > RX_COPY_THRESHOLD > #ifdef CONFIG_UNALIGNED_EXPENSIVE > || tp->rx_offset == 2 > #endif > ) { > ... > > And then only their platform and only when the buggy chips are present, > will get the desired change in behavior. -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From davem@pizda.ninka.net Mon Oct 13 12:55:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 12:56:19 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DJtj25014688 for ; Mon, 13 Oct 2003 12:55:45 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA25918; Mon, 13 Oct 2003 12:49:30 -0700 Date: Mon, 13 Oct 2003 12:49:30 -0700 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: Re: [PATCH] fixing the cases where tcp_tw_bucket was accessed as a sock Message-Id: <20031013124930.0e75a325.davem@redhat.com> In-Reply-To: <20031012131344.GH16182@conectiva.com.br> References: <20031012131344.GH16182@conectiva.com.br> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 775 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 On Sun, 12 Oct 2003 10:13:44 -0300 Arnaldo Carvalho de Melo wrote: > The WARN_ON is just to be paranoid for a while, I should have done > that a loooong time ago :-\ I appreciate the intentions here but the resulting code is really a mess. We have this thing now in in.h called "inet_something()" that tests TCP state, and then we have something similar for ipv6 in addrconf.c :-) Let's do one thing at a time. First, fix the original bug in tcp_ipv4.c by just putting your inet_rcv_saddr() shorthand right there in tcp_ipv4.c and name it tcp4_rcv_saddr() or something like that. Then we can move onto the rest of the changes and try to find a common place for the helper routines. See what happens when you try to do too many things at one time :-) From davem@pizda.ninka.net Mon Oct 13 12:58:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 12:58:50 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DJwH25015357 for ; Mon, 13 Oct 2003 12:58:17 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA25934; Mon, 13 Oct 2003 12:51:56 -0700 Date: Mon, 13 Oct 2003 12:51:56 -0700 From: "David S. Miller" To: johnip@sgi.com Cc: ak@suse.de, modica@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031013125156.63c3be24.davem@redhat.com> In-Reply-To: <3F8B02D2.4020007@sgi.com> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8B02D2.4020007@sgi.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 776 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 On Mon, 13 Oct 2003 14:53:54 -0500 John Partridge wrote: > Could we create a module argument like "do_5701_align" and just give it a -1 > default which does NOT do the copy but if we give the arg 1, 0, whatever it > DOES to the copy to align the buffs ? Absolutely not, we're not going to put super-hacky module parameters into the driver just because you guys don't want to create and use the CONFIG_UNALIGNED_EXPENSIVE config option needed to fix this properly. > That way all the default comiles work and no CONFIG option for people > who compile all defaults and don't want to re compile the kernel for > this issue. > > Is that acceptable ? No it's not. When you add this new config option, and set it on ia64, the only thing that will need to be rebuilt is the tg3 driver, no other thing in the entire kernel tree should trigger a dependency on this new config option. I don't understand why at all you guys are trying to avoid fixing this the proper way, you will meet only resistence from me if you continue doing that :) From ja@ssi.bg Mon Oct 13 14:29:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 14:29:50 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DLT725017690 for ; Mon, 13 Oct 2003 14:29:11 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h9DLTAL02153; Tue, 14 Oct 2003 00:29:12 +0300 Date: Tue, 14 Oct 2003 00:29:10 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: Wensong Zhang , Subject: Re: [2.6 PATCH] Fix IPVS sync state check In-Reply-To: <20031013122540.0446f173.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 777 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Hello, On Mon, 13 Oct 2003, David S. Miller wrote: > BTW, on the 2.4.x side the IPVS code still has the NF_DROP return > which Julian changed in the 2.6.x version of the IPVS code. Maybe > this 2.6.x NF_DROP change needs to be propagated into the 2.4.x code? The current 2.4 code does not need such fix, it was a 2.6 specific bug that I introduced with the non-linear patch. Regards -- Julian Anastasov From shemminger@osdl.org Mon Oct 13 16:32:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 16:32:58 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9DNWN25023713 for ; Mon, 13 Oct 2003 16:32:23 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9DNWFo03889; Mon, 13 Oct 2003 16:32:15 -0700 Date: Mon, 13 Oct 2003 16:32:00 -0700 From: Stephen Hemminger To: Martin Josefsson , Jeff Garzik Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: NULL pointer dereference in sysfs_hash_and_remove() Message-Id: <20031013163200.43e5d1bf.shemminger@osdl.org> In-Reply-To: <1065220892.31749.39.camel@tux.rsn.bth.se> References: <1065220892.31749.39.camel@tux.rsn.bth.se> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (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: 778 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 On Sat, 04 Oct 2003 00:41:32 +0200 Martin Josefsson wrote: > Hi > > I compiled 2.6.0-test6 and ran it on a laptop with cardbus. > I have an Xircom NIC and if I remove it during operation I get the bug > below. > > I have yenta_socket and xircom_cb loaded as modules. The driver was setting the statistics pointer after registration had occurred, so on unregister the network code was removing a non-existent sysfs directory. Try this please. diff -Nru a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c --- a/drivers/net/tulip/xircom_cb.c Mon Oct 13 16:29:05 2003 +++ b/drivers/net/tulip/xircom_cb.c Mon Oct 13 16:29:05 2003 @@ -230,7 +230,8 @@ This way, we can fail gracefully if not enough memory is available. */ - if ((dev = init_etherdev(NULL, sizeof(struct xircom_private))) == NULL) { + dev = alloc_etherdev(sizeof(struct xircom_private)); + if (!dev) { printk(KERN_ERR "xircom_probe: failed to allocate etherdev\n"); goto device_fail; } @@ -250,7 +251,7 @@ SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq); + private->dev = dev; private->pdev = pdev; @@ -259,7 +260,6 @@ dev->irq = pdev->irq; dev->base_addr = private->io_port; - initialize_card(private); read_mac_address(private); setup_descriptors(private); @@ -272,7 +272,12 @@ SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); pci_set_drvdata(pdev, dev); - + if (register_netdev(dev)) { + printk(KERN_ERR "xircom_probe: netdevice registration failed.\n"); + goto reg_fail; + } + + printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq); /* start the transmitter to get a heartbeat */ /* TODO: send 2 dummy packets here */ transceiver_voodoo(private); @@ -287,10 +292,12 @@ leave("xircom_probe"); return 0; +reg_fail: + kfree(private->tx_buffer); tx_buf_fail: kfree(private->rx_buffer); rx_buf_fail: - kfree(dev); + free_netdev(dev); device_fail: return -ENODEV; } @@ -305,22 +312,16 @@ static void __devexit xircom_remove(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); - struct xircom_private *card; + struct xircom_private *card = dev->priv; + enter("xircom_remove"); - if (dev!=NULL) { - card=dev->priv; - if (card!=NULL) { - if (card->rx_buffer!=NULL) - pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle); - card->rx_buffer = NULL; - if (card->tx_buffer!=NULL) - pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle); - card->tx_buffer = NULL; - } - } + pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle); + pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle); + release_region(dev->base_addr, 128); unregister_netdev(dev); free_netdev(dev); + pci_set_drvdata(pdev, NULL); leave("xircom_remove"); } From chas@cmf.nrl.navy.mil Mon Oct 13 20:42:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 20:43:12 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E3gb25001604 for ; Mon, 13 Oct 2003 20:42:38 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9E3gUkT005558; Mon, 13 Oct 2003 23:42:31 -0400 (EDT) Message-Id: <200310140342.h9E3gUkT005558@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM][0/6] backports from 2.6 Reply-To: chas3@users.sourceforge.net Date: Mon, 13 Oct 2003 23:42:31 -0400 From: chas williams X-Spam-Score: (**) hits=2.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 779 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev the next set of patches are backports of changes made in 2.6. please apply to latest 2.4. --thanks From chas@cmf.nrl.navy.mil Mon Oct 13 20:44:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 20:45:20 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E3ik25001905 for ; Mon, 13 Oct 2003 20:44:46 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9E3iekT005589; Mon, 13 Oct 2003 23:44:40 -0400 (EDT) Message-Id: <200310140344.h9E3iekT005589@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM][2/6] remove listenq and backlog_quota from struct atm_vcc Reply-To: chas3@users.sourceforge.net Date: Mon, 13 Oct 2003 23:44:41 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 780 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.4 --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1137 -> 1.1138 # include/linux/atmdev.h 1.10 -> 1.11 # net/atm/svc.c 1.6 -> 1.7 # net/atm/signaling.c 1.6 -> 1.7 # net/atm/common.c 1.22 -> 1.23 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/29 chas@relax.cmf.nrl.navy.mil 1.1138 # [ATM]: remove listenq and backlog_quota from struct atm_vcc # -------------------------------------------- # diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h Mon Oct 13 18:41:13 2003 +++ b/include/linux/atmdev.h Mon Oct 13 18:41:13 2003 @@ -302,9 +302,6 @@ struct sockaddr_atmsvc local; struct sockaddr_atmsvc remote; void (*callback)(struct atm_vcc *vcc); - struct sk_buff_head listenq; - int backlog_quota; /* number of connection requests we */ - /* can still accept */ int reply; /* also used by ATMTCP */ /* Multipoint part ------------------------------------------------- */ struct atm_vcc *session; /* session VCC descriptor */ diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Mon Oct 13 18:41:13 2003 +++ b/net/atm/common.c Mon Oct 13 18:41:13 2003 @@ -217,7 +217,6 @@ vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */ vcc->atm_options = vcc->aal_options = 0; init_waitqueue_head(&vcc->sleep); - skb_queue_head_init(&vcc->listenq); sk->sleep = &vcc->sleep; sock->sk = sk; return 0; @@ -553,7 +552,7 @@ vcc = ATM_SD(sock); poll_wait(file,&vcc->sleep,wait); mask = 0; - if (skb_peek(&vcc->sk->receive_queue) || skb_peek(&vcc->listenq)) + if (skb_peek(&vcc->sk->receive_queue)) mask |= POLLIN | POLLRDNORM; if (test_bit(ATM_VF_RELEASED,&vcc->flags) || test_bit(ATM_VF_CLOSE,&vcc->flags)) diff -Nru a/net/atm/signaling.c b/net/atm/signaling.c --- a/net/atm/signaling.c Mon Oct 13 18:41:13 2003 +++ b/net/atm/signaling.c Mon Oct 13 18:41:13 2003 @@ -129,12 +129,12 @@ case as_indicate: vcc = *(struct atm_vcc **) &msg->listen_vcc; DPRINTK("as_indicate!!!\n"); - if (!vcc->backlog_quota) { + if (vcc->sk->ack_backlog == vcc->sk->max_ack_backlog) { sigd_enq(0,as_reject,vcc,NULL,NULL); return 0; } - vcc->backlog_quota--; - skb_queue_tail(&vcc->listenq,skb); + vcc->sk->ack_backlog++; + skb_queue_tail(&vcc->sk->receive_queue,skb); if (vcc->callback) { DPRINTK("waking vcc->sleep 0x%p\n", &vcc->sleep); diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c Mon Oct 13 18:41:13 2003 +++ b/net/atm/svc.c Mon Oct 13 18:41:13 2003 @@ -75,7 +75,7 @@ } /* beware - socket is still in use by atmsigd until the last as_indicate has been answered */ - while ((skb = skb_dequeue(&vcc->listenq))) { + while ((skb = skb_dequeue(&vcc->sk->receive_queue))) { DPRINTK("LISTEN REL\n"); sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0); dev_kfree_skb(skb); @@ -254,7 +254,7 @@ remove_wait_queue(&vcc->sleep,&wait); if (!sigd) return -EUNATCH; set_bit(ATM_VF_LISTEN,&vcc->flags); - vcc->backlog_quota = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT; + vcc->sk->max_ack_backlog = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT; return vcc->reply; } @@ -278,7 +278,7 @@ DECLARE_WAITQUEUE(wait,current); add_wait_queue(&old_vcc->sleep,&wait); - while (!(skb = skb_dequeue(&old_vcc->listenq)) && sigd) { + while (!(skb = skb_dequeue(&old_vcc->sk->receive_queue)) && sigd) { if (test_bit(ATM_VF_RELEASED,&old_vcc->flags)) break; if (test_bit(ATM_VF_CLOSE,&old_vcc->flags)) { error = old_vcc->reply; @@ -307,7 +307,7 @@ error = atm_connect(newsock,msg->pvc.sap_addr.itf, msg->pvc.sap_addr.vpi,msg->pvc.sap_addr.vci); dev_kfree_skb(skb); - old_vcc->backlog_quota++; + old_vcc->sk->ack_backlog--; if (error) { sigd_enq2(NULL,as_reject,old_vcc,NULL,NULL, &old_vcc->qos,error); From chas@cmf.nrl.navy.mil Mon Oct 13 20:46:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 20:46:21 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E3kC25002332 for ; Mon, 13 Oct 2003 20:46:13 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9E3k4kT005607; Mon, 13 Oct 2003 23:46:04 -0400 (EDT) Message-Id: <200310140346.h9E3k4kT005607@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM][4/6] eliminate SOCKOPS_WRAPPED Reply-To: chas3@users.sourceforge.net Date: Mon, 13 Oct 2003 23:46:04 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 781 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.4 --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1142 -> 1.1143 # net/atm/pvc.c 1.7 -> 1.8 # net/atm/svc.c 1.8 -> 1.9 # net/atm/common.h 1.7 -> 1.8 # net/atm/signaling.c 1.7 -> 1.8 # net/atm/common.c 1.24 -> 1.25 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/13 chas@relax.cmf.nrl.navy.mil 1.1143 # [ATM]: eliminate SOCKOPS_WRAPPED # -------------------------------------------- # diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Mon Oct 13 18:41:25 2003 +++ b/net/atm/common.c Mon Oct 13 18:41:25 2003 @@ -469,35 +469,57 @@ -int atm_sendmsg(struct socket *sock,struct msghdr *m,int total_len, - struct scm_cookie *scm) +int vcc_sendmsg(struct socket *sock, struct msghdr *m, int total_len, + struct scm_cookie *scm) { + struct sock *sk = sock->sk; DECLARE_WAITQUEUE(wait,current); - struct atm_vcc *vcc; - struct sk_buff *skb; - int eff,error; - const void *buff; - int size; + struct atm_vcc *vcc; + struct sk_buff *skb; + int eff,error; + const void *buff; + int size; - if (sock->state != SS_CONNECTED) return -ENOTCONN; - if (m->msg_name) return -EISCONN; - if (m->msg_iovlen != 1) return -ENOSYS; /* fix this later @@@ */ - buff = m->msg_iov->iov_base; - size = m->msg_iov->iov_len; - vcc = ATM_SD(sock); - if (test_bit(ATM_VF_RELEASED,&vcc->flags) || - test_bit(ATM_VF_CLOSE,&vcc->flags)) - return vcc->reply; - if (!test_bit(ATM_VF_READY,&vcc->flags)) return -EPIPE; - if (!size) return 0; - if (size < 0 || size > vcc->qos.txtp.max_sdu) return -EMSGSIZE; - /* verify_area is done by net/socket.c */ - eff = (size+3) & ~3; /* align to word boundary */ - add_wait_queue(&vcc->sleep,&wait); + lock_sock(sk); + if (sock->state != SS_CONNECTED) { + error = -ENOTCONN; + goto out; + } + if (m->msg_name) { + error = -EISCONN; + goto out; + } + if (m->msg_iovlen != 1) { + error = -ENOSYS; /* fix this later @@@ */ + goto out; + } + buff = m->msg_iov->iov_base; + size = m->msg_iov->iov_len; + vcc = ATM_SD(sock); + if (test_bit(ATM_VF_RELEASED, &vcc->flags) || + test_bit(ATM_VF_CLOSE, &vcc->flags)) { + error = vcc->reply; + goto out; + } + if (!test_bit(ATM_VF_READY, &vcc->flags)) { + error = -EPIPE; + goto out; + } + if (!size) { + error = 0; + goto out; + } + if (size < 0 || size > vcc->qos.txtp.max_sdu) { + error = -EMSGSIZE; + goto out; + } + /* verify_area is done by net/socket.c */ + eff = (size+3) & ~3; /* align to word boundary */ + add_wait_queue(&vcc->sleep,&wait); set_current_state(TASK_INTERRUPTIBLE); - error = 0; - while (!(skb = alloc_tx(vcc,eff))) { - if (m->msg_flags & MSG_DONTWAIT) { + error = 0; + while (!(skb = alloc_tx(vcc,eff))) { + if (m->msg_flags & MSG_DONTWAIT) { error = -EAGAIN; break; } @@ -519,16 +541,21 @@ } set_current_state(TASK_RUNNING); remove_wait_queue(&vcc->sleep,&wait); - if (error) return error; + if (error) + goto out; skb->dev = NULL; /* for paths shared with net_device interfaces */ ATM_SKB(skb)->atm_options = vcc->atm_options; if (copy_from_user(skb_put(skb,size),buff,size)) { kfree_skb(skb); - return -EFAULT; + error = -EFAULT; + goto out; } if (eff != size) memset(skb->data+size,0,eff-size); error = vcc->dev->ops->send(vcc,skb); - return error ? error : size; + error = error ? error : size; +out: + release_sock(sk); + return error; } diff -Nru a/net/atm/common.h b/net/atm/common.h --- a/net/atm/common.h Mon Oct 13 18:41:25 2003 +++ b/net/atm/common.h Mon Oct 13 18:41:25 2003 @@ -15,8 +15,8 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci); int vcc_recvmsg(struct socket *sock, struct msghdr *msg, int size, int flags, struct scm_cookie *scm); -int atm_sendmsg(struct socket *sock,struct msghdr *m,int total_len, - struct scm_cookie *scm); +int vcc_sendmsg(struct socket *sock, struct msghdr *m, int total_len, + struct scm_cookie *scm); unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait); int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); int atm_setsockopt(struct socket *sock,int level,int optname,char *optval, diff -Nru a/net/atm/pvc.c b/net/atm/pvc.c --- a/net/atm/pvc.c Mon Oct 13 18:41:25 2003 +++ b/net/atm/pvc.c Mon Oct 13 18:41:25 2003 @@ -32,20 +32,29 @@ static int pvc_bind(struct socket *sock,struct sockaddr *sockaddr, int sockaddr_len) { + struct sock *sk = sock->sk; struct sockaddr_atmpvc *addr; struct atm_vcc *vcc; + int error; if (sockaddr_len != sizeof(struct sockaddr_atmpvc)) return -EINVAL; addr = (struct sockaddr_atmpvc *) sockaddr; if (addr->sap_family != AF_ATMPVC) return -EAFNOSUPPORT; + lock_sock(sk); vcc = ATM_SD(sock); - if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD; + if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) { + error = -EBADFD; + goto out; + } if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) { if (vcc->vpi != ATM_VPI_UNSPEC) addr->sap_addr.vpi = vcc->vpi; if (vcc->vci != ATM_VCI_UNSPEC) addr->sap_addr.vci = vcc->vci; } - return vcc_connect(sock, addr->sap_addr.itf, addr->sap_addr.vpi, + error = vcc_connect(sock, addr->sap_addr.itf, addr->sap_addr.vpi, addr->sap_addr.vci); +out: + release_sock(sk); + return error; } @@ -55,6 +64,31 @@ return pvc_bind(sock,sockaddr,sockaddr_len); } +static int pvc_setsockopt(struct socket *sock, int level, int optname, + char *optval, int optlen) +{ + struct sock *sk = sock->sk; + int error; + + lock_sock(sk); + error = atm_setsockopt(sock, level, optname, optval, optlen); + release_sock(sk); + return error; +} + + +static int pvc_getsockopt(struct socket *sock, int level, int optname, + char *optval, int *optlen) +{ + struct sock *sk = sock->sk; + int error; + + lock_sock(sk); + error = atm_getsockopt(sock, level, optname, optval, optlen); + release_sock(sk); + return error; +} + static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr, int *sockaddr_len,int peer) @@ -73,7 +107,7 @@ } -static struct proto_ops SOCKOPS_WRAPPED(pvc_proto_ops) = { +static struct proto_ops pvc_proto_ops = { .family = PF_ATMPVC, .release = atm_release, @@ -86,17 +120,13 @@ .ioctl = vcc_ioctl, .listen = sock_no_listen, .shutdown = pvc_shutdown, - .setsockopt = atm_setsockopt, - .getsockopt = atm_getsockopt, - .sendmsg = atm_sendmsg, + .setsockopt = pvc_setsockopt, + .getsockopt = pvc_getsockopt, + .sendmsg = vcc_sendmsg, .recvmsg = vcc_recvmsg, .mmap = sock_no_mmap, .sendpage = sock_no_sendpage, }; - - -#include -SOCKOPS_WRAP(pvc_proto, PF_ATMPVC); static int pvc_create(struct socket *sock,int protocol) diff -Nru a/net/atm/signaling.c b/net/atm/signaling.c --- a/net/atm/signaling.c Mon Oct 13 18:41:25 2003 +++ b/net/atm/signaling.c Mon Oct 13 18:41:25 2003 @@ -129,9 +129,10 @@ case as_indicate: vcc = *(struct atm_vcc **) &msg->listen_vcc; DPRINTK("as_indicate!!!\n"); + lock_sock(vcc->sk); if (vcc->sk->ack_backlog == vcc->sk->max_ack_backlog) { sigd_enq(0,as_reject,vcc,NULL,NULL); - return 0; + goto as_indicate_complete; } vcc->sk->ack_backlog++; skb_queue_tail(&vcc->sk->receive_queue,skb); @@ -140,6 +141,8 @@ &vcc->sleep); vcc->callback(vcc); } +as_indicate_complete: + release_sock(vcc->sk); return 0; case as_close: set_bit(ATM_VF_RELEASED,&vcc->flags); diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c Mon Oct 13 18:41:25 2003 +++ b/net/atm/svc.c Mon Oct 13 18:41:25 2003 @@ -109,20 +109,39 @@ int sockaddr_len) { DECLARE_WAITQUEUE(wait,current); + struct sock *sk = sock->sk; struct sockaddr_atmsvc *addr; struct atm_vcc *vcc; + int error; - if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) return -EINVAL; - if (sock->state == SS_CONNECTED) return -EISCONN; - if (sock->state != SS_UNCONNECTED) return -EINVAL; + if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) + return -EINVAL; + lock_sock(sk); + if (sock->state == SS_CONNECTED) { + error = -EISCONN; + goto out; + } + if (sock->state != SS_UNCONNECTED) { + error = -EINVAL; + goto out; + } vcc = ATM_SD(sock); - if (test_bit(ATM_VF_SESSION,&vcc->flags)) return -EINVAL; + if (test_bit(ATM_VF_SESSION, &vcc->flags)) { + error = -EINVAL; + goto out; + } addr = (struct sockaddr_atmsvc *) sockaddr; - if (addr->sas_family != AF_ATMSVC) return -EAFNOSUPPORT; + if (addr->sas_family != AF_ATMSVC) { + error = -EAFNOSUPPORT; + goto out; + } clear_bit(ATM_VF_BOUND,&vcc->flags); /* failing rebind will kill old binding */ /* @@@ check memory (de)allocation on rebind */ - if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD; + if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) { + error = -EBADFD; + goto out; + } vcc->local = *addr; vcc->reply = WAITING; add_wait_queue(&vcc->sleep,&wait); @@ -133,9 +152,16 @@ } remove_wait_queue(&vcc->sleep,&wait); clear_bit(ATM_VF_REGIS,&vcc->flags); /* doesn't count */ - if (!sigd) return -EUNATCH; - if (!vcc->reply) set_bit(ATM_VF_BOUND,&vcc->flags); - return vcc->reply; + if (!sigd) { + error = -EUNATCH; + goto out; + } + if (!vcc->reply) + set_bit(ATM_VF_BOUND,&vcc->flags); + error = vcc->reply; +out: + release_sock(sk); + return error; } @@ -143,31 +169,60 @@ int sockaddr_len,int flags) { DECLARE_WAITQUEUE(wait,current); + struct sock *sk = sock->sk; struct sockaddr_atmsvc *addr; struct atm_vcc *vcc = ATM_SD(sock); int error; DPRINTK("svc_connect %p\n",vcc); - if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) return -EINVAL; - if (sock->state == SS_CONNECTED) return -EISCONN; - if (sock->state == SS_CONNECTING) { - if (vcc->reply == WAITING) return -EALREADY; - sock->state = SS_UNCONNECTED; - if (vcc->reply) return vcc->reply; + lock_sock(sk); + if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) { + error = -EINVAL; + goto out; } - else { - int error; - if (sock->state != SS_UNCONNECTED) return -EINVAL; - if (test_bit(ATM_VF_SESSION,&vcc->flags)) return -EINVAL; + switch (sock->state) { + default: + error = -EINVAL; + goto out; + case SS_CONNECTED: + error = -EISCONN; + goto out; + case SS_CONNECTING: + if (vcc->reply == WAITING) { + error = -EALREADY; + goto out; + } + sock->state = SS_UNCONNECTED; + if (vcc->reply) { + error = vcc->reply; + goto out; + } + break; + case SS_UNCONNECTED: + if (test_bit(ATM_VF_SESSION, &vcc->flags)) { + error = -EINVAL; + goto out; + } addr = (struct sockaddr_atmsvc *) sockaddr; - if (addr->sas_family != AF_ATMSVC) return -EAFNOSUPPORT; - if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD; + if (addr->sas_family != AF_ATMSVC) { + error = -EAFNOSUPPORT; + goto out; + } + if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) { + error = -EBADFD; + goto out; + } if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS || - vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) - return -EINVAL; + vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) { + error = -EINVAL; + goto out; + } if (!vcc->qos.txtp.traffic_class && - !vcc->qos.rxtp.traffic_class) return -EINVAL; + !vcc->qos.rxtp.traffic_class) { + error = -EINVAL; + goto out; + } vcc->remote = *addr; vcc->reply = WAITING; add_wait_queue(&vcc->sleep,&wait); @@ -175,7 +230,8 @@ if (flags & O_NONBLOCK) { remove_wait_queue(&vcc->sleep,&wait); sock->state = SS_CONNECTING; - return -EINPROGRESS; + error = -EINPROGRESS; + goto out; } error = 0; while (vcc->reply == WAITING && sigd) { @@ -214,9 +270,16 @@ break; } remove_wait_queue(&vcc->sleep,&wait); - if (error) return error; - if (!sigd) return -EUNATCH; - if (vcc->reply) return vcc->reply; + if (error) + goto out; + if (!sigd) { + error = -EUNATCH; + goto out; + } + if (vcc->reply) { + error = vcc->reply; + goto out; + } } /* * Not supported yet @@ -232,6 +295,8 @@ if (!(error = vcc_connect(sock, vcc->itf, vcc->vpi, vcc->vci))) sock->state = SS_CONNECTED; else (void) svc_disconnect(vcc); +out: + release_sock(sk); return error; } @@ -239,11 +304,17 @@ static int svc_listen(struct socket *sock,int backlog) { DECLARE_WAITQUEUE(wait,current); + struct sock *sk = sock->sk; struct atm_vcc *vcc = ATM_SD(sock); + int error; DPRINTK("svc_listen %p\n",vcc); + lock_sock(sk); /* let server handle listen on unbound sockets */ - if (test_bit(ATM_VF_SESSION,&vcc->flags)) return -EINVAL; + if (test_bit(ATM_VF_SESSION,&vcc->flags)) { + error = -EINVAL; + goto out; + } vcc->reply = WAITING; add_wait_queue(&vcc->sleep,&wait); sigd_enq(vcc,as_listen,NULL,NULL,&vcc->local); @@ -252,24 +323,33 @@ schedule(); } remove_wait_queue(&vcc->sleep,&wait); - if (!sigd) return -EUNATCH; + if (!sigd) { + error = -EUNATCH; + goto out; + } set_bit(ATM_VF_LISTEN,&vcc->flags); vcc->sk->max_ack_backlog = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT; - return vcc->reply; + error = vcc->reply; +out: + release_sock(sk); + return error; } static int svc_accept(struct socket *sock,struct socket *newsock,int flags) { + struct sock *sk = sock->sk; struct sk_buff *skb; struct atmsvc_msg *msg; struct atm_vcc *old_vcc = ATM_SD(sock); struct atm_vcc *new_vcc; int error; + lock_sock(sk); + error = svc_create(newsock,0); if (error) - return error; + goto out; new_vcc = ATM_SD(newsock); @@ -288,16 +368,21 @@ error = -EAGAIN; break; } - set_current_state(TASK_INTERRUPTIBLE); + release_sock(sk); schedule(); + lock_sock(sk); if (signal_pending(current)) { error = -ERESTARTSYS; break; } } remove_wait_queue(&old_vcc->sleep,&wait); - if (error) return error; - if (!skb) return -EUNATCH; + if (error) + goto out; + if (!skb) { + error = -EUNATCH; + goto out; + } msg = (struct atmsvc_msg *) skb->data; new_vcc->qos = msg->qos; set_bit(ATM_VF_HASQOS,&new_vcc->flags); @@ -311,7 +396,8 @@ if (error) { sigd_enq2(NULL,as_reject,old_vcc,NULL,NULL, &old_vcc->qos,error); - return error == -EAGAIN ? -EBUSY : error; + error = error == -EAGAIN ? -EBUSY : error; + goto out; } /* wait should be short, so we ignore the non-blocking flag */ new_vcc->reply = WAITING; @@ -319,15 +405,25 @@ sigd_enq(new_vcc,as_accept,old_vcc,NULL,NULL); while (new_vcc->reply == WAITING && sigd) { set_current_state(TASK_UNINTERRUPTIBLE); + release_sock(sk); schedule(); + lock_sock(sk); } remove_wait_queue(&new_vcc->sleep,&wait); - if (!sigd) return -EUNATCH; + if (!sigd) { + error = -EUNATCH; + goto out; + } if (!new_vcc->reply) break; - if (new_vcc->reply != -ERESTARTSYS) return new_vcc->reply; + if (new_vcc->reply != -ERESTARTSYS) { + error = new_vcc->reply; + goto out; + } } newsock->state = SS_CONNECTED; - return 0; +out: + release_sock(sk); + return error; } @@ -365,33 +461,57 @@ static int svc_setsockopt(struct socket *sock,int level,int optname, char *optval,int optlen) { + struct sock *sk = sock->sk; struct atm_vcc *vcc; + int error = 0; if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP || - optlen != sizeof(struct atm_sap)) - return atm_setsockopt(sock,level,optname,optval,optlen); + optlen != sizeof(struct atm_sap)) { + error = atm_setsockopt(sock, level, optname, optval, optlen); + goto out; + } vcc = ATM_SD(sock); - if (copy_from_user(&vcc->sap,optval,optlen)) return -EFAULT; - set_bit(ATM_VF_HASSAP,&vcc->flags); - return 0; + if (copy_from_user(&vcc->sap, optval, optlen)) { + error = -EFAULT; + goto out; + } + set_bit(ATM_VF_HASSAP, &vcc->flags); +out: + release_sock(sk); + return error; } static int svc_getsockopt(struct socket *sock,int level,int optname, char *optval,int *optlen) { - int len; + struct sock *sk = sock->sk; + int error = 0, len; - if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP) - return atm_getsockopt(sock,level,optname,optval,optlen); - if (get_user(len,optlen)) return -EFAULT; - if (len != sizeof(struct atm_sap)) return -EINVAL; - return copy_to_user(optval,&ATM_SD(sock)->sap,sizeof(struct atm_sap)) ? - -EFAULT : 0; + lock_sock(sk); + if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP) { + error = atm_getsockopt(sock, level, optname, optval, optlen); + goto out; + } + if (get_user(len, optlen)) { + error = -EFAULT; + goto out; + } + if (len != sizeof(struct atm_sap)) { + error = -EINVAL; + goto out; + } + if (copy_to_user(optval, &ATM_SD(sock)->sap, sizeof(struct atm_sap))) { + error = -EFAULT; + goto out; + } +out: + release_sock(sk); + return error; } -static struct proto_ops SOCKOPS_WRAPPED(svc_proto_ops) = { +static struct proto_ops svc_proto_ops = { .family = PF_ATMSVC, .release = svc_release, @@ -406,15 +526,12 @@ .shutdown = svc_shutdown, .setsockopt = svc_setsockopt, .getsockopt = svc_getsockopt, - .sendmsg = atm_sendmsg, + .sendmsg = vcc_sendmsg, .recvmsg = vcc_recvmsg, .mmap = sock_no_mmap, .sendpage = sock_no_sendpage, }; - -#include -SOCKOPS_WRAP(svc_proto, PF_ATMSVC); static int svc_create(struct socket *sock,int protocol) { From chas@cmf.nrl.navy.mil Mon Oct 13 20:46:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 20:47:25 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E3ko25002605 for ; Mon, 13 Oct 2003 20:46:51 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9E3kXkT005615; Mon, 13 Oct 2003 23:46:33 -0400 (EDT) Message-Id: <200310140346.h9E3kXkT005615@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM][5/6] move vcc's to global sk-based linked list Reply-To: chas3@users.sourceforge.net Date: Mon, 13 Oct 2003 23:46:34 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 782 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.4 --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1143 -> 1.1144 # drivers/atm/he.c 1.6 -> 1.7 # net/atm/atm_misc.c 1.3 -> 1.4 # drivers/atm/eni.c 1.8 -> 1.9 # include/linux/atmdev.h 1.11 -> 1.12 # net/atm/proc.c 1.10 -> 1.11 # net/atm/pvc.c 1.8 -> 1.9 # net/atm/clip.c 1.11 -> 1.12 # drivers/atm/fore200e.c 1.9 -> 1.10 # drivers/atm/idt77252.c 1.8 -> 1.9 # net/atm/lec.c 1.19 -> 1.20 # net/atm/svc.c 1.9 -> 1.10 # drivers/atm/atmtcp.c 1.4 -> 1.5 # net/atm/common.h 1.8 -> 1.9 # net/atm/signaling.c 1.8 -> 1.9 # net/atm/resources.h 1.4 -> 1.5 # net/atm/mpc.c 1.9 -> 1.10 # net/atm/resources.c 1.8 -> 1.9 # net/atm/common.c 1.25 -> 1.26 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/13 chas@relax.cmf.nrl.navy.mil 1.1144 # [ATM]: move vcc's to global sk-based linked list # -------------------------------------------- # diff -Nru a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c --- a/drivers/atm/atmtcp.c Mon Oct 13 18:41:38 2003 +++ b/drivers/atm/atmtcp.c Mon Oct 13 18:41:38 2003 @@ -153,9 +153,9 @@ static int atmtcp_v_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) { - unsigned long flags; struct atm_cirange ci; struct atm_vcc *vcc; + struct sock *s; if (cmd != ATM_SETCIRANGE) return -ENOIOCTLCMD; if (copy_from_user(&ci,(void *) arg,sizeof(ci))) return -EFAULT; @@ -163,14 +163,18 @@ if (ci.vci_bits == ATM_CI_MAX) ci.vci_bits = MAX_VCI_BITS; if (ci.vpi_bits > MAX_VPI_BITS || ci.vpi_bits < 0 || ci.vci_bits > MAX_VCI_BITS || ci.vci_bits < 0) return -EINVAL; - spin_lock_irqsave(&dev->lock, flags); - for (vcc = dev->vccs; vcc; vcc = vcc->next) + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (vcc->dev != dev) + continue; if ((vcc->vpi >> ci.vpi_bits) || (vcc->vci >> ci.vci_bits)) { - spin_unlock_irqrestore(&dev->lock, flags); + read_unlock(&vcc_sklist_lock); return -EBUSY; } - spin_unlock_irqrestore(&dev->lock, flags); + } + read_unlock(&vcc_sklist_lock); dev->ci_range = ci; return 0; } @@ -233,9 +237,9 @@ static void atmtcp_c_close(struct atm_vcc *vcc) { - unsigned long flags; struct atm_dev *atmtcp_dev; struct atmtcp_dev_data *dev_data; + struct sock *s; struct atm_vcc *walk; atmtcp_dev = (struct atm_dev *) vcc->dev_data; @@ -246,19 +250,23 @@ kfree(dev_data); shutdown_atm_dev(atmtcp_dev); vcc->dev_data = NULL; - spin_lock_irqsave(&atmtcp_dev->lock, flags); - for (walk = atmtcp_dev->vccs; walk; walk = walk->next) + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != atmtcp_dev) + continue; wake_up(&walk->sleep); - spin_unlock_irqrestore(&atmtcp_dev->lock, flags); + } + read_unlock(&vcc_sklist_lock); } static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb) { - unsigned long flags; struct atm_dev *dev; struct atmtcp_hdr *hdr; - struct atm_vcc *out_vcc; + struct sock *s; + struct atm_vcc *out_vcc = NULL; struct sk_buff *new_skb; int result = 0; @@ -270,13 +278,17 @@ (struct atmtcp_control *) skb->data); goto done; } - spin_lock_irqsave(&dev->lock, flags); - for (out_vcc = dev->vccs; out_vcc; out_vcc = out_vcc->next) + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + out_vcc = s->protinfo.af_atm; + if (out_vcc->dev != dev) + continue; if (out_vcc->vpi == ntohs(hdr->vpi) && out_vcc->vci == ntohs(hdr->vci) && out_vcc->qos.rxtp.traffic_class != ATM_NONE) break; - spin_unlock_irqrestore(&dev->lock, flags); + } + read_unlock(&vcc_sklist_lock); if (!out_vcc) { atomic_inc(&vcc->stats->tx_err); goto done; @@ -366,7 +378,7 @@ if (itf != -1) dev = atm_dev_lookup(itf); if (dev) { if (dev->ops != &atmtcp_v_dev_ops) { - atm_dev_release(dev); + atm_dev_put(dev); return -EMEDIUMTYPE; } if (PRIV(dev)->vcc) return -EBUSY; @@ -378,7 +390,8 @@ if (error) return error; } PRIV(dev)->vcc = vcc; - bind_vcc(vcc,&atmtcp_control_dev); + vcc->dev = &atmtcp_control_dev; + vcc_insert_socket(vcc->sk); set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); vcc->dev_data = dev; @@ -402,7 +415,7 @@ dev = atm_dev_lookup(itf); if (!dev) return -ENODEV; if (dev->ops != &atmtcp_v_dev_ops) { - atm_dev_release(dev); + atm_dev_put(dev); return -EMEDIUMTYPE; } dev_data = PRIV(dev); @@ -410,7 +423,7 @@ dev_data->persist = 0; if (PRIV(dev)->vcc) return 0; kfree(dev_data); - atm_dev_release(dev); + atm_dev_put(dev); shutdown_atm_dev(dev); return 0; } diff -Nru a/drivers/atm/eni.c b/drivers/atm/eni.c --- a/drivers/atm/eni.c Mon Oct 13 18:41:38 2003 +++ b/drivers/atm/eni.c Mon Oct 13 18:41:38 2003 @@ -1887,10 +1887,10 @@ static int get_ci(struct atm_vcc *vcc,short *vpi,int *vci) { - unsigned long flags; + struct sock *s; struct atm_vcc *walk; - spin_lock_irqsave(&vcc->dev->lock, flags); + read_lock(&vcc_sklist_lock); if (*vpi == ATM_VPI_ANY) *vpi = 0; if (*vci == ATM_VCI_ANY) { for (*vci = ATM_NOT_RSV_VCI; *vci < NR_VCI; (*vci)++) { @@ -1898,40 +1898,47 @@ ENI_DEV(vcc->dev)->rx_map[*vci]) continue; if (vcc->qos.txtp.traffic_class != ATM_NONE) { - for (walk = vcc->dev->vccs; walk; - walk = walk->next) + for (s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vci == *vci && walk->qos.txtp.traffic_class != ATM_NONE) break; - if (walk) continue; + } + if (s) continue; } break; } - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return *vci == NR_VCI ? -EADDRINUSE : 0; } if (*vci == ATM_VCI_UNSPEC) { - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return 0; } if (vcc->qos.rxtp.traffic_class != ATM_NONE && ENI_DEV(vcc->dev)->rx_map[*vci]) { - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return -EADDRINUSE; } if (vcc->qos.txtp.traffic_class == ATM_NONE) { - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return 0; } - for (walk = vcc->dev->vccs; walk; walk = walk->next) + for (s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vci == *vci && walk->qos.txtp.traffic_class != ATM_NONE) { - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return -EADDRINUSE; } - spin_unlock_irqrestore(&vcc->dev->lock, flags); + } + read_unlock(&vcc_sklist_lock); return 0; } @@ -2139,7 +2146,7 @@ static int eni_proc_read(struct atm_dev *dev,loff_t *pos,char *page) { - unsigned long flags; + struct sock *s; static const char *signal[] = { "LOST","unknown","okay" }; struct eni_dev *eni_dev = ENI_DEV(dev); struct atm_vcc *vcc; @@ -2212,11 +2219,15 @@ return sprintf(page,"%10sbacklog %u packets\n","", skb_queue_len(&tx->backlog)); } - spin_lock_irqsave(&dev->lock, flags); - for (vcc = dev->vccs; vcc; vcc = vcc->next) { - struct eni_vcc *eni_vcc = ENI_VCC(vcc); + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + struct eni_vcc *eni_vcc; int length; + vcc = s->protinfo.af_atm; + if (vcc->dev != dev) + continue; + eni_vcc = ENI_VCC(vcc); if (--left) continue; length = sprintf(page,"vcc %4d: ",vcc->vci); if (eni_vcc->rx) { @@ -2231,10 +2242,10 @@ length += sprintf(page+length,"tx[%d], txing %d bytes", eni_vcc->tx->index,eni_vcc->txing); page[length] = '\n'; - spin_unlock_irqrestore(&dev->lock, flags); + read_unlock(&vcc_sklist_lock); return length+1; } - spin_unlock_irqrestore(&dev->lock, flags); + read_unlock(&vcc_sklist_lock); for (i = 0; i < eni_dev->free_len; i++) { struct eni_free *fe = eni_dev->free_list+i; unsigned long offset; diff -Nru a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c --- a/drivers/atm/fore200e.c Mon Oct 13 18:41:38 2003 +++ b/drivers/atm/fore200e.c Mon Oct 13 18:41:38 2003 @@ -1077,18 +1077,22 @@ static struct atm_vcc* fore200e_find_vcc(struct fore200e* fore200e, struct rpd* rpd) { - unsigned long flags; + struct sock *s; struct atm_vcc* vcc; - spin_lock_irqsave(&fore200e->atm_dev->lock, flags); - for (vcc = fore200e->atm_dev->vccs; vcc; vcc = vcc->next) { - - if (vcc->vpi == rpd->atm_header.vpi && vcc->vci == rpd->atm_header.vci) - break; + read_lock(&vcc_sklist_lock); + for(s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (vcc->dev != fore200e->atm_dev) + continue; + if (vcc->vpi == rpd->atm_header.vpi && vcc->vci == rpd->atm_header.vci) { + read_unlock(&vcc_sklist_lock); + return vcc; + } } - spin_unlock_irqrestore(&fore200e->atm_dev->lock, flags); - - return vcc; + read_unlock(&vcc_sklist_lock); + + return NULL; } @@ -1357,20 +1361,23 @@ static int fore200e_walk_vccs(struct atm_vcc *vcc, short *vpi, int *vci) { - unsigned long flags; struct atm_vcc* walk; + struct sock *s; /* find a free VPI */ - spin_lock_irqsave(&vcc->dev->lock, flags); + read_lock(&vcc_sklist_lock); if (*vpi == ATM_VPI_ANY) { - for (*vpi = 0, walk = vcc->dev->vccs; walk; walk = walk->next) { + for (*vpi = 0, s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if ((walk->vci == *vci) && (walk->vpi == *vpi)) { (*vpi)++; - walk = vcc->dev->vccs; + s = vcc_sklist; } } } @@ -1378,16 +1385,19 @@ /* find a free VCI */ if (*vci == ATM_VCI_ANY) { - for (*vci = ATM_NOT_RSV_VCI, walk = vcc->dev->vccs; walk; walk = walk->next) { + for (*vci = ATM_NOT_RSV_VCI, s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if ((walk->vpi = *vpi) && (walk->vci == *vci)) { *vci = walk->vci + 1; - walk = vcc->dev->vccs; + s = vcc_sklist; } } } - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return 0; } @@ -2649,7 +2659,7 @@ static int fore200e_proc_read(struct atm_dev *dev,loff_t* pos,char* page) { - unsigned long flags; + struct sock *s; struct fore200e* fore200e = FORE200E_DEV(dev); int len, left = *pos; @@ -2896,8 +2906,12 @@ len = sprintf(page,"\n" " VCCs:\n address\tVPI.VCI:AAL\t(min/max tx PDU size) (min/max rx PDU size)\n"); - spin_lock_irqsave(&fore200e->atm_dev->lock, flags); - for (vcc = fore200e->atm_dev->vccs; vcc; vcc = vcc->next) { + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + + if (vcc->dev != fore200e->atm_dev) + continue; fore200e_vcc = FORE200E_VCC(vcc); @@ -2911,7 +2925,7 @@ fore200e_vcc->rx_max_pdu ); } - spin_unlock_irqrestore(&fore200e->atm_dev->lock, flags); + read_unlock(&vcc_sklist_lock); return len; } diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c Mon Oct 13 18:41:38 2003 +++ b/drivers/atm/he.c Mon Oct 13 18:41:38 2003 @@ -323,25 +323,25 @@ he_writel_rcm(dev, val, 0x00000 | (cid << 3) | 7) static __inline__ struct atm_vcc* -he_find_vcc(struct he_dev *he_dev, unsigned cid) +__find_vcc(struct he_dev *he_dev, unsigned cid) { - unsigned long flags; struct atm_vcc *vcc; + struct sock *s; short vpi; int vci; vpi = cid >> he_dev->vcibits; vci = cid & ((1 << he_dev->vcibits) - 1); - spin_lock_irqsave(&he_dev->atm_dev->lock, flags); - for (vcc = he_dev->atm_dev->vccs; vcc; vcc = vcc->next) - if (vcc->vci == vci && vcc->vpi == vpi - && vcc->qos.rxtp.traffic_class != ATM_NONE) { - spin_unlock_irqrestore(&he_dev->atm_dev->lock, flags); - return vcc; - } + for (s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (vcc->vci == vci && vcc->vpi == vpi && + vcc->dev == he_dev->atm_dev && + vcc->qos.rxtp.traffic_class != ATM_NONE) { + return vcc; + } + } - spin_unlock_irqrestore(&he_dev->atm_dev->lock, flags); return NULL; } @@ -1777,6 +1778,7 @@ int pdus_assembled = 0; int updated = 0; + read_lock(&vcc_sklist_lock); while (he_dev->rbrq_head != rbrq_tail) { ++updated; @@ -1803,7 +1805,7 @@ cid = RBRQ_CID(he_dev->rbrq_head); if (cid != lastcid) - vcc = he_find_vcc(he_dev, cid); + vcc = __find_vcc(he_dev, cid); lastcid = cid; if (vcc == NULL) { @@ -1942,6 +1944,7 @@ RBRQ_MASK(++he_dev->rbrq_head)); } + read_unlock(&vcc_sklist_lock); if (updated) { if (updated > he_dev->rbrq_peak) diff -Nru a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c --- a/drivers/atm/idt77252.c Mon Oct 13 18:41:38 2003 +++ b/drivers/atm/idt77252.c Mon Oct 13 18:41:38 2003 @@ -2404,37 +2404,43 @@ static int idt77252_find_vcc(struct atm_vcc *vcc, short *vpi, int *vci) { - unsigned long flags; + struct sock *s; struct atm_vcc *walk; - spin_lock_irqsave(&vcc->dev->lock, flags); + read_lock(&vcc_sklist_lock); if (*vpi == ATM_VPI_ANY) { *vpi = 0; - walk = vcc->dev->vccs; - while (walk) { + s = vcc_sklist; + while (s) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if ((walk->vci == *vci) && (walk->vpi == *vpi)) { (*vpi)++; - walk = vcc->dev->vccs; + s = vcc_sklist; continue; } - walk = walk->next; + s = s->next; } } if (*vci == ATM_VCI_ANY) { *vci = ATM_NOT_RSV_VCI; - walk = vcc->dev->vccs; - while (walk) { + s = vcc_sklist; + while (s) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if ((walk->vci == *vci) && (walk->vpi == *vpi)) { (*vci)++; - walk = vcc->dev->vccs; + s = vcc_sklist; continue; } - walk = walk->next; + s = s->next; } } - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return 0; } diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h Mon Oct 13 18:41:38 2003 +++ b/include/linux/atmdev.h Mon Oct 13 18:41:38 2003 @@ -296,7 +296,6 @@ struct k_atm_aal_stats *stats; /* pointer to AAL stats group */ wait_queue_head_t sleep; /* if socket is busy */ struct sock *sk; /* socket backpointer */ - struct atm_vcc *prev,*next; /* SVC part --- may move later ------------------------------------- */ short itf; /* interface number */ struct sockaddr_atmsvc local; @@ -327,8 +326,6 @@ /* (NULL) */ const char *type; /* device type name */ int number; /* device index */ - struct atm_vcc *vccs; /* VCC table (or NULL) */ - struct atm_vcc *last; /* last VCC (or undefined) */ void *dev_data; /* per-device data */ void *phy_data; /* private PHY date */ atm_dev_flags_t flags; /* device flags (ATM_DF_*) */ @@ -397,6 +394,9 @@ unsigned long atm_options; /* ATM layer options */ }; +extern struct sock *vcc_sklist; +extern rwlock_t vcc_sklist_lock; + #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, @@ -404,7 +404,8 @@ struct atm_dev *atm_dev_lookup(int number); void atm_dev_deregister(struct atm_dev *dev); void shutdown_atm_dev(struct atm_dev *dev); -void bind_vcc(struct atm_vcc *vcc,struct atm_dev *dev); +void vcc_insert_socket(struct sock *sk); +void vcc_remove_socket(struct sock *sk); /* @@ -442,7 +443,7 @@ } -static inline void atm_dev_release(struct atm_dev *dev) +static inline void atm_dev_put(struct atm_dev *dev) { atomic_dec(&dev->refcnt); diff -Nru a/net/atm/atm_misc.c b/net/atm/atm_misc.c --- a/net/atm/atm_misc.c Mon Oct 13 18:41:38 2003 +++ b/net/atm/atm_misc.c Mon Oct 13 18:41:38 2003 @@ -45,15 +45,20 @@ static int check_ci(struct atm_vcc *vcc,short vpi,int vci) { + struct sock *s; struct atm_vcc *walk; - for (walk = vcc->dev->vccs; walk; walk = walk->next) + for (s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vpi == vpi && walk->vci == vci && ((walk->qos.txtp.traffic_class != ATM_NONE && vcc->qos.txtp.traffic_class != ATM_NONE) || (walk->qos.rxtp.traffic_class != ATM_NONE && vcc->qos.rxtp.traffic_class != ATM_NONE))) return -EADDRINUSE; + } /* allow VCCs with same VPI/VCI iff they don't collide on TX/RX (but we may refuse such sharing for other reasons, e.g. if protocol requires to have both channels) */ @@ -63,17 +68,16 @@ int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci) { - unsigned long flags; static short p = 0; /* poor man's per-device cache */ static int c = 0; short old_p; int old_c; int err; - spin_lock_irqsave(&vcc->dev->lock, flags); + read_lock(&vcc_sklist_lock); if (*vpi != ATM_VPI_ANY && *vci != ATM_VCI_ANY) { err = check_ci(vcc,*vpi,*vci); - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return err; } /* last scan may have left values out of bounds for current device */ @@ -88,7 +92,7 @@ if (!check_ci(vcc,p,c)) { *vpi = p; *vci = c; - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return 0; } if (*vci == ATM_VCI_ANY) { @@ -103,7 +107,7 @@ } } while (old_p != p || old_c != c); - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return -EADDRINUSE; } diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Mon Oct 13 18:41:38 2003 +++ b/net/atm/clip.c Mon Oct 13 18:41:38 2003 @@ -740,7 +740,8 @@ set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); /* allow replies and avoid getting closed if signaling dies */ - bind_vcc(vcc,&atmarpd_dev); + vcc->dev = &atmarpd_dev; + vcc_insert_socket(vcc->sk); vcc->push = NULL; vcc->pop = NULL; /* crash */ vcc->push_oam = NULL; /* crash */ diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Mon Oct 13 18:41:38 2003 +++ b/net/atm/common.c Mon Oct 13 18:41:38 2003 @@ -178,6 +178,38 @@ #endif +struct sock *vcc_sklist; +rwlock_t vcc_sklist_lock = RW_LOCK_UNLOCKED; + +void __vcc_insert_socket(struct sock *sk) +{ + sk->next = vcc_sklist; + if (sk->next) + vcc_sklist->pprev = &sk->next; + vcc_sklist = sk; + sk->pprev = &vcc_sklist; +} + +void vcc_insert_socket(struct sock *sk) +{ + write_lock_irq(&vcc_sklist_lock); + __vcc_insert_socket(sk); + write_unlock_irq(&vcc_sklist_lock); +} + +void vcc_remove_socket(struct sock *sk) +{ + write_lock_irq(&vcc_sklist_lock); + if (sk->pprev) { + if (sk->next) + sk->next->pprev = sk->pprev; + *sk->pprev = sk->next; + sk->pprev = NULL; + } + write_unlock_irq(&vcc_sklist_lock); +} + + static struct sk_buff *alloc_tx(struct atm_vcc *vcc,unsigned int size) { struct sk_buff *skb; @@ -194,16 +226,46 @@ } -int atm_create(struct socket *sock,int protocol,int family) +EXPORT_SYMBOL(vcc_sklist); +EXPORT_SYMBOL(vcc_sklist_lock); +EXPORT_SYMBOL(vcc_insert_socket); +EXPORT_SYMBOL(vcc_remove_socket); + +static void vcc_sock_destruct(struct sock *sk) { + struct atm_vcc *vcc = sk->protinfo.af_atm; + + if (atomic_read(&vcc->sk->rmem_alloc)) + printk(KERN_DEBUG "vcc_sock_destruct: rmem leakage (%d bytes) detected.\n", atomic_read(&sk->rmem_alloc)); + + if (atomic_read(&vcc->sk->wmem_alloc)) + printk(KERN_DEBUG "vcc_sock_destruct: wmem leakage (%d bytes) detected.\n", atomic_read(&sk->wmem_alloc)); + + kfree(sk->protinfo.af_atm); +} + +int vcc_create(struct socket *sock, int protocol, int family) +{ struct sock *sk; struct atm_vcc *vcc; sock->sk = NULL; - if (sock->type == SOCK_STREAM) return -EINVAL; - if (!(sk = alloc_atm_vcc_sk(family))) return -ENOMEM; - vcc = sk->protinfo.af_atm; - memset(&vcc->flags,0,sizeof(vcc->flags)); + if (sock->type == SOCK_STREAM) + return -EINVAL; + sk = sk_alloc(family, GFP_KERNEL, 1); + if (!sk) + return -ENOMEM; + sock_init_data(NULL, sk); + + vcc = sk->protinfo.af_atm = kmalloc(sizeof(*vcc), GFP_KERNEL); + if (!vcc) { + sk_free(sk); + return -ENOMEM; + } + + memset(vcc, 0, sizeof(*vcc)); + vcc->sk = sk; + vcc->dev = NULL; vcc->callback = NULL; memset(&vcc->local,0,sizeof(struct sockaddr_atmsvc)); @@ -218,21 +280,27 @@ vcc->atm_options = vcc->aal_options = 0; init_waitqueue_head(&vcc->sleep); sk->sleep = &vcc->sleep; + sk->destruct = vcc_sock_destruct; sock->sk = sk; return 0; } -void atm_release_vcc_sk(struct sock *sk,int free_sk) +static void vcc_destroy_socket(struct sock *sk) { struct atm_vcc *vcc; struct sk_buff *skb; vcc = sk->protinfo.af_atm; - clear_bit(ATM_VF_READY,&vcc->flags); + clear_bit(ATM_VF_READY, &vcc->flags); if (vcc->dev) { - if (vcc->dev->ops->close) vcc->dev->ops->close(vcc); - if (vcc->push) vcc->push(vcc,NULL); /* atmarpd has no push */ + if (vcc->dev->ops->close) + vcc->dev->ops->close(vcc); + if (vcc->push) + vcc->push(vcc, NULL); /* atmarpd has no push */ + + vcc_remove_socket(sk); /* no more receive */ + while ((skb = skb_dequeue(&vcc->sk->receive_queue))) { atm_return(vcc,skb->truesize); kfree_skb(skb); @@ -240,22 +308,22 @@ if (vcc->dev->ops->owner) __MOD_DEC_USE_COUNT(vcc->dev->ops->owner); - atm_dev_release(vcc->dev); - if (atomic_read(&vcc->sk->rmem_alloc)) - printk(KERN_WARNING "atm_release_vcc: strange ... " - "rmem_alloc == %d after closing\n", - atomic_read(&vcc->sk->rmem_alloc)); - bind_vcc(vcc,NULL); + atm_dev_put(vcc->dev); } - - if (free_sk) free_atm_vcc_sk(sk); } -int atm_release(struct socket *sock) +int vcc_release(struct socket *sock) { - if (sock->sk) - atm_release_vcc_sk(sock->sk,1); + struct sock *sk = sock->sk; + + if (sk) { + lock_sock(sk); + vcc_destroy_socket(sock->sk); + release_sock(sk); + sock_put(sk); + } + return 0; } @@ -312,7 +380,8 @@ error = 0; if (!try_inc_mod_count(dev->ops->owner)) return -ENODEV; - bind_vcc(vcc,dev); + vcc->dev = dev; + vcc_insert_socket(vcc->sk); switch (vcc->qos.aal) { case ATM_AAL0: error = atm_init_aal0(vcc); @@ -349,9 +418,11 @@ return 0; fail: - bind_vcc(vcc, NULL); + vcc_remove_socket(vcc->sk); if (dev->ops->owner) __MOD_DEC_USE_COUNT(dev->ops->owner); + /* ensure we get dev module ref count correct */ + vcc->dev = NULL; return error; } @@ -395,7 +466,7 @@ return -ENODEV; error = __vcc_connect(vcc, dev, vpi, vci); if (error) { - atm_dev_release(dev); + atm_dev_put(dev); return error; } } else { @@ -409,7 +480,7 @@ spin_unlock(&atm_dev_lock); if (!__vcc_connect(vcc, dev, vpi, vci)) break; - atm_dev_release(dev); + atm_dev_put(dev); dev = NULL; spin_lock(&atm_dev_lock); } diff -Nru a/net/atm/common.h b/net/atm/common.h --- a/net/atm/common.h Mon Oct 13 18:41:38 2003 +++ b/net/atm/common.h Mon Oct 13 18:41:38 2003 @@ -10,8 +10,8 @@ #include /* for poll_table */ -int atm_create(struct socket *sock,int protocol,int family); -int atm_release(struct socket *sock); +int vcc_create(struct socket *sock, int protocol, int family); +int vcc_release(struct socket *sock); int vcc_connect(struct socket *sock, int itf, short vpi, int vci); int vcc_recvmsg(struct socket *sock, struct msghdr *msg, int size, int flags, struct scm_cookie *scm); @@ -24,7 +24,6 @@ int atm_getsockopt(struct socket *sock,int level,int optname,char *optval, int *optlen); -void atm_release_vcc_sk(struct sock *sk,int free_sk); void atm_shutdown_dev(struct atm_dev *dev); void pppoatm_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)); diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c Mon Oct 13 18:41:38 2003 +++ b/net/atm/lec.c Mon Oct 13 18:41:38 2003 @@ -45,7 +45,7 @@ #include "lec.h" #include "lec_arpc.h" -#include "resources.h" /* for bind_vcc() */ +#include "resources.h" #if 0 #define DPRINTK printk @@ -818,7 +818,8 @@ lec_arp_init(priv); priv->itfnum = i; /* LANE2 addition */ priv->lecd = vcc; - bind_vcc(vcc, &lecatm_dev); + vcc->dev = &lecatm_dev; + vcc_insert_socket(vcc->sk); vcc->proto_data = dev_lec[i]; set_bit(ATM_VF_META,&vcc->flags); diff -Nru a/net/atm/mpc.c b/net/atm/mpc.c --- a/net/atm/mpc.c Mon Oct 13 18:41:38 2003 +++ b/net/atm/mpc.c Mon Oct 13 18:41:38 2003 @@ -28,7 +28,7 @@ #include "lec.h" #include "mpc.h" -#include "resources.h" /* for bind_vcc() */ +#include "resources.h" /* * mpc.c: Implementation of MPOA client kernel part @@ -787,7 +787,8 @@ } mpc->mpoad_vcc = vcc; - bind_vcc(vcc, &mpc_dev); + vcc->dev = &mpc_dev; + vcc_insert_socket(vcc->sk); set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); diff -Nru a/net/atm/proc.c b/net/atm/proc.c --- a/net/atm/proc.c Mon Oct 13 18:41:38 2003 +++ b/net/atm/proc.c Mon Oct 13 18:41:38 2003 @@ -332,9 +332,7 @@ static int atm_pvc_info(loff_t pos,char *buf) { - unsigned long flags; - struct atm_dev *dev; - struct list_head *p; + struct sock *s; struct atm_vcc *vcc; int left, clip_info = 0; @@ -347,24 +345,20 @@ if (try_atm_clip_ops()) clip_info = 1; #endif - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - spin_lock_irqsave(&dev->lock, flags); - for (vcc = dev->vccs; vcc; vcc = vcc->next) - if (vcc->sk->family == PF_ATMPVC && vcc->dev && !left--) { - pvc_info(vcc,buf,clip_info); - spin_unlock_irqrestore(&dev->lock, flags); - spin_unlock(&atm_dev_lock); + read_lock(&vcc_sklist_lock); + for(s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (vcc->sk->family == PF_ATMPVC && vcc->dev && !left--) { + pvc_info(vcc,buf,clip_info); + read_unlock(&vcc_sklist_lock); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - if (clip_info && atm_clip_ops->owner) - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (clip_info && atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); #endif - return strlen(buf); - } - spin_unlock_irqrestore(&dev->lock, flags); + return strlen(buf); + } } - spin_unlock(&atm_dev_lock); + read_unlock(&vcc_sklist_lock); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) if (clip_info && atm_clip_ops->owner) __MOD_DEC_USE_COUNT(atm_clip_ops->owner); @@ -375,10 +369,8 @@ static int atm_vc_info(loff_t pos,char *buf) { - unsigned long flags; - struct atm_dev *dev; - struct list_head *p; struct atm_vcc *vcc; + struct sock *s; int left; if (!pos) @@ -386,20 +378,16 @@ "Address"," Itf VPI VCI Fam Flags Reply Send buffer" " Recv buffer\n"); left = pos-1; - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - spin_lock_irqsave(&dev->lock, flags); - for (vcc = dev->vccs; vcc; vcc = vcc->next) - if (!left--) { - vc_info(vcc,buf); - spin_unlock_irqrestore(&dev->lock, flags); - spin_unlock(&atm_dev_lock); - return strlen(buf); - } - spin_unlock_irqrestore(&dev->lock, flags); + read_lock(&vcc_sklist_lock); + for(s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (!left--) { + vc_info(vcc,buf); + read_unlock(&vcc_sklist_lock); + return strlen(buf); + } } - spin_unlock(&atm_dev_lock); + read_unlock(&vcc_sklist_lock); return 0; } @@ -407,29 +395,23 @@ static int atm_svc_info(loff_t pos,char *buf) { - unsigned long flags; - struct atm_dev *dev; - struct list_head *p; + struct sock *s; struct atm_vcc *vcc; int left; if (!pos) return sprintf(buf,"Itf VPI VCI State Remote\n"); left = pos-1; - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - spin_lock_irqsave(&dev->lock, flags); - for (vcc = dev->vccs; vcc; vcc = vcc->next) - if (vcc->sk->family == PF_ATMSVC && !left--) { - svc_info(vcc,buf); - spin_unlock_irqrestore(&dev->lock, flags); - spin_unlock(&atm_dev_lock); - return strlen(buf); - } - spin_unlock_irqrestore(&dev->lock, flags); + read_lock(&vcc_sklist_lock); + for(s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (vcc->sk->family == PF_ATMSVC && !left--) { + svc_info(vcc,buf); + read_unlock(&vcc_sklist_lock); + return strlen(buf); + } } - spin_unlock(&atm_dev_lock); + read_unlock(&vcc_sklist_lock); return 0; } diff -Nru a/net/atm/pvc.c b/net/atm/pvc.c --- a/net/atm/pvc.c Mon Oct 13 18:41:38 2003 +++ b/net/atm/pvc.c Mon Oct 13 18:41:38 2003 @@ -18,10 +18,6 @@ #include "resources.h" /* devs and vccs */ #include "common.h" /* common for PVCs and SVCs */ -#ifndef NULL -#define NULL 0 -#endif - static int pvc_shutdown(struct socket *sock,int how) { @@ -110,7 +106,7 @@ static struct proto_ops pvc_proto_ops = { .family = PF_ATMPVC, - .release = atm_release, + .release = vcc_release, .bind = pvc_bind, .connect = pvc_connect, .socketpair = sock_no_socketpair, @@ -132,7 +128,7 @@ static int pvc_create(struct socket *sock,int protocol) { sock->ops = &pvc_proto_ops; - return atm_create(sock,protocol,PF_ATMPVC); + return vcc_create(sock, protocol, PF_ATMPVC); } diff -Nru a/net/atm/resources.c b/net/atm/resources.c --- a/net/atm/resources.c Mon Oct 13 18:41:38 2003 +++ b/net/atm/resources.c Mon Oct 13 18:41:38 2003 @@ -19,11 +19,6 @@ #include "addr.h" -#ifndef NULL -#define NULL 0 -#endif - - LIST_HEAD(atm_devs); spinlock_t atm_dev_lock = SPIN_LOCK_UNLOCKED; @@ -90,7 +85,7 @@ spin_lock(&atm_dev_lock); if (number != -1) { if ((inuse = __atm_dev_lookup(number))) { - atm_dev_release(inuse); + atm_dev_put(inuse); spin_unlock(&atm_dev_lock); __free_atm_dev(dev); return NULL; @@ -99,13 +94,11 @@ } else { dev->number = 0; while ((inuse = __atm_dev_lookup(dev->number))) { - atm_dev_release(inuse); + atm_dev_put(inuse); dev->number++; } } - dev->vccs = dev->last = NULL; - dev->dev_data = NULL; - barrier(); + dev->ops = ops; if (flags) dev->flags = *flags; @@ -140,7 +133,8 @@ unsigned long warning_time; #ifdef CONFIG_PROC_FS - if (dev->ops->proc_read) atm_proc_dev_deregister(dev); + if (dev->ops->proc_read) + atm_proc_dev_deregister(dev); #endif spin_lock(&atm_dev_lock); list_del(&dev->dev_list); @@ -400,87 +394,12 @@ ? -EFAULT : 0; } done: - atm_dev_release(dev); + atm_dev_put(dev); return error; } - -/* Handler for sk->destruct, invoked by sk_free() */ -static void atm_free_sock(struct sock *sk) -{ - kfree(sk->protinfo.af_atm); -} - -struct sock *alloc_atm_vcc_sk(int family) -{ - struct sock *sk; - struct atm_vcc *vcc; - - sk = sk_alloc(family, GFP_KERNEL, 1); - if (!sk) - return NULL; - vcc = sk->protinfo.af_atm = kmalloc(sizeof(*vcc), GFP_KERNEL); - if (!vcc) { - sk_free(sk); - return NULL; - } - sock_init_data(NULL, sk); - sk->destruct = atm_free_sock; - memset(vcc, 0, sizeof(*vcc)); - vcc->sk = sk; - - return sk; -} - - -static void unlink_vcc(struct atm_vcc *vcc) -{ - unsigned long flags; - if (vcc->dev) { - spin_lock_irqsave(&vcc->dev->lock, flags); - if (vcc->prev) - vcc->prev->next = vcc->next; - else - vcc->dev->vccs = vcc->next; - - if (vcc->next) - vcc->next->prev = vcc->prev; - else - vcc->dev->last = vcc->prev; - spin_unlock_irqrestore(&vcc->dev->lock, flags); - } -} - - - -void free_atm_vcc_sk(struct sock *sk) -{ - unlink_vcc(sk->protinfo.af_atm); - sk_free(sk); -} - - -void bind_vcc(struct atm_vcc *vcc,struct atm_dev *dev) -{ - unsigned long flags; - - unlink_vcc(vcc); - vcc->dev = dev; - if (dev) { - spin_lock_irqsave(&dev->lock, flags); - vcc->next = NULL; - vcc->prev = dev->last; - if (dev->vccs) dev->last->next = vcc; - else dev->vccs = vcc; - dev->last = vcc; - spin_unlock_irqrestore(&dev->lock, flags); - } -} - - EXPORT_SYMBOL(atm_dev_register); EXPORT_SYMBOL(atm_dev_deregister); EXPORT_SYMBOL(atm_dev_lookup); EXPORT_SYMBOL(shutdown_atm_dev); -EXPORT_SYMBOL(bind_vcc); diff -Nru a/net/atm/resources.h b/net/atm/resources.h --- a/net/atm/resources.h Mon Oct 13 18:41:38 2003 +++ b/net/atm/resources.h Mon Oct 13 18:41:38 2003 @@ -14,8 +14,6 @@ extern spinlock_t atm_dev_lock; -struct sock *alloc_atm_vcc_sk(int family); -void free_atm_vcc_sk(struct sock *sk); int atm_dev_ioctl(unsigned int cmd, unsigned long arg); diff -Nru a/net/atm/signaling.c b/net/atm/signaling.c --- a/net/atm/signaling.c Mon Oct 13 18:41:38 2003 +++ b/net/atm/signaling.c Mon Oct 13 18:41:38 2003 @@ -199,26 +199,21 @@ } -static void purge_vccs(struct atm_vcc *vcc) +static void purge_vcc(struct atm_vcc *vcc) { - while (vcc) { - if (vcc->sk->family == PF_ATMSVC && - !test_bit(ATM_VF_META,&vcc->flags)) { - set_bit(ATM_VF_RELEASED,&vcc->flags); - vcc->reply = -EUNATCH; - vcc->sk->err = EUNATCH; - wake_up(&vcc->sleep); - } - vcc = vcc->next; + if (vcc->sk->family == PF_ATMSVC && + !test_bit(ATM_VF_META, &vcc->flags)) { + set_bit(ATM_VF_RELEASED, &vcc->flags); + vcc->reply = -EUNATCH; + vcc->sk->err = EUNATCH; + wake_up(&vcc->sleep); } } static void sigd_close(struct atm_vcc *vcc) { - unsigned long flags; - struct atm_dev *dev; - struct list_head *p; + struct sock *s; DPRINTK("sigd_close\n"); sigd = NULL; @@ -226,14 +221,14 @@ printk(KERN_ERR "sigd_close: closing with requests pending\n"); skb_queue_purge(&vcc->sk->receive_queue); - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - spin_lock_irqsave(&dev->lock, flags); - purge_vccs(dev->vccs); - spin_unlock_irqrestore(&dev->lock, flags); + read_lock(&vcc_sklist_lock); + for(s = vcc_sklist; s; s = s->next) { + struct atm_vcc *vcc = s->protinfo.af_atm; + + if (vcc->dev) + purge_vcc(vcc); } - spin_unlock(&atm_dev_lock); + read_unlock(&vcc_sklist_lock); } @@ -256,7 +251,8 @@ if (sigd) return -EADDRINUSE; DPRINTK("sigd_attach\n"); sigd = vcc; - bind_vcc(vcc,&sigd_dev); + vcc->dev = &sigd_dev; + vcc_insert_socket(vcc->sk); set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); wake_up(&sigd_sleep); diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c Mon Oct 13 18:41:38 2003 +++ b/net/atm/svc.c Mon Oct 13 18:41:38 2003 @@ -89,18 +89,21 @@ static int svc_release(struct socket *sock) { + struct sock *sk = sock->sk; struct atm_vcc *vcc; - if (!sock->sk) return 0; - vcc = ATM_SD(sock); - DPRINTK("svc_release %p\n",vcc); - clear_bit(ATM_VF_READY,&vcc->flags); - atm_release_vcc_sk(sock->sk,0); - svc_disconnect(vcc); - /* VCC pointer is used as a reference, so we must not free it - (thereby subjecting it to re-use) before all pending connections - are closed */ - free_atm_vcc_sk(sock->sk); + if (sk) { + vcc = ATM_SD(sock); + DPRINTK("svc_release %p\n", vcc); + clear_bit(ATM_VF_READY, &vcc->flags); + /* VCC pointer is used as a reference, so we must not free it + (thereby subjecting it to re-use) before all pending connections + are closed */ + sock_hold(sk); + vcc_release(sock); + svc_disconnect(vcc); + sock_put(sk); + } return 0; } @@ -538,7 +541,7 @@ int error; sock->ops = &svc_proto_ops; - error = atm_create(sock,protocol,AF_ATMSVC); + error = vcc_create(sock, protocol, AF_ATMSVC); if (error) return error; ATM_SD(sock)->callback = svc_callback; ATM_SD(sock)->local.sas_family = AF_ATMSVC; From chas@cmf.nrl.navy.mil Mon Oct 13 20:47:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 20:47:57 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E3lO25002712 for ; Mon, 13 Oct 2003 20:47:24 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9E3lIkT005624; Mon, 13 Oct 2003 23:47:18 -0400 (EDT) Message-Id: <200310140347.h9E3lIkT005624@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM][6/6] setsockopt/getsockopt cleanup Reply-To: chas3@users.sourceforge.net Date: Mon, 13 Oct 2003 23:47:19 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 783 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.4 --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1144 -> 1.1145 # net/atm/pvc.c 1.9 -> 1.10 # net/atm/svc.c 1.10 -> 1.11 # net/atm/common.h 1.9 -> 1.10 # net/atm/common.c 1.26 -> 1.27 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/13 chas@relax.cmf.nrl.navy.mil 1.1145 # [ATM]: setsockopt/getsockopt cleanup # -------------------------------------------- # diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Mon Oct 13 18:41:42 2003 +++ b/net/atm/common.c Mon Oct 13 18:41:42 2003 @@ -987,14 +987,16 @@ return check_tp(&qos->rxtp); } - -static int atm_do_setsockopt(struct socket *sock,int level,int optname, - void *optval,int optlen) +int vcc_setsockopt(struct socket *sock, int level, int optname, + char *optval, int optlen) { struct atm_vcc *vcc; unsigned long value; int error; + if (__SO_LEVEL_MATCH(optname, level) && optlen != __SO_SIZE(optname)) + return -EINVAL; + vcc = ATM_SD(sock); switch (optname) { case SO_ATMQOS: @@ -1028,10 +1030,16 @@ } -static int atm_do_getsockopt(struct socket *sock,int level,int optname, - void *optval,int optlen) +int vcc_getsockopt(struct socket *sock, int level, int optname, + char *optval, int *optlen) { struct atm_vcc *vcc; + int len; + + if (get_user(len, optlen)) + return -EFAULT; + if (__SO_LEVEL_MATCH(optname, level) && len != __SO_SIZE(optname)) + return -EINVAL; vcc = ATM_SD(sock); switch (optname) { @@ -1062,28 +1070,7 @@ break; } if (!vcc->dev || !vcc->dev->ops->getsockopt) return -EINVAL; - return vcc->dev->ops->getsockopt(vcc,level,optname,optval,optlen); -} - - -int atm_setsockopt(struct socket *sock,int level,int optname,char *optval, - int optlen) -{ - if (__SO_LEVEL_MATCH(optname, level) && optlen != __SO_SIZE(optname)) - return -EINVAL; - return atm_do_setsockopt(sock,level,optname,optval,optlen); -} - - -int atm_getsockopt(struct socket *sock,int level,int optname, - char *optval,int *optlen) -{ - int len; - - if (get_user(len,optlen)) return -EFAULT; - if (__SO_LEVEL_MATCH(optname, level) && len != __SO_SIZE(optname)) - return -EINVAL; - return atm_do_getsockopt(sock,level,optname,optval,len); + return vcc->dev->ops->getsockopt(vcc, level, optname, optval, len); } diff -Nru a/net/atm/common.h b/net/atm/common.h --- a/net/atm/common.h Mon Oct 13 18:41:42 2003 +++ b/net/atm/common.h Mon Oct 13 18:41:42 2003 @@ -19,10 +19,10 @@ struct scm_cookie *scm); unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait); int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); -int atm_setsockopt(struct socket *sock,int level,int optname,char *optval, - int optlen); -int atm_getsockopt(struct socket *sock,int level,int optname,char *optval, - int *optlen); +int vcc_setsockopt(struct socket *sock, int level, int optname, char *optval, + int optlen); +int vcc_getsockopt(struct socket *sock, int level, int optname, char *optval, + int *optlen); void atm_shutdown_dev(struct atm_dev *dev); diff -Nru a/net/atm/pvc.c b/net/atm/pvc.c --- a/net/atm/pvc.c Mon Oct 13 18:41:42 2003 +++ b/net/atm/pvc.c Mon Oct 13 18:41:42 2003 @@ -67,7 +67,7 @@ int error; lock_sock(sk); - error = atm_setsockopt(sock, level, optname, optval, optlen); + error = vcc_setsockopt(sock, level, optname, optval, optlen); release_sock(sk); return error; } @@ -80,7 +80,7 @@ int error; lock_sock(sk); - error = atm_getsockopt(sock, level, optname, optval, optlen); + error = vcc_getsockopt(sock, level, optname, optval, optlen); release_sock(sk); return error; } diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c Mon Oct 13 18:41:42 2003 +++ b/net/atm/svc.c Mon Oct 13 18:41:42 2003 @@ -470,7 +470,7 @@ if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP || optlen != sizeof(struct atm_sap)) { - error = atm_setsockopt(sock, level, optname, optval, optlen); + error = vcc_setsockopt(sock, level, optname, optval, optlen); goto out; } vcc = ATM_SD(sock); @@ -493,7 +493,7 @@ lock_sock(sk); if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP) { - error = atm_getsockopt(sock, level, optname, optval, optlen); + error = vcc_getsockopt(sock, level, optname, optval, optlen); goto out; } if (get_user(len, optlen)) { From noah@caltech.edu Mon Oct 13 22:18:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 22:18:39 -0700 (PDT) Received: from earth-ox.its.caltech.edu (SteeleMR-loadb-NAT-49.caltech.edu [131.215.49.69]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E5I425005146 for ; Mon, 13 Oct 2003 22:18:04 -0700 Received: from fire-dog (fire-dog [192.168.1.4]) by earth-ox-postvirus (Postfix) with ESMTP id E8DA0109A98; Mon, 13 Oct 2003 22:17:58 -0700 (PDT) Received: from earth-ox ([192.168.1.9]) by fire-dog (MailMonitor for SMTP v1.2.2 ) ; Mon, 13 Oct 2003 22:17:57 -0700 (PDT) Received: from blinky.its.caltech.edu (blinky.its.caltech.edu [131.215.48.132]) by earth-ox.its.caltech.edu (Postfix) with ESMTP id A0578109A95; Mon, 13 Oct 2003 22:17:57 -0700 (PDT) Received: from localhost (noah@localhost) by blinky.its.caltech.edu (8.12.9/8.12.8) with ESMTP id h9E5Hvso014363; Mon, 13 Oct 2003 22:17:57 -0700 (PDT) X-Authentication-Warning: blinky.its.caltech.edu: noah owned process doing -bs Date: Mon, 13 Oct 2003 22:17:57 -0700 (PDT) From: "Noah J. Misch" X-X-Sender: noah@blinky To: "Randy.Dunlap" Cc: maxk@qualcomm.com, netdev@oss.sgi.com, davem@redhat.com Subject: Re: patches for PROC_FS=n (2.6.0-test7) In-Reply-To: <20031012191725.093139d5.rddunlap@osdl.org> Message-ID: References: <20031012191725.093139d5.rddunlap@osdl.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 784 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: noah@caltech.edu Precedence: bulk X-list: netdev Randy, That fix looks like the best to me. I did notice also that proc_bt_rfcomm and proc_bt_hci have similar #ifdef wrappers. I think that's okay since they aren't EXPORT_SYMBOL-ed, and they're used in fewer places. FYI, IPX won't compile without CONFIG_PROC_FS at this time. The merged patch depended on a patch that I sent to Linus and posted to linux-kernel alongside the IPX patch. I also sent them to linux-net (accidentally, instead of netdev). I may need to resend that patch. In the mean time, if you actually need to use IPX without procfs, you can grab the patch (and rationale) here: http://www.ussg.iu.edu/hypermail/linux/kernel/0310.1/0452.html FYI #2, from elsewhere in the department of fixing exotic breakage, I'm working on patches that will allow one to compile a linux kernel under Unix and other similar systems. I've gotten allnoconfig for i386 to build from Solaris 2.7 on sun4u, but a number of the userspace tools that support the build process of optional components need a bit more help. On Sun, 12 Oct 2003, Randy.Dunlap wrote: > On Fri, 10 Oct 2003 16:06:29 -0700 (PDT) "Noah J. Misch" wrote: > > | > There are several other drivers/protocols that don't build > | > with PROC_FS=n, like arlan, siimage, ipx, llc, and bluetooth. > | > | I put in a patch for ipx yesterday, and I have patches for siimage and llc > | pretty much ready to go. I noticed the others but I have not done much. > > ipx is merged. I'll leave siimage and llc to Noah. > Patch below fixes af_bluetooth. Comments on it? > > -- > ~Randy > > > patch_name: bt_noprocfs.patch > patch_version: 2003-10-12.19:11:03 > author: Randy.Dunlap > description: af_bluetooth uses/needs proc_bt when PROC_FS=n > product: Linux > product_versions: 2.6.0-test7 > diffstat: = > net/bluetooth/af_bluetooth.c | 2 -- > 1 files changed, 2 deletions(-) > > > diff -Naur ./net/bluetooth/af_bluetooth.c~btprocfs ./net/bluetooth/af_bluetooth.c > --- ./net/bluetooth/af_bluetooth.c~btprocfs 2003-10-08 12:24:02.000000000 -0700 > +++ ./net/bluetooth/af_bluetooth.c 2003-10-12 19:09:11.000000000 -0700 > @@ -56,9 +56,7 @@ > #define BT_DBG( A... ) > #endif > > -#ifdef CONFIG_PROC_FS > struct proc_dir_entry *proc_bt; > -#endif > > /* Bluetooth sockets */ > #define BT_MAX_PROTO 5 > > From noah@caltech.edu Mon Oct 13 22:53:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 22:53:43 -0700 (PDT) Received: from earth-ox.its.caltech.edu (SteeleMR-loadb-NAT-49.caltech.edu [131.215.49.69]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E5r425006214 for ; Mon, 13 Oct 2003 22:53:04 -0700 Received: from fire-dog (fire-dog [192.168.1.4]) by earth-ox-postvirus (Postfix) with ESMTP id D2C2B109A50; Mon, 13 Oct 2003 22:52:58 -0700 (PDT) Received: from earth-ox ([192.168.1.9]) by fire-dog (MailMonitor for SMTP v1.2.2 ) ; Mon, 13 Oct 2003 22:52:57 -0700 (PDT) Received: from blinky.its.caltech.edu (blinky.its.caltech.edu [131.215.48.132]) by earth-ox.its.caltech.edu (Postfix) with ESMTP id 83AAC109A6F; Mon, 13 Oct 2003 22:52:57 -0700 (PDT) Received: from localhost (noah@localhost) by blinky.its.caltech.edu (8.12.9/8.12.8) with ESMTP id h9E5quxh015760; Mon, 13 Oct 2003 22:52:56 -0700 (PDT) X-Authentication-Warning: blinky.its.caltech.edu: noah owned process doing -bs Date: Mon, 13 Oct 2003 22:52:56 -0700 (PDT) From: "Noah J. Misch" X-X-Sender: noah@blinky To: "Randy.Dunlap" , Elmer.Joandi@ut.ee, elmer@ylenurme.ee Cc: netdev@oss.sgi.com Subject: Re: patches for PROC_FS=n (2.6.0-test7) In-Reply-To: <20031012201316.7ecf73c8.rddunlap@osdl.org> Message-ID: References: <20031012201316.7ecf73c8.rddunlap@osdl.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 785 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: noah@caltech.edu Precedence: bulk X-list: netdev Randy, I poked around the driver a bit and uncovered a few points that suggest to me a different approach to the problem. The file arlan-proc.c contains a number of functions supporting the driver's sysctl interface. Nothing in that file appears procfs-specific. I would change the Makefile to compile arlan-proc.c depending on CONFIG_SYSCTL and remove the #ifdef CONFIG_PROC_FS guarding much of that file. I would then make arlan.h define macro or static inline stubs for init_arlan_proc and cleanup_arlan_proc much like the current arlan.h does. For the matter, perhaps one could add an extra config option, ARLAN_SYSCTL, that depends on ARLAN and SYSCTL, and conditional-compile arlan-proc.c on that instead of CONFIG_SYSCTL itself. That way, users could leave it out to save space without zapping all sysctls. I would go for this approach myself. The configuration help text for the arlan driver claims that it builds a module for the driver and another for its sysctl interface. It doesn't do that at the moment, but that is another option (though not one I like as much). What do you think? On Sun, 12 Oct 2003, Randy.Dunlap wrote: > On Fri, 10 Oct 2003 16:06:29 -0700 (PDT) "Noah J. Misch" wrote: > > | > There are several other drivers/protocols that don't build > | > with PROC_FS=n, like arlan, siimage, ipx, llc, and bluetooth. > > > Here's a patch for the wireless/arlan driver for PROC_FS=n. > Currently it defines both a function and a macro for > init_arlan_proc() if PROC_FS=n. This causes a bunch of > compile-time errors. > > It looks to me like it should always call the init_arlan_proc() > (and cleanup_arlan_proc()) functions since it inits some sysctl tables. > Or am I misunderstanding it? > > Thanks, > -- > ~Randy > > > patch_name: arlan_noprocfs.patch > patch_version: 2003-10-12.19:46:24 > author: Randy.Dunlap > description: use init_arlan_proc() for sysctl inits > product: Linux > product_versions: 2.6.0-test7 > diffstat: = > drivers/net/wireless/arlan.h | 5 ----- > 1 files changed, 5 deletions(-) > > > diff -Naur ./drivers/net/wireless/arlan.h~arlanprocfs ./drivers/net/wireless/arlan.h > --- ./drivers/net/wireless/arlan.h~arlanprocfs 2003-10-08 12:24:08.000000000 -0700 > +++ ./drivers/net/wireless/arlan.h 2003-10-12 19:45:46.000000000 -0700 > @@ -39,13 +39,8 @@ > #define ARLAN_RCV_PROMISC 1 > #define ARLAN_RCV_CONTROL 2 > > -#ifdef CONFIG_PROC_FS > extern int init_arlan_proc(void); > extern void cleanup_arlan_proc(void); > -#else > -#define init_arlan_proc() (0) > -#define cleanup_arlan_proc() do { } while (0); > -#endif > > extern struct net_device *arlan_device[MAX_ARLANS]; > extern int arlan_debug; > > From rddunlap@osdl.org Mon Oct 13 23:14:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 13 Oct 2003 23:14:44 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E6E625006972 for ; Mon, 13 Oct 2003 23:14:07 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9E6Dmo01974; Mon, 13 Oct 2003 23:13:48 -0700 Date: Mon, 13 Oct 2003 23:12:31 -0700 From: "Randy.Dunlap" To: "Noah J. Misch" Cc: Elmer.Joandi@ut.ee, elmer@ylenurme.ee, netdev@oss.sgi.com Subject: Re: patches for PROC_FS=n (2.6.0-test7) Message-Id: <20031013231231.791317ff.rddunlap@osdl.org> In-Reply-To: References: <20031012201316.7ecf73c8.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (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: 786 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev On Mon, 13 Oct 2003 22:52:56 -0700 (PDT) "Noah J. Misch" wrote: | Randy, | | I poked around the driver a bit and uncovered a few points that suggest to me a | different approach to the problem. | | The file arlan-proc.c contains a number of functions supporting the driver's | sysctl interface. Nothing in that file appears procfs-specific. Right. | I would change the Makefile to compile arlan-proc.c depending on CONFIG_SYSCTL | and remove the #ifdef CONFIG_PROC_FS guarding much of that file. I would then | make arlan.h define macro or static inline stubs for init_arlan_proc and | cleanup_arlan_proc much like the current arlan.h does. That's about what I was planning to do next if I didn't hear anything else from Elmer. | For the matter, perhaps one could add an extra config option, ARLAN_SYSCTL, that | depends on ARLAN and SYSCTL, and conditional-compile arlan-proc.c on that | instead of CONFIG_SYSCTL itself. That way, users could leave it out to save | space without zapping all sysctls. I would go for this approach myself. I wouldn't prefer this, but if you make the patch, do whatever you want. I think that CONFIG_SYSCTL should be enough to determine/decide/control it. | The configuration help text for the arlan driver claims that it builds a module | for the driver and another for its sysctl interface. It doesn't do that at the | moment, but that is another option (though not one I like as much). I missed this config help text. Glad you caught it. But I wouldn't make that a separate module. | What do you think? Go ahead, your choice, but my preferences are above. | On Sun, 12 Oct 2003, Randy.Dunlap wrote: | | > On Fri, 10 Oct 2003 16:06:29 -0700 (PDT) "Noah J. Misch" wrote: | > | > | > There are several other drivers/protocols that don't build | > | > with PROC_FS=n, like arlan, siimage, ipx, llc, and bluetooth. | > | > | > Here's a patch for the wireless/arlan driver for PROC_FS=n. | > Currently it defines both a function and a macro for | > init_arlan_proc() if PROC_FS=n. This causes a bunch of | > compile-time errors. | > | > It looks to me like it should always call the init_arlan_proc() | > (and cleanup_arlan_proc()) functions since it inits some sysctl tables. | > Or am I misunderstanding it? Thanks. And I hope that your mailbox is functional now. -- ~Randy From elmer@linking.ee Tue Oct 14 00:41:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 00:42:12 -0700 (PDT) Received: from linking.ee (11.ylenurme.ee [193.40.6.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E7fb25011863 for ; Tue, 14 Oct 2003 00:41:38 -0700 Received: (qmail 1068 invoked by uid 64014); 14 Oct 2003 08:39:52 -0000 Received: from elmer@linking.ee by server by uid 64011 with qmail-scanner-1.16 ( Clear:. Processed in 0.011507 secs); 14 Oct 2003 08:39:52 -0000 Received: from mail.linking.sise ([10.110.0.21]) (envelope-sender ) by mail.linking.sise (qmail-ldap-1.03) with SMTP for ; 14 Oct 2003 08:39:52 -0000 Date: Tue, 14 Oct 2003 10:39:52 +0200 (EET) From: Elmer X-X-Sender: elmer@server To: "Randy.Dunlap" cc: "Noah J. Misch" , "netdev@oss.sgi.com" Subject: Re: patches for PROC_FS=n (2.6.0-test7) In-Reply-To: <20031013231231.791317ff.rddunlap@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 787 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: elmer@linking.ee Precedence: bulk X-list: netdev on the other hand, consider following: 1. the card is shit, also, on ISA interface 2. most people do write configuration parameters into cards BIOS under DOS and do not need interface for configuration. 3. all of contents should be in /proc/sys , as far as I remember, I have tried to implement all via sysctl rather than procfs io. 4. there is a file, reading of which causes card reset. Most of people need this. Therefore sensible solution would be simple, whatever it is. Elmer. From chas@cmf.nrl.navy.mil Tue Oct 14 02:02:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 02:03:27 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E92n25013687 for ; Tue, 14 Oct 2003 02:02:52 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9E3jIkT005594; Mon, 13 Oct 2003 23:45:18 -0400 (EDT) Message-Id: <200310140345.h9E3jIkT005594@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM][3/6] cleanup connect Reply-To: chas3@users.sourceforge.net Date: Mon, 13 Oct 2003 23:45:18 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 789 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.4 --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1138 -> 1.1139 # net/atm/pvc.c 1.6 -> 1.7 # net/atm/svc.c 1.7 -> 1.8 # net/atm/common.h 1.6 -> 1.7 # net/atm/common.c 1.23 -> 1.24 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/29 chas@relax.cmf.nrl.navy.mil 1.1139 # [ATM]: cleanup connect # -------------------------------------------- # diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Mon Oct 13 18:41:18 2003 +++ b/net/atm/common.c Mon Oct 13 18:41:18 2003 @@ -298,8 +298,8 @@ } -static int atm_do_connect_dev(struct atm_vcc *vcc,struct atm_dev *dev,int vpi, - int vci) +static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, int vpi, + int vci) { int error; @@ -310,6 +310,8 @@ if (vci > 0 && vci < ATM_NOT_RSV_VCI && !capable(CAP_NET_BIND_SERVICE)) return -EPERM; error = 0; + if (!try_inc_mod_count(dev->ops->owner)) + return -ENODEV; bind_vcc(vcc,dev); switch (vcc->qos.aal) { case ATM_AAL0: @@ -333,53 +335,48 @@ } if (!error) error = adjust_tp(&vcc->qos.txtp,vcc->qos.aal); if (!error) error = adjust_tp(&vcc->qos.rxtp,vcc->qos.aal); - if (error) { - bind_vcc(vcc,NULL); - return error; - } + if (error) + goto fail; DPRINTK("VCC %d.%d, AAL %d\n",vpi,vci,vcc->qos.aal); DPRINTK(" TX: %d, PCR %d..%d, SDU %d\n",vcc->qos.txtp.traffic_class, vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu); DPRINTK(" RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.traffic_class, vcc->qos.rxtp.min_pcr,vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu); - if (!try_inc_mod_count(dev->ops->owner)) - return -ENODEV; if (dev->ops->open) { - error = dev->ops->open(vcc,vpi,vci); - if (error) { - if (dev->ops->owner) - __MOD_DEC_USE_COUNT(dev->ops->owner); - bind_vcc(vcc,NULL); - return error; - } + if ((error = dev->ops->open(vcc,vpi,vci))) + goto fail; } return 0; + +fail: + bind_vcc(vcc, NULL); + if (dev->ops->owner) + __MOD_DEC_USE_COUNT(dev->ops->owner); + return error; + } -static int atm_do_connect(struct atm_vcc *vcc,int itf,int vpi,int vci) +int vcc_connect(struct socket *sock, int itf, short vpi, int vci) { struct atm_dev *dev; - int return_val; - - dev = atm_dev_lookup(itf); - if (!dev) - return_val = -ENODEV; - else { - return_val = atm_do_connect_dev(vcc,dev,vpi,vci); - if (return_val) atm_dev_release(dev); - } - - return return_val; -} + struct atm_vcc *vcc = ATM_SD(sock); + int error; + DPRINTK("vcc_connect (vpi %d, vci %d)\n",vpi,vci); + if (sock->state == SS_CONNECTED) + return -EISCONN; + if (sock->state != SS_UNCONNECTED) + return -EINVAL; + if (!(vpi || vci)) + return -EINVAL; -int atm_connect_vcc(struct atm_vcc *vcc,int itf,short vpi,int vci) -{ if (vpi != ATM_VPI_UNSPEC && vci != ATM_VCI_UNSPEC) clear_bit(ATM_VF_PARTIAL,&vcc->flags); - else if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) return -EINVAL; - DPRINTK("atm_connect (TX: cl %d,bw %d-%d,sdu %d; " + else + if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) + return -EINVAL; + DPRINTK("vcc_connect (TX: cl %d,bw %d-%d,sdu %d; " "RX: cl %d,bw %d-%d,sdu %d,AAL %s%d)\n", vcc->qos.txtp.traffic_class,vcc->qos.txtp.min_pcr, vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu, @@ -387,50 +384,41 @@ vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu, vcc->qos.aal == ATM_AAL5 ? "" : vcc->qos.aal == ATM_AAL0 ? "" : " ??? code ",vcc->qos.aal == ATM_AAL0 ? 0 : vcc->qos.aal); - if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD; + if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) + return -EBADFD; if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS || vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) return -EINVAL; if (itf != ATM_ITF_ANY) { - int error; - - error = atm_do_connect(vcc,itf,vpi,vci); - if (error) return error; - } - else { - struct atm_dev *dev = NULL; + dev = atm_dev_lookup(itf); + if (!dev) + return -ENODEV; + error = __vcc_connect(vcc, dev, vpi, vci); + if (error) { + atm_dev_release(dev); + return error; + } + } else { struct list_head *p, *next; + dev = NULL; spin_lock(&atm_dev_lock); list_for_each_safe(p, next, &atm_devs) { dev = list_entry(p, struct atm_dev, dev_list); atm_dev_hold(dev); spin_unlock(&atm_dev_lock); - if (!atm_do_connect_dev(vcc,dev,vpi,vci)) + if (!__vcc_connect(vcc, dev, vpi, vci)) break; atm_dev_release(dev); dev = NULL; spin_lock(&atm_dev_lock); } spin_unlock(&atm_dev_lock); - if (!dev) return -ENODEV; + if (!dev) + return -ENODEV; } if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC) set_bit(ATM_VF_PARTIAL,&vcc->flags); - return 0; -} - - -int atm_connect(struct socket *sock,int itf,short vpi,int vci) -{ - int error; - - DPRINTK("atm_connect (vpi %d, vci %d)\n",vpi,vci); - if (sock->state == SS_CONNECTED) return -EISCONN; - if (sock->state != SS_UNCONNECTED) return -EINVAL; - if (!(vpi || vci)) return -EINVAL; - error = atm_connect_vcc(ATM_SD(sock),itf,vpi,vci); - if (error) return error; if (test_bit(ATM_VF_READY,&ATM_SD(sock)->flags)) sock->state = SS_CONNECTED; return 0; diff -Nru a/net/atm/common.h b/net/atm/common.h --- a/net/atm/common.h Mon Oct 13 18:41:18 2003 +++ b/net/atm/common.h Mon Oct 13 18:41:18 2003 @@ -12,7 +12,7 @@ int atm_create(struct socket *sock,int protocol,int family); int atm_release(struct socket *sock); -int atm_connect(struct socket *sock,int itf,short vpi,int vci); +int vcc_connect(struct socket *sock, int itf, short vpi, int vci); int vcc_recvmsg(struct socket *sock, struct msghdr *msg, int size, int flags, struct scm_cookie *scm); int atm_sendmsg(struct socket *sock,struct msghdr *m,int total_len, @@ -24,7 +24,6 @@ int atm_getsockopt(struct socket *sock,int level,int optname,char *optval, int *optlen); -int atm_connect_vcc(struct atm_vcc *vcc,int itf,short vpi,int vci); void atm_release_vcc_sk(struct sock *sk,int free_sk); void atm_shutdown_dev(struct atm_dev *dev); diff -Nru a/net/atm/pvc.c b/net/atm/pvc.c --- a/net/atm/pvc.c Mon Oct 13 18:41:18 2003 +++ b/net/atm/pvc.c Mon Oct 13 18:41:18 2003 @@ -44,8 +44,8 @@ if (vcc->vpi != ATM_VPI_UNSPEC) addr->sap_addr.vpi = vcc->vpi; if (vcc->vci != ATM_VCI_UNSPEC) addr->sap_addr.vci = vcc->vci; } - return atm_connect(sock,addr->sap_addr.itf,addr->sap_addr.vpi, - addr->sap_addr.vci); + return vcc_connect(sock, addr->sap_addr.itf, addr->sap_addr.vpi, + addr->sap_addr.vci); } diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c Mon Oct 13 18:41:18 2003 +++ b/net/atm/svc.c Mon Oct 13 18:41:18 2003 @@ -229,7 +229,7 @@ /* * #endif */ - if (!(error = atm_connect(sock,vcc->itf,vcc->vpi,vcc->vci))) + if (!(error = vcc_connect(sock, vcc->itf, vcc->vpi, vcc->vci))) sock->state = SS_CONNECTED; else (void) svc_disconnect(vcc); return error; @@ -304,8 +304,8 @@ new_vcc->remote = msg->svc; new_vcc->local = msg->local; new_vcc->sap = msg->sap; - error = atm_connect(newsock,msg->pvc.sap_addr.itf, - msg->pvc.sap_addr.vpi,msg->pvc.sap_addr.vci); + error = vcc_connect(newsock, msg->pvc.sap_addr.itf, + msg->pvc.sap_addr.vpi, msg->pvc.sap_addr.vci); dev_kfree_skb(skb); old_vcc->sk->ack_backlog--; if (error) { From chas@cmf.nrl.navy.mil Tue Oct 14 02:02:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 02:03:27 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E92n27013687 for ; Tue, 14 Oct 2003 02:02:53 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9E3hAkT005566; Mon, 13 Oct 2003 23:43:10 -0400 (EDT) Message-Id: <200310140343.h9E3hAkT005566@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: rewrite recvmsg to use skb_copy_datagram_iovec Reply-To: chas3@users.sourceforge.net Date: Mon, 13 Oct 2003 23:43:10 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 788 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.4 --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1136 -> 1.1137 # net/atm/mpoa_caches.c 1.1 -> 1.2 # include/linux/atmdev.h 1.9 -> 1.10 # net/atm/pvc.c 1.5 -> 1.6 # net/atm/clip.c 1.10 -> 1.11 # net/atm/lec.c 1.18 -> 1.19 # net/atm/svc.c 1.5 -> 1.6 # net/atm/common.h 1.5 -> 1.6 # net/atm/signaling.c 1.5 -> 1.6 # net/atm/common.c 1.21 -> 1.22 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/29 chas@relax.cmf.nrl.navy.mil 1.1137 # [ATM]: rewrite recvmsg to use skb_copy_datagram_iovec # -------------------------------------------- # diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h Mon Oct 13 18:41:06 2003 +++ b/include/linux/atmdev.h Mon Oct 13 18:41:06 2003 @@ -461,7 +461,7 @@ int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci); int atm_pcr_goal(struct atm_trafprm *tp); -void atm_async_release_vcc(struct atm_vcc *vcc,int reply); +void vcc_release_async(struct atm_vcc *vcc, int reply); #endif /* __KERNEL__ */ diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Mon Oct 13 18:41:06 2003 +++ b/net/atm/clip.c Mon Oct 13 18:41:06 2003 @@ -144,8 +144,8 @@ DPRINTK("releasing vcc %p->%p of " "entry %p\n",clip_vcc,clip_vcc->vcc, entry); - atm_async_release_vcc(clip_vcc->vcc, - -ETIMEDOUT); + vcc_release_async(clip_vcc->vcc, + -ETIMEDOUT); } if (entry->vccs || time_before(jiffies, entry->expires)) { diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Mon Oct 13 18:41:06 2003 +++ b/net/atm/common.c Mon Oct 13 18:41:06 2003 @@ -261,15 +261,16 @@ } -void atm_async_release_vcc(struct atm_vcc *vcc,int reply) +void vcc_release_async(struct atm_vcc *vcc, int reply) { - set_bit(ATM_VF_CLOSE,&vcc->flags); + set_bit(ATM_VF_CLOSE, &vcc->flags); vcc->reply = reply; + vcc->sk->err = -reply; wake_up(&vcc->sleep); } -EXPORT_SYMBOL(atm_async_release_vcc); +EXPORT_SYMBOL(vcc_release_async); static int adjust_tp(struct atm_trafprm *tp,unsigned char aal) @@ -437,63 +438,49 @@ } -int atm_recvmsg(struct socket *sock,struct msghdr *m,int total_len, - int flags,struct scm_cookie *scm) +int vcc_recvmsg(struct socket *sock, struct msghdr *msg, + int size, int flags, struct scm_cookie *scm) { - DECLARE_WAITQUEUE(wait,current); - struct atm_vcc *vcc; - struct sk_buff *skb; - int eff_len,error; - void *buff; - int size; - - if (sock->state != SS_CONNECTED) return -ENOTCONN; - if (flags & ~MSG_DONTWAIT) return -EOPNOTSUPP; - if (m->msg_iovlen != 1) return -ENOSYS; /* fix this later @@@ */ - buff = m->msg_iov->iov_base; - size = m->msg_iov->iov_len; - vcc = ATM_SD(sock); - add_wait_queue(&vcc->sleep,&wait); - set_current_state(TASK_INTERRUPTIBLE); - error = 1; /* <= 0 is error */ - while (!(skb = skb_dequeue(&vcc->sk->receive_queue))) { - if (test_bit(ATM_VF_RELEASED,&vcc->flags) || - test_bit(ATM_VF_CLOSE,&vcc->flags)) { - error = vcc->reply; - break; - } - if (!test_bit(ATM_VF_READY,&vcc->flags)) { - error = 0; - break; - } - if (flags & MSG_DONTWAIT) { - error = -EAGAIN; - break; - } - schedule(); - set_current_state(TASK_INTERRUPTIBLE); - if (signal_pending(current)) { - error = -ERESTARTSYS; - break; - } - } - set_current_state(TASK_RUNNING); - remove_wait_queue(&vcc->sleep,&wait); - if (error <= 0) return error; - sock_recv_timestamp(m, vcc->sk, skb); - eff_len = skb->len > size ? size : skb->len; - if (skb->len > size) /* Not fit ? Report it... */ - m->msg_flags |= MSG_TRUNC; + struct sock *sk = sock->sk; + struct atm_vcc *vcc; + struct sk_buff *skb; + int copied, error = -EINVAL; + + if (sock->state != SS_CONNECTED) + return -ENOTCONN; + if (flags & ~MSG_DONTWAIT) /* only handle MSG_DONTWAIT */ + return -EOPNOTSUPP; + vcc = ATM_SD(sock); + if (test_bit(ATM_VF_RELEASED,&vcc->flags) || + test_bit(ATM_VF_CLOSE,&vcc->flags)) + return vcc->reply; + if (!test_bit(ATM_VF_READY, &vcc->flags)) + return 0; + + skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &error); + if (!skb) + return error; + + copied = skb->len; + if (copied > size) { + copied = size; + msg->msg_flags |= MSG_TRUNC; + } + + error = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); + if (error) + return error; + sock_recv_timestamp(msg, sk, skb); if (vcc->dev->ops->feedback) - vcc->dev->ops->feedback(vcc,skb,(unsigned long) skb->data, - (unsigned long) buff,eff_len); - DPRINTK("RcvM %d -= %d\n",atomic_read(&vcc->sk->rmem_alloc),skb->truesize); - atm_return(vcc,skb->truesize); - error = copy_to_user(buff,skb->data,eff_len) ? -EFAULT : 0; - kfree_skb(skb); - return error ? error : eff_len; + vcc->dev->ops->feedback(vcc, skb, (unsigned long) skb->data, + (unsigned long) msg->msg_iov->iov_base, copied); + DPRINTK("RcvM %d -= %d\n", atomic_read(&vcc->sk->rmem_alloc), skb->truesize); + atm_return(vcc, skb->truesize); + skb_free_datagram(sk, skb); + return copied; } - + + int atm_sendmsg(struct socket *sock,struct msghdr *m,int total_len, struct scm_cookie *scm) diff -Nru a/net/atm/common.h b/net/atm/common.h --- a/net/atm/common.h Mon Oct 13 18:41:06 2003 +++ b/net/atm/common.h Mon Oct 13 18:41:06 2003 @@ -13,8 +13,8 @@ int atm_create(struct socket *sock,int protocol,int family); int atm_release(struct socket *sock); int atm_connect(struct socket *sock,int itf,short vpi,int vci); -int atm_recvmsg(struct socket *sock,struct msghdr *m,int total_len, - int flags,struct scm_cookie *scm); +int vcc_recvmsg(struct socket *sock, struct msghdr *msg, + int size, int flags, struct scm_cookie *scm); int atm_sendmsg(struct socket *sock,struct msghdr *m,int total_len, struct scm_cookie *scm); unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait); diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c Mon Oct 13 18:41:06 2003 +++ b/net/atm/lec.c Mon Oct 13 18:41:06 2003 @@ -1092,7 +1092,7 @@ clear_bit(ATM_VF_READY,&entry->vcc->flags); entry->vcc->push(entry->vcc, NULL); #endif - atm_async_release_vcc(entry->vcc, -EPIPE); + vcc_release_async(entry->vcc, -EPIPE); entry->vcc = NULL; } if (entry->recv_vcc) { @@ -1102,7 +1102,7 @@ clear_bit(ATM_VF_READY,&entry->recv_vcc->flags); entry->recv_vcc->push(entry->recv_vcc, NULL); #endif - atm_async_release_vcc(entry->recv_vcc, -EPIPE); + vcc_release_async(entry->recv_vcc, -EPIPE); entry->recv_vcc = NULL; } } diff -Nru a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c --- a/net/atm/mpoa_caches.c Mon Oct 13 18:41:06 2003 +++ b/net/atm/mpoa_caches.c Mon Oct 13 18:41:06 2003 @@ -212,7 +212,7 @@ client->eg_ops->put(eg_entry); return; } - atm_async_release_vcc(vcc, -EPIPE); + vcc_release_async(vcc, -EPIPE); } return; @@ -447,7 +447,7 @@ client->in_ops->put(in_entry); return; } - atm_async_release_vcc(vcc, -EPIPE); + vcc_release_async(vcc, -EPIPE); } return; diff -Nru a/net/atm/pvc.c b/net/atm/pvc.c --- a/net/atm/pvc.c Mon Oct 13 18:41:06 2003 +++ b/net/atm/pvc.c Mon Oct 13 18:41:06 2003 @@ -89,7 +89,7 @@ .setsockopt = atm_setsockopt, .getsockopt = atm_getsockopt, .sendmsg = atm_sendmsg, - .recvmsg = atm_recvmsg, + .recvmsg = vcc_recvmsg, .mmap = sock_no_mmap, .sendpage = sock_no_sendpage, }; diff -Nru a/net/atm/signaling.c b/net/atm/signaling.c --- a/net/atm/signaling.c Mon Oct 13 18:41:06 2003 +++ b/net/atm/signaling.c Mon Oct 13 18:41:06 2003 @@ -124,6 +124,7 @@ clear_bit(ATM_VF_REGIS,&vcc->flags); clear_bit(ATM_VF_READY,&vcc->flags); vcc->reply = msg->reply; + vcc->sk->err = -msg->reply; break; case as_indicate: vcc = *(struct atm_vcc **) &msg->listen_vcc; @@ -144,6 +145,7 @@ set_bit(ATM_VF_RELEASED,&vcc->flags); clear_bit(ATM_VF_READY,&vcc->flags); vcc->reply = msg->reply; + vcc->sk->err = -msg->reply; break; case as_modify: modify_qos(vcc,msg); @@ -201,6 +203,7 @@ !test_bit(ATM_VF_META,&vcc->flags)) { set_bit(ATM_VF_RELEASED,&vcc->flags); vcc->reply = -EUNATCH; + vcc->sk->err = EUNATCH; wake_up(&vcc->sleep); } vcc = vcc->next; diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c Mon Oct 13 18:41:06 2003 +++ b/net/atm/svc.c Mon Oct 13 18:41:06 2003 @@ -407,7 +407,7 @@ .setsockopt = svc_setsockopt, .getsockopt = svc_getsockopt, .sendmsg = atm_sendmsg, - .recvmsg = atm_recvmsg, + .recvmsg = vcc_recvmsg, .mmap = sock_no_mmap, .sendpage = sock_no_sendpage, }; From clock@twibright.com Tue Oct 14 02:14:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 02:15:29 -0700 (PDT) Received: from beton.cybernet.src (cimice4.lam.cz [212.71.168.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9E9Ei25014573 for ; Tue, 14 Oct 2003 02:14:45 -0700 Received: by beton.cybernet.src (Postfix, from userid 1000) id 02B812D01BB; Mon, 13 Oct 2003 18:37:28 +0200 (CEST) Date: Mon, 13 Oct 2003 18:37:28 +0200 From: =?iso-8859-2?Q?Karel_Kulhav=FD?= To: netdev@oss.sgi.com Subject: 3c900 Vortex Linux kernel driver documentation Message-ID: <20031013183728.A300@beton.cybernet.src> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Orientation: Gay X-archive-position: 790 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: clock@twibright.com Precedence: bulk X-list: netdev Hello I have a 3c900 and want to set it to AUI and full duplex and having it compiled-in into the kernel, not as a module. I have read Documentation/networking/vortex.txt but this documentation covers only the modules. Why is the documentation so incomplete? Please tell me how to set up the card. Cl< From kuznet@ms2.inr.ac.ru Tue Oct 14 05:05:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 05:06:00 -0700 (PDT) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EC5425024517 for ; Tue, 14 Oct 2003 05:05:25 -0700 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id QAA23474; Tue, 14 Oct 2003 16:03:32 +0400 From: kuznet@ms2.inr.ac.ru Message-Id: <200310141203.QAA23474@yakov.inr.ac.ru> Subject: Re: [2.4/2.6 PATCHES] Change some ip_fragment checks to help IPVS To: davem@redhat.com (David S. Miller) Date: Tue, 14 Oct 2003 16:03:32 +0400 (MSD) Cc: ja@ssi.bg, wensong@linux-vs.org, netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru In-Reply-To: <20031011120228.74914c91.davem@redhat.com> from "David S. Miller" at ïËÔ 11, 2003 12:02:28 X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 792 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Content-Length: 566 Lines: 22 Hello! > On Sat, 11 Oct 2003 20:18:33 +0300 (EEST) > Julian Anastasov wrote: > > > /* Correct socket ownership. */ > > - if (frag->sk == NULL) > > + if (frag->sk == NULL && skb->sk) > > goto slow_path; > > Alexey I think this piece of Julian's patch is OK and this is > the test you meant to make in the first place. Yes. The test was to eliminate the pathological cases, but the test is really valid only when skb is generated by ip_append_*. If skb as whole is now owned, it is also perfect case. > Right? Perfectly correct. Alexey From shep@ginger.lcs.mit.edu Tue Oct 14 08:45:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 08:46:28 -0700 (PDT) Received: from ginger.lcs.mit.edu (ginger.lcs.mit.edu [18.26.0.82]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EFjq25004557 for ; Tue, 14 Oct 2003 08:45:53 -0700 Received: from ginger.lcs.mit.edu (localhost [127.0.0.1]) by ginger.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id h9EFjVWB013311; Tue, 14 Oct 2003 11:45:32 -0400 Message-Id: <200310141545.h9EFjVWB013311@ginger.lcs.mit.edu> From: Tim Shepard To: davem@redhat.com, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@redhat.com, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com cc: torvalds@osdl.org, linux-kernel@vger.kernel.org Subject: [PATCH] (linux-2.6.0-test7) fix missing connections in /proc/net/tcp ("netstat -n -t -a") Date: Tue, 14 Oct 2003 11:45:31 -0400 X-archive-position: 793 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shep@alum.mit.edu Precedence: bulk X-list: netdev Content-Length: 2481 Lines: 83 I'm running linux-2.6.0-test7 and I have just found and fixed a bug that was causing "netstat -n -t" to fail to display all of the relevant connections (in some cases). The bug can be demonstrated by noticing that dd if=/proc/net/tcp bs=128k of=/tmp/tcp.big returns more lines into the output file than does dd if=/proc/net/tcp bs=1k of=/tmp/tcp.1k which is using the same size read buffer that /bin/netstat uses. (Note, the first number on each line read from /proc/net/tcp is crazy on a linux-2.6.0-test7 kernel, and I will in a few moments send another patch along to address that. But fixing *this* bug is much more important than fixing that bug.) Triggering this bug depends on having enough TCP sockets in LISTEN (I believe 8 is sufficient) and you may have to create a few more TCP connections and/or transition some to TIMEWAIT (by closing them) to be able to see the bug. The bug is most easily seen on a system where you know exactly what TCP connections you have open and in time-wait and can spot the descrepency in the output from "netstat -n -t". Patch is below. The problem is that listening_get_idx was not decrementing *pos exactly the same number of times that it cdr'd down the list. The change to established_get_idx is not necessary to fix the bug, but does keep it in sync with listening_get_idx. I hope this is helpful and that that I have properly submitted this patch. I welcome any comments. -Tim Shepard shep@alum.mit.edu --- ../pristine/linux-2.6.0-test7/net/ipv4/tcp_ipv4.c 2003-10-08 15:24:03.000000000 -0400 +++ net/ipv4/tcp_ipv4.c 2003-10-13 17:33:09.000000000 -0400 @@ -2233,14 +2233,15 @@ static void *listening_get_idx(struct seq_file *seq, loff_t *pos) { void *rc = listening_get_first(seq); - if (rc) - while (*pos && (rc = listening_get_next(seq, rc))) - --*pos; - return *pos ? NULL : rc; + while (rc && *pos) { + rc = listening_get_next(seq, rc); + --*pos; + } + return rc; } static void *established_get_first(struct seq_file *seq) { struct tcp_iter_state* st = seq->private; @@ -2325,14 +2326,15 @@ static void *established_get_idx(struct seq_file *seq, loff_t pos) { void *rc = established_get_first(seq); - if (rc) - while (pos && (rc = established_get_next(seq, rc))) - --pos; - return pos ? NULL : rc; + while (rc && pos) { + rc = established_get_next(seq, rc); + --pos; + } + return rc; } static void *tcp_get_idx(struct seq_file *seq, loff_t pos) { void *rc; From shep@ginger.lcs.mit.edu Tue Oct 14 09:19:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 09:20:25 -0700 (PDT) Received: from ginger.lcs.mit.edu (ginger.lcs.mit.edu [18.26.0.82]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EGJo25007945 for ; Tue, 14 Oct 2003 09:19:51 -0700 Received: from ginger.lcs.mit.edu (localhost [127.0.0.1]) by ginger.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id h9EGJWWB013461; Tue, 14 Oct 2003 12:19:33 -0400 Message-Id: <200310141619.h9EGJWWB013461@ginger.lcs.mit.edu> From: Tim Shepard To: davem@redhat.com, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@redhat.com, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com cc: torvalds@osdl.org, linux-kernel@vger.kernel.org Subject: [PATCH] fix numbering of lines in /proc/net/tcp (linux-2.6.0-test7) Date: Tue, 14 Oct 2003 12:19:32 -0400 X-archive-position: 794 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shep@alum.mit.edu Precedence: bulk X-list: netdev Content-Length: 9138 Lines: 168 While debugging another problem, I noticed that the first number on each line read from /proc/net/tcp (and from /proc/net/tcp6) was meaningless. The netstat program ignores this number, and I know of no other readers of /proc/net/tcp{,6}. So perhaps this is only a cosmetic bug. Nevertheless, in debugging another problem with the lines produced by /proc/net/tcp, these meaningless numbers caused confusion. On a linux-2.6.0-test7 system, it looks like this: $ cat /proc/net/tcp sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode 1: 0100007F:2260 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 2253 1 cdb27440 3000 0 0 2 -1 1: 00000000:1F40 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 1862 1 cf1e5060 3000 0 0 2 -1 1: 0100007F:0A43 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 2259 1 cc949460 3000 0 0 2 -1 1: 00000000:0203 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 1256 1 cf1e53e0 3000 0 0 2 -1 1: 0100007F:2266 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 2255 1 cc949b60 3000 0 0 2 -1 1: 0100007F:2B48 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 2257 1 cc9497e0 3000 0 0 2 -1 2: 0100007F:16E9 00000000:0000 0A 00000000:00000000 00:00000000 00000000 103 0 1250 1 cf1e5760 3000 0 0 2 -1 2: 0100007F:2B6F 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 2261 1 cc9490e0 3000 0 0 2 -1 2: 0100007F:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 1141 1 c13443c0 3000 0 0 2 -1 2: 0100007F:0C38 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 2265 1 cc927800 3000 0 0 2 -1 2: 0100007F:09DD 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 2263 1 cc927b80 3000 0 0 2 -1 2: B8425C42:8001 0C00000A:0016 01 00000000:00000000 02:006B7C78 00000000 1000 0 2273 2 cc927100 205 40 0 3 -1 2: B8425C42:8000 52001A12:0016 01 00000000:00000000 02:006B4970 00000000 1000 0 2249 2 cdb270c0 262 40 0 3 -1 On a linux-2.4.21 system, this first number just counts up like this: $ cat /proc/net/tcp sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode 0: 00000000:1F40 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 580 1 c702f820 300 0 0 2 -1 1: 00000000:16E9 00000000:0000 0A 00000000:00000000 00:00000000 00000000 101 0 297102 1 c718dba0 300 0 0 2 -1 2: 00000000:006F 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 145 1 c77e5420 300 0 0 2 -1 3: 00000000:1770 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 840 1 c6cf94c0 300 0 0 2 -1 4: 0C00000A:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 2627 1 c5fd2b60 300 0 0 2 -1 5: 92425C42:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 2625 1 c5fd2080 300 0 0 2 -1 6: 0100007F:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 332 1 c718d0c0 300 0 0 2 -1 7: 00000000:0016 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 76922 1 c2eac880 300 0 0 2 -1 8: 00000000:0019 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 403 1 c718d800 300 0 0 2 -1 9: 0100007F:177A 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 314391 1 c2eacc20 300 0 0 2 -1 However, on a linux-2.4.21 system with ipv6 listeners, the numbers are shared between ipv4 and ipv6: $ cat /proc/net/tcp sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode 0: 00000000:1F40 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 580 1 c702f820 300 0 0 2 -1 1: 00000000:16E9 00000000:0000 0A 00000000:00000000 00:00000000 00000000 101 0 297102 1 c718dba0 300 0 0 2 -1 2: 00000000:006F 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 145 1 c77e5420 300 0 0 2 -1 4: 00000000:1770 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 840 1 c6cf94c0 300 0 0 2 -1 5: 0C00000A:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 2627 1 c5fd2b60 300 0 0 2 -1 6: 92425C42:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 2625 1 c5fd2080 300 0 0 2 -1 7: 0100007F:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 332 1 c718d0c0 300 0 0 2 -1 8: 00000000:0016 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 76922 1 c2eac880 300 0 0 2 -1 9: 00000000:0019 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 403 1 c718d800 300 0 0 2 -1 10: 0100007F:177A 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 314391 1 c2eacc20 300 0 0 2 -1 $ cat /proc/net/tcp6 sl local_address remote_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode 3: 00000000000000000000000000000000:0050 00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 6630 1 c702fbc0 300 0 0 2 -1 I am not sure what the behavior is supposed to be. Is there a spec anywhere for the interface with /proc/net/tcp? The patch below changes it to always count up from zero, without sharing the numbers between ipv4 and ipv6. This is an improvement over linux-2.6.0-test7 behavior, but without a spec I cannot be sure what the correct behavior would be. This patch can be applied before, after, alone, or with the other patch I submitted earlier today. This patch is the less important of the two. I welcome comments. -Tim Shepard shep@alum.mit.edu --- ../pristine/linux-2.6.0-test7/net/ipv4/tcp_ipv4.c 2003-10-08 15:24:03.000000000 -0400 +++ net/ipv4/tcp_ipv4.c 2003-10-13 22:33:10.000000000 -0400 @@ -2145,7 +2145,6 @@ if (!sk) continue; - ++st->num; if (sk->sk_family == st->family) { rc = sk; goto out; @@ -2159,7 +2158,7 @@ for (st->sbucket = 0; st->sbucket < TCP_SYNQ_HSIZE; ++st->sbucket) { for (req = tp->listen_opt->syn_table[st->sbucket]; - req; req = req->dl_next, ++st->num) { + req; req = req->dl_next) { if (req->class->family != st->family) continue; rc = req; @@ -2181,6 +2180,8 @@ struct sock *sk = cur; struct tcp_iter_state* st = seq->private; + ++st->num; + if (st->state == TCP_SEQ_STATE_OPENREQ) { struct open_request *req = cur; @@ -2188,7 +2189,6 @@ req = req->dl_next; while (1) { while (req) { - ++st->num; if (req->class->family == st->family) { cur = req; goto out; @@ -2254,7 +2254,6 @@ read_lock(&tcp_ehash[st->bucket].lock); sk_for_each(sk, node, &tcp_ehash[st->bucket].chain) { if (sk->sk_family != st->family) { - ++st->num; continue; } rc = sk; @@ -2264,7 +2263,6 @@ tw_for_each(tw, node, &tcp_ehash[st->bucket + tcp_ehash_size].chain) { if (tw->tw_family != st->family) { - ++st->num; continue; } rc = tw; @@ -2284,12 +2282,13 @@ struct hlist_node *node; struct tcp_iter_state* st = seq->private; + ++st->num; + if (st->state == TCP_SEQ_STATE_TIME_WAIT) { tw = cur; tw = tw_next(tw); get_tw: while (tw && tw->tw_family != st->family) { - ++st->num; tw = tw_next(tw); } if (tw) { @@ -2311,7 +2310,6 @@ sk_for_each_from(sk, node) { if (sk->sk_family == st->family) goto found; - ++st->num; } st->state = TCP_SEQ_STATE_TIME_WAIT; @@ -2354,6 +2352,8 @@ static void *tcp_seq_start(struct seq_file *seq, loff_t *pos) { + struct tcp_iter_state* st = seq->private; + st->num = 0; return *pos ? tcp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } From yoshfuji@linux-ipv6.org Tue Oct 14 09:37:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 09:38:18 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EGbf25008644 for ; Tue, 14 Oct 2003 09:37:42 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9EGcmft010282; Wed, 15 Oct 2003 01:38:49 +0900 Date: Wed, 15 Oct 2003 01:38:48 +0900 (JST) Message-Id: <20031015.013848.133364889.yoshfuji@linux-ipv6.org> To: shep@alum.mit.edu Cc: davem@redhat.com, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@redhat.com, netdev@oss.sgi.com, torvalds@osdl.org, linux-kernel@vger.kernel.org, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] fix numbering of lines in /proc/net/tcp (linux-2.6.0-test7) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <200310141619.h9EGJWWB013461@ginger.lcs.mit.edu> References: <200310141619.h9EGJWWB013461@ginger.lcs.mit.edu> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 795 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 Content-Length: 1754 Lines: 26 In article <200310141619.h9EGJWWB013461@ginger.lcs.mit.edu> (at Tue, 14 Oct 2003 12:19:32 -0400), Tim Shepard says: > However, on a linux-2.4.21 system with ipv6 listeners, the numbers are > shared between ipv4 and ipv6: > > $ cat /proc/net/tcp > sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode > 0: 00000000:1F40 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 580 1 c702f820 300 0 0 2 -1 > 1: 00000000:16E9 00000000:0000 0A 00000000:00000000 00:00000000 00000000 101 0 297102 1 c718dba0 300 0 0 2 -1 > 2: 00000000:006F 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 145 1 c77e5420 300 0 0 2 -1 > 4: 00000000:1770 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 840 1 c6cf94c0 300 0 0 2 -1 : > $ cat /proc/net/tcp6 > sl local_address remote_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode > 3: 00000000000000000000000000000000:0050 00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 6630 1 c702fbc0 300 0 0 2 -1 > > > > I am not sure what the behavior is supposed to be. Is there a spec > anywhere for the interface with /proc/net/tcp? Yes, I think the original is okay because the bucket is shared between tcp6 and tcp4, and I don't want to change this behavior in 2.6 from 2.4.x. (so, we need to fix 2.6.x.) --yoshfuji From johnip@sgi.com Tue Oct 14 09:49:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 09:49:55 -0700 (PDT) Received: from tolkor.sgi.com (tolkor.SGI.COM [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EGnK25009274 for ; Tue, 14 Oct 2003 09:49:21 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h9EH7PHc006577 for ; Tue, 14 Oct 2003 12:07:25 -0500 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h9EGnFaP12241477; Tue, 14 Oct 2003 11:49:15 -0500 (CDT) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h9EGnERn317235532; Tue, 14 Oct 2003 11:49:15 -0500 (CDT) Message-ID: <3F8C290A.3010508@sgi.com> Date: Tue, 14 Oct 2003 11:49:14 -0500 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030905 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Andi Kleen , modica@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> In-Reply-To: <20031011105054.0e16a607.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 796 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev Content-Length: 1736 Lines: 54 The key point for me is, as David said yesterday, SGI users will only have to recompile the tg3 driver with the CONFIG defined to get the desired behavior, not hte whole kernel. They just use the recompiled driver with whatever kernel they are using. Users who use SGI propack will already have the (static) driver with the CONFIG defined by SGI, SuSE users who use a tg3.o use it as a module anyway, so it's not a big deal just to recompile tg3. The only problem I can see is if users use RedHat Advanced Server, I believe the tg3 driver is static in the kernel so they won't be able to just recompile the tg3 driver. I do propose that we make the CONFIG a little more descriptive something like CONFIG_5701PCIX_UNALIGNED_EXPENSIVE just to make it easier for users to see what it does. John David S. Miller wrote: > On Sat, 11 Oct 2003 15:19:21 +0200 > Andi Kleen wrote: > > >>Then just don't set the argument to zero in modules.conf on the 5704cards. >>That could be even handled somewhere in user space. Switching over sounds >>best of course, because the performance with the copying won't be great > > > There is no "argument" we don't have a variable in the tg3 driver > that determines the "copybreak", it's a hard-coded macro define. > > For them it's really easy to know when the 5701 hw bug case is present, > so they can do something like: > > if (len > RX_COPY_THRESHOLD > #ifdef CONFIG_UNALIGNED_EXPENSIVE > || tp->rx_offset == 2 > #endif > ) { > ... > > And then only their platform and only when the buggy chips are present, > will get the desired change in behavior. > -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From rddunlap@osdl.org Tue Oct 14 09:54:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 09:55:25 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EGso25009689 for ; Tue, 14 Oct 2003 09:54:50 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9EGsgo23560; Tue, 14 Oct 2003 09:54:42 -0700 Date: Tue, 14 Oct 2003 09:53:49 -0700 From: "Randy.Dunlap" To: Karel =?ISO-8859-1?Q?Kulhav=FD?= Cc: netdev@oss.sgi.com Subject: Re: 3c900 Vortex Linux kernel driver documentation Message-Id: <20031014095349.68c96ca8.rddunlap@osdl.org> In-Reply-To: <20031013183728.A300@beton.cybernet.src> References: <20031013183728.A300@beton.cybernet.src> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW 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 h9EGso25009689 X-archive-position: 797 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 2091 Lines: 71 On Mon, 13 Oct 2003 18:37:28 +0200 Karel Kulhavý wrote: | Hello | | I have a 3c900 and want to set it to AUI and full duplex and | having it compiled-in into the kernel, not as a module. | | I have read Documentation/networking/vortex.txt but this documentation | covers only the modules. Why is the documentation so incomplete? | Please tell me how to set up the card. Please try this, although I'm not yet convinced that the 3c59x driver calls all of the right hooks for this to work. but good luck, and please report back on it. -- ~Randy Parameters when driver is built into kernel image ================================================= There are a few parameters which may be provided to the driver as the kernel is loaded if the driver is built into the kernel. These parameters are passed as kernel boot options on the kernel "command line", after the keyword "ether=". The syntax for ether= is: ether=irq,base_address,mem_start,mem_end,name where mem_start is used for certain driver options (below). Example: linux console=tty0 debug ether=11,0x320,9 If you need to pass options for multiple adapters, use "ether=..." multiple times, separated by a space. Supported driver options ------------------------ The individual options are composed of a number of bitfields which have the following meanings: Possible media type settings 0 10baseT 1 10Mbs AUI 2 undefined 3 10base2 (BNC) 4 100base-TX 5 100base-FX 6 MII (Media Independent Interface) 7 Use default setting from EEPROM 8 Autonegotiate 9 External MII 10 Use default setting from EEPROM When generating a value for the 'options' setting, the above media selection values may be OR'ed (or added to) the following: 0x8000 Set driver debugging level to 7 0x4000 Set driver debugging level to 2 0x0400 Enable Wake-on-LAN 0x0200 Force full duplex mode. 0x0010 Bus-master enable bit (Old Vortex cards only) For example: ether=11,0x320,0x204 will force full-duplex 100base-TX, rather than allowing the usual autonegotiation. From davem@pizda.ninka.net Tue Oct 14 09:59:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 10:00:32 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EGxr25010069 for ; Tue, 14 Oct 2003 09:59:55 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA08429; Tue, 14 Oct 2003 09:53:23 -0700 Date: Tue, 14 Oct 2003 09:53:23 -0700 From: "David S. Miller" To: johnip@sgi.com Cc: ak@suse.de, modica@sgi.com, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031014095323.71c8b9fe.davem@redhat.com> In-Reply-To: <3F8C290A.3010508@sgi.com> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 798 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: 449 Lines: 14 On Tue, 14 Oct 2003 11:49:14 -0500 John Partridge wrote: > I do propose that we make the CONFIG a little more descriptive something like > > CONFIG_5701PCIX_UNALIGNED_EXPENSIVE > > just to make it easier for users to see what it does. That's grosser than gross. We're trying to create a generic mechanism to fix this kind of problem in _ALL_ drivers. I will heavily thwart any attempt to make this some kind of "tg3 thing". From jgarzik@pobox.com Tue Oct 14 10:32:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 10:33:21 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EHWm25011467 for ; Tue, 14 Oct 2003 10:32:49 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36346 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9T2M-0004Mx-Bj; Tue, 14 Oct 2003 18:32:46 +0100 Message-ID: <3F8C3333.1000602@pobox.com> Date: Tue, 14 Oct 2003 13:32:35 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: Martin Josefsson , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: NULL pointer dereference in sysfs_hash_and_remove() References: <1065220892.31749.39.camel@tux.rsn.bth.se> <20031013163200.43e5d1bf.shemminger@osdl.org> In-Reply-To: <20031013163200.43e5d1bf.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 800 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: 24 Lines: 2 applied to 2.4 and 2.5 From mashirle@us.ibm.com Tue Oct 14 10:32:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 10:33:20 -0700 (PDT) Received: from linux2.suntekindustrial.com (wbar1.sjo1-4-4-004-065.sjo1.dsl-verizon.net [4.4.4.65]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EHWb25011460 for ; Tue, 14 Oct 2003 10:32:44 -0700 Received: from ibm-mxl (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated bits=0) by linux2.suntekindustrial.com (8.12.8/8.12.8) with ESMTP id h9EHiKo7016256; Tue, 14 Oct 2003 10:44:22 -0700 Content-Type: text/plain; charset="us-ascii" From: Shirley Ma Organization: IBM Linux To: "David S. Miller" , kuznet@ms2.inr.ac.ru Subject: [PATCH]Implementation for IPv6 MIB:ipv6InterfaceTable Date: Tue, 14 Oct 2003 10:32:23 -0700 User-Agent: KMail/1.4.3 Cc: netdev@oss.sgi.com MIME-Version: 1.0 Message-Id: <200310141032.23998.mashirle@us.ibm.com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h9EHWb25011460 X-archive-position: 799 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 10753 Lines: 341 The implementation is based on last call new draft of IP MIBs: http://www.ietf.org/internet-drafts/draft-ietf-ipv6-rfc2011-update-04.txt The patch has been tested against linux-2.6.0-test6-bk3. Please give me your comments. Thanks Shirley Ma IBM Linux Technology Center ====================== diff -urN linux-2.6.0-test6/include/linux/rtnetlink.h linux-2.6.0-test6-ipv6mib1/include/linux/rtnetlink.h --- linux-2.6.0-test6/include/linux/rtnetlink.h 2003-09-27 17:50:40.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib1/include/linux/rtnetlink.h 2003-10-10 15:55:39.000000000 -0700 @@ -555,9 +555,17 @@ IFLA_INET6_CONF, /* sysctl parameters */ IFLA_INET6_STATS, /* statistics */ IFLA_INET6_MCAST, /* MC things. What of them? */ + IFLA_INET6_CACHEINFO, /* time values and max reasm size */ }; -#define IFLA_INET6_MAX IFLA_INET6_MCAST +struct ifla_cacheinfo +{ + __u32 max_reasm_len; + __u32 reachable_time; + __u32 retrans_time; +}; + +#define IFLA_INET6_MAX IFLA_INET6_CACHEINFO /***************************************************************** * Traffic control messages. @@ -608,6 +616,7 @@ #define RTMGRP_IPV6_IFADDR 0x100 #define RTMGRP_IPV6_MROUTE 0x200 #define RTMGRP_IPV6_ROUTE 0x400 +#define RTMGRP_IPV6_IFINFO 0x800 #define RTMGRP_DECnet_IFADDR 0x1000 #define RTMGRP_DECnet_ROUTE 0x4000 diff -urN linux-2.6.0-test6/include/net/neighbour.h linux-2.6.0-test6-ipv6mib1/include/net/neighbour.h --- linux-2.6.0-test6/include/net/neighbour.h 2003-09-27 17:51:07.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib1/include/net/neighbour.h 2003-10-09 10:36:56.000000000 -0700 @@ -47,6 +47,9 @@ #include #include +#ifdef CONFIG_SYSCTL +#include +#endif #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) @@ -206,8 +209,11 @@ extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); extern void neigh_app_ns(struct neighbour *n); -extern int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, - int p_id, int pdev_id, char *p_name); +extern int neigh_sysctl_register(struct net_device *dev, + struct neigh_parms *p, + int p_id, int pdev_id, + char *p_name, + proc_handler *proc_handler); extern void neigh_sysctl_unregister(struct neigh_parms *p); /* diff -urN linux-2.6.0-test6/net/core/neighbour.c linux-2.6.0-test6-ipv6mib1/net/core/neighbour.c --- linux-2.6.0-test6/net/core/neighbour.c 2003-10-07 16:36:53.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib1/net/core/neighbour.c 2003-10-09 11:24:05.000000000 -0700 @@ -1625,7 +1625,8 @@ }; int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, - int p_id, int pdev_id, char *p_name) + int p_id, int pdev_id, char *p_name, + proc_handler *handler) { struct neigh_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL); @@ -1636,6 +1637,10 @@ t->neigh_vars[1].data = &p->ucast_probes; t->neigh_vars[2].data = &p->app_probes; t->neigh_vars[3].data = &p->retrans_time; + if (handler) { + t->neigh_vars[3].proc_handler = handler; + t->neigh_vars[3].extra1 = dev; + } t->neigh_vars[4].data = &p->base_reachable_time; t->neigh_vars[5].data = &p->delay_probe_time; t->neigh_vars[6].data = &p->gc_staletime; diff -urN linux-2.6.0-test6/net/ipv4/arp.c linux-2.6.0-test6-ipv6mib1/net/ipv4/arp.c --- linux-2.6.0-test6/net/ipv4/arp.c 2003-10-07 16:36:53.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib1/net/ipv4/arp.c 2003-10-07 13:52:32.000000000 -0700 @@ -1123,7 +1123,7 @@ arp_proc_init(); #ifdef CONFIG_SYSCTL neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, - NET_IPV4_NEIGH, "ipv4"); + NET_IPV4_NEIGH, "ipv4", NULL); #endif register_netdevice_notifier(&arp_netdev_notifier); } diff -urN linux-2.6.0-test6/net/ipv4/devinet.c linux-2.6.0-test6-ipv6mib1/net/ipv4/devinet.c --- linux-2.6.0-test6/net/ipv4/devinet.c 2003-10-07 16:36:53.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib1/net/ipv4/devinet.c 2003-10-07 13:52:32.000000000 -0700 @@ -155,7 +155,7 @@ dev_hold(dev); #ifdef CONFIG_SYSCTL neigh_sysctl_register(dev, in_dev->arp_parms, NET_IPV4, - NET_IPV4_NEIGH, "ipv4"); + NET_IPV4_NEIGH, "ipv4", NULL); #endif write_lock_bh(&inetdev_lock); dev->ip_ptr = in_dev; diff -urN linux-2.6.0-test6/net/ipv6/addrconf.c linux-2.6.0-test6-ipv6mib1/net/ipv6/addrconf.c --- linux-2.6.0-test6/net/ipv6/addrconf.c 2003-09-27 17:51:02.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib1/net/ipv6/addrconf.c 2003-10-10 15:47:25.000000000 -0700 @@ -92,7 +92,9 @@ #define ADBG(x) #endif +void inet6_ifinfo_notify(int event, struct inet6_dev *idev); #ifdef CONFIG_SYSCTL +extern int ndisc_ifinfo_sysctl_change(ctl_table *ctl, int write, struct file * filp, void __user *buffer, size_t *lenp); static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p); static void addrconf_sysctl_unregister(struct ipv6_devconf *p); #endif @@ -372,7 +374,8 @@ ipv6_mc_init_dev(ndev); #ifdef CONFIG_SYSCTL - neigh_sysctl_register(dev, ndev->nd_parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6"); + neigh_sysctl_register(dev, ndev->nd_parms, NET_IPV6, + NET_IPV6_NEIGH, "ipv6", &ndisc_ifinfo_sysctl_change); addrconf_sysctl_register(ndev, &ndev->cnf); #endif } @@ -1848,6 +1851,7 @@ rt6_mtu_change(dev, dev->mtu); idev->cnf.mtu6 = dev->mtu; } + inet6_ifinfo_notify(RTM_NEWLINK, idev); /* If the changed mtu during down is lower than IPV6_MIN_MTU stop IPv6 on this interface. */ @@ -1875,7 +1879,6 @@ case NETDEV_CHANGE: break; }; - return NOTIFY_OK; } @@ -1966,7 +1969,9 @@ ipv6_mc_destroy_dev(idev); else ipv6_mc_down(idev); - + /* Step 5: netlink notification of this interface */ + inet6_ifinfo_notify(RTM_NEWLINK, idev); + /* Shot the device (if unregistered) */ if (how == 1) { @@ -2540,17 +2545,19 @@ #endif } -static int inet6_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, - struct inet6_dev *idev, - int type, u32 pid, u32 seq) +static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, + u32 pid, u32 seq, int event) { + struct net_device *dev = idev->dev; __s32 *array = NULL; struct ifinfomsg *r; struct nlmsghdr *nlh; unsigned char *b = skb->tail; struct rtattr *subattr; + __u32 mtu = dev->mtu; + struct ifla_cacheinfo ci; - nlh = NLMSG_PUT(skb, pid, seq, type, sizeof(*r)); + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*r)); if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; r = NLMSG_DATA(nlh); r->ifi_family = AF_INET6; @@ -2565,6 +2572,13 @@ RTA_PUT(skb, IFLA_IFNAME, strlen(dev->name)+1, dev->name); + if (dev->addr_len) + RTA_PUT(skb, IFLA_ADDRESS, dev->addr_len, dev->dev_addr); + + RTA_PUT(skb, IFLA_MTU, sizeof(mtu), &mtu); + if (dev->ifindex != dev->iflink) + RTA_PUT(skb, IFLA_LINK, sizeof(int), &dev->iflink); + subattr = (struct rtattr*)skb->tail; RTA_PUT(skb, IFLA_PROTINFO, 0, NULL); @@ -2572,6 +2586,12 @@ /* return the device flags */ RTA_PUT(skb, IFLA_INET6_FLAGS, sizeof(__u32), &idev->if_flags); + /* return interface cacheinfo */ + ci.max_reasm_len = IPV6_MAXPLEN; + ci.reachable_time = idev->nd_parms->reachable_time; + ci.retrans_time = idev->nd_parms->retrans_time; + RTA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci); + /* return the device sysctl params */ if ((array = kmalloc(DEVCONF_MAX * sizeof(*array), GFP_ATOMIC)) == NULL) goto rtattr_failure; @@ -2606,8 +2626,8 @@ continue; if ((idev = in6_dev_get(dev)) == NULL) continue; - err = inet6_fill_ifinfo(skb, dev, idev, RTM_NEWLINK, - NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq); + err = inet6_fill_ifinfo(skb, idev, NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWLINK); in6_dev_put(idev); if (err <= 0) break; @@ -2618,6 +2638,26 @@ return skb->len; } +void inet6_ifinfo_notify(int event, struct inet6_dev *idev) +{ + struct sk_buff *skb; + /* 128 bytes ?? */ + int size = NLMSG_SPACE(sizeof(struct ifinfomsg)+128); + + skb = alloc_skb(size, GFP_ATOMIC); + if (!skb) { + netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFINFO, ENOBUFS); + return; + } + if (inet6_fill_ifinfo(skb, idev, 0, 0, event) < 0) { + kfree_skb(skb); + netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFINFO, EINVAL); + return; + } + NETLINK_CB(skb).dst_groups = RTMGRP_IPV6_IFINFO; + netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_IFINFO, GFP_ATOMIC); +} + static struct rtnetlink_link inet6_rtnetlink_table[RTM_MAX - RTM_BASE + 1] = { [RTM_GETLINK - RTM_BASE] = { .dumpit = inet6_dump_ifinfo, }, [RTM_NEWADDR - RTM_BASE] = { .doit = inet6_rtm_newaddr, }, diff -urN linux-2.6.0-test6/net/ipv6/ndisc.c linux-2.6.0-test6-ipv6mib1/net/ipv6/ndisc.c --- linux-2.6.0-test6/net/ipv6/ndisc.c 2003-09-27 17:50:29.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib1/net/ipv6/ndisc.c 2003-10-10 15:46:03.000000000 -0700 @@ -76,7 +76,7 @@ #include static struct socket *ndisc_socket; - +extern void inet6_ifinfo_notify(int event, struct inet6_dev *idev); static u32 ndisc_hash(const void *pkey, const struct net_device *dev); static int ndisc_constructor(struct neighbour *neigh); static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb); @@ -1109,6 +1109,7 @@ if (rtime < HZ/10) rtime = HZ/10; in6_dev->nd_parms->retrans_time = rtime; + inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); } rtime = ntohl(ra_msg->reachable_time); @@ -1122,6 +1123,7 @@ in6_dev->nd_parms->base_reachable_time = rtime; in6_dev->nd_parms->gc_staletime = 3 * rtime; in6_dev->nd_parms->reachable_time = neigh_rand_reach_time(rtime); + inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); } } } @@ -1487,6 +1489,20 @@ .notifier_call = ndisc_netdev_event, }; +#ifdef CONFIG_SYSCTL +int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * filp, void __user *buffer, size_t *lenp) +{ + struct net_device *dev = ctl->extra1; + struct inet6_dev *idev; + + if (write && dev && (idev = in6_dev_get(dev)) != NULL) { + inet6_ifinfo_notify(RTM_NEWLINK, idev); + in6_dev_put(idev); + } + return proc_dointvec(ctl, write, filp, buffer, lenp); +} +#endif + int __init ndisc_init(struct net_proto_family *ops) { struct ipv6_pinfo *np; @@ -1517,7 +1533,8 @@ neigh_table_init(&nd_tbl); #ifdef CONFIG_SYSCTL - neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6"); + neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, + "ipv6", &ndisc_ifinfo_sysctl_change); #endif register_netdevice_notifier(&ndisc_netdev_notifier); From mashirle@us.ibm.com Tue Oct 14 10:38:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 10:39:06 -0700 (PDT) Received: from linux2.suntekindustrial.com (wbar1.sjo1-4-4-004-065.sjo1.dsl-verizon.net [4.4.4.65]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EHcV25012190 for ; Tue, 14 Oct 2003 10:38:31 -0700 Received: from ibm-mxl (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated bits=0) by linux2.suntekindustrial.com (8.12.8/8.12.8) with ESMTP id h9EHo1o7016291; Tue, 14 Oct 2003 10:50:04 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shirley Ma Organization: IBM Linux To: "David S. Miller" , kuznet@ms2.inr.ac.ru Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable Date: Tue, 14 Oct 2003 10:38:04 -0700 User-Agent: KMail/1.4.3 Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org References: <20031008130016.559b8047.davem@redhat.com> <200310081706.09485.mashirle@us.ibm.com> In-Reply-To: <200310081706.09485.mashirle@us.ibm.com> MIME-Version: 1.0 Message-Id: <200310141038.04322.mashirle@us.ibm.com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h9EHcV25012190 X-archive-position: 801 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 9727 Lines: 324 This is the modified new patch for IPv6 MIB: ipv6AddressTable. This patch has been tested against linux-2.6.0-test6-bk8 kernel. Thanks Shirley Ma IBM Linux Technology Center ======================= diff -urN linux-2.6.0-test6/include/linux/rtnetlink.h linux-2.6.0-test6-ipv6mib4/include/linux/rtnetlink.h --- linux-2.6.0-test6/include/linux/rtnetlink.h 2003-09-27 17:50:40.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/include/linux/rtnetlink.h 2003-10-08 00:15:38.000000000 -0700 @@ -352,8 +352,10 @@ struct ifa_cacheinfo { - __s32 ifa_prefered; - __s32 ifa_valid; + __u32 ifa_prefered; + __u32 ifa_valid; + __u32 cstamp; /* created timestamp, hundredths of seconds */ + __u32 tstamp; /* updated timestamp, hundredths of seconds */ }; diff -urN linux-2.6.0-test6/include/net/if_inet6.h linux-2.6.0-test6-ipv6mib4/include/net/if_inet6.h --- linux-2.6.0-test6/include/net/if_inet6.h 2003-09-27 17:51:07.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/include/net/if_inet6.h 2003-10-08 00:15:38.000000000 -0700 @@ -34,7 +34,8 @@ __u32 valid_lft; __u32 prefered_lft; - unsigned long tstamp; + unsigned long cstamp; /* created timestamp */ + unsigned long tstamp; /* updated timestamp */ atomic_t refcnt; spinlock_t lock; @@ -111,6 +112,8 @@ atomic_t mca_refcnt; spinlock_t mca_lock; unsigned char mca_crcount; + unsigned long mca_cstamp; + unsigned long mca_tstamp; }; /* Anycast stuff */ @@ -130,6 +133,8 @@ int aca_users; atomic_t aca_refcnt; spinlock_t aca_lock; + unsigned long aca_cstamp; + unsigned long aca_tstamp; }; #define IFA_HOST IPV6_ADDR_LOOPBACK diff -urN linux-2.6.0-test6/net/ipv6/addrconf.c linux-2.6.0-test6-ipv6mib4/net/ipv6/addrconf.c --- linux-2.6.0-test6/net/ipv6/addrconf.c 2003-09-27 17:51:02.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/addrconf.c 2003-10-09 12:28:54.000000000 -0700 @@ -92,6 +92,9 @@ #define ADBG(x) #endif +#define INFINITY_LIFE_TIME 0xFFFFFFFF +#define TIME_DELTA(a,b) ((unsigned long)((long)(a) - (long)(b))) + #ifdef CONFIG_SYSCTL static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p); static void addrconf_sysctl_unregister(struct ipv6_devconf *p); @@ -505,6 +508,7 @@ ifa->scope = scope; ifa->prefix_len = pfxlen; ifa->flags = flags | IFA_F_TENTATIVE; + ifa->cstamp = ifa->tstamp = jiffies; read_lock(&addrconf_lock); if (idev->dead) { @@ -707,6 +711,7 @@ ift->ifpub = ifp; ift->valid_lft = tmp_valid_lft; ift->prefered_lft = tmp_prefered_lft; + ift->cstamp = ifp->cstamp; ift->tstamp = ifp->tstamp; spin_unlock_bh(&ift->lock); addrconf_dad_start(ift, 0); @@ -1412,6 +1417,7 @@ } update_lft = create = 1; + ifp->cstamp = jiffies; addrconf_dad_start(ifp, RTF_ADDRCONF|RTF_PREFIX_RT); } @@ -2447,14 +2453,95 @@ if (!(ifa->flags&IFA_F_PERMANENT)) { ci.ifa_prefered = ifa->prefered_lft; ci.ifa_valid = ifa->valid_lft; - if (ci.ifa_prefered != 0xFFFFFFFF) { + if (ci.ifa_prefered != INFINITY_LIFE_TIME) { long tval = (jiffies - ifa->tstamp)/HZ; ci.ifa_prefered -= tval; - if (ci.ifa_valid != 0xFFFFFFFF) + if (ci.ifa_valid != INFINITY_LIFE_TIME) ci.ifa_valid -= tval; } - RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + } else { + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; } + ci.cstamp = (__u32)(TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) / HZ * 100 + + TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); + ci.tstamp = (__u32)(TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) / HZ * 100 + + TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifmca->mca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifmca->idev->dev->ifindex; + RTA_PUT(skb, IFA_ADDRESS, 16, &ifmca->mca_addr); + ci.cstamp = (__u32)(TIME_DELTA(ifmca->mca_cstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifmca->mca_cstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.tstamp = (__u32)(TIME_DELTA(ifmca->mca_tstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifmca->mca_tstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifacaddr(struct sk_buff *skb, struct ifacaddr6 *ifaca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifaca->aca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifaca->aca_idev->dev->ifindex; + RTA_PUT(skb, IFA_ADDRESS, 16, &ifaca->aca_addr); + ci.cstamp = (__u32)(TIME_DELTA(ifaca->aca_cstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifaca->aca_cstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.tstamp = (__u32)(TIME_DELTA(ifaca->aca_tstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifaca->aca_tstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); nlh->nlmsg_len = skb->tail - b; return skb->len; @@ -2468,33 +2555,79 @@ { int idx, ip_idx; int s_idx, s_ip_idx; - struct inet6_ifaddr *ifa; - + int err = 1; + struct net_device *dev; + struct inet6_dev *idev = NULL; + struct inet6_ifaddr *ifa; + struct ifmcaddr6 *ifmca; + struct ifacaddr6 *ifaca; + s_idx = cb->args[0]; s_ip_idx = ip_idx = cb->args[1]; - - for (idx=0; idx < IN6_ADDR_HSIZE; idx++) { + read_lock(&dev_base_lock); + + for (dev = dev_base, idx = 0; dev; dev = dev->next, idx++) { if (idx < s_idx) continue; if (idx > s_idx) s_ip_idx = 0; - read_lock_bh(&addrconf_hash_lock); - for (ifa=inet6_addr_lst[idx], ip_idx = 0; ifa; - ifa = ifa->lst_next, ip_idx++) { + ip_idx = 0; + if ((idev = in6_dev_get(dev)) == NULL) + continue; + read_lock_bh(&idev->lock); + /* unicast address */ + for (ifa = idev->addr_list; ifa; + ifa = ifa->if_next, ip_idx++) { if (ip_idx < s_ip_idx) continue; - if (inet6_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR) <= 0) { - read_unlock_bh(&addrconf_hash_lock); + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) goto done; - } } - read_unlock_bh(&addrconf_hash_lock); + /* temp addr */ +#ifdef CONFIG_IPV6_PRIVACY + for (ifa = idev->tempaddr_list; ifa; + ifa = ifua->tmp_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } +#endif + /* multicast address */ + for (ifmca = idev->mc_list; ifmca; + ifmca = ifmca->next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifmcaddr(skb, ifmca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } + /* anycast address */ + for (ifaca = idev->ac_list; ifaca; + ifaca = ifaca->aca_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifacaddr(skb, ifaca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } + read_unlock_bh(&idev->lock); + in6_dev_put(idev); } done: + if (err <= 0) { + read_unlock_bh(&idev->lock); + in6_dev_put(idev); + } + read_unlock(&dev_base_lock); cb->args[0] = idx; cb->args[1] = ip_idx; - return skb->len; } diff -urN linux-2.6.0-test6/net/ipv6/anycast.c linux-2.6.0-test6-ipv6mib4/net/ipv6/anycast.c --- linux-2.6.0-test6/net/ipv6/anycast.c 2003-09-27 17:50:06.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/anycast.c 2003-10-08 00:15:38.000000000 -0700 @@ -343,6 +343,8 @@ ipv6_addr_copy(&aca->aca_addr, addr); aca->aca_idev = idev; aca->aca_users = 1; + /* aca_tstamp should be updated upon changes */ + aca->aca_cstamp = aca->aca_tstamp = jiffies; atomic_set(&aca->aca_refcnt, 2); aca->aca_lock = SPIN_LOCK_UNLOCKED; diff -urN linux-2.6.0-test6/net/ipv6/mcast.c linux-2.6.0-test6-ipv6mib4/net/ipv6/mcast.c --- linux-2.6.0-test6/net/ipv6/mcast.c 2003-09-27 17:50:53.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/mcast.c 2003-10-08 00:15:38.000000000 -0700 @@ -830,6 +830,8 @@ ipv6_addr_copy(&mc->mca_addr, addr); mc->idev = idev; mc->mca_users = 1; + /* mca_stamp should be updated upon changes */ + mc->mca_cstamp = mc->mca_tstamp = jiffies; atomic_set(&mc->mca_refcnt, 2); mc->mca_lock = SPIN_LOCK_UNLOCKED; From jgarzik@pobox.com Tue Oct 14 10:39:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 10:39:56 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EHdL25012315 for ; Tue, 14 Oct 2003 10:39:22 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36352 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9T8i-0004Pv-H7; Tue, 14 Oct 2003 18:39:20 +0100 Message-ID: <3F8C34BD.4070406@pobox.com> Date: Tue, 14 Oct 2003 13:39:09 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: Nenad Corbic , netdev@oss.sgi.com Subject: Re: [PATCH] remove dev_get from wanrouter References: <20030929143603.06d32058.shemminger@osdl.org> In-Reply-To: <20030929143603.06d32058.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 802 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: 16 Lines: 2 applied to 2.5 From jgarzik@pobox.com Tue Oct 14 10:39:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 10:40:03 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EHdT25012371 for ; Tue, 14 Oct 2003 10:39:30 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36353 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9T8q-0004Q0-Va; Tue, 14 Oct 2003 18:39:29 +0100 Message-ID: <3F8C34C6.3030504@pobox.com> Date: Tue, 14 Oct 2003 13:39:18 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] wan/lmc -- convert to new network device model References: <20030929144119.03cf1ad7.shemminger@osdl.org> In-Reply-To: <20030929144119.03cf1ad7.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 803 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: 17 Lines: 3 applied to 2.5 From jgarzik@pobox.com Tue Oct 14 10:39:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 10:40:17 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EHdh25012479 for ; Tue, 14 Oct 2003 10:39:44 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36354 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9T94-0004QJ-IY; Tue, 14 Oct 2003 18:39:42 +0100 Message-ID: <3F8C34D3.7060408@pobox.com> Date: Tue, 14 Oct 2003 13:39:31 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu CC: netdev@oss.sgi.com, "David S. Miller" Subject: Re: [PATCH] 2.6.0-test6 - more free_netdev() conversion References: <20030930000646.A19220@electric-eye.fr.zoreil.com> In-Reply-To: <20030930000646.A19220@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 804 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: 17 Lines: 3 applied to 2.5 From davem@pizda.ninka.net Tue Oct 14 10:51:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 10:52:09 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EHpZ25013779 for ; Tue, 14 Oct 2003 10:51:35 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id KAA08712; Tue, 14 Oct 2003 10:45:03 -0700 Date: Tue, 14 Oct 2003 10:45:03 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: shep@alum.mit.edu, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@redhat.com, netdev@oss.sgi.com, torvalds@osdl.org, linux-kernel@vger.kernel.org, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] fix numbering of lines in /proc/net/tcp (linux-2.6.0-test7) Message-Id: <20031014104503.12ca907e.davem@redhat.com> In-Reply-To: <20031015.013848.133364889.yoshfuji@linux-ipv6.org> References: <200310141619.h9EGJWWB013461@ginger.lcs.mit.edu> <20031015.013848.133364889.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 805 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: 924 Lines: 20 On Wed, 15 Oct 2003 01:38:48 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > In article <200310141619.h9EGJWWB013461@ginger.lcs.mit.edu> (at Tue, 14 Oct 2003 12:19:32 -0400), Tim Shepard says: > > > I am not sure what the behavior is supposed to be. Is there a spec > > anywhere for the interface with /proc/net/tcp? > > Yes, I think the original is okay because the bucket is shared between > tcp6 and tcp4, and I don't want to change this behavior in 2.6 from 2.4.x. > (so, we need to fix 2.6.x.) In the meantime I've applied Tim's patch because it is definitely a step in the right direction and the current 2.6.x behavior makes no sense at all :-) We can add a fix on top to make 2.6.x behave more closely to 2.4.x (by sharing numbers between v4 and v6). If that proves to be very difficult to do, it's not absolutely critical to preserve this behavior I think. From jgarzik@pobox.com Tue Oct 14 10:52:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 10:53:25 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EHqo25014003 for ; Tue, 14 Oct 2003 10:52:51 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36368 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9TLl-0004j7-QJ; Tue, 14 Oct 2003 18:52:49 +0100 Message-ID: <3F8C37E6.70700@pobox.com> Date: Tue, 14 Oct 2003 13:52:38 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Feldman, Scott" CC: matthew@wil.cx, netdev@oss.sgi.com Subject: Re: [PATCH 2.6] ethtool_ops eeprom stuff References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 806 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: 25 Lines: 3 applied to 2.4 and 2.5 From jgarzik@pobox.com Tue Oct 14 11:07:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:08:23 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EI7m25014775 for ; Tue, 14 Oct 2003 11:07:49 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36377 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9TaF-00051o-Gj; Tue, 14 Oct 2003 19:07:47 +0100 Message-ID: <3F8C3B68.6000207@pobox.com> Date: Tue, 14 Oct 2003 14:07:36 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeroen Vreeken CC: linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] (resend) References: <20031008235634.C207@jeroen.pe1rxq.ampr.org> In-Reply-To: <20031008235634.C207@jeroen.pe1rxq.ampr.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 807 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: 10 Lines: 3 applied From shep@ginger.lcs.mit.edu Tue Oct 14 11:15:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:16:01 -0700 (PDT) Received: from ginger.lcs.mit.edu (ginger.lcs.mit.edu [18.26.0.82]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EIFD25015974 for ; Tue, 14 Oct 2003 11:15:26 -0700 Received: from ginger.lcs.mit.edu (localhost [127.0.0.1]) by ginger.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id h9EIErWB014091; Tue, 14 Oct 2003 14:14:53 -0400 Message-Id: <200310141814.h9EIErWB014091@ginger.lcs.mit.edu> From: Tim Shepard To: "David S. Miller" cc: "YOSHIFUJI Hideaki / _$B5HF#1QL@" , kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@redhat.com, netdev@oss.sgi.com, torvalds@osdl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fix numbering of lines in /proc/net/tcp (linux-2.6.0-test7) In-reply-to: Your message of Tue, 14 Oct 2003 10:45:03 -0700. <20031014104503.12ca907e.davem@redhat.com> Date: Tue, 14 Oct 2003 14:14:52 -0400 X-archive-position: 808 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shep@alum.mit.edu Precedence: bulk X-list: netdev Content-Length: 5417 Lines: 198 > > > I am not sure what the behavior is supposed to be. Is there a spec > > > anywhere for the interface with /proc/net/tcp? > > > > Yes, I think the original is okay because the bucket is shared between > > tcp6 and tcp4, and I don't want to change this behavior in 2.6 from 2.4.x. > > (so, we need to fix 2.6.x.) > > In the meantime I've applied Tim's patch because it is definitely > a step in the right direction and the current 2.6.x behavior makes > no sense at all :-) Ok, that makes good sense to me. > We can add a fix on top to make 2.6.x behave more closely to 2.4.x > (by sharing numbers between v4 and v6). If that proves to be very > difficult to do, it's not absolutely critical to preserve this behavior > I think. Whoever dives in and fixes this (i.e. makes the linux-2.6 behavior exactly match linux-2.4 behavior) may want to start with a copy of net/ipv4/tcp_ipv4.c from 2.6.0-test7 without that patch applied because that patch rips out bits of code that was trying to increment st->num whenever sk->sk_family does not match st->family. Some of those bits of code will need to reappear to make linux-2.6 match linux-2.4 behavior. (Note, the patch below might contain some clues.) When testing this stuff, you need to make sure that there is no dependence upon the buffer size that the user mode program is using to read from /proc/net/tcp and /proc/net/tcp6. (Use dd with different bs= arguments.) I just quickly tried to make the linux-2.6 numbering behave identically to linux-2.4 (see patch below) but it did not work properly, and I have not figured out yet where I goofed. Note: THIS PATCH IS WRONG. Do not apply this patch unless you want to help figure out why it does not work correctly. I was trying to make linux-2.6 number the lines the same way linux-2.4 did, but the numbers come out wrong. This patch is against linux-2.6.0-test7 without my previous patch to fix the numbering. -Tim Shepard shep@alum.mit.edu --- ../pristine/linux-2.6.0-test7/net/ipv4/tcp_ipv4.c 2003-10-08 15:24:03.000000000 -0400 +++ net/ipv4/tcp_ipv4.c 2003-10-14 13:23:58.000000000 -0400 @@ -2136,29 +2136,29 @@ static void *listening_get_first(struct seq_file *seq) { struct tcp_iter_state* st = seq->private; void *rc = NULL; for (st->bucket = 0; st->bucket < TCP_LHTABLE_SIZE; ++st->bucket) { struct open_request *req; struct tcp_opt *tp; struct sock *sk = sk_head(&tcp_listening_hash[st->bucket]); if (!sk) continue; - ++st->num; if (sk->sk_family == st->family) { rc = sk; goto out; } + ++st->num; tp = tcp_sk(sk); read_lock_bh(&tp->syn_wait_lock); if (tp->listen_opt && tp->listen_opt->qlen) { st->uid = sock_i_uid(sk); st->syn_wait_sk = sk; st->state = TCP_SEQ_STATE_OPENREQ; for (st->sbucket = 0; st->sbucket < TCP_SYNQ_HSIZE; ++st->sbucket) { for (req = tp->listen_opt->syn_table[st->sbucket]; req; req = req->dl_next, ++st->num) { if (req->class->family != st->family) continue; @@ -2172,54 +2172,57 @@ } out: return rc; } static void *listening_get_next(struct seq_file *seq, void *cur) { struct tcp_opt *tp; struct hlist_node *node; struct sock *sk = cur; struct tcp_iter_state* st = seq->private; + ++st->num; + if (st->state == TCP_SEQ_STATE_OPENREQ) { struct open_request *req = cur; tp = tcp_sk(st->syn_wait_sk); req = req->dl_next; while (1) { while (req) { - ++st->num; if (req->class->family == st->family) { cur = req; goto out; } + ++st->num; req = req->dl_next; } if (++st->sbucket >= TCP_SYNQ_HSIZE) break; get_req: req = tp->listen_opt->syn_table[st->sbucket]; } sk = sk_next(st->syn_wait_sk); st->state = TCP_SEQ_STATE_LISTENING; read_unlock_bh(&tp->syn_wait_lock); } else sk = sk_next(sk); get_sk: sk_for_each_from(sk, node) { if (sk->sk_family == st->family) { cur = sk; goto out; } + ++st->num; tp = tcp_sk(sk); read_lock_bh(&tp->syn_wait_lock); if (tp->listen_opt && tp->listen_opt->qlen) { st->uid = sock_i_uid(sk); st->syn_wait_sk = sk; st->state = TCP_SEQ_STATE_OPENREQ; st->sbucket = 0; goto get_req; } read_unlock_bh(&tp->syn_wait_lock); } if (++st->bucket < TCP_LHTABLE_SIZE) { @@ -2275,24 +2278,26 @@ } out: return rc; } static void *established_get_next(struct seq_file *seq, void *cur) { struct sock *sk = cur; struct tcp_tw_bucket *tw; struct hlist_node *node; struct tcp_iter_state* st = seq->private; + ++st->num; + if (st->state == TCP_SEQ_STATE_TIME_WAIT) { tw = cur; tw = tw_next(tw); get_tw: while (tw && tw->tw_family != st->family) { ++st->num; tw = tw_next(tw); } if (tw) { cur = tw; goto out; } @@ -2345,24 +2350,26 @@ if (!rc) { tcp_listen_unlock(); local_bh_disable(); st->state = TCP_SEQ_STATE_ESTABLISHED; rc = established_get_idx(seq, pos); } return rc; } static void *tcp_seq_start(struct seq_file *seq, loff_t *pos) { + struct tcp_iter_state* st = seq->private; + st->num = 0; return *pos ? tcp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *tcp_seq_next(struct seq_file *seq, void *v, loff_t *pos) { void *rc = NULL; struct tcp_iter_state* st; if (v == SEQ_START_TOKEN) { rc = tcp_get_idx(seq, 0); goto out; } From jgarzik@pobox.com Tue Oct 14 11:16:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:16:38 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EIG525016108 for ; Tue, 14 Oct 2003 11:16:05 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36387 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9TiF-0005Be-SQ; Tue, 14 Oct 2003 19:16:03 +0100 Message-ID: <3F8C3D58.5000603@pobox.com> Date: Tue, 14 Oct 2003 14:15:52 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Feldman, Scott" CC: netdev@oss.sgi.com Subject: Re: [e1000 2.4] hang on ZEROCOPY/TSO when hitting no-Tx-resources condition References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 809 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: 24 Lines: 2 applied to 2.4 and 2.5 From jgarzik@pobox.com Tue Oct 14 11:18:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:18:52 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EIII25017047 for ; Tue, 14 Oct 2003 11:18:19 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36388 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9TkP-0005Le-EO; Tue, 14 Oct 2003 19:18:17 +0100 Message-ID: <3F8C3DDE.1020506@pobox.com> Date: Tue, 14 Oct 2003 14:18:06 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Felipe W Damasio CC: Richard Procter , Linux Kernel Mailing List , linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] SMP support and perfomance improvement in 3c527 net driver References: <3F81C30B.7080106@terra.com.br> In-Reply-To: <3F81C30B.7080106@terra.com.br> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 810 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: 18 Lines: 3 applied to 2.5. From jgarzik@pobox.com Tue Oct 14 11:18:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:19:23 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EIIn25017074 for ; Tue, 14 Oct 2003 11:18:50 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36389 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9Tku-0005UO-Tx; Tue, 14 Oct 2003 19:18:49 +0100 Message-ID: <3F8C3DFD.1050706@pobox.com> Date: Tue, 14 Oct 2003 14:18:37 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Felipe W Damasio CC: Linux Kernel Mailing List , linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] finer-grained locking in wan/lmc driver References: <3F81B086.9050905@terra.com.br> In-Reply-To: <3F81B086.9050905@terra.com.br> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 811 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: 112 Lines: 4 conflicts with a just-applied patch... can you wait a few days, then resend against the latest -bk snapshot? From shemminger@osdl.org Tue Oct 14 11:20:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:21:09 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EIKC25017738 for ; Tue, 14 Oct 2003 11:20:35 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9EIJso09983; Tue, 14 Oct 2003 11:19:55 -0700 Date: Tue, 14 Oct 2003 11:19:40 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] mark dev_alloc as deprecated. Message-Id: <20031014111940.709280d7.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 812 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 Content-Length: 2112 Lines: 47 dev_alloc is an older way of getting a network device. Most uses of it are gone, and it was usually used in an unsafe way. The remaining usage in 2.6.0-test7 are in arcnet devices. diff -urN -X dontdiff linux-2.5/include/linux/netdevice.h linux-2.5-net/include/linux/netdevice.h --- linux-2.5/include/linux/netdevice.h 2003-10-07 11:28:37.000000000 -0700 +++ linux-2.5-net/include/linux/netdevice.h 2003-10-07 11:59:36.000000000 -0700 @@ -511,7 +511,11 @@ unsigned short mask); extern struct net_device *dev_get_by_name(const char *name); extern struct net_device *__dev_get_by_name(const char *name); -extern struct net_device *dev_alloc(const char *name, int *err); +extern struct net_device *__dev_alloc(const char *name, int *err); +static inline __deprecated struct net_device *dev_alloc(const char *name, int *err) +{ + return __dev_alloc(name, err); +} extern int dev_alloc_name(struct net_device *dev, const char *name); extern int dev_open(struct net_device *dev); extern int dev_close(struct net_device *dev); diff -urN -X dontdiff linux-2.5/net/core/dev.c linux-2.5-net/net/core/dev.c --- linux-2.5/net/core/dev.c 2003-10-07 11:29:56.000000000 -0700 +++ linux-2.5-net/net/core/dev.c 2003-10-07 16:35:51.000000000 -0700 @@ -646,11 +646,12 @@ * failed. The cause of an error is returned as a negative errno code * in the variable @err points to. * - * The caller must hold the @dev_base or RTNL locks when doing this in + * This call is deprecated in favor of alloc_netdev because + * the caller must hold the @dev_base or RTNL locks when doing this in * order to avoid duplicate name allocations. */ -struct net_device *dev_alloc(const char *name, int *err) +struct net_device *__dev_alloc(const char *name, int *err) { struct net_device *dev = kmalloc(sizeof(*dev), GFP_KERNEL); @@ -2997,7 +2998,7 @@ EXPORT_SYMBOL(__skb_linearize); EXPORT_SYMBOL(call_netdevice_notifiers); EXPORT_SYMBOL(dev_add_pack); -EXPORT_SYMBOL(dev_alloc); +EXPORT_SYMBOL(__dev_alloc); EXPORT_SYMBOL(dev_alloc_name); EXPORT_SYMBOL(dev_close); EXPORT_SYMBOL(dev_get_by_flags); From felipewd@terra.com.br Tue Oct 14 11:28:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:28:46 -0700 (PDT) Received: from ivoti.terra.com.br (ivoti.terra.com.br [200.176.3.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EISB25018191 for ; Tue, 14 Oct 2003 11:28:12 -0700 Received: from altamira.terra.com.br (altamira.terra.com.br [200.176.3.40]) by ivoti.terra.com.br (Postfix) with ESMTP id B38E279C222; Tue, 14 Oct 2003 15:28:09 -0300 (BRT) Received: from terra.com.br (200-163-191-105.paemt7004.e.brasiltelecom.net.br [200.163.191.105]) (authenticated user felipewd) by altamira.terra.com.br (Postfix) with ESMTP id 7280A3DC117; Tue, 14 Oct 2003 15:28:08 -0300 (BRT) Message-ID: <3F8C32E4.6030405@terra.com.br> Date: Tue, 14 Oct 2003 15:31:16 -0200 From: Felipe W Damasio User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik Cc: Linux Kernel Mailing List , linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] finer-grained locking in wan/lmc driver References: <3F81B086.9050905@terra.com.br> <3F8C3DFD.1050706@pobox.com> In-Reply-To: <3F8C3DFD.1050706@pobox.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 813 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipewd@terra.com.br Precedence: bulk X-list: netdev Content-Length: 151 Lines: 10 Jeff Garzik wrote: > conflicts with a just-applied patch... can you wait a few days, then > resend against the latest -bk snapshot? Yep. Felipe From jgarzik@pobox.com Tue Oct 14 11:39:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:39:35 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EId125019085 for ; Tue, 14 Oct 2003 11:39:02 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36401 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9U4S-0005s1-78; Tue, 14 Oct 2003 19:39:00 +0100 Message-ID: <3F8C42B9.5070807@pobox.com> Date: Tue, 14 Oct 2003 14:38:49 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Randy.Dunlap" CC: netdev@oss.sgi.com Subject: Re: [PATCH] janitor: insert missing iounmap(), add error handling References: <20031003212904.34d4ca01.rddunlap@osdl.org> In-Reply-To: <20031003212904.34d4ca01.rddunlap@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 814 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: 31 Lines: 3 patch applied to 2.4 and 2.5 From johnip@sgi.com Tue Oct 14 11:48:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:48:35 -0700 (PDT) Received: from tolkor.sgi.com (tolkor.SGI.COM [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EIm025019645 for ; Tue, 14 Oct 2003 11:48:00 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h9EJ64Hc032628 for ; Tue, 14 Oct 2003 14:06:04 -0500 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h9EIljaP12234495; Tue, 14 Oct 2003 13:47:45 -0500 (CDT) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h9EIliRn325115695; Tue, 14 Oct 2003 13:47:45 -0500 (CDT) Message-ID: <3F8C44D0.20907@sgi.com> Date: Tue, 14 Oct 2003 13:47:44 -0500 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030905 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andi Kleen CC: Steve Modica , "David S. Miller" , netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> In-Reply-To: <20031011131921.GC21763@wotan.suse.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 815 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev Content-Length: 483 Lines: 20 Andi Kleen wrote: > Then just don't set the argument to zero in modules.conf on the 5704cards. > That could be even handled somewhere in user space. Switching over sounds > best of course, because the performance with the copying won't be great The problem with this is if you mix 5704 and 5701 cards in the same system you are not seting it for the 5701's that need it. John -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From gandalf@wlug.westbo.se Tue Oct 14 11:50:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:51:24 -0700 (PDT) Received: from tux.rsn.bth.se (postfix@tux.rsn.bth.se [194.47.143.135]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EIon25020008 for ; Tue, 14 Oct 2003 11:50:50 -0700 Received: by tux.rsn.bth.se (Postfix, from userid 501) id 04FE83FED; Tue, 14 Oct 2003 20:50:46 +0200 (CEST) Subject: Re: NULL pointer dereference in sysfs_hash_and_remove() From: Martin Josefsson To: Stephen Hemminger Cc: Jeff Garzik , linux-kernel@vger.kernel.org, netdev@oss.sgi.com In-Reply-To: <20031013163200.43e5d1bf.shemminger@osdl.org> References: <1065220892.31749.39.camel@tux.rsn.bth.se> <20031013163200.43e5d1bf.shemminger@osdl.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-0aUiYSDu5jwesMQwEtGO" Message-Id: <1066157445.740.2.camel@tux.rsn.bth.se> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 14 Oct 2003 20:50:45 +0200 X-archive-position: 816 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@wlug.westbo.se Precedence: bulk X-list: netdev Content-Length: 1188 Lines: 47 --=-0aUiYSDu5jwesMQwEtGO Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2003-10-14 at 01:32, Stephen Hemminger wrote: > On Sat, 04 Oct 2003 00:41:32 +0200 > Martin Josefsson wrote: >=20 > > Hi > >=20 > > I compiled 2.6.0-test6 and ran it on a laptop with cardbus. > > I have an Xircom NIC and if I remove it during operation I get the bug > > below. > >=20 > > I have yenta_socket and xircom_cb loaded as modules. >=20 >=20 > The driver was setting the statistics pointer after registration had occu= rred, > so on unregister the network code was removing a non-existent sysfs direc= tory. >=20 > Try this please. I've applied this patch and=20 "[PATCH] sysfs -- don't crash if removing non-existant attribute group" and now it works great. Thanks. --=20 /Martin --=-0aUiYSDu5jwesMQwEtGO Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQA/jEWFWm2vlfa207ERAhF8AKCAFiUOZUmcxjEvEmpw9uA7w+nk5wCdEwG+ xk/Ch/NO8NUa/06vTa1S/yA= =g+ip -----END PGP SIGNATURE----- --=-0aUiYSDu5jwesMQwEtGO-- From shemminger@osdl.org Tue Oct 14 11:56:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 11:57:08 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EIuZ25020786 for ; Tue, 14 Oct 2003 11:56:35 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9EIuTo17450; Tue, 14 Oct 2003 11:56:29 -0700 Date: Tue, 14 Oct 2003 11:56:14 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] xircom_cb -- fix setting statistics after registration Message-Id: <20031014115614.42b86470.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 817 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 Content-Length: 2744 Lines: 93 This driver was setting dev->get_statistics after registration and confusing netdevice sysfs on unload. The change was to use alloc_etherdev and defer registration till the device was initialized properly. This patch has been tested by the original bug reporter. diff -Nru a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c --- a/drivers/net/tulip/xircom_cb.c Tue Oct 14 09:34:41 2003 +++ b/drivers/net/tulip/xircom_cb.c Tue Oct 14 09:34:41 2003 @@ -230,7 +230,8 @@ This way, we can fail gracefully if not enough memory is available. */ - if ((dev = init_etherdev(NULL, sizeof(struct xircom_private))) == NULL) { + dev = alloc_etherdev(sizeof(struct xircom_private)); + if (!dev) { printk(KERN_ERR "xircom_probe: failed to allocate etherdev\n"); goto device_fail; } @@ -250,7 +251,7 @@ SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq); + private->dev = dev; private->pdev = pdev; @@ -259,7 +260,6 @@ dev->irq = pdev->irq; dev->base_addr = private->io_port; - initialize_card(private); read_mac_address(private); setup_descriptors(private); @@ -272,7 +272,12 @@ SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); pci_set_drvdata(pdev, dev); - + if (register_netdev(dev)) { + printk(KERN_ERR "xircom_probe: netdevice registration failed.\n"); + goto reg_fail; + } + + printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq); /* start the transmitter to get a heartbeat */ /* TODO: send 2 dummy packets here */ transceiver_voodoo(private); @@ -287,10 +292,12 @@ leave("xircom_probe"); return 0; +reg_fail: + kfree(private->tx_buffer); tx_buf_fail: kfree(private->rx_buffer); rx_buf_fail: - kfree(dev); + free_netdev(dev); device_fail: return -ENODEV; } @@ -305,22 +312,16 @@ static void __devexit xircom_remove(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); - struct xircom_private *card; + struct xircom_private *card = dev->priv; + enter("xircom_remove"); - if (dev!=NULL) { - card=dev->priv; - if (card!=NULL) { - if (card->rx_buffer!=NULL) - pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle); - card->rx_buffer = NULL; - if (card->tx_buffer!=NULL) - pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle); - card->tx_buffer = NULL; - } - } + pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle); + pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle); + release_region(dev->base_addr, 128); unregister_netdev(dev); free_netdev(dev); + pci_set_drvdata(pdev, NULL); leave("xircom_remove"); } From garzik@gtf.org Tue Oct 14 12:01:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 12:02:27 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EJ1m25021222 for ; Tue, 14 Oct 2003 12:01:48 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 3DB896663; Tue, 14 Oct 2003 15:01:08 -0400 (EDT) Date: Tue, 14 Oct 2003 15:01:08 -0400 From: Jeff Garzik To: marcelo@parcelfarce.linux.theplanet.co.uk, marcelo.tosatti@cyclades.com Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [BK PATCHES] 2.4.x net driver updates Message-ID: <20031014190108.GA19665@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 818 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: 30801 Lines: 1009 Marcelo, please do a bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.4 This will update the following files: drivers/net/8139too.c | 2 drivers/net/b44.c | 23 +---- drivers/net/e1000/e1000_main.c | 30 +++++- drivers/net/natsemi.c | 2 drivers/net/pcmcia/xircom_cb.c | 114 ++++++++++++------------- drivers/net/sk98lin/h/skversion.h | 13 +- drivers/net/sk98lin/skge.c | 171 ++++++++++++++++++++++++++------------ drivers/net/tulip/tulip_core.c | 1 include/linux/ethtool.h | 11 +- include/linux/pci_ids.h | 1 net/core/ethtool.c | 49 ++++++---- 11 files changed, 254 insertions(+), 163 deletions(-) through these ChangeSets: (03/10/14 1.1198) [PATCH] b44 enable interrupts after tx timeout (2.4.23-pre6) Here's the 2.4.23-pre6 version, which syncs the driver fully with 2.6. Seems to work (tm). (03/10/14 1.1197) [netdrvr natsemi] fix ring clean Too much copy&paste in a call to pci_unmap_single. (03/10/14 1.1196) [netdrvr tulip] add pci id Contributed by Ken Zalewski. (03/10/14 1.1195) [netdrvr 8139too] another new PCI ID Contributed by Josh Litherland, Donald Becker, and others. (03/10/14 1.1194) [netdrvr 8139too] add pci id contributed by "JaReK" and Donald Becker. (03/10/14 1.1193) [PATCH] hang on ZEROCOPY/TSO when hitting no-Tx-resources * Critical bug fix: under heavy Tx stress using ZEROCOPY or TSO, if we run out of Tx descriptors, we don't calculate for the context descriptor used as the first of the ZEROCOPY/TSO send, nor do we clean up the context descriptor bits in the case where the send isn't going to fit and we need to undo the mappings. This bug was introduced with the 5.2.16 patch set which included a workaround for a hang on 82544 over PCI-X. This workaround caused the check for no-Tx- resource logic to change, and this bug slipped in. (03/10/14 1.1192) [PATCH] ethtool_ops eeprom stuff Finally got around to adding ethtool_ops to e100-3.0.x. I found a bug with get_eeprom() and it seems to work best if we add get_eeprom_len() to the ops list. Also moved check for offest + len < size into ethtool.c. I was able to test [GS]EEPROM, PHYS_ID, GSTATS, GSTRINGS, and TEST, and everything looks good. Should I send same for 2.4? (03/10/14 1.1191) [PATCH] sk98lin-2.4: Driver update to version 6.18 here is a new version of the sk98lin driver (v6.18) with some changes for the kernel 2.4.22-bk25. Patch 1/1 * Add: New Gigabit LOM vendors (Epox, Gigabyte, Abit, Iwill, ECS, Asus) * Add: Better Support for Yukon Plus chipset * Fix: IO-control return race condition * Fix: Interrupt moderation value check * Fix: PCI initialization (SkGeInitPCI) * Fix: TCP and UDP HW Checksum calculation (03/10/14 1.1190) [netdrvr xircom_cb] backport 2.6 changes * use alloc_etherdev; fixes races in stats pointer setting (by Stephen Hemminger) * kill unnecessary whitespace and #includes * use C99-style initializers * speling and irqreturn_t changes diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c --- a/drivers/net/8139too.c Tue Oct 14 14:52:41 2003 +++ b/drivers/net/8139too.c Tue Oct 14 14:52:41 2003 @@ -247,6 +247,8 @@ {0x14ea, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x14ea, 0xab07, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x11db, 0x1234, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, + {0x1432, 0x9130, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, + {0x02ac, 0x1012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, #ifdef CONFIG_SH_SECUREEDGE5410 /* Bogus 8139 silicon reports 8129 without external PROM :-( */ diff -Nru a/drivers/net/b44.c b/drivers/net/b44.c --- a/drivers/net/b44.c Tue Oct 14 14:52:41 2003 +++ b/drivers/net/b44.c Tue Oct 14 14:52:41 2003 @@ -25,8 +25,8 @@ #define DRV_MODULE_NAME "b44" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "0.9" -#define DRV_MODULE_RELDATE "Jul 14, 2003" +#define DRV_MODULE_VERSION "0.91" +#define DRV_MODULE_RELDATE "Oct 3, 2003" #define B44_DEF_MSG_ENABLE \ (NETIF_MSG_DRV | \ @@ -80,16 +80,7 @@ static int b44_debug = -1; /* -1 == use B44_DEF_MSG_ENABLE as value */ -#ifndef PCI_DEVICE_ID_BCM4401 -#define PCI_DEVICE_ID_BCM4401 0x4401 -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#define IRQ_RETVAL(x) -#define irqreturn_t void -#endif - -static struct pci_device_id b44_pci_tbl[] __devinitdata = { +static struct pci_device_id b44_pci_tbl[] = { { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4401, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { } /* terminate list with empty entry */ @@ -870,6 +861,8 @@ spin_unlock_irq(&bp->lock); + b44_enable_ints(bp); + netif_wake_queue(dev); } @@ -1393,7 +1386,7 @@ strcpy (info.driver, DRV_MODULE_NAME); strcpy (info.version, DRV_MODULE_VERSION); memset(&info.fw_version, 0, sizeof(info.fw_version)); - strcpy (info.bus_info, pci_dev->slot_name); + strcpy (info.bus_info, pci_name(pci_dev)); info.eedump_len = 0; info.regdump_len = 0; if (copy_to_user (useraddr, &info, sizeof (info))) @@ -1834,7 +1827,7 @@ iounmap((void *) bp->regs); err_out_free_dev: - kfree(dev); + free_netdev(dev); err_out_free_res: pci_release_regions(pdev); @@ -1852,7 +1845,7 @@ if (dev) { unregister_netdev(dev); iounmap((void *) ((struct b44 *)(dev->priv))->regs); - kfree(dev); + free_netdev(dev); pci_release_regions(pdev); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c --- a/drivers/net/e1000/e1000_main.c Tue Oct 14 14:52:41 2003 +++ b/drivers/net/e1000/e1000_main.c Tue Oct 14 14:52:41 2003 @@ -59,7 +59,7 @@ char e1000_driver_name[] = "e1000"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; -char e1000_driver_version[] = "5.2.16-k1"; +char e1000_driver_version[] = "5.2.16-k2"; char e1000_copyright[] = "Copyright (c) 1999-2003 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -1532,6 +1532,7 @@ unsigned int first) { struct e1000_desc_ring *tx_ring = &adapter->tx_ring; + struct e1000_tx_desc *tx_desc; struct e1000_buffer *buffer_info; unsigned int len = skb->len, max_per_txd = E1000_MAX_DATA_PER_TXD; unsigned int offset = 0, size, count = 0, i; @@ -1622,17 +1623,29 @@ } } - if(E1000_DESC_UNUSED(&adapter->tx_ring) < count) { + if(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2) { /* There aren't enough descriptors available to queue up - * this send, so undo the mapping and abort the send. - * We could have done the check before we mapped the skb, - * but because of all the workarounds (above), it's too - * difficult to predict how many we're going to need.*/ - i = first; + * this send (need: count + 1 context desc + 1 desc gap + * to keep tail from touching head), so undo the mapping + * and abort the send. We could have done the check before + * we mapped the skb, but because of all the workarounds + * (above), it's too difficult to predict how many we're + * going to need.*/ + i = adapter->tx_ring.next_to_use; + + if(i == first) { + /* Cleanup after e1000_tx_[csum|tso] scribbling + * on descriptors. */ + tx_desc = E1000_TX_DESC(*tx_ring, first); + tx_desc->buffer_addr = 0; + tx_desc->lower.data = 0; + tx_desc->upper.data = 0; + } while(count--) { buffer_info = &tx_ring->buffer_info[i]; + if(buffer_info->dma) { pci_unmap_page(adapter->pdev, buffer_info->dma, @@ -1640,8 +1653,11 @@ PCI_DMA_TODEVICE); buffer_info->dma = 0; } + if(++i == tx_ring->count) i = 0; } + + adapter->tx_ring.next_to_use = first; return 0; } diff -Nru a/drivers/net/natsemi.c b/drivers/net/natsemi.c --- a/drivers/net/natsemi.c Tue Oct 14 14:52:41 2003 +++ b/drivers/net/natsemi.c Tue Oct 14 14:52:41 2003 @@ -1528,7 +1528,7 @@ for (i = 0; i < TX_RING_SIZE; i++) { if (np->tx_skbuff[i]) { pci_unmap_single(np->pci_dev, - np->rx_dma[i], np->rx_skbuff[i]->len, + np->tx_dma[i], np->tx_skbuff[i]->len, PCI_DMA_TODEVICE); dev_kfree_skb(np->tx_skbuff[i]); np->stats.tx_dropped++; diff -Nru a/drivers/net/pcmcia/xircom_cb.c b/drivers/net/pcmcia/xircom_cb.c --- a/drivers/net/pcmcia/xircom_cb.c Tue Oct 14 14:52:41 2003 +++ b/drivers/net/pcmcia/xircom_cb.c Tue Oct 14 14:52:41 2003 @@ -14,10 +14,8 @@ * $Id: xircom_cb.c,v 1.33 2001/03/19 14:02:07 arjanv Exp $ */ - #include #include -#include #include #include #include @@ -30,12 +28,11 @@ #include #include #include + #include #include #include - - #ifdef DEBUG #define enter(x) printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__) #define leave(x) printk("Leave: %s, %s line %i\n",x,__FILE__,__LINE__) @@ -114,7 +111,7 @@ /* Function prototypes */ static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id); static void xircom_remove(struct pci_dev *pdev); -static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev); static int xircom_open(struct net_device *dev); static int xircom_close(struct net_device *dev); @@ -124,7 +121,7 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_private *card, int descnr, unsigned int bufferoffset); static void investigate_write_descriptor(struct net_device *dev, struct xircom_private *card, int descnr, unsigned int bufferoffset); static void read_mac_address(struct xircom_private *card); -static void tranceiver_voodoo(struct xircom_private *card); +static void transceiver_voodoo(struct xircom_private *card); static void initialize_card(struct xircom_private *card); static void trigger_transmit(struct xircom_private *card); static void trigger_receive(struct xircom_private *card); @@ -143,17 +140,19 @@ -static struct pci_device_id xircom_pci_table[] __devinitdata = { +static struct pci_device_id xircom_pci_table[] = { {0x115D, 0x0003, PCI_ANY_ID, PCI_ANY_ID,}, {0,}, }; MODULE_DEVICE_TABLE(pci, xircom_pci_table); static struct pci_driver xircom_ops = { - name: "xircom_cb", - id_table: xircom_pci_table, - probe: xircom_probe, - remove: __devexit_p(xircom_remove), + .name = "xircom_cb", + .id_table = xircom_pci_table, + .probe = xircom_probe, + .remove = xircom_remove, + .suspend =NULL, + .resume =NULL }; @@ -226,40 +225,32 @@ return -ENODEV; } - /* Before changing the hardware, allocate the memory. This way, we can fail gracefully if not enough memory is available. */ - private = kmalloc(sizeof(*private),GFP_KERNEL); - memset(private, 0, sizeof(struct xircom_private)); + dev = alloc_etherdev(sizeof(struct xircom_private)); + if (!dev) { + printk(KERN_ERR "xircom_probe: failed to allocate etherdev\n"); + goto device_fail; + } + private = dev->priv; /* Allocate the send/receive buffers */ private->rx_buffer = pci_alloc_consistent(pdev,8192,&private->rx_dma_handle); - if (private->rx_buffer == NULL) { printk(KERN_ERR "xircom_probe: no memory for rx buffer \n"); - kfree(private); - return -ENODEV; + goto rx_buf_fail; } private->tx_buffer = pci_alloc_consistent(pdev,8192,&private->tx_dma_handle); if (private->tx_buffer == NULL) { printk(KERN_ERR "xircom_probe: no memory for tx buffer \n"); - kfree(private->rx_buffer); - kfree(private); - return -ENODEV; - } - dev = init_etherdev(dev, 0); - if (dev == NULL) { - printk(KERN_ERR "xircom_probe: failed to allocate etherdev\n"); - kfree(private->rx_buffer); - kfree(private->tx_buffer); - kfree(private); - return -ENODEV; + goto tx_buf_fail; } + SET_MODULE_OWNER(dev); - printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq); + private->dev = dev; private->pdev = pdev; @@ -267,11 +258,11 @@ private->lock = SPIN_LOCK_UNLOCKED; dev->irq = pdev->irq; dev->base_addr = private->io_port; - + initialize_card(private); read_mac_address(private); setup_descriptors(private); - + dev->open = &xircom_open; dev->hard_start_xmit = &xircom_start_xmit; dev->stop = &xircom_close; @@ -280,19 +271,34 @@ SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); pci_set_drvdata(pdev, dev); + if (register_netdev(dev)) { + printk(KERN_ERR "xircom_probe: netdevice registration failed.\n"); + goto reg_fail; + } + + printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq); /* start the transmitter to get a heartbeat */ /* TODO: send 2 dummy packets here */ - tranceiver_voodoo(private); - + transceiver_voodoo(private); + spin_lock_irqsave(&private->lock,flags); - activate_transmitter(private); - activate_receiver(private); + activate_transmitter(private); + activate_receiver(private); spin_unlock_irqrestore(&private->lock,flags); - + trigger_receive(private); - + leave("xircom_probe"); return 0; + +reg_fail: + kfree(private->tx_buffer); +tx_buf_fail: + kfree(private->rx_buffer); +rx_buf_fail: + free_netdev(dev); +device_fail: + return -ENODEV; } @@ -305,27 +311,20 @@ static void __devexit xircom_remove(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); - struct xircom_private *card; + struct xircom_private *card = dev->priv; + enter("xircom_remove"); - if (dev!=NULL) { - card=dev->priv; - if (card!=NULL) { - if (card->rx_buffer!=NULL) - pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle); - card->rx_buffer = NULL; - if (card->tx_buffer!=NULL) - pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle); - card->tx_buffer = NULL; - } - kfree(card); - } + pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle); + pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle); + release_region(dev->base_addr, 128); unregister_netdev(dev); - kfree(dev); + free_netdev(dev); + pci_set_drvdata(pdev, NULL); leave("xircom_remove"); } -static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_instance; struct xircom_private *card = (struct xircom_private *) dev->priv; @@ -369,6 +368,7 @@ spin_unlock(&card->lock); leave("xircom_interrupt"); + return IRQ_HANDLED; } static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev) @@ -1022,7 +1022,7 @@ /* -link_status() checks the link's status and will return 0 for no link, 10 for 10mbit link and 100 for.. guess what. +link_status() checks the the links status and will return 0 for no link, 10 for 10mbit link and 100 for.. guess what. Must be called in locked state with interrupts disabled */ @@ -1097,15 +1097,15 @@ /* - tranceiver_voodoo() enables the external UTP plug thingy. + transceiver_voodoo() enables the external UTP plug thingy. it's called voodoo as I stole this code and cannot cross-reference it with the specification. */ -static void tranceiver_voodoo(struct xircom_private *card) +static void transceiver_voodoo(struct xircom_private *card) { unsigned long flags; - enter("tranceiver_voodoo"); + enter("transceiver_voodoo"); /* disable all powermanagement */ pci_write_config_dword(card->pdev, PCI_POWERMGMT, 0x0000); @@ -1124,7 +1124,7 @@ spin_unlock_irqrestore(&card->lock, flags); netif_start_queue(card->dev); - leave("tranceiver_voodoo"); + leave("transceiver_voodoo"); } diff -Nru a/drivers/net/sk98lin/h/skversion.h b/drivers/net/sk98lin/h/skversion.h --- a/drivers/net/sk98lin/h/skversion.h Tue Oct 14 14:52:41 2003 +++ b/drivers/net/sk98lin/h/skversion.h Tue Oct 14 14:52:41 2003 @@ -2,8 +2,8 @@ * * Name: version.h * Project: GEnesis, PCI Gigabit Ethernet Adapter - * Version: $Revision: 1.2 $ - * Date: $Date: 2003/08/13 12:01:01 $ + * Version: $Revision: 1.3 $ + * Date: $Date: 2003/08/25 13:34:48 $ * Purpose: SK specific Error log support * ******************************************************************************/ @@ -25,6 +25,9 @@ * * History: * $Log: skversion.h,v $ + * Revision 1.3 2003/08/25 13:34:48 mlindner + * Fix: Lint changes + * * Revision 1.2 2003/08/13 12:01:01 mlindner * Add: Changes for Lint * @@ -51,12 +54,12 @@ #ifdef lint static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH."; static const char SysKonnectBuildNumber[] = - "@(#)SK-BUILD: 6.17 PL: 01"; + "@(#)SK-BUILD: 6.18 PL: 01"; #endif /* !defined(lint) */ -#define BOOT_STRING "sk98lin: Network Device Driver v6.17\n" \ +#define BOOT_STRING "sk98lin: Network Device Driver v6.18\n" \ "(C)Copyright 1999-2003 Marvell(R)." -#define VER_STRING "6.17" +#define VER_STRING "6.18" diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c --- a/drivers/net/sk98lin/skge.c Tue Oct 14 14:52:41 2003 +++ b/drivers/net/sk98lin/skge.c Tue Oct 14 14:52:41 2003 @@ -56,6 +56,18 @@ * History: * * $Log: skge.c,v $ + * Revision 1.16 2003/09/23 11:07:35 mlindner + * Fix: IO-control return race condition + * Fix: Interrupt moderation value check + * + * Revision 1.15 2003/09/22 08:40:05 mlindner + * Add: Added DRIVER_FILE_NAME and DRIVER_REL_DATE + * + * Revision 1.14 2003/09/22 08:11:10 mlindner + * Add: New function for PCI initialization (SkGeInitPCI) + * Add: Yukon Plus changes (ChipID, PCI...) + * Fix: TCP and UDP Checksum calculation + * * Revision 1.11 2003/08/26 16:05:19 mlindner * Fix: Compiler warnings (void *) * @@ -551,6 +563,7 @@ static int SkGeChangeMtu(struct SK_NET_DEVICE *dev, int new_mtu); static void PortReInitBmu(SK_AC*, int); static int SkGeIocMib(DEV_NET*, unsigned int, int); +static int SkGeInitPCI(SK_AC *pAC); static void StartDrvCleanupTimer(SK_AC *pAC); static void StopDrvCleanupTimer(SK_AC *pAC); static int XmitFrameSG(SK_AC*, TX_PORT*, struct sk_buff*); @@ -620,10 +633,10 @@ SK_AC *pAC; DEV_NET *pNet = NULL; struct pci_dev *pdev = NULL; - unsigned long base_address; struct SK_NET_DEVICE *dev = NULL; SK_BOOL DeviceFound = SK_FALSE; SK_BOOL BootStringCount = SK_FALSE; + int retval; #ifdef CONFIG_PROC_FS int proc_root_initialized = 0; struct proc_dir_entry *pProcFile; @@ -668,6 +681,8 @@ pNet = dev->priv; pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL); if (pNet->pAC == NULL){ + dev->get_stats = NULL; + unregister_netdev(dev); kfree(dev->priv); printk(KERN_ERR "Unable to allocate adapter " "structure!\n"); @@ -694,6 +709,14 @@ pNet->Mtu = 1500; pNet->Up = 0; dev->irq = pdev->irq; + retval = SkGeInitPCI(pAC); + if (retval) { + printk("SKGE: PCI setup failed: %i\n", retval); + dev->get_stats = NULL; + unregister_netdev(dev); + kfree(dev); + continue; + } dev->open = &SkGeOpen; dev->stop = &SkGeClose; @@ -716,41 +739,6 @@ #endif #endif - /* - * Dummy value. - */ - dev->base_addr = 42; - pci_set_master(pdev); - - pci_set_master(pdev); - base_address = pci_resource_start (pdev, 0); - -#ifdef SK_BIG_ENDIAN - /* - * On big endian machines, we use the adapter's aibility of - * reading the descriptors as big endian. - */ - { - SK_U32 our2; - SkPciReadCfgDWord(pAC, PCI_OUR_REG_2, &our2); - our2 |= PCI_REV_DESC; - SkPciWriteCfgDWord(pAC, PCI_OUR_REG_2, our2); - } -#endif - - /* - * Remap the regs into kernel space. - */ - pAC->IoBase = (char*)ioremap(base_address, 0x4000); - - if (!pAC->IoBase){ - printk(KERN_ERR "%s: Unable to map I/O register, " - "SK 98xx No. %i will be disabled.\n", - dev->name, boards_found); - kfree(dev); - break; - } - pAC->Index = boards_found; if (SkGeBoardInit(dev, pAC)) { FreeResources(dev); @@ -887,6 +875,68 @@ } /* skge_probe */ + +/***************************************************************************** + * + * SkGeInitPCI - Init the PCI resources + * + * Description: + * This function initialize the PCI resources and IO + * + * Returns: N/A + * + */ +int SkGeInitPCI(SK_AC *pAC) +{ + struct SK_NET_DEVICE *dev = pAC->dev[0]; + struct pci_dev *pdev = pAC->PciDev; + int retval; + + if (pci_enable_device(pdev) != 0) { + return 1; + } + + dev->mem_start = pci_resource_start (pdev, 0); + pci_set_master(pdev); + + if (pci_request_regions(pdev, pAC->Name) != 0) { + retval = 2; + goto out_disable; + } + +#ifdef SK_BIG_ENDIAN + /* + * On big endian machines, we use the adapter's aibility of + * reading the descriptors as big endian. + */ + { + SK_U32 our2; + SkPciReadCfgDWord(pAC, PCI_OUR_REG_2, &our2); + our2 |= PCI_REV_DESC; + SkPciWriteCfgDWord(pAC, PCI_OUR_REG_2, our2); + } +#endif + + /* + * Remap the regs into kernel space. + */ + pAC->IoBase = (char*)ioremap_nocache(dev->mem_start, 0x4000); + + if (!pAC->IoBase){ + retval = 3; + goto out_release; + } + + return 0; + + out_release: + pci_release_regions(pdev); + out_disable: + pci_disable_device(pdev); + return retval; +} + + /***************************************************************************** * * FreeResources - release resources allocated for adapter @@ -908,6 +958,9 @@ pNet = (DEV_NET*) dev->priv; pAC = pNet->pAC; AllocFlag = pAC->AllocFlag; + if (pAC->PciDev) { + pci_release_regions(pAC->PciDev); + } if (AllocFlag & SK_ALLOC_IRQ) { free_irq(dev->irq, dev); } @@ -2172,7 +2225,7 @@ */ if (BytesSend < C_LEN_ETHERNET_MINSIZE) { skb_put(pMessage, (C_LEN_ETHERNET_MINSIZE-BytesSend)); - memset( ((int *)(pMessage->data))+BytesSend, + SK_MEMSET( ((char *)(pMessage->data))+BytesSend, 0, C_LEN_ETHERNET_MINSIZE-BytesSend); } @@ -2205,10 +2258,12 @@ if (pMessage->ip_summed == CHECKSUM_HW) { Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff); - if ((Protocol == C_PROTO_ID_UDP) && (pAC->GIni.GIChipRev != 0)) { - pTxd->TBControl = BMU_UDP_CHECK; + if ((Protocol == C_PROTO_ID_UDP) && + (pAC->GIni.GIChipRev == 0) && + (pAC->GIni.GIChipId == CHIP_ID_YUKON)) { + pTxd->TBControl = BMU_TCP_CHECK; } else { - pTxd->TBControl = BMU_TCP_CHECK ; + pTxd->TBControl = BMU_UDP_CHECK; } IpHeaderLength = (SK_U8)pMessage->data[C_OFFSET_IPHEADER]; @@ -2232,7 +2287,7 @@ #ifdef USE_TX_COMPLETE BMU_IRQ_EOF | #endif - pMessage->len; + pMessage->len; } /* @@ -2333,10 +2388,12 @@ ** (Revision 2.0) */ Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff); - if ((Protocol == C_PROTO_ID_UDP) && (pAC->GIni.GIChipRev != 0)) { - pTxd->TBControl |= BMU_UDP_CHECK; + if ((Protocol == C_PROTO_ID_UDP) && + (pAC->GIni.GIChipRev == 0) && + (pAC->GIni.GIChipId == CHIP_ID_YUKON)) { + pTxd->TBControl |= BMU_TCP_CHECK; } else { - pTxd->TBControl |= BMU_TCP_CHECK ; + pTxd->TBControl |= BMU_UDP_CHECK; } IpHeaderLength = ((SK_U8)pMessage->data[C_OFFSET_IPHEADER] & 0xf)*4; @@ -2383,11 +2440,12 @@ ** opcode for udp is not working in the hardware yet ** (revision 2.0) */ - if ( (Protocol == C_PROTO_ID_UDP) && - (pAC->GIni.GIChipRev != 0) ) { - pTxd->TBControl |= BMU_UDP_CHECK ; + if ((Protocol == C_PROTO_ID_UDP) && + (pAC->GIni.GIChipRev == 0) && + (pAC->GIni.GIChipId == CHIP_ID_YUKON)) { + pTxd->TBControl |= BMU_TCP_CHECK; } else { - pTxd->TBControl |= BMU_TCP_CHECK ; + pTxd->TBControl |= BMU_UDP_CHECK; } } else { pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_OWN; @@ -3616,21 +3674,26 @@ Length = sizeof(pAC->PnmiStruct) + HeaderLength; } if (NULL == (pMemBuf = kmalloc(Length, GFP_KERNEL))) { - return -EFAULT; + return -ENOMEM; } if(copy_from_user(pMemBuf, Ioctl.pData, Length)) { - return -EFAULT; + Err = -EFAULT; + goto fault_gen; } if ((Ret = SkPnmiGenIoctl(pAC, pAC->IoBase, pMemBuf, &Length, 0)) < 0) { - return -EFAULT; + Err = -EFAULT; + goto fault_gen; } if(copy_to_user(Ioctl.pData, pMemBuf, Length) ) { - return -EFAULT; + Err = -EFAULT; + goto fault_gen; } Ioctl.Len = Length; if(copy_to_user(rq->ifr_data, &Ioctl, sizeof(SK_GE_IOCTL))) { - return -EFAULT; + Err = -EFAULT; + goto fault_gen; } +fault_gen: kfree(pMemBuf); /* cleanup everything */ break; default: @@ -4370,7 +4433,7 @@ } if (IntsPerSec[pAC->Index] != 0) { - if ((IntsPerSec[pAC->Index]< 30)&&(IntsPerSec[pAC->Index]> 40000)) { + if ((IntsPerSec[pAC->Index]< 30) || (IntsPerSec[pAC->Index]> 40000)) { pAC->DynIrqModInfo.MaxModIntsPerSec = C_INTS_PER_SEC_DEFAULT; } else { pAC->DynIrqModInfo.MaxModIntsPerSec = IntsPerSec[pAC->Index]; diff -Nru a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c --- a/drivers/net/tulip/tulip_core.c Tue Oct 14 14:52:41 2003 +++ b/drivers/net/tulip/tulip_core.c Tue Oct 14 14:52:41 2003 @@ -229,6 +229,7 @@ { 0x1186, 0x1561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x1626, 0x8410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x1737, 0xAB09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, + { 0x1737, 0xAB08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x17B3, 0xAB08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x14f1, 0x1803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CONEXANT }, { 0x10b9, 0x5261, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X }, /* ALi 1563 integrated ethernet */ diff -Nru a/include/linux/ethtool.h b/include/linux/ethtool.h --- a/include/linux/ethtool.h Tue Oct 14 14:52:41 2003 +++ b/include/linux/ethtool.h Tue Oct 14 14:52:41 2003 @@ -303,14 +303,14 @@ * * get_eeprom: * Should fill in the magic field. Don't need to check len for zero - * or wraparound but must check offset + len < size. Fill in the data - * argument with the eeprom values from offset to offset + len. Update - * len to the amount read. Returns an error or zero. + * or wraparound. Fill in the data argument with the eeprom values + * from offset to offset + len. Update len to the amount read. + * Returns an error or zero. * * set_eeprom: * Should validate the magic field. Don't need to check len for zero - * or wraparound but must check offset + len < size. Update len to - * the amount written. Returns an error or zero. + * or wraparound. Update len to the amount written. Returns an error + * or zero. */ struct ethtool_ops { int (*get_settings)(struct net_device *, struct ethtool_cmd *); @@ -324,6 +324,7 @@ void (*set_msglevel)(struct net_device *, u32); int (*nway_reset)(struct net_device *); u32 (*get_link)(struct net_device *); + int (*get_eeprom_len)(struct net_device *); int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h --- a/include/linux/pci_ids.h Tue Oct 14 14:52:41 2003 +++ b/include/linux/pci_ids.h Tue Oct 14 14:52:41 2003 @@ -1669,6 +1669,7 @@ #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 #define PCI_DEVICE_ID_TIGON3_5901 0x170d #define PCI_DEVICE_ID_TIGON3_5901_2 0x170e +#define PCI_DEVICE_ID_BCM4401 0x4401 #define PCI_VENDOR_ID_SYBA 0x1592 #define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 diff -Nru a/net/core/ethtool.c b/net/core/ethtool.c --- a/net/core/ethtool.c Tue Oct 14 14:52:41 2003 +++ b/net/core/ethtool.c Tue Oct 14 14:52:41 2003 @@ -106,7 +106,8 @@ info.n_stats = ops->get_stats_count(dev); if (ops->get_regs_len) info.regdump_len = ops->get_regs_len(dev); - /* XXX: eeprom? */ + if (ops->get_eeprom_len) + info.eedump_len = ops->get_eeprom_len(dev); if (copy_to_user(useraddr, &info, sizeof(info))) return -EFAULT; @@ -229,29 +230,34 @@ static int ethtool_get_eeprom(struct net_device *dev, void *useraddr) { struct ethtool_eeprom eeprom; + struct ethtool_ops *ops = dev->ethtool_ops; u8 *data; - int len, ret; + int ret; - if (!dev->ethtool_ops->get_eeprom) + if (!ops->get_eeprom || !ops->get_eeprom_len) return -EOPNOTSUPP; if (copy_from_user(&eeprom, useraddr, sizeof(eeprom))) return -EFAULT; - len = eeprom.len; /* Check for wrap and zero */ - if (eeprom.offset + len <= eeprom.offset) + if (eeprom.offset + eeprom.len <= eeprom.offset) + return -EINVAL; + + /* Check for exceeding total eeprom len */ + if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev)) return -EINVAL; - data = kmalloc(len, GFP_USER); + data = kmalloc(eeprom.len, GFP_USER); if (!data) return -ENOMEM; - if (copy_from_user(data, useraddr + sizeof(eeprom), len)) - return -EFAULT; + ret = -EFAULT; + if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len)) + goto out; - ret = dev->ethtool_ops->get_eeprom(dev, &eeprom, data); - if (!ret) + ret = ops->get_eeprom(dev, &eeprom, data); + if (ret) goto out; ret = -EFAULT; @@ -269,32 +275,37 @@ static int ethtool_set_eeprom(struct net_device *dev, void *useraddr) { struct ethtool_eeprom eeprom; + struct ethtool_ops *ops = dev->ethtool_ops; u8 *data; - int len, ret; + int ret; - if (!dev->ethtool_ops->set_eeprom) + if (!ops->set_eeprom || !ops->get_eeprom_len) return -EOPNOTSUPP; if (copy_from_user(&eeprom, useraddr, sizeof(eeprom))) return -EFAULT; - len = eeprom.len; /* Check for wrap and zero */ - if (eeprom.offset + len <= eeprom.offset) + if (eeprom.offset + eeprom.len <= eeprom.offset) + return -EINVAL; + + /* Check for exceeding total eeprom len */ + if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev)) return -EINVAL; - data = kmalloc(len, GFP_USER); + data = kmalloc(eeprom.len, GFP_USER); if (!data) return -ENOMEM; - if (copy_from_user(data, useraddr + sizeof(eeprom), len)) - return -EFAULT; + ret = -EFAULT; + if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len)) + goto out; - ret = dev->ethtool_ops->set_eeprom(dev, &eeprom, data); + ret = ops->set_eeprom(dev, &eeprom, data); if (ret) goto out; - if (copy_to_user(useraddr + sizeof(eeprom), data, len)) + if (copy_to_user(useraddr + sizeof(eeprom), data, eeprom.len)) ret = -EFAULT; out: From garzik@gtf.org Tue Oct 14 12:08:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 12:09:24 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EJ8k25022255 for ; Tue, 14 Oct 2003 12:08:46 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 646C066B2; Tue, 14 Oct 2003 15:06:03 -0400 (EDT) Date: Tue, 14 Oct 2003 15:06:03 -0400 From: Jeff Garzik To: torvalds@osdl.org Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [BK PATCHES] 2.6.x net driver updates Message-ID: <20031014190603.GA20087@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 819 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: 24351 Lines: 734 I've tried to keep it to fixes, and created a separate queue (net-drivers-2.[45]-exp) for non-fixes. Linus, please do a bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5 This will update the following files: drivers/net/8139too.c | 2 + drivers/net/Kconfig | 4 +-- drivers/net/b44.c | 15 +++--------- drivers/net/defxx.c | 4 +-- drivers/net/e1000/e1000_main.c | 35 ++++++++++++++++++++++------ drivers/net/hamradio/bpqether.c | 6 ---- drivers/net/hamradio/scc.c | 4 +-- drivers/net/hp100.c | 10 ++++---- drivers/net/natsemi.c | 2 - drivers/net/pcmcia/pcnet_cs.c | 23 ++++++++++++------ drivers/net/tulip/tulip_core.c | 1 drivers/net/tulip/xircom_cb.c | 35 ++++++++++++++-------------- drivers/net/wireless/atmel.c | 1 drivers/net/wireless/atmel_cs.c | 11 +++++--- include/linux/ethtool.h | 11 ++++---- net/core/ethtool.c | 49 ++++++++++++++++++++++++---------------- 16 files changed, 123 insertions(+), 90 deletions(-) through these ChangeSets: (03/10/14 1.1370) [PATCH] b44 enable interrupts after tx timeout (2.6-test version) Resending the patch I sent some time ago for b44.c that nukes the 2.4 compatibility cruft as well. I'll do one for 2.4.23pre6 ASAP, hopefully being able sync the driver fully with the one in 2.6 (free_netdev() etc.). (03/10/14 1.1369) [netdrvr natsemi] fix ring clean Too much copy&paste in a call to pci_unmap_single. (03/10/14 1.1368) [netdrvr tulip] add pci id Contributed by Ken Zalewski. (03/10/14 1.1367) [PATCH] - atmel wireless driver 1) Remove "#include " which was not needed and added bad extra compile dependencies. 2) Fix typo in module description. 3) Make card detection code cope with buggy SMC CIS entries. (03/10/14 1.1366) [netdrvr 8139too] another new PCI ID Contributed by Josh Litherland, Donald Becker, and others. (03/10/14 1.1365) [netdrvr 8139too] add pci id contributed by "JaReK" and Donald Becker. (03/10/14 1.1364) [PATCH] hang on ZEROCOPY/TSO when hitting no-Tx-resources * Critical bug fix: under heavy Tx stress using ZEROCOPY or TSO, if we ran out of Tx descriptors, we didn't calculate for the context descritor used as the first of the ZEROCOPY/TSO send, nor do we clean up the context desriptor bits in the case where the send isn't going to fit, where we need to undo the mappings. This bug was introduced with the 5.2.16 patch set which included a workaround for a hang on 82544 over PCI-X. This workaround cause the check for no-Tx- rosource logic to change, and this bug slipped in. (03/10/14 1.1363) [PATCH] Fix warnings in defxx.c Fix harmless 64bit warnings in defxx.c (03/10/14 1.1362) [PATCH] Fix warnings in hp100 Fix some harmless integer/pointer size mismatch warnings in hp100.c on 64bit compiles (03/10/14 1.1361) [PATCH] Mark non 64bit clean network drivers This marks some net drivers which are clearly not 64bit (judging from the warnings) as !64BIT. -Andi (03/10/14 1.1360) [hamradio bpqether] fix ancient debug line removes a verry old debug line from the bpqethernet driver that only fills logs. (03/10/14 1.1359) [hamradio scc] fix probe function fix for the probe function of the scc driver which now uses an uninitialised scc struct for requesting an io region. (03/10/14 1.1358) [PATCH] ethtool_ops eeprom stuff Finally got around to adding ethtool_ops to e100-3.0.x. I found a bug with get_eeprom() and it seems to work best if we add get_eeprom_len() to the ops list. Also moved check for offest + len < size into ethtool.c. I was able to test [GS]EEPROM, PHYS_ID, GSTATS, GSTRINGS, and TEST, and everything looks good. Should I send same for 2.4? (03/10/14 1.1357) [PATCH] Fix pcnet_cs network hotplug pcnet_cs registers the network device too early. The effect of this is that the networking hotplug scripts are unable to bring the device up automatically. There are two issues: - we were registering the net device before we finished setting up the device (eg, reading the MAC address.) - we were using DEV_CONFIG_PENDING to block the net device "open" callback, and as we know the other methods may be called prior to open. My only concern with this patch is that we set info->node.dev_name after we register the net device, so use of cardctl during the hotplug scripts may give unexpected results. However, I am not aware of anyone using cardctl to read the device name in network hotplug scripts. Please review and merge. Thanks. (03/10/14 1.1356) [netdrvr xircom_cb] fix race in statistics pointer setting by converting to use alloc_etherdev. diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c --- a/drivers/net/8139too.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/8139too.c Tue Oct 14 15:02:25 2003 @@ -248,6 +248,8 @@ {0x14ea, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x14ea, 0xab07, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x11db, 0x1234, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, + {0x1432, 0x9130, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, + {0x02ac, 0x1012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, #ifdef CONFIG_SH_SECUREEDGE5410 /* Bogus 8139 silicon reports 8129 without external PROM :-( */ diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig Tue Oct 14 15:02:25 2003 +++ b/drivers/net/Kconfig Tue Oct 14 15:02:25 2003 @@ -1616,7 +1616,7 @@ config TLAN tristate "TI ThunderLAN support" - depends on NET_PCI && (PCI || EISA) + depends on NET_PCI && (PCI || EISA) && !64BIT ---help--- If you have a PCI Ethernet network card based on the ThunderLAN chip which is supported by this driver, say Y and read the @@ -2412,7 +2412,7 @@ config RCPCI tristate "Red Creek Hardware VPN (EXPERIMENTAL)" - depends on NETDEVICES && EXPERIMENTAL && PCI + depends on NETDEVICES && EXPERIMENTAL && PCI && !64BIT help This is a driver for hardware which provides a Virtual Private Network (VPN). Say Y if you have it. diff -Nru a/drivers/net/b44.c b/drivers/net/b44.c --- a/drivers/net/b44.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/b44.c Tue Oct 14 15:02:25 2003 @@ -25,8 +25,8 @@ #define DRV_MODULE_NAME "b44" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "0.9" -#define DRV_MODULE_RELDATE "Jul 14, 2003" +#define DRV_MODULE_VERSION "0.91" +#define DRV_MODULE_RELDATE "Oct 3, 2003" #define B44_DEF_MSG_ENABLE \ (NETIF_MSG_DRV | \ @@ -80,15 +80,6 @@ static int b44_debug = -1; /* -1 == use B44_DEF_MSG_ENABLE as value */ -#ifndef PCI_DEVICE_ID_BCM4401 -#define PCI_DEVICE_ID_BCM4401 0x4401 -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#define IRQ_RETVAL(x) -#define irqreturn_t void -#endif - static struct pci_device_id b44_pci_tbl[] = { { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4401, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, @@ -869,6 +860,8 @@ b44_init_hw(bp); spin_unlock_irq(&bp->lock); + + b44_enable_ints(bp); netif_wake_queue(dev); } diff -Nru a/drivers/net/defxx.c b/drivers/net/defxx.c --- a/drivers/net/defxx.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/defxx.c Tue Oct 14 15:02:25 2003 @@ -2664,8 +2664,8 @@ static void my_skb_align(struct sk_buff *skb, int n) { - u32 x=(u32)skb->data; /* We only want the low bits .. */ - u32 v; + unsigned long x=(unsigned long)skb->data; + unsigned long v; v=(x+n-1)&~(n-1); /* Where we want to be */ diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c --- a/drivers/net/e1000/e1000_main.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/e1000/e1000_main.c Tue Oct 14 15:02:25 2003 @@ -30,7 +30,7 @@ /* Change Log * - * 5.2.18 9/13/03 + * 5.2.20 9/30/03 * o Bug fix: SERDES devices might be connected to a back-plane * switch that doesn't support auto-neg, so add the capability * to force 1000/Full. @@ -39,6 +39,9 @@ * Jumbo Frames or with the reduced FIFO in 82547. * o Better propagation of error codes. [Janice Girouard * (janiceg@us.ibm.com)]. + * o Bug fix: hang under heavy Tx stress when running out of Tx + * descriptors; wasn't clearing context descriptor when backing + * out of send because of no-resource condition. * * 5.2.16 8/8/03 * o Added support for new controllers: 82545GM, 82546GB, 82541/7_B1 @@ -61,7 +64,7 @@ char e1000_driver_name[] = "e1000"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; -char e1000_driver_version[] = "5.2.19-k1"; +char e1000_driver_version[] = "5.2.20-k1"; char e1000_copyright[] = "Copyright (c) 1999-2003 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -1545,6 +1548,7 @@ unsigned int first) { struct e1000_desc_ring *tx_ring = &adapter->tx_ring; + struct e1000_tx_desc *tx_desc; struct e1000_buffer *buffer_info; unsigned int len = skb->len, max_per_txd = E1000_MAX_DATA_PER_TXD; unsigned int offset = 0, size, count = 0, i; @@ -1640,17 +1644,29 @@ } } - if(E1000_DESC_UNUSED(&adapter->tx_ring) < count) { + if(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2) { /* There aren't enough descriptors available to queue up - * this send, so undo the mapping and abort the send. - * We could have done the check before we mapped the skb, - * but because of all the workarounds (above), it's too - * difficult to predict how many we're going to need.*/ - i = first; + * this send (need: count + 1 context desc + 1 desc gap + * to keep tail from touching head), so undo the mapping + * and abort the send. We could have done the check before + * we mapped the skb, but because of all the workarounds + * (above), it's too difficult to predict how many we're + * going to need.*/ + i = adapter->tx_ring.next_to_use; + + if(i == first) { + /* Cleanup after e1000_tx_[csum|tso] scribbling + * on descriptors. */ + tx_desc = E1000_TX_DESC(*tx_ring, first); + tx_desc->buffer_addr = 0; + tx_desc->lower.data = 0; + tx_desc->upper.data = 0; + } while(count--) { buffer_info = &tx_ring->buffer_info[i]; + if(buffer_info->dma) { pci_unmap_page(adapter->pdev, buffer_info->dma, @@ -1658,8 +1674,11 @@ PCI_DMA_TODEVICE); buffer_info->dma = 0; } + if(++i == tx_ring->count) i = 0; } + + adapter->tx_ring.next_to_use = first; return 0; } diff -Nru a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c --- a/drivers/net/hamradio/bpqether.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/hamradio/bpqether.c Tue Oct 14 15:02:25 2003 @@ -196,12 +196,8 @@ eth = (struct ethhdr *)skb->mac.raw; if (!(bpq->acpt_addr[0] & 0x01) && - memcmp(eth->h_source, bpq->acpt_addr, ETH_ALEN)) { - if (net_ratelimit()) - printk(KERN_DEBUG "bpqether: wrong dest %s\n", - bpq_print_ethaddr(eth->h_source)); + memcmp(eth->h_source, bpq->acpt_addr, ETH_ALEN)) goto drop_unlock; - } if (skb_cow(skb, sizeof(struct ethhdr))) goto drop_unlock; diff -Nru a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c --- a/drivers/net/hamradio/scc.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/hamradio/scc.c Tue Oct 14 15:02:25 2003 @@ -1762,7 +1762,7 @@ #ifndef SCC_DONT_CHECK - if(request_region(scc->ctrl, 1, "scc-probe")) + if(request_region(hwcfg.ctrl_a, 1, "scc-probe")) { disable_irq(hwcfg.irq); Outb(hwcfg.ctrl_a, 0); @@ -1774,7 +1774,7 @@ if (InReg(hwcfg.ctrl_a,R13) != 0x55) found = 0; enable_irq(hwcfg.irq); - release_region(scc->ctrl, 1); + release_region(hwcfg.ctrl_a, 1); } else found = 0; diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c --- a/drivers/net/hp100.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/hp100.c Tue Oct 14 15:02:25 2003 @@ -1265,9 +1265,9 @@ { /* pdlptr is starting address for this pdl */ - if (0 != (((unsigned) pdlptr) & 0xf)) - printk("hp100: %s: Init rxpdl: Unaligned pdlptr 0x%x.\n", - dev->name, (unsigned) pdlptr); + if (0 != (((unsigned long) pdlptr) & 0xf)) + printk("hp100: %s: Init rxpdl: Unaligned pdlptr 0x%lx.\n", + dev->name, (unsigned long) pdlptr); ringptr->pdl = pdlptr + 1; ringptr->pdl_paddr = virt_to_whatever(dev, pdlptr + 1); @@ -1292,8 +1292,8 @@ register hp100_ring_t * ringptr, register u32 * pdlptr) { - if (0 != (((unsigned) pdlptr) & 0xf)) - printk("hp100: %s: Init txpdl: Unaligned pdlptr 0x%x.\n", dev->name, (unsigned) pdlptr); + if (0 != (((unsigned long) pdlptr) & 0xf)) + printk("hp100: %s: Init txpdl: Unaligned pdlptr 0x%lx.\n", dev->name, (unsigned long) pdlptr); ringptr->pdl = pdlptr; /* +1; */ ringptr->pdl_paddr = virt_to_whatever(dev, pdlptr); /* +1 */ diff -Nru a/drivers/net/natsemi.c b/drivers/net/natsemi.c --- a/drivers/net/natsemi.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/natsemi.c Tue Oct 14 15:02:25 2003 @@ -1530,7 +1530,7 @@ for (i = 0; i < TX_RING_SIZE; i++) { if (np->tx_skbuff[i]) { pci_unmap_single(np->pci_dev, - np->rx_dma[i], np->rx_skbuff[i]->len, + np->tx_dma[i], np->tx_skbuff[i]->len, PCI_DMA_TODEVICE); dev_kfree_skb(np->tx_skbuff[i]); np->stats.tx_dropped++; diff -Nru a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c --- a/drivers/net/pcmcia/pcnet_cs.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/pcmcia/pcnet_cs.c Tue Oct 14 15:02:25 2003 @@ -681,10 +681,6 @@ } else { dev->if_port = 0; } - if (register_netdev(dev) != 0) { - printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); - goto failed; - } hw_info = get_hwinfo(link); if (hw_info == NULL) @@ -699,7 +695,6 @@ if (hw_info == NULL) { printk(KERN_NOTICE "pcnet_cs: unable to read hardware net" " address for io base %#3lx\n", dev->base_addr); - unregister_netdev(dev); goto failed; } @@ -733,8 +728,6 @@ ei_status.word16 = 1; ei_status.reset_8390 = &pcnet_reset_8390; - strcpy(info->node.dev_name, dev->name); - link->dev = &info->node; SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); if (info->flags & (IS_DL10019|IS_DL10022)) { @@ -743,6 +736,21 @@ mii_phy_probe(dev); if ((id == 0x30) && !info->pna_phy && (info->eth_phy == 4)) info->eth_phy = 0; + } + + link->dev = &info->node; + link->state &= ~DEV_CONFIG_PENDING; + + if (register_netdev(dev) != 0) { + printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); + link->dev = NULL; + goto failed; + } + + strcpy(info->node.dev_name, dev->name); + + if (info->flags & (IS_DL10019|IS_DL10022)) { + u_char id = inb(dev->base_addr + 0x1a); printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ", dev->name, ((info->flags & IS_DL10022) ? 22 : 19), id); if (info->pna_phy) @@ -758,7 +766,6 @@ printk(" hw_addr "); for (i = 0; i < 6; i++) printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); - link->state &= ~DEV_CONFIG_PENDING; return; cs_failed: diff -Nru a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c --- a/drivers/net/tulip/tulip_core.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/tulip/tulip_core.c Tue Oct 14 15:02:25 2003 @@ -224,6 +224,7 @@ { 0x1186, 0x1561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x1626, 0x8410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x1737, 0xAB09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, + { 0x1737, 0xAB08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x17B3, 0xAB08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, { 0x10b9, 0x5261, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X }, /* ALi 1563 integrated ethernet */ { 0x10b7, 0x9300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, /* 3Com 3CSOHO100B-TX */ diff -Nru a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c --- a/drivers/net/tulip/xircom_cb.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/tulip/xircom_cb.c Tue Oct 14 15:02:25 2003 @@ -230,7 +230,8 @@ This way, we can fail gracefully if not enough memory is available. */ - if ((dev = init_etherdev(NULL, sizeof(struct xircom_private))) == NULL) { + dev = alloc_etherdev(sizeof(struct xircom_private)); + if (!dev) { printk(KERN_ERR "xircom_probe: failed to allocate etherdev\n"); goto device_fail; } @@ -250,7 +251,7 @@ SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq); + private->dev = dev; private->pdev = pdev; @@ -259,7 +260,6 @@ dev->irq = pdev->irq; dev->base_addr = private->io_port; - initialize_card(private); read_mac_address(private); setup_descriptors(private); @@ -272,7 +272,12 @@ SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); pci_set_drvdata(pdev, dev); - + if (register_netdev(dev)) { + printk(KERN_ERR "xircom_probe: netdevice registration failed.\n"); + goto reg_fail; + } + + printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq); /* start the transmitter to get a heartbeat */ /* TODO: send 2 dummy packets here */ transceiver_voodoo(private); @@ -287,10 +292,12 @@ leave("xircom_probe"); return 0; +reg_fail: + kfree(private->tx_buffer); tx_buf_fail: kfree(private->rx_buffer); rx_buf_fail: - kfree(dev); + free_netdev(dev); device_fail: return -ENODEV; } @@ -305,22 +312,16 @@ static void __devexit xircom_remove(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); - struct xircom_private *card; + struct xircom_private *card = dev->priv; + enter("xircom_remove"); - if (dev!=NULL) { - card=dev->priv; - if (card!=NULL) { - if (card->rx_buffer!=NULL) - pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle); - card->rx_buffer = NULL; - if (card->tx_buffer!=NULL) - pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle); - card->tx_buffer = NULL; - } - } + pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle); + pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle); + release_region(dev->base_addr, 128); unregister_netdev(dev); free_netdev(dev); + pci_set_drvdata(pdev, NULL); leave("xircom_remove"); } diff -Nru a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c --- a/drivers/net/wireless/atmel.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/wireless/atmel.c Tue Oct 14 15:02:25 2003 @@ -37,7 +37,6 @@ ******************************************************************************/ #include -#include #include #include diff -Nru a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c --- a/drivers/net/wireless/atmel_cs.c Tue Oct 14 15:02:25 2003 +++ b/drivers/net/wireless/atmel_cs.c Tue Oct 14 15:02:25 2003 @@ -84,7 +84,7 @@ static int irq_list[4] = { -1 }; MODULE_AUTHOR("Simon Kelley"); -MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethnet cards."); +MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards."); MODULE_LICENSE("GPL"); MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards"); MODULE_PARM(irq_mask, "i"); @@ -404,9 +404,12 @@ goto mismatch; for (k = 0; k < j; k++) { while ((*p != '\0') && (*p != '/')) p++; - if (*p == '\0') - goto mismatch; - p++; + if (*p == '\0') { + if (*q != '\0') + goto mismatch; + } else { + p++; + } } while((*q != '\0') && (*p != '\0') && (*p != '/') && (*p == *q)) p++, q++; diff -Nru a/include/linux/ethtool.h b/include/linux/ethtool.h --- a/include/linux/ethtool.h Tue Oct 14 15:02:25 2003 +++ b/include/linux/ethtool.h Tue Oct 14 15:02:25 2003 @@ -307,14 +307,14 @@ * * get_eeprom: * Should fill in the magic field. Don't need to check len for zero - * or wraparound but must check offset + len < size. Fill in the data - * argument with the eeprom values from offset to offset + len. Update - * len to the amount read. Returns an error or zero. + * or wraparound. Fill in the data argument with the eeprom values + * from offset to offset + len. Update len to the amount read. + * Returns an error or zero. * * set_eeprom: * Should validate the magic field. Don't need to check len for zero - * or wraparound but must check offset + len < size. Update len to - * the amount written. Returns an error or zero. + * or wraparound. Update len to the amount written. Returns an error + * or zero. */ struct ethtool_ops { int (*get_settings)(struct net_device *, struct ethtool_cmd *); @@ -328,6 +328,7 @@ void (*set_msglevel)(struct net_device *, u32); int (*nway_reset)(struct net_device *); u32 (*get_link)(struct net_device *); + int (*get_eeprom_len)(struct net_device *); int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); diff -Nru a/net/core/ethtool.c b/net/core/ethtool.c --- a/net/core/ethtool.c Tue Oct 14 15:02:25 2003 +++ b/net/core/ethtool.c Tue Oct 14 15:02:25 2003 @@ -122,7 +122,8 @@ info.n_stats = ops->get_stats_count(dev); if (ops->get_regs_len) info.regdump_len = ops->get_regs_len(dev); - /* XXX: eeprom? */ + if (ops->get_eeprom_len) + info.eedump_len = ops->get_eeprom_len(dev); if (copy_to_user(useraddr, &info, sizeof(info))) return -EFAULT; @@ -245,29 +246,34 @@ static int ethtool_get_eeprom(struct net_device *dev, void *useraddr) { struct ethtool_eeprom eeprom; + struct ethtool_ops *ops = dev->ethtool_ops; u8 *data; - int len, ret; + int ret; - if (!dev->ethtool_ops->get_eeprom) + if (!ops->get_eeprom || !ops->get_eeprom_len) return -EOPNOTSUPP; if (copy_from_user(&eeprom, useraddr, sizeof(eeprom))) return -EFAULT; - len = eeprom.len; /* Check for wrap and zero */ - if (eeprom.offset + len <= eeprom.offset) + if (eeprom.offset + eeprom.len <= eeprom.offset) + return -EINVAL; + + /* Check for exceeding total eeprom len */ + if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev)) return -EINVAL; - data = kmalloc(len, GFP_USER); + data = kmalloc(eeprom.len, GFP_USER); if (!data) return -ENOMEM; - if (copy_from_user(data, useraddr + sizeof(eeprom), len)) - return -EFAULT; + ret = -EFAULT; + if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len)) + goto out; - ret = dev->ethtool_ops->get_eeprom(dev, &eeprom, data); - if (!ret) + ret = ops->get_eeprom(dev, &eeprom, data); + if (ret) goto out; ret = -EFAULT; @@ -285,32 +291,37 @@ static int ethtool_set_eeprom(struct net_device *dev, void *useraddr) { struct ethtool_eeprom eeprom; + struct ethtool_ops *ops = dev->ethtool_ops; u8 *data; - int len, ret; + int ret; - if (!dev->ethtool_ops->set_eeprom) + if (!ops->set_eeprom || !ops->get_eeprom_len) return -EOPNOTSUPP; if (copy_from_user(&eeprom, useraddr, sizeof(eeprom))) return -EFAULT; - len = eeprom.len; /* Check for wrap and zero */ - if (eeprom.offset + len <= eeprom.offset) + if (eeprom.offset + eeprom.len <= eeprom.offset) + return -EINVAL; + + /* Check for exceeding total eeprom len */ + if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev)) return -EINVAL; - data = kmalloc(len, GFP_USER); + data = kmalloc(eeprom.len, GFP_USER); if (!data) return -ENOMEM; - if (copy_from_user(data, useraddr + sizeof(eeprom), len)) - return -EFAULT; + ret = -EFAULT; + if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len)) + goto out; - ret = dev->ethtool_ops->set_eeprom(dev, &eeprom, data); + ret = ops->set_eeprom(dev, &eeprom, data); if (ret) goto out; - if (copy_to_user(useraddr + sizeof(eeprom), data, len)) + if (copy_to_user(useraddr + sizeof(eeprom), data, eeprom.len)) ret = -EFAULT; out: From garzik@gtf.org Tue Oct 14 12:30:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 12:31:28 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EJUs25025866 for ; Tue, 14 Oct 2003 12:30:54 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id D98336662; Tue, 14 Oct 2003 15:30:48 -0400 (EDT) Date: Tue, 14 Oct 2003 15:30:48 -0400 From: Jeff Garzik To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: New queue: net-drivers-exp Message-ID: <20031014193048.GA22739@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 820 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: 759 Lines: 22 Over time while using BK, I have developed "queues", or buckets, into which patches are sorted. One of the key ones are the net-drivers-2.[45] queues, which are staging areas for sending net-driver-related patches to Marcelo and Linus. With the "bug fixes only" freeze in 2.6, I took the opportunity to send some of the non-bugfix patches to a new pair of queues, "net-drivers-2.[45]-exp", with "-exp" meaning experimental. The contents of net-drivers-2.[45]-exp will be patches pending for Marcelo or Linus, but ones that need to "stew" for a little while. Brand new features and drivers will sit here for a week or two, usually, to allow for greater public review and testing. See upcoming 2.4 and 2.6 postings for BitKeeper and patch URLs. Jeff From garzik@gtf.org Tue Oct 14 12:32:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 12:32:27 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EJWM25026191 for ; Tue, 14 Oct 2003 12:32:23 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 087916663; Tue, 14 Oct 2003 15:32:15 -0400 (EDT) Date: Tue, 14 Oct 2003 15:32:14 -0400 From: Jeff Garzik To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [BK PATCHES] 2.4.x experimental net driver updates Message-ID: <20031014193214.GA23154@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 821 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: 670 Lines: 23 BK users: bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.4-exp GNU diff: ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.4/2.4.22-bk34-netdrvr-exp1.patch.bz2 This will update the following files: drivers/net/8139too.c | 51 +++++++++++++++-------- drivers/net/Makefile.lib | 1 drivers/net/natsemi.c | 101 +++++++++++++++-------------------------------- 3 files changed, 68 insertions(+), 85 deletions(-) through these ChangeSets: (03/10/14 1.1191) [netdrvr natsemi] backport 2.6 fixes and cleanups (03/10/14 1.1190) [netdrvr 8139too] support netif_msg_* interface From ak@muc.de Tue Oct 14 12:48:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 12:49:33 -0700 (PDT) Received: from colin2.muc.de (qmailr@colin2.muc.de [193.149.48.15]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EJmv25026865 for ; Tue, 14 Oct 2003 12:48:58 -0700 Received: (qmail 59874 invoked by uid 3709); 14 Oct 2003 19:49:14 -0000 Date: 14 Oct 2003 21:49:14 +0200 Date: Tue, 14 Oct 2003 21:49:14 +0200 From: Andi Kleen To: Jeff Garzik Cc: Andi Kleen , netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit warnings in rtl8139too Message-ID: <20031014194914.GA58843@colin2.muc.de> References: <20031007175638.GA1754@averell> <3F8C3CB0.9090502@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F8C3CB0.9090502@pobox.com> User-Agent: Mutt/1.4.1i X-archive-position: 822 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@colin2.muc.de Precedence: bulk X-list: netdev Content-Length: 839 Lines: 28 On Tue, Oct 14, 2003 at 02:13:04PM -0400, Jeff Garzik wrote: > Andi Kleen wrote: > >Fix a harmless 64bit pointer/integer mismatch warning in 8139too. > > > >diff -u linux-2.5-cleanup/drivers/net/8139too.c-o > >linux-2.5-cleanup/drivers/net/8139too.c > >--- linux-2.5-cleanup/drivers/net/8139too.c-o 2003-09-08 > >00:02:03.000000000 +0200 > >+++ linux-2.5-cleanup/drivers/net/8139too.c 2003-12-02 > >17:13:24.634752560 +0100 > >@@ -746,7 +746,8 @@ > > u8 tmp8; > > int rc; > > unsigned int i; > >- u32 pio_start, pio_end, pio_flags, pio_len; > >+ unsigned long pio_start; > >+ u32 pio_end, pio_flags, pio_len; > > unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; > > u32 version; > > > Why not just make this look like mmio_*? No problems, feel free to do that. I just did the minimal change to fix the warning. -Andi From garzik@gtf.org Tue Oct 14 13:12:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 13:13:03 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EKCF25027546 for ; Tue, 14 Oct 2003 13:12:15 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 11CA56662; Tue, 14 Oct 2003 15:32:51 -0400 (EDT) Date: Tue, 14 Oct 2003 15:32:51 -0400 From: Jeff Garzik To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [BK PATCHES] 2.6.x experimental net driver updates Message-ID: <20031014193250.GA23250@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 823 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: 4896 Lines: 140 BK users: bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5-exp GNU diff: ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test7-bk6-netdrvr-exp1.patch.bz2 This will update the following files: drivers/net/3c515.c | 23 +- drivers/net/3c527.c | 371 +++++++++++++++---------------------- drivers/net/8139too.c | 51 +++-- drivers/net/defxx.c | 2 drivers/net/dummy.c | 2 drivers/net/eql.c | 2 drivers/net/natsemi.c | 39 ++- drivers/net/ns83820.c | 2 drivers/net/plip.c | 14 + drivers/net/shaper.c | 11 - drivers/net/skfp/skfddi.c | 12 - drivers/net/tokenring/smctr.c | 8 drivers/net/tulip/Kconfig | 20 ++ drivers/net/tulip/interrupt.c | 410 ++++++++++++++++++++++++++++++----------- drivers/net/tulip/tulip.h | 18 + drivers/net/tulip/tulip_core.c | 55 ++--- drivers/net/tun.c | 18 - drivers/net/wan/lmc/lmc_main.c | 375 ++++++++++++------------------------- drivers/net/wan/lmc/lmc_var.h | 15 - net/wanrouter/wanmain.c | 2 20 files changed, 740 insertions(+), 710 deletions(-) through these ChangeSets: (03/10/14 1.1364) [netdrvr tulip] support NAPI Contributed by Robert Ollsson. (03/10/14 1.1363) [PATCH] smctr - get rid of MOD_INC/DEC Get rid of warning now that module refcounting now done by network code not drivers. Not tested on real hardware. (03/10/14 1.1362) [PATCH] janitor: insert missing iounmap(), add error handling Hi, Please apply to 2.6.0-test6-current. Thanks, -- ~Randy From: Leann Ogasawara Subject: Re: [Kernel-janitors] [PATCH] insert missing iounmap() > > Patch inserts a missing iounmap(). Implements a cleanup path > > for error handling as well. Feedback is much appreciated. Thanks :) ===== drivers/net/natsemi.c 1.55 vs edited ===== linux-260-test6-kj1-rddunlap/drivers/net/natsemi.c | 39 ++++++++++----------- 1 files changed, 20 insertions(+), 19 deletions(-) (03/10/14 1.1361) [PATCH] release region in skfddi driver This is a multi-part message in MIME format. (03/10/14 1.1360) [netdrvr 3c527] remove cli/sti Richard Procter and I worked to remove cli/sti to add proper SMP support (I did the original stuff and Richard did the actual current code :)). Besides that, Richard did a great jog improving the perfomance of the driver quite a bit: - Improve mc32_command by 770% (438% non-inlined) over the semaphore version (at a cost of 1 sem + 2 completions per driver). - Removed mutex covering mc32_send_packet (hard_start_xmit). This lets the interrupt handler operate concurrently and removes unnecessary locking. It makes the code only slightly more brittle Original post: http://marc.theaimsgroup.com/?l=linux-netdev&m=106438449315202&w=2 Since it didn't apply cleanly against 2.6.0-test6, I forward ported it. Patch attached. Jeff, please consider applying, Thanks. (03/10/14 1.1359) [PATCH] remove dev_get from wanrouter The call to dev_get() in wanrouter_device_new_if is racy and redundant and should be removed. The later 'register_netdev()' does the same test internally and will return the appropriate error if the name already exists. This patch is against 2.6.0-test6. Resend of earlier patch because it was ignored, or missed. (03/10/14 1.1358) [PATCH] 2.6.0-test6 - more free_netdev() conversion Compiles ok (with true .o generated, yeah). Please review. free_netdev() of devices allocated through use of alloc_netdev(). Though baroque, drivers/net/3c515.c now uses alloc_etherdev(). drivers/net/3c515.c | 23 ++++++++++++----------- drivers/net/defxx.c | 2 +- drivers/net/dummy.c | 2 +- drivers/net/eql.c | 2 +- drivers/net/ns83820.c | 2 +- drivers/net/plip.c | 14 ++++++++++---- drivers/net/shaper.c | 11 ++++++++--- drivers/net/tun.c | 18 +++++++++--------- 9 files changed, 43 insertions(+), 31 deletions(-) (03/10/14 1.1357) [PATCH] wan/lmc -- convert to new network device model Resend of LMC driver patch for 2.6.0-test6 * do proper probing * allocate network device with alloc_netdev * use standard pci_id's instead of local defines * use standard PCI device interface to find and remove devices. (03/10/14 1.1356) [netdrvr 8139too] support netif_msg_* interface From davem@pizda.ninka.net Tue Oct 14 13:23:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 13:23:43 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EKN625028083 for ; Tue, 14 Oct 2003 13:23:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA09262; Tue, 14 Oct 2003 13:16:41 -0700 Date: Tue, 14 Oct 2003 13:16:41 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] mark dev_alloc as deprecated. Message-Id: <20031014131641.42c545b5.davem@redhat.com> In-Reply-To: <20031014111940.709280d7.shemminger@osdl.org> References: <20031014111940.709280d7.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 824 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: 298 Lines: 8 On Tue, 14 Oct 2003 11:19:40 -0700 Stephen Hemminger wrote: > dev_alloc is an older way of getting a network device. Most uses of it are gone, > and it was usually used in an unsafe way. The remaining usage in 2.6.0-test7 > are in arcnet devices. Applied, thanks Stephen. From davem@pizda.ninka.net Tue Oct 14 14:05:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 14:06:14 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EL5c25029610 for ; Tue, 14 Oct 2003 14:05:38 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA09575; Tue, 14 Oct 2003 13:59:07 -0700 Date: Tue, 14 Oct 2003 13:59:04 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM][0/6] backports from 2.6 Message-Id: <20031014135904.0d150bd5.davem@redhat.com> In-Reply-To: <200310140342.h9E3gUkT005558@ginger.cmf.nrl.navy.mil> References: <200310140342.h9E3gUkT005558@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 825 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: 199 Lines: 7 On Mon, 13 Oct 2003 23:42:31 -0400 chas williams wrote: > the next set of patches are backports of changes > made in 2.6. please apply to latest 2.4. Applied, thanks Chas. From davem@pizda.ninka.net Tue Oct 14 15:31:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:32:17 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMVb25031976 for ; Tue, 14 Oct 2003 15:31:38 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA09876; Tue, 14 Oct 2003 15:24:41 -0700 Date: Tue, 14 Oct 2003 15:24:41 -0700 From: "David S. Miller" To: Shirley Ma Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: [PATCH]Implementation for IPv6 MIB:ipv6InterfaceTable Message-Id: <20031014152441.1be6b336.davem@redhat.com> In-Reply-To: <200310141032.23998.mashirle@us.ibm.com> References: <200310141032.23998.mashirle@us.ibm.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 826 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: 525 Lines: 20 On Tue, 14 Oct 2003 10:32:23 -0700 Shirley Ma wrote: > +#ifdef CONFIG_SYSCTL > +#include > +#endif Please don't add ifdefs around header includes like this if you can avoid it. > +void inet6_ifinfo_notify(int event, struct inet6_dev *idev); ... > +extern int ndisc_ifinfo_sysctl_change(ctl_table *ctl, int write, struct file ... > +extern void inet6_ifinfo_notify(int event, struct inet6_dev *idev); ... These belong in header files, not scattered around in *.c files. Thanks. From davem@pizda.ninka.net Tue Oct 14 15:32:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:33:12 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMWd25032038 for ; Tue, 14 Oct 2003 15:32:39 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA09883; Tue, 14 Oct 2003 15:25:19 -0700 Date: Tue, 14 Oct 2003 15:25:19 -0700 From: "David S. Miller" To: Shirley Ma Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable Message-Id: <20031014152519.612e9f12.davem@redhat.com> In-Reply-To: <200310141038.04322.mashirle@us.ibm.com> References: <20031008130016.559b8047.davem@redhat.com> <200310081706.09485.mashirle@us.ibm.com> <200310141038.04322.mashirle@us.ibm.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 827 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: 280 Lines: 8 On Tue, 14 Oct 2003 10:38:04 -0700 Shirley Ma wrote: > This is the modified new patch for IPv6 MIB: ipv6AddressTable. > This patch has been tested against linux-2.6.0-test6-bk8 kernel. This patch looks great, I think I'll add it to my 2.6.x tree tomorrow. From shemminger@osdl.org Tue Oct 14 15:34:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:34:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMYL25032392 for ; Tue, 14 Oct 2003 15:34:23 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYAT30154; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYAT30154@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (04/12) Probe2 -- ni52 Cc: netdev@oss.sgi.com X-archive-position: 828 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 Content-Length: 5820 Lines: 228 From viro NE15-ni52 * switched ni52 to dynamic allocation * ni52: embedded ->priv * ni52: fixed clobbering of everything on autoprobe Additional: * add free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:44:07 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:44:07 2003 @@ -69,7 +69,7 @@ extern int lne390_probe(struct net_device *); extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); -extern int ni52_probe(struct net_device *); +extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); extern int SK_init(struct net_device *); @@ -283,13 +283,13 @@ #ifdef CONFIG_NI5010 {ni5010_probe, 0}, #endif -#ifdef CONFIG_NI52 - {ni52_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_NI52 + {ni52_probe, 0}, +#endif #ifdef CONFIG_NI65 {ni65_probe, 0}, #endif diff -Nru a/drivers/net/ni52.c b/drivers/net/ni52.c --- a/drivers/net/ni52.c Mon Sep 29 09:44:07 2003 +++ b/drivers/net/ni52.c Mon Sep 29 09:44:07 2003 @@ -354,50 +354,76 @@ memset((char *)p->scb,0,sizeof(struct scb_struct)); } +/* set: io,irq,memstart,memend or set it when calling insmod */ +static int irq=9; +static int io=0x300; +static long memstart; /* e.g 0xd0000 */ +static long memend; /* e.g 0xd4000 */ + /********************************************** * probe the ni5210-card */ -int __init ni52_probe(struct net_device *dev) +struct net_device * __init ni52_probe(int unit) { -#ifndef MODULE - int *port; + struct net_device *dev = alloc_etherdev(sizeof(struct priv)); static int ports[] = {0x300, 0x280, 0x360 , 0x320 , 0x340, 0}; -#endif - int base_addr = dev->base_addr; - - SET_MODULE_OWNER(dev); + int *port; + int err = 0; - if (base_addr > 0x1ff) /* Check a single specified location. */ - return ni52_probe1(dev, base_addr); - else if (base_addr > 0) /* Don't probe at all. */ - return -ENXIO; + if (!dev) + return ERR_PTR(-ENOMEM); -#ifdef MODULE - printk("%s: no autoprobing allowed for modules.\n",dev->name); -#else - for (port = ports; *port; port++) { - int ioaddr = *port; - dev->base_addr = ioaddr; - if (ni52_probe1(dev, ioaddr) == 0) - return 0; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + memstart = dev->mem_start; + memend = dev->mem_end; } -#ifdef FULL_IO_PROBE - for(dev->base_addr=0x200; dev->base_addr<0x400; dev->base_addr+=8) - if (ni52_probe1(dev, dev->base_addr) == 0) - return 0; -#endif + SET_MODULE_OWNER(dev); + if (io > 0x1ff) { /* Check a single specified location. */ + err = ni52_probe1(dev, io); + } else if (io > 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = ports; *port && ni52_probe1(dev, *port) ; port++) + ; + if (*port) + goto got_it; +#ifdef FULL_IO_PROBE + for (io = 0x200; io < 0x400 && ni52_probe1(dev, io); io += 8) + ; + if (io < 0x400) + goto got_it; #endif - - dev->base_addr = base_addr; - return -ENODEV; + err = -ENODEV; + } + if (err) + goto out; +got_it: + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, NI52_TOTAL_SIZE); +out: + free_netdev(dev); + return ERR_PTR(err); } static int __init ni52_probe1(struct net_device *dev,int ioaddr) { int i, size, retval; + dev->base_addr = ioaddr; + dev->irq = irq; + dev->mem_start = memstart; + dev->mem_end = memend; + if (!request_region(ioaddr, NI52_TOTAL_SIZE, dev->name)) return -EBUSY; @@ -416,7 +442,7 @@ goto out; } - printk("%s: NI5210 found at %#3lx, ",dev->name,dev->base_addr); + printk(KERN_INFO "%s: NI5210 found at %#3lx, ",dev->name,dev->base_addr); /* * check (or search) IO-Memory, 8K and 16K @@ -469,13 +495,6 @@ dev->mem_end = dev->mem_start + size; /* set mem_end showed by 'ifconfig' */ #endif - dev->priv = (void *) kmalloc(sizeof(struct priv),GFP_KERNEL); - if(dev->priv == NULL) { - printk("%s: Ooops .. can't allocate private driver memory.\n",dev->name); - retval = -ENOMEM; - goto out; - } - /* warning: we don't free it on errors */ memset((char *) dev->priv,0,sizeof(struct priv)); ((struct priv *) (dev->priv))->memtop = isa_bus_to_virt(dev->mem_start) + size; @@ -503,8 +522,6 @@ if(!dev->irq) { printk("?autoirq, Failed to detect IRQ line!\n"); - kfree(dev->priv); - dev->priv = NULL; retval = -EAGAIN; goto out; } @@ -526,8 +543,6 @@ dev->if_port = 0; - ether_setup(dev); - return 0; out: release_region(ioaddr, NI52_TOTAL_SIZE); @@ -1295,13 +1310,7 @@ } #ifdef MODULE -static struct net_device dev_ni52; - -/* set: io,irq,memstart,memend or set it when calling insmod */ -static int irq=9; -static int io=0x300; -static long memstart; /* e.g 0xd0000 */ -static long memend; /* e.g 0xd4000 */ +static struct net_device *dev_ni52; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -1318,22 +1327,17 @@ printk("ni52: Autoprobing not allowed for modules.\nni52: Set symbols 'io' 'irq' 'memstart' and 'memend'\n"); return -ENODEV; } - dev_ni52.init = ni52_probe; - dev_ni52.irq = irq; - dev_ni52.base_addr = io; - dev_ni52.mem_end = memend; - dev_ni52.mem_start = memstart; - if (register_netdev(&dev_ni52) != 0) - return -EIO; + dev_ni52 = ni52_probe(-1); + if (IS_ERR(dev_ni52)) + return PTR_ERR(dev_ni52); return 0; } void cleanup_module(void) { - release_region(dev_ni52.base_addr, NI52_TOTAL_SIZE); - unregister_netdev(&dev_ni52); - kfree(dev_ni52.priv); - dev_ni52.priv = NULL; + unregister_netdev(dev_ni52); + release_region(dev_ni52->base_addr, NI52_TOTAL_SIZE); + free_netdev(dev_ni52); } #endif /* MODULE */ From shemminger@osdl.org Tue Oct 14 15:34:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:35:02 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMYL25032397 for ; Tue, 14 Oct 2003 15:34:24 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYAJ30190; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYAJ30190@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (12/12) Probe2 -- 82596 Cc: netdev@oss.sgi.com X-archive-position: 831 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 Content-Length: 5337 Lines: 202 Originally by Al Viro (NE23-82596) * switched 82596 to dynamic allocation * 82596: fixed resource leaks on failure exits Updated to apply agains jgarzik/net-drivers-2.5-exp diff -Nru a/drivers/net/82596.c b/drivers/net/82596.c --- a/drivers/net/82596.c Tue Oct 14 14:46:31 2003 +++ b/drivers/net/82596.c Tue Oct 14 14:46:31 2003 @@ -1129,21 +1129,40 @@ printk(" %02X%02X, %s\n", add[12], add[13], str); } -int __init i82596_probe(struct net_device *dev) +static int io = 0x300; +static int irq = 10; + +struct net_device * __init i82596_probe(int unit) { + struct net_device *dev; int i; struct i596_private *lp; char eth_addr[8]; static int probed; + int err; if (probed) - return -ENODEV; + return ERR_PTR(-ENODEV); probed++; + + dev = alloc_etherdev(0); + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } else { + dev->base_addr = io; + dev->irq = irq; + } + #ifdef ENABLE_MVME16x_NET if (MACH_IS_MVME16x) { if (mvme16x_config & MVME16x_CONFIG_NO_ETHERNET) { printk(KERN_NOTICE "Ethernet probe disabled - chip not present\n"); - return -ENODEV; + err = -ENODEV; + goto out; } memcpy(eth_addr, (void *) 0xfffc1f2c, 6); /* YUCK! Get addr from NOVRAM */ dev->base_addr = MVME_I596_BASE; @@ -1174,7 +1193,8 @@ if (!request_region(ioaddr, I596_TOTAL_SIZE, dev->name)) { printk(KERN_ERR "82596: IO address 0x%04x in use\n", ioaddr); - return -EBUSY; + err = -EBUSY; + goto out; } for (i = 0; i < 8; i++) { @@ -1190,8 +1210,8 @@ if ((checksum % 0x100) || (memcmp(eth_addr, "\x00\x00\x49", 3) != 0)) { - release_region(ioaddr, I596_TOTAL_SIZE); - return -ENODEV; + err = -ENODEV; + goto out1; } dev->base_addr = ioaddr; @@ -1200,13 +1220,10 @@ #endif dev->mem_start = (int)__get_free_pages(GFP_ATOMIC, 0); if (!dev->mem_start) { -#ifdef ENABLE_APRICOT - release_region(dev->base_addr, I596_TOTAL_SIZE); -#endif - return -ENOMEM; + err = -ENOMEM; + goto out1; } - ether_setup(dev); DEB(DEB_PROBE,printk(KERN_INFO "%s: 82596 at %#3lx,", dev->name, dev->base_addr)); for (i = 0; i < 6; i++) @@ -1244,7 +1261,26 @@ lp->scb.rfd = I596_NULL; lp->lock = SPIN_LOCK_UNLOCKED; - return 0; + err = register_netdev(dev); + if (err) + goto out2; + return dev; +out2: +#ifdef __mc68000__ + /* XXX This assumes default cache mode to be IOMAP_FULL_CACHING, + * XXX which may be invalid (CONFIG_060_WRITETHROUGH) + */ + kernel_set_cachemode((void *)(dev->mem_start), 4096, + IOMAP_FULL_CACHING); +#endif + free_page ((u32)(dev->mem_start)); +out1: +#ifdef ENABLE_APRICOT + release_region(dev->base_addr, I596_TOTAL_SIZE); +#endif +out: + free_netdev(dev); + return ERR_PTR(err); } static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs) @@ -1532,11 +1568,9 @@ } #ifdef MODULE -static struct net_device dev_82596 = { .init = i82596_probe }; +static struct net_device *dev_82596; #ifdef ENABLE_APRICOT -static int io = 0x300; -static int irq = 10; MODULE_PARM(irq, "i"); MODULE_PARM_DESC(irq, "Apricot IRQ number"); #endif @@ -1547,34 +1581,31 @@ int init_module(void) { -#ifdef ENABLE_APRICOT - dev_82596.base_addr = io; - dev_82596.irq = irq; -#endif if (debug >= 0) i596_debug = debug; - if (register_netdev(&dev_82596) != 0) - return -EIO; + dev_82596 = i82596_probe(-1); + if (IS_ERR(dev_82596)) + return PTR_ERR(dev_82596); return 0; } void cleanup_module(void) { - unregister_netdev(&dev_82596); + unregister_netdev(dev_82596); #ifdef __mc68000__ /* XXX This assumes default cache mode to be IOMAP_FULL_CACHING, * XXX which may be invalid (CONFIG_060_WRITETHROUGH) */ - kernel_set_cachemode((void *)(dev_82596.mem_start), 4096, + kernel_set_cachemode((void *)(dev_82596->mem_start), 4096, IOMAP_FULL_CACHING); #endif - free_page ((u32)(dev_82596.mem_start)); - dev_82596.priv = NULL; + free_page ((u32)(dev_82596->mem_start)); #ifdef ENABLE_APRICOT /* If we don't do this, we can't re-insmod it later. */ - release_region(dev_82596.base_addr, I596_TOTAL_SIZE); + release_region(dev_82596->base_addr, I596_TOTAL_SIZE); #endif + free_netdev(dev_82596); } #endif /* MODULE */ diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Oct 14 14:46:31 2003 +++ b/drivers/net/Space.c Tue Oct 14 14:46:31 2003 @@ -55,7 +55,7 @@ extern int at1700_probe(struct net_device *); extern int fmv18x_probe(struct net_device *); extern int eth16i_probe(struct net_device *); -extern int i82596_probe(struct net_device *); +extern struct net_device *i82596_probe(int unit); extern int ewrk3_probe(struct net_device *); extern struct net_device *el1_probe(int unit); extern struct net_device *wavelan_probe(int unit); @@ -259,13 +259,13 @@ #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */ {ewrk3_probe, 0}, #endif -#if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */ - {i82596_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */ + {i82596_probe, 0}, +#endif #ifdef CONFIG_EL1 /* 3c501 */ {el1_probe, 0}, #endif From shemminger@osdl.org Tue Oct 14 15:34:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:35:02 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMYL25032394 for ; Tue, 14 Oct 2003 15:34:24 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYA930170; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYA930170@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (08/12) Probe2 -- 3c507 Cc: netdev@oss.sgi.com X-archive-position: 829 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 Content-Length: 6038 Lines: 223 Originally by Al Viro (NE19-3c507) * switched 3c507 to dynamic allocation * 3c507: embedded ->priv * 3c507: fixed clobbering on autoprobe * NB: 3c507.c buggers port 0x100 without claiming it. Most likely it should be doing request_region() there. Updated to apply agains jgarzik/net-drivers-2.5-exp diff -Nru a/drivers/net/3c507.c b/drivers/net/3c507.c --- a/drivers/net/3c507.c Tue Oct 14 14:27:21 2003 +++ b/drivers/net/3c507.c Tue Oct 14 14:27:21 2003 @@ -74,10 +74,6 @@ #define debug net_debug -/* A zero-terminated list of common I/O addresses to be probed. */ -static unsigned int netcard_portlist[] __initdata = - { 0x300, 0x320, 0x340, 0x280, 0}; - /* Details of the i82586. @@ -286,8 +282,6 @@ /* Index to functions, as function prototypes. */ -extern int el16_probe(struct net_device *dev); /* Called from Space.c */ - static int el16_probe1(struct net_device *dev, int ioaddr); static int el16_open(struct net_device *dev); static int el16_send_packet(struct sk_buff *skb, struct net_device *dev); @@ -301,6 +295,10 @@ static void init_82586_mem(struct net_device *dev); static struct ethtool_ops netdev_ethtool_ops; +static int io = 0x300; +static int irq; +static int mem_start; + /* Check for a network adaptor of this type, and return '0' iff one exists. If dev->base_addr == 0, probe all likely locations. @@ -309,23 +307,50 @@ device and return success. */ -int __init el16_probe(struct net_device *dev) +struct net_device * __init el16_probe(int unit) { - int base_addr = dev->base_addr; - int i; + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); + static unsigned ports[] = { 0x300, 0x320, 0x340, 0x280, 0}; + unsigned *port; + int err = -ENODEV; + + if (!dev) + return ERR_PTR(-ENODEV); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + mem_start = dev->mem_start & 15; + } SET_MODULE_OWNER(dev); - if (base_addr > 0x1ff) /* Check a single specified location. */ - return el16_probe1(dev, base_addr); - else if (base_addr != 0) - return -ENXIO; /* Don't probe at all. */ - - for (i = 0; netcard_portlist[i]; i++) - if (el16_probe1(dev, netcard_portlist[i]) == 0) - return 0; + if (io > 0x1ff) /* Check a single specified location. */ + err = el16_probe1(dev, io); + else if (io != 0) + err = -ENXIO; /* Don't probe at all. */ + else { + for (port = ports; *port; port++) { + err = el16_probe1(dev, io); + if (!err) + break; + } + } - return -ENODEV; + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + free_irq(dev->irq, dev); + release_region(dev->base_addr, EL16_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } static int __init el16_probe1(struct net_device *dev, int ioaddr) @@ -383,8 +408,8 @@ printk(" %02x", dev->dev_addr[i]); } - if ((dev->mem_start & 0xf) > 0) - net_debug = dev->mem_start & 7; + if (mem_start) + net_debug = mem_start & 7; #ifdef MEM_BASE dev->mem_start = MEM_BASE; @@ -416,27 +441,18 @@ if (net_debug) printk(version); - /* Initialize the device structure. */ - lp = dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (dev->priv == NULL) { - retval = -ENOMEM; - goto out; - } - memset(dev->priv, 0, sizeof(struct net_local)); + lp = dev->priv; + memset(lp, 0, sizeof(*lp)); spin_lock_init(&lp->lock); - dev->open = el16_open; - dev->stop = el16_close; + dev->open = el16_open; + dev->stop = el16_close; dev->hard_start_xmit = el16_send_packet; dev->get_stats = el16_get_stats; dev->tx_timeout = el16_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; dev->ethtool_ops = &netdev_ethtool_ops; - - ether_setup(dev); /* Generic ethernet behaviour */ - - dev->flags&=~IFF_MULTICAST; /* Multicast doesn't work */ - + dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ return 0; out: release_region(ioaddr, EL16_IO_EXTENT); @@ -899,9 +915,7 @@ }; #ifdef MODULE -static struct net_device dev_3c507; -static int io = 0x300; -static int irq; +static struct net_device *dev_3c507; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); MODULE_PARM_DESC(io, "EtherLink16 I/O base address"); @@ -911,26 +925,18 @@ { if (io == 0) printk("3c507: You should not use auto-probing with insmod!\n"); - dev_3c507.base_addr = io; - dev_3c507.irq = irq; - dev_3c507.init = el16_probe; - if (register_netdev(&dev_3c507) != 0) { - printk("3c507: register_netdev() returned non-zero.\n"); - return -EIO; - } - return 0; + dev_3c507 = el16_probe(-1); + return IS_ERR(dev_3c507) ? PTR_ERR(dev_3c507) : 0; } void cleanup_module(void) { - unregister_netdev(&dev_3c507); - kfree(dev_3c507.priv); - dev_3c507.priv = NULL; - - /* If we don't do this, we can't re-insmod it later. */ - free_irq(dev_3c507.irq, &dev_3c507); - release_region(dev_3c507.base_addr, EL16_IO_EXTENT); + struct net_device *dev = dev_3c507; + unregister_netdev(dev); + free_irq(dev->irq, dev); + release_region(dev->base_addr, EL16_IO_EXTENT); + free_netdev(dev); } #endif /* MODULE */ MODULE_LICENSE("GPL"); diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Oct 14 14:27:21 2003 +++ b/drivers/net/Space.c Tue Oct 14 14:27:21 2003 @@ -60,7 +60,7 @@ extern int el1_probe(struct net_device *); extern int wavelan_probe(struct net_device *); extern int arlan_probe(struct net_device *); -extern int el16_probe(struct net_device *); +extern struct net_device *el16_probe(int unit); extern int elmc_probe(struct net_device *); extern int skmca_probe(struct net_device *); extern struct net_device *elplus_probe(int unit); @@ -271,13 +271,13 @@ #ifdef CONFIG_ARLAN /* Aironet */ {arlan_probe, 0}, #endif -#ifdef CONFIG_EL16 /* 3c507 */ - {el16_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_EL16 /* 3c507 */ + {el16_probe, 0}, +#endif #ifdef CONFIG_ELPLUS /* 3c505 */ {elplus_probe, 0}, #endif From shemminger@osdl.org Tue Oct 14 15:34:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:35:02 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMYL25032395 for ; Tue, 14 Oct 2003 15:34:24 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYA130180; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYA130180@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (11/12) Probe2 -- 3c501 Cc: netdev@oss.sgi.com X-archive-position: 830 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 Content-Length: 5748 Lines: 242 From viro NE22-3c501 * switched 3c501 to dynamic allocation * 3c501: embedded ->priv * 3c501: fixed clobbering on autoprobe * 3c501: fixed resource leaks on failure exits Additional: * probe correctly when no device present * fix loop forever bug in probing * free_netdev diff -Nru a/drivers/net/3c501.c b/drivers/net/3c501.c --- a/drivers/net/3c501.c Mon Sep 29 10:27:33 2003 +++ b/drivers/net/3c501.c Mon Sep 29 10:27:33 2003 @@ -136,17 +136,14 @@ #include "3c501.h" -/* A zero-terminated list of I/O addresses to be probed. - The 3c501 can be at many locations, but here are the popular ones. */ -static unsigned int netcard_portlist[] __initdata = { - 0x280, 0x300, 0 -}; - - /* * The boilerplate probe code. */ +static int io=0x280; +static int irq=5; +static int mem_start; + /** * el1_probe: - probe for a 3c501 * @dev: The device structure passed in to probe. @@ -160,23 +157,47 @@ * probe and failing to find anything. */ -int __init el1_probe(struct net_device *dev) +struct net_device * __init el1_probe(int unit) { - int i; - int base_addr = dev->base_addr; + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); + static unsigned ports[] = { 0x280, 0x300, 0}; + unsigned *port; + int err = 0; + + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + mem_start = dev->mem_start & 7; + } SET_MODULE_OWNER(dev); - if (base_addr > 0x1ff) /* Check a single specified location. */ - return el1_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; - - for (i = 0; netcard_portlist[i]; i++) - if (el1_probe1(dev, netcard_portlist[i]) == 0) - return 0; - - return -ENODEV; + if (io > 0x1ff) { /* Check a single specified location. */ + err = el1_probe1(dev, io); + } else if (io != 0) { + err = -ENXIO; /* Don't probe at all. */ + } else { + for (port = ports; *port && el1_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, EL1_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } /** @@ -240,6 +261,8 @@ * high. */ + dev->irq = irq; + if (dev->irq < 2) { unsigned long irq_mask; @@ -267,8 +290,8 @@ dev->base_addr = ioaddr; memcpy(dev->dev_addr, station_addr, ETH_ALEN); - if (dev->mem_start & 0xf) - el_debug = dev->mem_start & 0x7; + if (mem_start & 0xf) + el_debug = mem_start & 0x7; if (autoirq) dev->irq = autoirq; @@ -282,17 +305,7 @@ if (el_debug) printk(KERN_DEBUG "%s", version); - /* - * Initialize the device structure. - */ - - dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (dev->priv == NULL) { - release_region(ioaddr, EL1_IO_EXTENT); - return -ENOMEM; - } memset(dev->priv, 0, sizeof(struct net_local)); - lp=dev->priv; spin_lock_init(&lp->lock); @@ -308,13 +321,6 @@ dev->get_stats = &el1_get_stats; dev->set_multicast_list = &set_multicast_list; dev->ethtool_ops = &netdev_ethtool_ops; - - /* - * Setup the generic properties - */ - - ether_setup(dev); - return 0; } @@ -884,14 +890,8 @@ #ifdef MODULE -static struct net_device dev_3c501 = { - .init = el1_probe, - .base_addr = 0x280, - .irq = 5, -}; +static struct net_device *dev_3c501; -static int io=0x280; -static int irq=5; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); MODULE_PARM_DESC(io, "EtherLink I/O base address"); @@ -911,10 +911,9 @@ int init_module(void) { - dev_3c501.irq=irq; - dev_3c501.base_addr=io; - if (register_netdev(&dev_3c501) != 0) - return -EIO; + dev_3c501 = el1_probe(-1); + if (IS_ERR(dev_3c501)) + return PTR_ERR(dev_3c501); return 0; } @@ -927,19 +926,10 @@ void cleanup_module(void) { - unregister_netdev(&dev_3c501); - - /* - * Free up the private structure, or leak memory :-) - */ - - kfree(dev_3c501.priv); - dev_3c501.priv = NULL; /* gets re-allocated by el1_probe1 */ - - /* - * If we don't do this, we can't re-insmod it later. - */ - release_region(dev_3c501.base_addr, EL1_IO_EXTENT); + struct net_device *dev = dev_3c501; + unregister_netdev(dev); + release_region(dev->base_addr, EL1_IO_EXTENT); + free_netdev(dev); } #endif /* MODULE */ diff -Nru a/drivers/net/3c501.h b/drivers/net/3c501.h --- a/drivers/net/3c501.h Mon Sep 29 10:27:33 2003 +++ b/drivers/net/3c501.h Mon Sep 29 10:27:33 2003 @@ -3,7 +3,6 @@ * Index to functions. */ -int el1_probe(struct net_device *dev); static int el1_probe1(struct net_device *dev, int ioaddr); static int el_open(struct net_device *dev); static void el_timeout(struct net_device *dev); diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 10:27:33 2003 +++ b/drivers/net/Space.c Mon Sep 29 10:27:33 2003 @@ -57,7 +57,7 @@ extern int eth16i_probe(struct net_device *); extern int i82596_probe(struct net_device *); extern int ewrk3_probe(struct net_device *); -extern int el1_probe(struct net_device *); +extern struct net_device *el1_probe(int unit); extern struct net_device *wavelan_probe(int unit); extern struct net_device *arlan_probe(int unit); extern struct net_device *el16_probe(int unit); @@ -262,13 +262,13 @@ #if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */ {i82596_probe, 0}, #endif -#ifdef CONFIG_EL1 /* 3c501 */ - {el1_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_EL1 /* 3c501 */ + {el1_probe, 0}, +#endif #ifdef CONFIG_WAVELAN /* WaveLAN */ {wavelan_probe, 0}, #endif From shemminger@osdl.org Tue Oct 14 15:34:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:35:05 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMYL25032398 for ; Tue, 14 Oct 2003 15:34:24 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYAL30146; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYAL30146@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (1/12) Probe2 infrastructure for 2.6 experimental Cc: netdev@oss.sgi.com X-archive-position: 836 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 Content-Length: 3139 Lines: 112 New infrastructure to allow probing older builtin drivers (like ISA) Originally by Al Viro, updated to apply agains jgarzik/net-drivers-2.5-exp diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Fri Oct 10 10:07:40 2003 +++ b/drivers/net/Space.c Fri Oct 10 10:07:40 2003 @@ -110,6 +110,11 @@ int status; /* non-zero if autoprobe has failed */ }; +struct devprobe2 { + struct net_device *(*probe)(int unit); + int status; /* non-zero if autoprobe has failed */ +}; + /* * probe_list walks a list of probe functions and calls each so long * as a non-zero ioaddr is given, or as long as it hasn't already failed @@ -135,6 +140,21 @@ return -ENODEV; } +static int __init probe_list2(int unit, struct devprobe2 *p, int autoprobe) +{ + struct net_device *dev; + for (; p->probe; p++) { + if (autoprobe && p->status) + continue; + dev = p->probe(unit); + if (!IS_ERR(dev)) + return 0; + if (autoprobe) + p->status = PTR_ERR(dev); + } + return -ENODEV; +} + /* * This is a bit of an artificial separation as there are PCI drivers * that also probe for EISA cards (in the PCI group) and there are ISA @@ -372,6 +392,16 @@ return err; } + +static void __init ethif_probe2(int unit) +{ + unsigned long base_addr = netdev_boot_base("eth", unit); + + if (base_addr == 1) + return; + + return; /* nothing yet */ +} #ifdef CONFIG_TR /* Token-ring device probe */ @@ -440,7 +470,8 @@ trif_probe(num); #endif for (num = 0; num < 8; ++num) - ethif_probe(num); + if (!ethif_probe(num)) + ethif_probe2(num); #ifdef CONFIG_COPS cops_probe(0); diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h Fri Oct 10 10:07:40 2003 +++ b/include/linux/netdevice.h Fri Oct 10 10:07:40 2003 @@ -496,6 +496,7 @@ extern void probe_old_netdevs(void); extern int netdev_boot_setup_add(char *name, struct ifmap *map); extern int netdev_boot_setup_check(struct net_device *dev); +extern unsigned long netdev_boot_base(const char *prefix, int unit); extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); extern void dev_add_pack(struct packet_type *pt); extern void dev_remove_pack(struct packet_type *pt); diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Fri Oct 10 10:07:40 2003 +++ b/net/core/dev.c Fri Oct 10 10:07:40 2003 @@ -371,6 +371,30 @@ return 0; } + +/** + * netdev_boot_base - get address from boot time settings + * @prefix: prefix for network device + * @unit: id for network device + * + * Check boot time settings for the base address of device. + * The found settings are set for the device to be used + * later in the device probing. + * Returns 0 if no settings found. + */ +unsigned long netdev_boot_base(const char *prefix, int unit) +{ + const struct netdev_boot_setup *s = dev_boot_setup; + char name[IFNAMSIZ]; + int i; + + sprintf(name, "%s%d", prefix, unit); + for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) + if (!strcmp(name, s[i].name)) + return s[i].map.base_addr; + return 0; +} + /* * Saves at boot time configured settings for any netdevice. */ From shemminger@osdl.org Tue Oct 14 15:34:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:35:05 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMYM25032400 for ; Tue, 14 Oct 2003 15:34:24 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYAx30151; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYAx30151@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (03/12) Probe2 -- ni65 Cc: netdev@oss.sgi.com X-archive-position: 833 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 Content-Length: 4487 Lines: 188 Convert ni65 driver to new probing; patch sequence goes bottom up on the probe list. * switched ni65 to dynamic allocation * ni65: fixed ->irq and ->dma clobbering on autoprobe diff -urN 01-de620/drivers/net/ni65.c 02-ni65/drivers/net/ni65.c --- 01-de620/drivers/net/ni65.c 2003-09-27 17:50:14.000000000 -0700 +++ 02-ni65/drivers/net/ni65.c 2003-09-29 15:55:16.000000000 -0700 @@ -343,29 +343,64 @@ return 0; } +static void cleanup_card(struct net_device *dev) +{ + struct priv *p = (struct priv *) dev->priv; + disable_dma(dev->dma); + free_dma(dev->dma); + release_region(dev->base_addr, cards[p->cardno].total_size); + ni65_free_buffer(p); +} + +/* set: io,irq,dma or set it when calling insmod */ +static int irq; +static int io; +static int dma; + /* * Probe The Card (not the lance-chip) */ -#ifdef MODULE -static -#endif -int __init ni65_probe(struct net_device *dev) +struct net_device * __init ni65_probe(int unit) { - int *port; + struct net_device *dev = alloc_etherdev(0); static int ports[] = {0x360,0x300,0x320,0x340, 0}; + int *port; + int err = 0; - if (dev->base_addr > 0x1ff) /* Check a single specified location. */ - return ni65_probe1(dev, dev->base_addr); - else if (dev->base_addr > 0) /* Don't probe at all. */ - return -ENXIO; + if (!dev) + return ERR_PTR(-ENOMEM); - for (port = ports; *port; port++) - { - if (ni65_probe1(dev, *port) == 0) - return 0; - } - - return -ENODEV; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + irq = dev->irq; + dma = dev->dma; + } else { + dev->base_addr = io; + } + + if (dev->base_addr > 0x1ff) { /* Check a single specified location. */ + err = ni65_probe1(dev, dev->base_addr); + } else if (dev->base_addr > 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = ports; *port && ni65_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; + } + if (err) + goto out; + + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); } /* @@ -377,6 +412,9 @@ struct priv *p; unsigned long flags; + dev->irq = irq; + dev->dma = dma; + for(i=0;iwatchdog_timeo = HZ/2; dev->get_stats = ni65_get_stats; dev->set_multicast_list = set_multicast_list; - - ether_setup(dev); - return 0; /* everything is OK */ } @@ -1213,12 +1248,7 @@ } #ifdef MODULE -static struct net_device dev_ni65 = { .base_addr = 0x360, .irq = 9, .init = ni65_probe }; - -/* set: io,irq,dma or set it when calling insmod */ -static int irq; -static int io; -static int dma; +static struct net_device *dev_ni65; MODULE_PARM(irq, "i"); MODULE_PARM(io, "i"); @@ -1229,26 +1259,15 @@ int init_module(void) { - dev_ni65.irq = irq; - dev_ni65.dma = dma; - dev_ni65.base_addr = io; - if (register_netdev(&dev_ni65) != 0) - return -EIO; - return 0; + dev_ni65 = ni65_probe(-1); + return IS_ERR(dev_ni65) ? PTR_ERR(dev_ni65) : 0; } void cleanup_module(void) { - struct priv *p; - p = (struct priv *) dev_ni65.priv; - if(!p) - BUG(); - disable_dma(dev_ni65.dma); - free_dma(dev_ni65.dma); - unregister_netdev(&dev_ni65); - release_region(dev_ni65.base_addr,cards[p->cardno].total_size); - ni65_free_buffer(p); - dev_ni65.priv = NULL; + unregister_netdev(dev_ni65); + cleanup_card(dev_ni65); + free_netdev(dev_ni65); } #endif /* MODULE */ diff -urN 01-de620/drivers/net/Space.c 02-ni65/drivers/net/Space.c --- 01-de620/drivers/net/Space.c 2003-09-29 15:48:30.000000000 -0700 +++ 02-ni65/drivers/net/Space.c 2003-09-29 15:55:16.000000000 -0700 @@ -71,7 +71,7 @@ extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); extern int ni52_probe(struct net_device *); -extern int ni65_probe(struct net_device *); +extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); extern int SK_init(struct net_device *); extern int seeq8005_probe(struct net_device *); @@ -290,6 +290,10 @@ #ifdef CONFIG_NI52 {ni52_probe, 0}, #endif + {NULL, 0}, +}; + +static struct devprobe2 isa_probes2[] __initdata = { #ifdef CONFIG_NI65 {ni65_probe, 0}, #endif @@ -403,6 +407,7 @@ if (base_addr == 1) return; + probe_list2(unit, isa_probes2, base_addr == 0) && probe_list2(unit, parport_probes, base_addr == 0); } From shemminger@osdl.org Tue Oct 14 15:34:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:35:04 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMYM25032401 for ; Tue, 14 Oct 2003 15:34:24 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYAK30148; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYAK30148@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (2/12) Probe2 -- de620 Cc: netdev@oss.sgi.com X-archive-position: 832 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 Content-Length: 4542 Lines: 185 Rework de620 driver to new dynamic allocation Originally by Al Viro. * switched de620 to dynamic allocation * de620: embedded ->priv * de620: fixed IO before request_region() Updated to ~jgarzik/net-drivers-2.5-exp diff -urN 00-probe/drivers/net/de620.c 01-de620/drivers/net/de620.c --- 00-probe/drivers/net/de620.c 2003-09-27 17:50:20.000000000 -0700 +++ 01-de620/drivers/net/de620.c 2003-09-29 15:48:30.000000000 -0700 @@ -226,7 +226,6 @@ /* Initialization */ static int adapter_init(struct net_device *); -int de620_probe(struct net_device *); static int read_eeprom(struct net_device *); @@ -814,11 +813,16 @@ * * Check if there is a DE-620 connected */ -int __init de620_probe(struct net_device *dev) +struct net_device * __init de620_probe(int unit) { - static struct net_device_stats de620_netstats; - int i; byte checkbyte = 0xa5; + struct net_device *dev; + int err = -ENOMEM; + int i; + + dev = alloc_etherdev(sizeof(struct net_device_stats)); + if (!dev) + goto out; SET_MODULE_OWNER(dev); @@ -831,11 +835,23 @@ dev->base_addr = io; dev->irq = irq; + /* allow overriding parameters on command line */ + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } + if (de620_debug) printk(version); printk(KERN_INFO "D-Link DE-620 pocket adapter"); + if (!request_region(dev->base_addr, 3, "de620")) { + printk(" io 0x%3lX, which is busy.\n", dev->base_addr); + err = -EBUSY; + goto out1; + } + /* Initially, configure basic nibble mode, so we can read the EEPROM */ NIC_Cmd = DEF_NIC_CMD; de620_set_register(dev, W_EIP, EIPRegister); @@ -846,12 +862,8 @@ if ((checkbyte != 0xa5) || (read_eeprom(dev) != 0)) { printk(" not identified in the printer port\n"); - return -ENODEV; - } - - if (!request_region(dev->base_addr, 3, "de620")) { - printk(KERN_ERR "io 0x%3lX, which is busy.\n", dev->base_addr); - return -EBUSY; + err = -ENODEV; + goto out2; } /* else, got it! */ @@ -870,10 +882,6 @@ else printk(" UTP)\n"); - /* Initialize the device structure. */ - dev->priv = &de620_netstats; - - memset(dev->priv, 0, sizeof(struct net_device_stats)); dev->get_stats = get_stats; dev->open = de620_open; dev->stop = de620_close; @@ -884,8 +892,6 @@ /* base_addr and irq are already set, see above! */ - ether_setup(dev); - /* dump eeprom */ if (de620_debug) { printk("\nEEPROM contents:\n"); @@ -899,7 +905,17 @@ printk("SCR = 0x%02x\n", nic_data.SCR); } - return 0; + err = register_netdev(dev); + if (err) + goto out2; + return dev; + +out2: + release_region(dev->base_addr, 3); +out1: + free_netdev(dev); +out: + return ERR_PTR(err); } /********************************** @@ -994,20 +1010,21 @@ * */ #ifdef MODULE -static struct net_device de620_dev; +static struct net_device *de620_dev; int init_module(void) { - de620_dev.init = de620_probe; - if (register_netdev(&de620_dev) != 0) - return -EIO; + de620_dev = de620_probe(-1); + if (IS_ERR(de620_dev)) + return PTR_ERR(de620_dev); return 0; } void cleanup_module(void) { - unregister_netdev(&de620_dev); - release_region(de620_dev.base_addr, 3); + unregister_netdev(de620_dev); + release_region(de620_dev->base_addr, 3); + free_netdev(de620_dev); } #endif /* MODULE */ MODULE_LICENSE("GPL"); diff -urN 00-probe/drivers/net/Space.c 01-de620/drivers/net/Space.c --- 00-probe/drivers/net/Space.c 2003-09-29 15:44:32.000000000 -0700 +++ 01-de620/drivers/net/Space.c 2003-09-29 15:48:30.000000000 -0700 @@ -97,7 +97,7 @@ extern struct net_device *ltpc_probe(void); /* Detachable devices ("pocket adaptors") */ -extern int de620_probe(struct net_device *); +extern struct net_device *de620_probe(int unit); /* Fibre Channel adapters */ extern int iph5526_probe(struct net_device *dev); @@ -296,7 +296,7 @@ {NULL, 0}, }; -static struct devprobe parport_probes[] __initdata = { +static struct devprobe2 parport_probes[] __initdata = { #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */ {de620_probe, 0}, #endif @@ -387,8 +387,7 @@ probe_list(dev, mips_probes) == 0 || probe_list(dev, eisa_probes) == 0 || probe_list(dev, mca_probes) == 0 || - probe_list(dev, isa_probes) == 0 || - probe_list(dev, parport_probes) == 0) + probe_list(dev, isa_probes) == 0) err = register_netdev(dev); if (err) @@ -404,7 +403,7 @@ if (base_addr == 1) return; - return; /* nothing yet */ + probe_list2(unit, parport_probes, base_addr == 0); } #ifdef CONFIG_TR From shemminger@osdl.org Tue Oct 14 15:34:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:35:05 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMYL25032399 for ; Tue, 14 Oct 2003 15:34:24 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYAG30175; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYAG30175@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (10/12) Probe2 -- wavelan Cc: netdev@oss.sgi.com X-archive-position: 834 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 Content-Length: 9880 Lines: 348 Original by Al Viro (NE21-wavelan) * switched wavelan to dynamic allocation * wavelan: embedded ->priv * wavelan: fixed clobbering on autoprobe * wavelan: fixed IO before request_region() * wavelan: fixed resource leaks on failure exits * wavelan: fixed order of freeing bugs Updated to apply agains jgarzik/net-drivers-2.5-exp diff -urN 08-arlan/drivers/net/Space.c 09-wavelan/drivers/net/Space.c --- 08-arlan/drivers/net/Space.c 2003-09-29 16:23:44.000000000 -0700 +++ 09-wavelan/drivers/net/Space.c 2003-09-29 16:30:02.000000000 -0700 @@ -58,7 +58,7 @@ extern int i82596_probe(struct net_device *); extern int ewrk3_probe(struct net_device *); extern int el1_probe(struct net_device *); -extern int wavelan_probe(struct net_device *); +extern struct net_device *wavelan_probe(int unit); extern struct net_device *arlan_probe(int unit); extern struct net_device *el16_probe(int unit); extern int elmc_probe(struct net_device *); @@ -269,13 +269,13 @@ #ifdef CONFIG_EL1 /* 3c501 */ {el1_probe, 0}, #endif -#ifdef CONFIG_WAVELAN /* WaveLAN */ - {wavelan_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_WAVELAN /* WaveLAN */ + {wavelan_probe, 0}, +#endif #ifdef CONFIG_ARLAN /* Aironet */ {arlan_probe, 0}, #endif diff -urN 08-arlan/drivers/net/wireless/wavelan.c 09-wavelan/drivers/net/wireless/wavelan.c --- 08-arlan/drivers/net/wireless/wavelan.c 2003-09-27 17:50:59.000000000 -0700 +++ 09-wavelan/drivers/net/wireless/wavelan.c 2003-09-29 16:30:09.000000000 -0700 @@ -4091,12 +4091,24 @@ * device structure * (called by wavelan_probe() and via init_module()). */ -static int __init wavelan_config(device * dev) +static int __init wavelan_config(device *dev, unsigned short ioaddr) { - unsigned long ioaddr = dev->base_addr; u8 irq_mask; int irq; net_local *lp; + mac_addr mac; + int err; + + if (!request_region(ioaddr, sizeof(ha_t), "wavelan")) + return -EADDRINUSE; + + err = wv_check_ioaddr(ioaddr, mac); + if (err) + goto out; + + memcpy(dev->dev_addr, mac, 6); + + dev->base_addr = ioaddr; #ifdef DEBUG_CALLBACK_TRACE printk(KERN_DEBUG "%s: ->wavelan_config(dev=0x%x, ioaddr=0x%lx)\n", @@ -4136,25 +4148,18 @@ "%s: wavelan_config(): could not wavelan_map_irq(%d).\n", dev->name, irq_mask); #endif - return -EAGAIN; + err = -EAGAIN; + goto out; } dev->irq = irq; - if (!request_region(ioaddr, sizeof(ha_t), "wavelan")) - return -EBUSY; - dev->mem_start = 0x0000; dev->mem_end = 0x0000; dev->if_port = 0; /* Initialize device structures */ - dev->priv = kmalloc(sizeof(net_local), GFP_KERNEL); - if (dev->priv == NULL) { - release_region(ioaddr, sizeof(ha_t)); - return -ENOMEM; - } - memset(dev->priv, 0x00, sizeof(net_local)); + memset(dev->priv, 0, sizeof(net_local)); lp = (net_local *) dev->priv; /* Back link to the device structure. */ @@ -4172,12 +4177,6 @@ /* Init spinlock */ spin_lock_init(&lp->spinlock); - /* - * Fill in the fields of the device structure - * with generic Ethernet values. - */ - ether_setup(dev); - SET_MODULE_OWNER(dev); dev->open = wavelan_open; dev->stop = wavelan_close; @@ -4204,6 +4203,9 @@ printk(KERN_DEBUG "%s: <-wavelan_config()\n", dev->name); #endif return 0; +out: + release_region(ioaddr, sizeof(ha_t)); + return err; } /*------------------------------------------------------------------*/ @@ -4214,19 +4216,13 @@ * We follow the example in drivers/net/ne.c. * (called in "Space.c") */ -int __init wavelan_probe(device * dev) +struct net_device * __init wavelan_probe(int unit) { + struct net_device *dev; short base_addr; - mac_addr mac; /* MAC address (check existence of WaveLAN) */ + int def_irq; int i; - int r; - -#ifdef DEBUG_CALLBACK_TRACE - printk(KERN_DEBUG - "%s: ->wavelan_probe(dev=0x%x (base_addr=0x%x))\n", - dev->name, (unsigned int) dev, - (unsigned int) dev->base_addr); -#endif + int r = 0; #ifdef STRUCT_CHECK if (wv_struct_check() != (char *) NULL) { @@ -4237,8 +4233,20 @@ } #endif /* STRUCT_CHECK */ - /* Check the value of the command line parameter for base address. */ + dev = alloc_etherdev(sizeof(net_local)); + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); base_addr = dev->base_addr; + def_irq = dev->irq; + +#ifdef DEBUG_CALLBACK_TRACE + printk(KERN_DEBUG + "%s: ->wavelan_probe(dev=%p (base_addr=0x%x))\n", + dev->name, dev, (unsigned int) dev->base_addr); +#endif /* Don't probe at all. */ if (base_addr < 0) { @@ -4247,16 +4255,9 @@ "%s: wavelan_probe(): invalid base address\n", dev->name); #endif - return -ENXIO; - } - - /* Check a single specified location. */ - if (base_addr > 0x100) { - /* Check if there is something at this base address */ - if ((r = wv_check_ioaddr(base_addr, mac)) == 0) { - memcpy(dev->dev_addr, mac, 6); /* Copy MAC address. */ - r = wavelan_config(dev); - } + r = -ENXIO; + } else if (base_addr > 0x100) { /* Check a single specified location. */ + r = wavelan_config(dev, base_addr); #ifdef DEBUG_CONFIG_INFO if (r != 0) printk(KERN_DEBUG @@ -4267,35 +4268,33 @@ #ifdef DEBUG_CALLBACK_TRACE printk(KERN_DEBUG "%s: <-wavelan_probe()\n", dev->name); #endif - return r; - } - - /* Scan all possible addresses of the WaveLAN hardware. */ - for (i = 0; i < NELS(iobase); i++) { - /* Check whether there is something at this base address. */ - if (wv_check_ioaddr(iobase[i], mac) == 0) { - dev->base_addr = iobase[i]; /* Copy base address. */ - memcpy(dev->dev_addr, mac, 6); /* Copy MAC address. */ - if (wavelan_config(dev) == 0) { + } else { /* Scan all possible addresses of the WaveLAN hardware. */ + for (i = 0; i < NELS(iobase); i++) { + dev->irq = def_irq; + if (wavelan_config(dev, iobase[i]) == 0) { #ifdef DEBUG_CALLBACK_TRACE printk(KERN_DEBUG "%s: <-wavelan_probe()\n", dev->name); #endif - return 0; + break; } } + if (i == NELS(iobase)) + r = -ENODEV; } - - /* We may have touched base_addr. Another driver may not like it. */ - dev->base_addr = base_addr; - -#ifdef DEBUG_CONFIG_INFO - printk(KERN_DEBUG "%s: wavelan_probe(): no device found\n", - dev->name); -#endif - - return -ENODEV; + if (r) + goto out; + r = register_netdev(dev); + if (r) + goto out1; + return dev; +out1: + release_region(dev->base_addr, sizeof(ha_t)); + wavelan_list = wavelan_list->next; +out: + kfree(dev); + return ERR_PTR(r); } /****************************** MODULE ******************************/ @@ -4311,7 +4310,6 @@ */ int init_module(void) { - mac_addr mac; /* MAC address (check WaveLAN existence) */ int ret = -EIO; /* Return error if no cards found */ int i; @@ -4337,38 +4335,28 @@ /* Loop on all possible base addresses. */ i = -1; while ((io[++i] != 0) && (i < NELS(io))) { - /* Check if there is something at this base address. */ - if (wv_check_ioaddr(io[i], mac) == 0) { - device *dev; + struct net_device *dev = alloc_etherdev(sizeof(net_local)); + if (!dev) + break; + memcpy(dev->name, name[i], IFNAMSIZ); /* Copy name */ + dev->base_addr = io[i]; + dev->irq = irq[i]; - /* Create device and set basic arguments. */ - dev = - kmalloc(sizeof(struct net_device), GFP_KERNEL); - if (dev == NULL) { - ret = -ENOMEM; - break; - } - memset(dev, 0x00, sizeof(struct net_device)); - memcpy(dev->name, name[i], IFNAMSIZ); /* Copy name */ - dev->base_addr = io[i]; - dev->irq = irq[i]; - dev->init = &wavelan_config; - memcpy(dev->dev_addr, mac, 6); /* Copy MAC address. */ - - /* Try to create the device. */ + /* Check if there is something at this base address. */ + if (wavelan_config(dev, io[i]) == 0) { if (register_netdev(dev) != 0) { - /* Deallocate everything. */ - /* Note: if dev->priv is mallocated, there is no way to fail. */ - kfree(dev); + release_region(dev->base_addr, sizeof(ha_t)); + wavelan_list = wavelan_list->next; } else { - /* If at least one device OK, we do not fail */ ret = 0; + continue; } - } /* if there is something at the address */ - } /* Loop on all addresses. */ + } + kfree(dev); + } #ifdef DEBUG_CONFIG_ERROR - if (wavelan_list == (net_local *) NULL) + if (!wavelan_list) printk(KERN_WARNING "WaveLAN init_module(): no device found\n"); #endif @@ -4390,7 +4378,7 @@ #endif /* Loop on all devices and release them. */ - while (wavelan_list != (net_local *) NULL) { + while (wavelan_list) { device *dev = wavelan_list->dev; #ifdef DEBUG_CONFIG_INFO @@ -4398,18 +4386,11 @@ "%s: cleanup_module(): removing device at 0x%x\n", dev->name, (unsigned int) dev); #endif - - /* Release the ioport region. */ - release_region(dev->base_addr, sizeof(ha_t)); - - /* Definitely remove the device. */ unregister_netdev(dev); - /* Unlink the device. */ + release_region(dev->base_addr, sizeof(ha_t)); wavelan_list = wavelan_list->next; - /* Free pieces. */ - kfree(dev->priv); free_netdev(dev); } diff -urN 08-arlan/drivers/net/wireless/wavelan.p.h 09-wavelan/drivers/net/wireless/wavelan.p.h --- 08-arlan/drivers/net/wireless/wavelan.p.h 2003-09-27 17:50:38.000000000 -0700 +++ 09-wavelan/drivers/net/wireless/wavelan.p.h 2003-09-29 16:30:09.000000000 -0700 @@ -656,9 +656,8 @@ static int wavelan_open(device *), /* Open the device. */ wavelan_close(device *), /* Close the device. */ - wavelan_config(device *); /* Configure one device. */ -extern int - wavelan_probe(device *); /* See Space.c. */ + wavelan_config(device *, unsigned short);/* Configure one device. */ +extern struct net_device *wavelan_probe(int unit); /* See Space.c. */ /**************************** VARIABLES ****************************/ From shemminger@osdl.org Tue Oct 14 15:34:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:35:05 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMYL25032391 for ; Tue, 14 Oct 2003 15:34:23 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYAg30167; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYAg30167@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (07/12) Probe2 -- 3c505 Cc: netdev@oss.sgi.com X-archive-position: 835 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 Content-Length: 6633 Lines: 257 from viro NE18-3c505 * switched 3c505 to dynamic allocation * 3c505: embedded ->priv * 3c505: fixed use of uninitialized variable * 3c505: fixed resource leaks on failure exits Additional: * add free_netdev diff -Nru a/drivers/net/3c505.c b/drivers/net/3c505.c --- a/drivers/net/3c505.c Mon Sep 29 09:45:12 2003 +++ b/drivers/net/3c505.c Mon Sep 29 09:45:12 2003 @@ -1293,42 +1293,6 @@ } } -/****************************************************** - * - * initialise Etherlink Plus board - * - ******************************************************/ - -static inline void elp_init(struct net_device *dev) -{ - elp_device *adapter = dev->priv; - - /* - * set ptrs to various functions - */ - dev->open = elp_open; /* local */ - dev->stop = elp_close; /* local */ - dev->get_stats = elp_get_stats; /* local */ - dev->hard_start_xmit = elp_start_xmit; /* local */ - dev->tx_timeout = elp_timeout; /* local */ - dev->watchdog_timeo = 10*HZ; - dev->set_multicast_list = elp_set_mc_list; /* local */ - dev->ethtool_ops = &netdev_ethtool_ops; /* local */ - - /* Setup the generic properties */ - ether_setup(dev); - - /* - * setup ptr to adapter specific information - */ - memset(&(adapter->stats), 0, sizeof(struct net_device_stats)); - - /* - * memory information - */ - dev->mem_start = dev->mem_end = 0; -} - /************************************************************ * * A couple of tests to see if there's 3C505 or not @@ -1442,12 +1406,13 @@ * work at all if it was in a weird state). */ -int __init elplus_probe(struct net_device *dev) +static int __init elplus_setup(struct net_device *dev) { - elp_device *adapter; + elp_device *adapter = dev->priv; int i, tries, tries1, okay; unsigned long timeout; unsigned long cookie = 0; + int err = -ENODEV; SET_MODULE_OWNER(dev); @@ -1456,17 +1421,8 @@ */ dev->base_addr = elp_autodetect(dev); - if (!(dev->base_addr)) - return -ENODEV; - - /* - * setup ptr to adapter specific information - */ - adapter = (elp_device *) (dev->priv = kmalloc(sizeof(elp_device), GFP_KERNEL)); - if (adapter == NULL) { - printk(KERN_ERR "%s: out of memory\n", dev->name); + if (!dev->base_addr) return -ENODEV; - } adapter->send_pcb_semaphore = 0; @@ -1544,8 +1500,7 @@ outb_control(adapter->hcr_val & ~(FLSH | ATTN), dev); } printk(KERN_ERR "%s: failed to initialise 3c505\n", dev->name); - release_region(dev->base_addr, ELP_IO_EXTENT); - return -ENODEV; + goto out; okay: if (dev->irq) { /* Is there a preset IRQ? */ @@ -1560,14 +1515,14 @@ case 0: printk(KERN_ERR "%s: IRQ probe failed: check 3c505 jumpers.\n", dev->name); - return -ENODEV; + goto out; case 1: case 6: case 8: case 13: printk(KERN_ERR "%s: Impossible IRQ %d reported by probe_irq_off().\n", dev->name, dev->irq); - return -ENODEV; + goto out; } /* * Now we have the IRQ number so we can disable the interrupts from @@ -1636,16 +1591,48 @@ printk(KERN_ERR "%s: adapter configuration failed\n", dev->name); } - /* - * initialise the device - */ - elp_init(dev); + dev->open = elp_open; /* local */ + dev->stop = elp_close; /* local */ + dev->get_stats = elp_get_stats; /* local */ + dev->hard_start_xmit = elp_start_xmit; /* local */ + dev->tx_timeout = elp_timeout; /* local */ + dev->watchdog_timeo = 10*HZ; + dev->set_multicast_list = elp_set_mc_list; /* local */ + dev->ethtool_ops = &netdev_ethtool_ops; /* local */ + + memset(&(adapter->stats), 0, sizeof(struct net_device_stats)); + dev->mem_start = dev->mem_end = 0; + + err = register_netdev(dev); + if (err) + goto out; return 0; +out: + release_region(dev->base_addr, ELP_IO_EXTENT); + return err; +} + +struct net_device * __init elplus_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(sizeof(elp_device)); + int err; + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + err = elplus_setup(dev); + if (err) { + free_netdev(dev); + return ERR_PTR(err); + } + return dev; } #ifdef MODULE -static struct net_device dev_3c505[ELP_MAX_CARDS]; +static struct net_device *dev_3c505[ELP_MAX_CARDS]; static int io[ELP_MAX_CARDS]; static int irq[ELP_MAX_CARDS]; static int dma[ELP_MAX_CARDS]; @@ -1661,10 +1648,12 @@ int this_dev, found = 0; for (this_dev = 0; this_dev < ELP_MAX_CARDS; this_dev++) { - struct net_device *dev = &dev_3c505[this_dev]; + struct net_device *dev = alloc_etherdev(sizeof(elp_device)); + if (!dev) + break; + dev->irq = irq[this_dev]; dev->base_addr = io[this_dev]; - dev->init = elplus_probe; if (dma[this_dev]) { dev->dma = dma[this_dev]; } else { @@ -1672,16 +1661,22 @@ printk(KERN_WARNING "3c505.c: warning, using default DMA channel,\n"); } if (io[this_dev] == 0) { - if (this_dev) break; + if (this_dev) { + free_netdev(dev); + break; + } printk(KERN_NOTICE "3c505.c: module autoprobe not recommended, give io=xx.\n"); } - if (register_netdev(dev) != 0) { + if (elplus_setup(dev) != 0) { printk(KERN_WARNING "3c505.c: Failed to register card at 0x%x.\n", io[this_dev]); - if (found != 0) return 0; - return -ENXIO; + free_netdev(dev); + break; } + dev_3c505[this_dev] = dev; found++; } + if (!found) + return -ENODEV; return 0; } @@ -1690,12 +1685,11 @@ int this_dev; for (this_dev = 0; this_dev < ELP_MAX_CARDS; this_dev++) { - struct net_device *dev = &dev_3c505[this_dev]; - if (dev->priv != NULL) { + struct net_device *dev = dev_3c505[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(dev->priv); - dev->priv = NULL; release_region(dev->base_addr, ELP_IO_EXTENT); + free_netdev(dev); } } } diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:45:12 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:45:12 2003 @@ -63,7 +63,7 @@ extern int el16_probe(struct net_device *); extern int elmc_probe(struct net_device *); extern int skmca_probe(struct net_device *); -extern int elplus_probe(struct net_device *); +extern struct net_device *elplus_probe(int unit); extern int ac3200_probe(struct net_device *); extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); @@ -274,13 +274,13 @@ #ifdef CONFIG_EL16 /* 3c507 */ {el16_probe, 0}, #endif -#ifdef CONFIG_ELPLUS /* 3c505 */ - {elplus_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_ELPLUS /* 3c505 */ + {elplus_probe, 0}, +#endif #ifdef CONFIG_SK_G16 {SK_init, 0}, #endif From ja@ssi.bg Tue Oct 14 15:55:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:56:18 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMtb25003546 for ; Tue, 14 Oct 2003 15:55:40 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h9EMthS16359; Wed, 15 Oct 2003 01:55:43 +0300 Date: Wed, 15 Oct 2003 01:55:43 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: kuznet@ms2.inr.ac.ru cc: "David S. Miller" , , Subject: Re: [2.4/2.6 PATCHES] Change some ip_fragment checks to help IPVS In-Reply-To: <200310141203.QAA23474@yakov.inr.ac.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 837 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Content-Length: 540 Lines: 21 Hello, On Tue, 14 Oct 2003 kuznet@ms2.inr.ac.ru wrote: > Yes. The test was to eliminate the pathological cases, but the test > is really valid only when skb is generated by ip_append_*. If skb as whole > is now owned, it is also perfect case. One related question: is ip_fragment() backport from 2.6 to 2.4 planned? Because so many NF hooks were changed to avoid linearization but ip_fragment is still outdated and the forced reassembly after ip_defrag is not always a good thing. > Alexey Regards -- Julian Anastasov From davem@pizda.ninka.net Tue Oct 14 15:58:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 15:58:57 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EMwM25003918 for ; Tue, 14 Oct 2003 15:58:23 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA10008; Tue, 14 Oct 2003 15:51:52 -0700 Date: Tue, 14 Oct 2003 15:51:52 -0700 From: "David S. Miller" To: Julian Anastasov Cc: kuznet@ms2.inr.ac.ru, wensong@linux-vs.org, netdev@oss.sgi.com Subject: Re: [2.4/2.6 PATCHES] Change some ip_fragment checks to help IPVS Message-Id: <20031014155152.275270c1.davem@redhat.com> In-Reply-To: References: <200310141203.QAA23474@yakov.inr.ac.ru> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 838 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: 345 Lines: 11 On Wed, 15 Oct 2003 01:55:43 +0300 (EEST) Julian Anastasov wrote: > One related question: is ip_fragment() backport from 2.6 > to 2.4 planned? No, it only makes sense in the 2.6.x stack. 2.4.x and 2.6.x networking are wildly different beasts and you'll therefore need to make the IPVS implementation cope with that in each tree. From shemminger@osdl.org Tue Oct 14 16:01:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 16:02:06 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EN1W25004300 for ; Tue, 14 Oct 2003 16:01:33 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EN1Pr02971; Tue, 14 Oct 2003 16:01:25 -0700 Date: Tue, 14 Oct 2003 16:01:25 -0700 From: Stephen Hemminger Message-Id: <200310142301.h9EN1Pr02971@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (05/12) Probe2 -- ni5010 Cc: netdev@oss.sgi.com X-archive-position: 839 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 Content-Length: 10920 Lines: 402 from viro NE16-ni5010 * switched ni5010 to dynamic allocation * ni5010: embedded ->priv * ni5010: fixed clobbering ->irq * ni5010: fixed IO before request_region() Additional: * add free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:44:30 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:44:30 2003 @@ -68,7 +68,7 @@ extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); extern int e2100_probe(struct net_device *); -extern int ni5010_probe(struct net_device *); +extern struct net_device *ni5010_probe(int unit); extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); @@ -280,13 +280,13 @@ #ifdef CONFIG_SK_G16 {SK_init, 0}, #endif -#ifdef CONFIG_NI5010 - {ni5010_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_NI5010 + {ni5010_probe, 0}, +#endif #ifdef CONFIG_NI52 {ni52_probe, 0}, #endif diff -Nru a/drivers/net/ni5010.c b/drivers/net/ni5010.c --- a/drivers/net/ni5010.c Mon Sep 29 09:44:30 2003 +++ b/drivers/net/ni5010.c Mon Sep 29 09:44:30 2003 @@ -82,7 +82,7 @@ #ifndef FULL_IODETECT /* A zero-terminated list of I/O addresses to be probed. */ -static unsigned int ni5010_portlist[] __initdata = +static unsigned int ports[] __initdata = { 0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0 }; #endif @@ -95,13 +95,11 @@ struct ni5010_local { struct net_device_stats stats; int o_pkt_size; - int i_pkt_size; spinlock_t lock; }; /* Index to functions, as function prototypes. */ -extern int ni5010_probe(struct net_device *dev); static int ni5010_probe1(struct net_device *dev, int ioaddr); static int ni5010_open(struct net_device *dev); static int ni5010_send_packet(struct sk_buff *skb, struct net_device *dev); @@ -120,38 +118,58 @@ static void dump_packet(void *buf, int len); static void ni5010_show_registers(struct net_device *dev); +static int io; +static int irq; -int __init ni5010_probe(struct net_device *dev) +struct net_device * __init ni5010_probe(int unit) { + struct net_device *dev = alloc_etherdev(sizeof(struct ni5010_local)); int *port; - int base_addr = dev->base_addr; + int err = 0; - PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name)); + if (!dev) + return ERR_PTR(-ENOMEM); - SET_MODULE_OWNER(dev); + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + } - if (base_addr > 0x1ff) /* Check a single specified location. */ - return ni5010_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; + PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name)); + SET_MODULE_OWNER(dev); + + if (io > 0x1ff) { /* Check a single specified location. */ + err = ni5010_probe1(dev, io); + } else if (io != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { #ifdef FULL_IODETECT - for (int ioaddr=0x200; ioaddr<0x400; ioaddr+=0x20) { - if (check_region(ioaddr, NI5010_IO_EXTENT)) - continue; - if (ni5010_probe1(dev, ioaddr) == 0) - return 0; - } + for (io=0x200; io<0x400 && ni5010_probe1(dev, io) ; io+=0x20) + ; + if (io == 0x400) + err = -ENODEV; + #else - for (port = ni5010_portlist; *port; port++) { - int ioaddr = *port; - if (check_region(ioaddr, NI5010_IO_EXTENT)) - continue; - if (ni5010_probe1(dev, ioaddr) == 0) - return 0; - } + for (port = ports; *port && ni5010_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; #endif /* FULL_IODETECT */ - return -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, NI5010_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } static inline int rd_port(int ioaddr) @@ -188,9 +206,17 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr) { static unsigned version_printed; + struct ni5010_local *lp; int i; unsigned int data = 0; int boguscount = 40; + int err = -ENODEV; + + dev->base_addr = ioaddr; + dev->irq = irq; + + if (!request_region(ioaddr, NI5010_IO_EXTENT, boardname)) + return -EBUSY; /* * This is no "official" probe method, I've rather tested which @@ -205,36 +231,40 @@ * * - Andreas */ - + PRINTK2((KERN_DEBUG "%s: entering ni5010_probe1(%#3x)\n", dev->name, ioaddr)); - if (inb(ioaddr+0) == 0xff) return -ENODEV; + if (inb(ioaddr+0) == 0xff) + goto out; while ( (rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr)) != 0xff) { - if (boguscount-- == 0) return -ENODEV; + if (boguscount-- == 0) + goto out; } PRINTK2((KERN_DEBUG "%s: I/O #1 passed!\n", dev->name)); for (i=0; i<32; i++) if ( (data = rd_port(ioaddr)) != 0xff) break; - if (data==0xff) return -ENODEV; + if (data==0xff) + goto out; PRINTK2((KERN_DEBUG "%s: I/O #2 passed!\n", dev->name)); - if ( (data == SA_ADDR0) && - (rd_port(ioaddr) == SA_ADDR1) && - (rd_port(ioaddr) == SA_ADDR2) ) { - for (i=0; i<4; i++) rd_port(ioaddr); - if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) || - (rd_port(ioaddr) != NI5010_MAGICVAL2) ) { - return -ENODEV; - } - } else return -ENODEV; - + if ((data != SA_ADDR0) || (rd_port(ioaddr) != SA_ADDR1) || + (rd_port(ioaddr) != SA_ADDR2)) + goto out; + + for (i=0; i<4; i++) + rd_port(ioaddr); + + if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) || + (rd_port(ioaddr) != NI5010_MAGICVAL2) ) + goto out; + PRINTK2((KERN_DEBUG "%s: I/O #3 passed!\n", dev->name)); if (NI5010_DEBUG && version_printed++ == 0) @@ -267,8 +297,9 @@ PRINTK2((KERN_DEBUG "%s: I/O #6 passed!\n", dev->name)); if (dev->irq == 0) { + err = -EAGAIN; printk(KERN_WARNING "%s: no IRQ found!\n", dev->name); - return -EAGAIN; + goto out; } PRINTK2((KERN_DEBUG "%s: I/O #7 passed!\n", dev->name)); } else if (dev->irq == 2) { @@ -278,19 +309,9 @@ PRINTK2((KERN_DEBUG "%s: I/O #9 passed!\n", dev->name)); /* DMA is not supported (yet?), so no use detecting it */ + lp = (struct ni5010_local*)dev->priv; - if (dev->priv == NULL) { - struct ni5010_local* lp; - - dev->priv = kmalloc(sizeof(struct ni5010_local), GFP_KERNEL|GFP_DMA); - if (dev->priv == NULL) { - printk(KERN_WARNING "%s: Failed to allocate private memory\n", dev->name); - return -ENOMEM; - } - - lp = (struct ni5010_local*)dev->priv; - spin_lock_init(&lp->lock); - } + spin_lock_init(&lp->lock); PRINTK2((KERN_DEBUG "%s: I/O #10 passed!\n", dev->name)); @@ -315,9 +336,6 @@ } printk("// bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); memset(dev->priv, 0, sizeof(struct ni5010_local)); - - /* Grab the region so we can find another board if autoIRQ fails. */ - request_region(ioaddr, NI5010_IO_EXTENT, boardname); dev->open = ni5010_open; dev->stop = ni5010_close; @@ -327,9 +345,6 @@ dev->tx_timeout = ni5010_timeout; dev->watchdog_timeo = HZ/20; - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ /* Shut up the ni5010 */ @@ -345,6 +360,9 @@ printk(KERN_INFO "Join the NI5010 driver development team!\n"); printk(KERN_INFO "Mail to a.mohr@mailto.de or jvbest@wi.leidenuniv.nl\n"); return 0; +out: + release_region(dev->base_addr, NI5010_IO_EXTENT); + return err; } /* @@ -513,6 +531,7 @@ int ioaddr = dev->base_addr; unsigned char rcv_stat; struct sk_buff *skb; + int i_pkt_size; PRINTK2((KERN_DEBUG "%s: entering ni5010_rx()\n", dev->name)); @@ -532,17 +551,17 @@ outb(0xff, EDLC_RCLR); /* Clear the interrupt */ - lp->i_pkt_size = inw(IE_RCNT); - if (lp->i_pkt_size > ETH_FRAME_LEN || lp->i_pkt_size < 10 ) { + i_pkt_size = inw(IE_RCNT); + if (i_pkt_size > ETH_FRAME_LEN || i_pkt_size < 10 ) { PRINTK((KERN_DEBUG "%s: Packet size error, packet size = %#4.4x\n", - dev->name, lp->i_pkt_size)); + dev->name, i_pkt_size)); lp->stats.rx_errors++; lp->stats.rx_length_errors++; return; } /* Malloc up new buffer. */ - skb = dev_alloc_skb(lp->i_pkt_size + 3); + skb = dev_alloc_skb(i_pkt_size + 3); if (skb == NULL) { printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name); lp->stats.rx_dropped++; @@ -555,7 +574,7 @@ /* Read packet into buffer */ outb(MM_MUX, IE_MMODE); /* Rcv buffer to system bus */ outw(0, IE_GP); /* Seek to beginning of packet */ - insb(IE_RBUF, skb_put(skb, lp->i_pkt_size), lp->i_pkt_size); + insb(IE_RBUF, skb_put(skb, i_pkt_size), i_pkt_size); if (NI5010_DEBUG >= 4) dump_packet(skb->data, skb->len); @@ -564,10 +583,10 @@ netif_rx(skb); dev->last_rx = jiffies; lp->stats.rx_packets++; - lp->stats.rx_bytes += lp->i_pkt_size; + lp->stats.rx_bytes += i_pkt_size; PRINTK2((KERN_DEBUG "%s: Received packet, size=%#4.4x\n", - dev->name, lp->i_pkt_size)); + dev->name, i_pkt_size)); } @@ -697,10 +716,10 @@ if (NI5010_DEBUG > 3) dump_packet(buf, length); - buf_offs = NI5010_BUFSIZE - length - pad; - lp->o_pkt_size = length + pad; + buf_offs = NI5010_BUFSIZE - length - pad; spin_lock_irqsave(&lp->lock, flags); + lp->o_pkt_size = length + pad; outb(0, EDLC_RMASK); /* Mask all receive interrupts */ outb(0, IE_MMODE); /* Put Xmit buffer on system bus */ @@ -745,9 +764,7 @@ } #ifdef MODULE -static struct net_device dev_ni5010; -static int io; -static int irq; +static struct net_device *dev_ni5010; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -756,8 +773,6 @@ int init_module(void) { - int result; - PRINTK2((KERN_DEBUG "%s: entering init_module\n", boardname)); /* if(io <= 0 || irq == 0){ @@ -771,29 +786,18 @@ } PRINTK2((KERN_DEBUG "%s: init_module irq=%#2x, io=%#3x\n", boardname, irq, io)); - dev_ni5010.irq=irq; - dev_ni5010.base_addr=io; - dev_ni5010.init=ni5010_probe; - if ((result = register_netdev(&dev_ni5010)) != 0) { - PRINTK((KERN_WARNING "%s: register_netdev returned %d.\n", - boardname, result)); - return -EIO; - } + dev_ni5010 = ni5010_probe(-1); + if (IS_ERR(dev_ni5010)) + return PTR_ERR(dev_ni5010); return 0; } -void -cleanup_module(void) +void cleanup_module(void) { PRINTK2((KERN_DEBUG "%s: entering cleanup_module\n", boardname)); - - unregister_netdev(&dev_ni5010); - - release_region(dev_ni5010.base_addr, NI5010_IO_EXTENT); - if (dev_ni5010.priv != NULL){ - kfree(dev_ni5010.priv); - dev_ni5010.priv = NULL; - } + unregister_netdev(dev_ni5010); + release_region(dev_ni5010->base_addr, NI5010_IO_EXTENT); + free_netdev(dev_ni5010); } #endif /* MODULE */ MODULE_LICENSE("GPL"); From shemminger@osdl.org Tue Oct 14 16:01:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 16:02:15 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EN1g25004305 for ; Tue, 14 Oct 2003 16:01:42 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EN1Zo02978; Tue, 14 Oct 2003 16:01:35 -0700 Date: Tue, 14 Oct 2003 16:01:35 -0700 From: Stephen Hemminger Message-Id: <200310142301.h9EN1Zo02978@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (06/12) Probe2 -- sk16 Cc: netdev@oss.sgi.com X-archive-position: 840 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 Content-Length: 8095 Lines: 313 from viro NE17-sk16 * switched sk_g16 to dynamic allocation * sk_g16: embedded ->priv * sk_g16: fixed buggy check for signature (|| instead of &&, somebody forgot to replace it when inverting the test). * sk_g16: fixed use after kfree() * sk_g16: fixed init_etherdev() race Additional: * add free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:44:51 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:44:51 2003 @@ -72,7 +72,7 @@ extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); -extern int SK_init(struct net_device *); +extern struct net_device *SK_init(int unit); extern int seeq8005_probe(struct net_device *); extern int smc_init( struct net_device * ); extern int atarilance_probe(struct net_device *); @@ -277,13 +277,13 @@ #ifdef CONFIG_ELPLUS /* 3c505 */ {elplus_probe, 0}, #endif -#ifdef CONFIG_SK_G16 - {SK_init, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_SK_G16 + {SK_init, 0}, +#endif #ifdef CONFIG_NI5010 {ni5010_probe, 0}, #endif diff -Nru a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c --- a/drivers/net/sk_g16.c Mon Sep 29 09:44:51 2003 +++ b/drivers/net/sk_g16.c Mon Sep 29 09:44:51 2003 @@ -457,8 +457,6 @@ /* static variables */ static SK_RAM *board; /* pointer to our memory mapped board components */ -static struct net_device *SK_dev; -unsigned long SK_ioaddr; static spinlock_t SK_lock = SPIN_LOCK_UNLOCKED; /* Macros */ @@ -472,7 +470,6 @@ * See for short explanation of each function its definitions header. */ -int SK_init(struct net_device *dev); static int SK_probe(struct net_device *dev, short ioaddr); static void SK_timeout(struct net_device *dev); @@ -530,84 +527,71 @@ * YY/MM/DD uid Description -*/ +static int io; /* 0 == probe */ + /* * Check for a network adaptor of this type, and return '0' if one exists. * If dev->base_addr == 0, probe all likely locations. * If dev->base_addr == 1, always return failure. */ -int __init SK_init(struct net_device *dev) +struct net_device * __init SK_init(int unit) { - int ioaddr; /* I/O port address used for POS regs */ int *port, ports[] = SK_IO_PORTS; /* SK_G16 supported ports */ static unsigned version_printed; + struct net_device *dev = alloc_etherdev(sizeof(struct priv)); + int err = -ENODEV; + + if (!dev) + return ERR_PTR(-ENOMEM); - /* get preconfigured base_addr from dev which is done in Space.c */ - int base_addr = dev->base_addr; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + } if (version_printed++ == 0) PRINTK(("%s: %s", SK_NAME, rcsid)); - if (base_addr > 0x0ff) /* Check a single specified address */ - { - int rc = -ENODEV; - - ioaddr = base_addr; + if (io > 0xff) { /* Check a single specified address */ + err = -EBUSY; + /* Check if on specified address is a SK_G16 */ + if (request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) { + err = SK_probe(dev, io); + if (!err) + goto got_it; + release_region(io, ETHERCARD_TOTAL_SIZE); + } + } else if (io > 0) { /* Don't probe at all */ + err = -ENXIO; + } else { + /* Autoprobe base_addr */ + for (port = &ports[0]; *port; port++) { + io = *port; + + /* Check if I/O Port region is used by another board */ + if (!request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) + continue; /* Try next Port address */ + + /* Check if at ioaddr is a SK_G16 */ + if (SK_probe(dev, io) == 0) + goto got_it; - /* Check if on specified address is a SK_G16 */ - if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16")) - return -EBUSY; - - if ( (inb(SK_POS0) == SK_IDLOW) || - (inb(SK_POS1) == SK_IDHIGH) ) - { - rc = SK_probe(dev, ioaddr); - } - - if (rc) - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - return rc; + release_region(io, ETHERCARD_TOTAL_SIZE); + } } - else if (base_addr > 0) /* Don't probe at all */ - { - return -ENXIO; +err_out: + free_netdev(dev); + return ERR_PTR(err); + +got_it: + err = register_netdev(dev); + if (err) { + release_region(dev->base_addr, ETHERCARD_TOTAL_SIZE); + goto err_out; } - - /* Autoprobe base_addr */ - - for (port = &ports[0]; *port; port++) - { - ioaddr = *port; /* we need ioaddr for accessing POS regs */ - - /* Check if I/O Port region is used by another board */ - - if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16")) - { - continue; /* Try next Port address */ - } - - /* Check if at ioaddr is a SK_G16 */ - - if ( !(inb(SK_POS0) == SK_IDLOW) || - !(inb(SK_POS1) == SK_IDHIGH) ) - { - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - continue; /* Try next Port address */ - } - - dev->base_addr = ioaddr; /* Set I/O Port Address */ - - if (SK_probe(dev, ioaddr) == 0) - { - return 0; /* Card found and initialized */ - } - - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - } - - dev->base_addr = base_addr; /* Write back original base_addr */ - - return -ENODEV; /* Failed to find or init driver */ + return dev; } /* End of SK_init */ @@ -620,54 +604,22 @@ #ifdef MODULE -static int io; /* 0 == probe */ - static int __init SK_init_module (void) { - int rc; - - SK_dev = init_etherdev (NULL, 0); - if (!SK_dev) - return -ENOMEM; - - SK_dev->base_addr = io; - - rc = SK_init (SK_dev); - if (rc) { - unregister_netdev (SK_dev); - kfree (SK_dev); - SK_dev = NULL; - } - - return rc; + SK_dev = SK_init(-1); + return IS_ERR(SK_dev) ? PTR_ERR(SK_dev) : 0; } -#endif /* MODULE */ - static void __exit SK_cleanup_module (void) { - if (SK_dev) { - if (SK_dev->priv) { - kfree(SK_dev->priv); - SK_dev->priv = NULL; - } - unregister_netdev(SK_dev); - free_netdev(SK_dev); - SK_dev = NULL; - } - if (SK_ioaddr) { - release_region(SK_ioaddr, ETHERCARD_TOTAL_SIZE); - SK_ioaddr = 0; - } - + unregister_netdev(SK_dev); + release_region(SK_dev->base_addr, ETHERCARD_TOTAL_SIZE); + free_netdev(SK_dev); } - -#ifdef MODULE module_init(SK_init_module); -#endif module_exit(SK_cleanup_module); - +#endif /*- @@ -695,7 +647,11 @@ int sk_addr_flag = 0; /* SK ADDR correct? 1 - no, 0 - yes */ unsigned int rom_addr; /* used to store RAM address used for POS_ADDR */ - struct priv *p; /* SK_G16 private structure */ + struct priv *p = dev->priv; /* SK_G16 private structure */ + + if (inb(SK_POS0) != SK_IDLOW || inb(SK_POS1) != SK_IDHIGH) + return -ENODEV; + dev->base_addr = ioaddr; if (SK_ADDR & 0x3fff || SK_ADDR < 0xa0000) { @@ -837,12 +793,6 @@ dev->dev_addr[4], dev->dev_addr[5]); - /* Allocate memory for private structure */ - p = dev->priv = (void *) kmalloc(sizeof(struct priv), GFP_KERNEL); - if (p == NULL) { - printk("%s: ERROR - no memory for driver data!\n", dev->name); - return -ENOMEM; - } memset((char *) dev->priv, 0, sizeof(struct priv)); /* clear memory */ /* Assign our Device Driver functions */ @@ -856,10 +806,6 @@ dev->watchdog_timeo = HZ/7; - /* Set the generic fields of the device structure */ - - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; /* Initialize private structure */ @@ -884,12 +830,7 @@ SK_print_pos(dev, "End of SK_probe"); SK_print_ram(dev); #endif - - SK_dev = dev; - SK_ioaddr = ioaddr; - return 0; /* Initialization done */ - } /* End of SK_probe() */ @@ -1280,7 +1221,7 @@ memcpy_toio((tmdp->u.buffer & 0x00ffffff), skb->data, skb->len); if (len != skb->len) - memcpy_toio((tmdp->u.buffer & 0x00ffffff) + sb->len, pad, len-skb->len); + memcpy_toio((tmdp->u.buffer & 0x00ffffff) + skb->len, pad, len-skb->len); writew(-len, &tmdp->blen); /* set length to transmit */ From shemminger@osdl.org Tue Oct 14 16:01:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 16:02:24 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EN1p25004319 for ; Tue, 14 Oct 2003 16:01:52 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EN1jX03023; Tue, 14 Oct 2003 16:01:45 -0700 Date: Tue, 14 Oct 2003 16:01:45 -0700 From: Stephen Hemminger Message-Id: <200310142301.h9EN1jX03023@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (09/12) Probe2 -- arlan Cc: netdev@oss.sgi.com X-archive-position: 841 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 Content-Length: 12857 Lines: 479 Convert arlan driver to new probing. This meant a rather large rework of the probing code for this driver since it did a lot ofnon standard things. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Oct 14 14:35:00 2003 +++ b/drivers/net/Space.c Tue Oct 14 14:35:00 2003 @@ -59,7 +59,7 @@ extern int ewrk3_probe(struct net_device *); extern int el1_probe(struct net_device *); extern int wavelan_probe(struct net_device *); -extern int arlan_probe(struct net_device *); +extern struct net_device *arlan_probe(int unit); extern struct net_device *el16_probe(int unit); extern int elmc_probe(struct net_device *); extern int skmca_probe(struct net_device *); @@ -268,13 +268,13 @@ #ifdef CONFIG_WAVELAN /* WaveLAN */ {wavelan_probe, 0}, #endif -#ifdef CONFIG_ARLAN /* Aironet */ - {arlan_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_ARLAN /* Aironet */ + {arlan_probe, 0}, +#endif #ifdef CONFIG_EL16 /* 3c507 */ {el16_probe, 0}, #endif diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Tue Oct 14 14:35:00 2003 +++ b/drivers/net/wireless/arlan-main.c Tue Oct 14 14:35:00 2003 @@ -19,9 +19,7 @@ static int SID = SIDUNKNOWN; static int radioNodeId = radioNodeIdUNKNOWN; static char encryptionKey[12] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}; -static int mem = memUNKNOWN; int arlan_debug = debugUNKNOWN; -static int numDevices = numDevicesUNKNOWN; static int spreadingCode = spreadingCodeUNKNOWN; static int channelNumber = channelNumberUNKNOWN; static int channelSet = channelSetUNKNOWN; @@ -45,9 +43,7 @@ MODULE_PARM(irq, "i"); MODULE_PARM(mem, "i"); -MODULE_PARM(probe, "i"); MODULE_PARM(arlan_debug, "i"); -MODULE_PARM(numDevices, "i"); MODULE_PARM(testMemory, "i"); MODULE_PARM(spreadingCode, "i"); MODULE_PARM(channelNumber, "i"); @@ -69,9 +65,7 @@ MODULE_PARM(arlan_EEPROM_bad, "i"); MODULE_PARM_DESC(irq, "(unused)"); MODULE_PARM_DESC(mem, "Arlan memory address for single device probing"); -MODULE_PARM_DESC(probe, "Arlan probe at initialization (0-1)"); MODULE_PARM_DESC(arlan_debug, "Arlan debug enable (0-1)"); -MODULE_PARM_DESC(numDevices, "Number of Arlan devices; ignored if >1"); MODULE_PARM_DESC(testMemory, "(unused)"); MODULE_PARM_DESC(mdebug, "Arlan multicast debugging (0-1)"); MODULE_PARM_DESC(retries, "Arlan maximum packet retransmisions"); @@ -88,7 +82,6 @@ struct arlan_conf_stru arlan_conf[MAX_ARLANS]; static int arlans_found; -static int arlan_probe_here(struct net_device *dev, int ioaddr); static int arlan_open(struct net_device *dev); static int arlan_tx(struct sk_buff *skb, struct net_device *dev); static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs); @@ -975,24 +968,27 @@ * probes on the ISA bus. A good device probes avoids doing writes, and * verifies that the correct device exists and functions. */ - -static int __init arlan_check_fingerprint(int memaddr) +#define ARLAN_SHMEM_SIZE 0x2000 +static int __init arlan_check_fingerprint(unsigned long memaddr) { - static char probeText[] = "TELESYSTEM SLW INC. ARLAN \0"; - char tempBuf[49]; + static const char probeText[] = "TELESYSTEM SLW INC. ARLAN \0"; volatile struct arlan_shmem *arlan = (struct arlan_shmem *) memaddr; + unsigned long paddr = virt_to_phys((void *) memaddr); + char tempBuf[49]; ARLAN_DEBUG_ENTRY("arlan_check_fingerprint"); - if (check_mem_region(virt_to_phys((void *)memaddr),0x2000 )){ - // printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",virt_to_phys((void*)memaddr)); + + if (!request_mem_region(paddr, ARLAN_SHMEM_SIZE, "arlan")) { + // printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",paddr); return -ENODEV; } + memcpy_fromio(tempBuf, arlan->textRegion, 29); tempBuf[30] = 0; /* check for card at this address */ if (0 != strncmp(tempBuf, probeText, 29)){ -// not release_mem_region(virt_to_phys((void*)memaddr),0x2000); + release_mem_region(paddr, ARLAN_SHMEM_SIZE); return -ENODEV; } @@ -1000,51 +996,8 @@ ARLAN_DEBUG_EXIT("arlan_check_fingerprint"); return 0; - - -} - -static int __init arlan_probe_everywhere(struct net_device *dev) -{ - int m; - int probed = 0; - int found = 0; - - SET_MODULE_OWNER(dev); - - ARLAN_DEBUG_ENTRY("arlan_probe_everywhere"); - if (mem != 0 && numDevices == 1) /* Check a single specified location. */ - { - if (arlan_probe_here(dev, (int) phys_to_virt( mem) ) == 0) - return 0; - else - return -ENODEV; - } - for (m = (int)phys_to_virt(lastFoundAt) + 0x2000; m <= (int)phys_to_virt(0xDE000); m += 0x2000) - { - if (arlan_probe_here(dev, m) == 0) - { - found++; - lastFoundAt = (int)virt_to_phys((void*)m); - break; - } - probed++; - } - if (found == 0 && probed != 0) - { - if (lastFoundAt == 0xbe000) - printk(KERN_ERR "arlan: No Arlan devices found \n"); - return -ENODEV; - } - else - return 0; - - ARLAN_DEBUG_EXIT("arlan_probe_everywhere"); - - return -ENODEV; } - static int arlan_change_mtu(struct net_device *dev, int new_mtu) { struct arlan_private *priv = dev->priv; @@ -1085,47 +1038,14 @@ - -static int __init - arlan_allocate_device(int num, struct net_device *devs) +static void __init arlan_setup_device(struct net_device *dev, int num) { + struct arlan_private *ap = dev->priv; - struct net_device *dev; - struct arlan_private *ap; + ARLAN_DEBUG_ENTRY("arlan_setup_device"); - ARLAN_DEBUG_ENTRY("arlan_allocate_device"); + ap->conf = (struct arlan_shmem *)(ap+1); - if (!devs) { - dev = init_etherdev(0, sizeof(struct arlan_private) + sizeof(struct arlan_shmem)); - if (!dev) { - printk(KERN_ERR "ARLAN: init_etherdev failed\n"); - return 0; - } - ap = dev->priv; - ap->conf = dev->priv + sizeof(struct arlan_private); - ap->init_etherdev_alloc = 1; - } else { - dev = devs; - dev->priv = kmalloc(sizeof(struct arlan_private) + sizeof(struct arlan_shmem), GFP_KERNEL); - if (!dev->priv) { - printk(KERN_ERR "ARLAN: kmalloc of dev->priv failed\n"); - return 0; - } - ap = dev->priv; - ap->conf = dev->priv + sizeof(struct arlan_private); - memset(ap, 0, sizeof(*ap)); - } - - /* Fill in the 'dev' fields. */ - dev->base_addr = 0; - dev->mem_start = 0; - dev->mem_end = 0; - dev->mtu = 1500; - dev->flags = 0; /* IFF_BROADCAST & IFF_MULTICAST & IFF_PROMISC; */ - dev->irq = 0; - dev->dma = 0; - dev->tx_queue_len = tx_queue_len; - ether_setup(dev); dev->tx_queue_len = tx_queue_len; dev->open = arlan_open; dev->stop = arlan_close; @@ -1145,34 +1065,29 @@ ap->Conf->rx_tweak1 = 30; ap->Conf->rx_tweak2 = 0; - ARLAN_DEBUG_EXIT("arlan_allocate_device"); - return (int) dev; + ARLAN_DEBUG_EXIT("arlan_setup_device"); } - -static int __init arlan_probe_here(struct net_device *dev, int memaddr) +static int __init arlan_probe_here(struct net_device *dev, + unsigned long memaddr) { - volatile struct arlan_shmem *arlan; + struct arlan_private *ap = dev->priv; ARLAN_DEBUG_ENTRY("arlan_probe_here"); if (arlan_check_fingerprint(memaddr)) return -ENODEV; - printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, (int) virt_to_phys((void*)memaddr)); - - if (!arlan_allocate_device(arlans_found, dev)) - return -1; - - ((struct arlan_private *) dev->priv)->card = (struct arlan_shmem *) memaddr; - arlan = (void *) memaddr; + printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, + (int) virt_to_phys((void*)memaddr)); + ap->card = (void *) memaddr; dev->mem_start = memaddr; - dev->mem_end = memaddr + 0x1FFF; + dev->mem_end = memaddr + ARLAN_SHMEM_SIZE-1; if (dev->irq < 2) { - READSHM(dev->irq, arlan->irqLevel, u_char); + READSHM(dev->irq, ap->card->irqLevel, u_char); } else if (dev->irq == 2) dev->irq = 9; @@ -1183,8 +1098,6 @@ } - - static int arlan_open(struct net_device *dev) { struct arlan_private *priv = dev->priv; @@ -1193,12 +1106,6 @@ ARLAN_DEBUG_ENTRY("arlan_open"); - if (dev->mem_start == 0) - ret = arlan_probe_everywhere(dev); - if (ret != 0) - return ret; - - arlan = priv->card; ret = request_irq(dev->irq, &arlan_interrupt, 0, dev->name, dev); if (ret) { @@ -1768,14 +1675,9 @@ { struct arlan_private *priv = dev->priv; - if (!priv) - { - printk(KERN_CRIT "arlan: No Device priv \n"); - return 0; - } ARLAN_DEBUG_ENTRY("arlan_close"); - del_timer(&priv->timer); + del_timer_sync(&priv->timer); arlan_command(dev, ARLAN_COMMAND_POWERDOWN); @@ -1867,39 +1769,68 @@ } -int __init arlan_probe(struct net_device *dev) +struct net_device * __init arlan_probe(int unit) { - printk("Arlan driver %s\n", arlan_version); + struct net_device *dev; + int m; - if (arlan_probe_everywhere(dev)) - return -ENODEV; + ARLAN_DEBUG_ENTRY("arlan_probe"); - arlans_found++; - return 0; -} + if (arlans_found == MAX_ARLANS) + return ERR_PTR(-ENODEV); -#ifdef MODULE + /* + * Reserve space for local data and a copy of the shared memory + * that is used by the /proc interface. + */ + dev = alloc_etherdev(sizeof(struct arlan_private) + + sizeof(struct arlan_shmem)); + if (!dev) + return ERR_PTR(-ENOMEM); -static int probe = probeUNKNOWN; + SET_MODULE_OWNER(dev); -static int __init arlan_find_devices(void) -{ - int m; - int found = 0; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + if (dev->mem_start) { + if (arlan_probe_here(dev, dev->mem_start) == 0) + goto found; + goto not_found; + } + + } - ARLAN_DEBUG_ENTRY("arlan_find_devices"); - if (mem != 0 && numDevices == 1) /* Check a single specified location. */ - return 1; - for (m =(int) phys_to_virt(0xc0000); m <=(int) phys_to_virt(0xDE000); m += 0x2000) + + for (m = (int)phys_to_virt(lastFoundAt) + ARLAN_SHMEM_SIZE; + m <= (int)phys_to_virt(0xDE000); + m += ARLAN_SHMEM_SIZE) { - if (arlan_check_fingerprint(m) == 0) - found++; + if (arlan_probe_here(dev, m) == 0) + { + lastFoundAt = (int)virt_to_phys((void*)m); + goto found; + } + } + + if (lastFoundAt == 0xbe000) + printk(KERN_ERR "arlan: No Arlan devices found \n"); + + not_found: + free_netdev(dev); + return ERR_PTR(-ENODEV); + + found: + arlan_setup_device(dev, arlans_found++); + if (arlans_found == 1) { + printk(KERN_INFO "Arlan driver %s\n", arlan_version); } - ARLAN_DEBUG_EXIT("arlan_find_devices"); - return found; + return dev; } +#ifdef MODULE int init_module(void) { int i = 0; @@ -1909,21 +1840,11 @@ if (channelSet != channelSetUNKNOWN || channelNumber != channelNumberUNKNOWN || systemId != systemIdUNKNOWN) return -EINVAL; - numDevices = arlan_find_devices(); - if (numDevices == 0) - return -ENODEV; + for (i = 0; i < MAX_ARLANS; i++) { + struct net_device *dev = arlan_probe(i); - for (i = 0; i < numDevices && i < MAX_ARLANS; i++) - { - if (!arlan_allocate_device(i, NULL)) - return -ENOMEM; - - if (arlan_device[i] == NULL) - return -ENOMEM; - - if (probe) - arlan_probe_everywhere(arlan_device[i]); -// arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); + if (IS_ERR(dev)) + return PTR_ERR(dev); } init_arlan_proc(); printk(KERN_INFO "Arlan driver %s\n", arlan_version); @@ -1935,7 +1856,7 @@ void cleanup_module(void) { int i = 0; - struct arlan_private *ap; + struct net_device *dev; ARLAN_DEBUG_ENTRY("cleanup_module"); @@ -1946,22 +1867,18 @@ for (i = 0; i < MAX_ARLANS; i++) { - if (arlan_device[i]) - { - arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); - -// release_mem_region(virt_to_phys(arlan_device[i]->mem_start), 0x2000 ); - unregister_netdev(arlan_device[i]); - ap = arlan_device[i]->priv; - if (ap->init_etherdev_alloc) { - free_netdev(arlan_device[i]); - arlan_device[i] = NULL; - } else { - kfree(ap); - ap = NULL; - } + dev = arlan_device[i]; + if (dev) { + arlan_command(dev, ARLAN_COMMAND_POWERDOWN ); + + unregister_netdev(dev); + release_mem_region(virt_to_phys((void *) dev->mem_start), + ARLAN_SHMEM_SIZE); + free_netdev(dev); + arlan_device[i] = NULL; } } + ARLAN_DEBUG_EXIT("cleanup_module"); } diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h --- a/drivers/net/wireless/arlan.h Tue Oct 14 14:35:00 2003 +++ b/drivers/net/wireless/arlan.h Tue Oct 14 14:35:00 2003 @@ -57,12 +57,8 @@ #define SIDUNKNOWN -1 #define radioNodeIdUNKNOWN -1 -#define encryptionKeyUNKNOWN '\0'; #define irqUNKNOWN 0 -#define memUNKNOWN 0 #define debugUNKNOWN 0 -#define probeUNKNOWN 1 -#define numDevicesUNKNOWN 1 #define testMemoryUNKNOWN 1 #define spreadingCodeUNKNOWN 0 #define channelNumberUNKNOWN 0 @@ -81,6 +77,8 @@ #else #define ARLAN_DEBUG(a,b) #endif + +#define ARLAN_SHMEM_SIZE 0x2000 struct arlan_shmem { From shemminger@osdl.org Tue Oct 14 16:03:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 16:04:23 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EN3n27005308 for ; Tue, 14 Oct 2003 16:03:49 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYAJ30157; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYAJ30157@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (05/12) Probe2 -- ni5010 Cc: netdev@oss.sgi.com X-archive-position: 843 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 Content-Length: 10920 Lines: 402 from viro NE16-ni5010 * switched ni5010 to dynamic allocation * ni5010: embedded ->priv * ni5010: fixed clobbering ->irq * ni5010: fixed IO before request_region() Additional: * add free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:44:30 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:44:30 2003 @@ -68,7 +68,7 @@ extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); extern int e2100_probe(struct net_device *); -extern int ni5010_probe(struct net_device *); +extern struct net_device *ni5010_probe(int unit); extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); @@ -280,13 +280,13 @@ #ifdef CONFIG_SK_G16 {SK_init, 0}, #endif -#ifdef CONFIG_NI5010 - {ni5010_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_NI5010 + {ni5010_probe, 0}, +#endif #ifdef CONFIG_NI52 {ni52_probe, 0}, #endif diff -Nru a/drivers/net/ni5010.c b/drivers/net/ni5010.c --- a/drivers/net/ni5010.c Mon Sep 29 09:44:30 2003 +++ b/drivers/net/ni5010.c Mon Sep 29 09:44:30 2003 @@ -82,7 +82,7 @@ #ifndef FULL_IODETECT /* A zero-terminated list of I/O addresses to be probed. */ -static unsigned int ni5010_portlist[] __initdata = +static unsigned int ports[] __initdata = { 0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0 }; #endif @@ -95,13 +95,11 @@ struct ni5010_local { struct net_device_stats stats; int o_pkt_size; - int i_pkt_size; spinlock_t lock; }; /* Index to functions, as function prototypes. */ -extern int ni5010_probe(struct net_device *dev); static int ni5010_probe1(struct net_device *dev, int ioaddr); static int ni5010_open(struct net_device *dev); static int ni5010_send_packet(struct sk_buff *skb, struct net_device *dev); @@ -120,38 +118,58 @@ static void dump_packet(void *buf, int len); static void ni5010_show_registers(struct net_device *dev); +static int io; +static int irq; -int __init ni5010_probe(struct net_device *dev) +struct net_device * __init ni5010_probe(int unit) { + struct net_device *dev = alloc_etherdev(sizeof(struct ni5010_local)); int *port; - int base_addr = dev->base_addr; + int err = 0; - PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name)); + if (!dev) + return ERR_PTR(-ENOMEM); - SET_MODULE_OWNER(dev); + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + } - if (base_addr > 0x1ff) /* Check a single specified location. */ - return ni5010_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; + PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name)); + SET_MODULE_OWNER(dev); + + if (io > 0x1ff) { /* Check a single specified location. */ + err = ni5010_probe1(dev, io); + } else if (io != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { #ifdef FULL_IODETECT - for (int ioaddr=0x200; ioaddr<0x400; ioaddr+=0x20) { - if (check_region(ioaddr, NI5010_IO_EXTENT)) - continue; - if (ni5010_probe1(dev, ioaddr) == 0) - return 0; - } + for (io=0x200; io<0x400 && ni5010_probe1(dev, io) ; io+=0x20) + ; + if (io == 0x400) + err = -ENODEV; + #else - for (port = ni5010_portlist; *port; port++) { - int ioaddr = *port; - if (check_region(ioaddr, NI5010_IO_EXTENT)) - continue; - if (ni5010_probe1(dev, ioaddr) == 0) - return 0; - } + for (port = ports; *port && ni5010_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; #endif /* FULL_IODETECT */ - return -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, NI5010_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } static inline int rd_port(int ioaddr) @@ -188,9 +206,17 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr) { static unsigned version_printed; + struct ni5010_local *lp; int i; unsigned int data = 0; int boguscount = 40; + int err = -ENODEV; + + dev->base_addr = ioaddr; + dev->irq = irq; + + if (!request_region(ioaddr, NI5010_IO_EXTENT, boardname)) + return -EBUSY; /* * This is no "official" probe method, I've rather tested which @@ -205,36 +231,40 @@ * * - Andreas */ - + PRINTK2((KERN_DEBUG "%s: entering ni5010_probe1(%#3x)\n", dev->name, ioaddr)); - if (inb(ioaddr+0) == 0xff) return -ENODEV; + if (inb(ioaddr+0) == 0xff) + goto out; while ( (rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr)) != 0xff) { - if (boguscount-- == 0) return -ENODEV; + if (boguscount-- == 0) + goto out; } PRINTK2((KERN_DEBUG "%s: I/O #1 passed!\n", dev->name)); for (i=0; i<32; i++) if ( (data = rd_port(ioaddr)) != 0xff) break; - if (data==0xff) return -ENODEV; + if (data==0xff) + goto out; PRINTK2((KERN_DEBUG "%s: I/O #2 passed!\n", dev->name)); - if ( (data == SA_ADDR0) && - (rd_port(ioaddr) == SA_ADDR1) && - (rd_port(ioaddr) == SA_ADDR2) ) { - for (i=0; i<4; i++) rd_port(ioaddr); - if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) || - (rd_port(ioaddr) != NI5010_MAGICVAL2) ) { - return -ENODEV; - } - } else return -ENODEV; - + if ((data != SA_ADDR0) || (rd_port(ioaddr) != SA_ADDR1) || + (rd_port(ioaddr) != SA_ADDR2)) + goto out; + + for (i=0; i<4; i++) + rd_port(ioaddr); + + if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) || + (rd_port(ioaddr) != NI5010_MAGICVAL2) ) + goto out; + PRINTK2((KERN_DEBUG "%s: I/O #3 passed!\n", dev->name)); if (NI5010_DEBUG && version_printed++ == 0) @@ -267,8 +297,9 @@ PRINTK2((KERN_DEBUG "%s: I/O #6 passed!\n", dev->name)); if (dev->irq == 0) { + err = -EAGAIN; printk(KERN_WARNING "%s: no IRQ found!\n", dev->name); - return -EAGAIN; + goto out; } PRINTK2((KERN_DEBUG "%s: I/O #7 passed!\n", dev->name)); } else if (dev->irq == 2) { @@ -278,19 +309,9 @@ PRINTK2((KERN_DEBUG "%s: I/O #9 passed!\n", dev->name)); /* DMA is not supported (yet?), so no use detecting it */ + lp = (struct ni5010_local*)dev->priv; - if (dev->priv == NULL) { - struct ni5010_local* lp; - - dev->priv = kmalloc(sizeof(struct ni5010_local), GFP_KERNEL|GFP_DMA); - if (dev->priv == NULL) { - printk(KERN_WARNING "%s: Failed to allocate private memory\n", dev->name); - return -ENOMEM; - } - - lp = (struct ni5010_local*)dev->priv; - spin_lock_init(&lp->lock); - } + spin_lock_init(&lp->lock); PRINTK2((KERN_DEBUG "%s: I/O #10 passed!\n", dev->name)); @@ -315,9 +336,6 @@ } printk("// bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); memset(dev->priv, 0, sizeof(struct ni5010_local)); - - /* Grab the region so we can find another board if autoIRQ fails. */ - request_region(ioaddr, NI5010_IO_EXTENT, boardname); dev->open = ni5010_open; dev->stop = ni5010_close; @@ -327,9 +345,6 @@ dev->tx_timeout = ni5010_timeout; dev->watchdog_timeo = HZ/20; - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ /* Shut up the ni5010 */ @@ -345,6 +360,9 @@ printk(KERN_INFO "Join the NI5010 driver development team!\n"); printk(KERN_INFO "Mail to a.mohr@mailto.de or jvbest@wi.leidenuniv.nl\n"); return 0; +out: + release_region(dev->base_addr, NI5010_IO_EXTENT); + return err; } /* @@ -513,6 +531,7 @@ int ioaddr = dev->base_addr; unsigned char rcv_stat; struct sk_buff *skb; + int i_pkt_size; PRINTK2((KERN_DEBUG "%s: entering ni5010_rx()\n", dev->name)); @@ -532,17 +551,17 @@ outb(0xff, EDLC_RCLR); /* Clear the interrupt */ - lp->i_pkt_size = inw(IE_RCNT); - if (lp->i_pkt_size > ETH_FRAME_LEN || lp->i_pkt_size < 10 ) { + i_pkt_size = inw(IE_RCNT); + if (i_pkt_size > ETH_FRAME_LEN || i_pkt_size < 10 ) { PRINTK((KERN_DEBUG "%s: Packet size error, packet size = %#4.4x\n", - dev->name, lp->i_pkt_size)); + dev->name, i_pkt_size)); lp->stats.rx_errors++; lp->stats.rx_length_errors++; return; } /* Malloc up new buffer. */ - skb = dev_alloc_skb(lp->i_pkt_size + 3); + skb = dev_alloc_skb(i_pkt_size + 3); if (skb == NULL) { printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name); lp->stats.rx_dropped++; @@ -555,7 +574,7 @@ /* Read packet into buffer */ outb(MM_MUX, IE_MMODE); /* Rcv buffer to system bus */ outw(0, IE_GP); /* Seek to beginning of packet */ - insb(IE_RBUF, skb_put(skb, lp->i_pkt_size), lp->i_pkt_size); + insb(IE_RBUF, skb_put(skb, i_pkt_size), i_pkt_size); if (NI5010_DEBUG >= 4) dump_packet(skb->data, skb->len); @@ -564,10 +583,10 @@ netif_rx(skb); dev->last_rx = jiffies; lp->stats.rx_packets++; - lp->stats.rx_bytes += lp->i_pkt_size; + lp->stats.rx_bytes += i_pkt_size; PRINTK2((KERN_DEBUG "%s: Received packet, size=%#4.4x\n", - dev->name, lp->i_pkt_size)); + dev->name, i_pkt_size)); } @@ -697,10 +716,10 @@ if (NI5010_DEBUG > 3) dump_packet(buf, length); - buf_offs = NI5010_BUFSIZE - length - pad; - lp->o_pkt_size = length + pad; + buf_offs = NI5010_BUFSIZE - length - pad; spin_lock_irqsave(&lp->lock, flags); + lp->o_pkt_size = length + pad; outb(0, EDLC_RMASK); /* Mask all receive interrupts */ outb(0, IE_MMODE); /* Put Xmit buffer on system bus */ @@ -745,9 +764,7 @@ } #ifdef MODULE -static struct net_device dev_ni5010; -static int io; -static int irq; +static struct net_device *dev_ni5010; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -756,8 +773,6 @@ int init_module(void) { - int result; - PRINTK2((KERN_DEBUG "%s: entering init_module\n", boardname)); /* if(io <= 0 || irq == 0){ @@ -771,29 +786,18 @@ } PRINTK2((KERN_DEBUG "%s: init_module irq=%#2x, io=%#3x\n", boardname, irq, io)); - dev_ni5010.irq=irq; - dev_ni5010.base_addr=io; - dev_ni5010.init=ni5010_probe; - if ((result = register_netdev(&dev_ni5010)) != 0) { - PRINTK((KERN_WARNING "%s: register_netdev returned %d.\n", - boardname, result)); - return -EIO; - } + dev_ni5010 = ni5010_probe(-1); + if (IS_ERR(dev_ni5010)) + return PTR_ERR(dev_ni5010); return 0; } -void -cleanup_module(void) +void cleanup_module(void) { PRINTK2((KERN_DEBUG "%s: entering cleanup_module\n", boardname)); - - unregister_netdev(&dev_ni5010); - - release_region(dev_ni5010.base_addr, NI5010_IO_EXTENT); - if (dev_ni5010.priv != NULL){ - kfree(dev_ni5010.priv); - dev_ni5010.priv = NULL; - } + unregister_netdev(dev_ni5010); + release_region(dev_ni5010->base_addr, NI5010_IO_EXTENT); + free_netdev(dev_ni5010); } #endif /* MODULE */ MODULE_LICENSE("GPL"); From shemminger@osdl.org Tue Oct 14 16:03:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 16:04:23 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EN3n29005308 for ; Tue, 14 Oct 2003 16:03:50 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYAZ30173; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYAZ30173@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (09/12) Probe2 -- arlan Cc: netdev@oss.sgi.com X-archive-position: 842 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 Content-Length: 12857 Lines: 479 Convert arlan driver to new probing. This meant a rather large rework of the probing code for this driver since it did a lot ofnon standard things. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Oct 14 14:35:00 2003 +++ b/drivers/net/Space.c Tue Oct 14 14:35:00 2003 @@ -59,7 +59,7 @@ extern int ewrk3_probe(struct net_device *); extern int el1_probe(struct net_device *); extern int wavelan_probe(struct net_device *); -extern int arlan_probe(struct net_device *); +extern struct net_device *arlan_probe(int unit); extern struct net_device *el16_probe(int unit); extern int elmc_probe(struct net_device *); extern int skmca_probe(struct net_device *); @@ -268,13 +268,13 @@ #ifdef CONFIG_WAVELAN /* WaveLAN */ {wavelan_probe, 0}, #endif -#ifdef CONFIG_ARLAN /* Aironet */ - {arlan_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_ARLAN /* Aironet */ + {arlan_probe, 0}, +#endif #ifdef CONFIG_EL16 /* 3c507 */ {el16_probe, 0}, #endif diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Tue Oct 14 14:35:00 2003 +++ b/drivers/net/wireless/arlan-main.c Tue Oct 14 14:35:00 2003 @@ -19,9 +19,7 @@ static int SID = SIDUNKNOWN; static int radioNodeId = radioNodeIdUNKNOWN; static char encryptionKey[12] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}; -static int mem = memUNKNOWN; int arlan_debug = debugUNKNOWN; -static int numDevices = numDevicesUNKNOWN; static int spreadingCode = spreadingCodeUNKNOWN; static int channelNumber = channelNumberUNKNOWN; static int channelSet = channelSetUNKNOWN; @@ -45,9 +43,7 @@ MODULE_PARM(irq, "i"); MODULE_PARM(mem, "i"); -MODULE_PARM(probe, "i"); MODULE_PARM(arlan_debug, "i"); -MODULE_PARM(numDevices, "i"); MODULE_PARM(testMemory, "i"); MODULE_PARM(spreadingCode, "i"); MODULE_PARM(channelNumber, "i"); @@ -69,9 +65,7 @@ MODULE_PARM(arlan_EEPROM_bad, "i"); MODULE_PARM_DESC(irq, "(unused)"); MODULE_PARM_DESC(mem, "Arlan memory address for single device probing"); -MODULE_PARM_DESC(probe, "Arlan probe at initialization (0-1)"); MODULE_PARM_DESC(arlan_debug, "Arlan debug enable (0-1)"); -MODULE_PARM_DESC(numDevices, "Number of Arlan devices; ignored if >1"); MODULE_PARM_DESC(testMemory, "(unused)"); MODULE_PARM_DESC(mdebug, "Arlan multicast debugging (0-1)"); MODULE_PARM_DESC(retries, "Arlan maximum packet retransmisions"); @@ -88,7 +82,6 @@ struct arlan_conf_stru arlan_conf[MAX_ARLANS]; static int arlans_found; -static int arlan_probe_here(struct net_device *dev, int ioaddr); static int arlan_open(struct net_device *dev); static int arlan_tx(struct sk_buff *skb, struct net_device *dev); static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs); @@ -975,24 +968,27 @@ * probes on the ISA bus. A good device probes avoids doing writes, and * verifies that the correct device exists and functions. */ - -static int __init arlan_check_fingerprint(int memaddr) +#define ARLAN_SHMEM_SIZE 0x2000 +static int __init arlan_check_fingerprint(unsigned long memaddr) { - static char probeText[] = "TELESYSTEM SLW INC. ARLAN \0"; - char tempBuf[49]; + static const char probeText[] = "TELESYSTEM SLW INC. ARLAN \0"; volatile struct arlan_shmem *arlan = (struct arlan_shmem *) memaddr; + unsigned long paddr = virt_to_phys((void *) memaddr); + char tempBuf[49]; ARLAN_DEBUG_ENTRY("arlan_check_fingerprint"); - if (check_mem_region(virt_to_phys((void *)memaddr),0x2000 )){ - // printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",virt_to_phys((void*)memaddr)); + + if (!request_mem_region(paddr, ARLAN_SHMEM_SIZE, "arlan")) { + // printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",paddr); return -ENODEV; } + memcpy_fromio(tempBuf, arlan->textRegion, 29); tempBuf[30] = 0; /* check for card at this address */ if (0 != strncmp(tempBuf, probeText, 29)){ -// not release_mem_region(virt_to_phys((void*)memaddr),0x2000); + release_mem_region(paddr, ARLAN_SHMEM_SIZE); return -ENODEV; } @@ -1000,51 +996,8 @@ ARLAN_DEBUG_EXIT("arlan_check_fingerprint"); return 0; - - -} - -static int __init arlan_probe_everywhere(struct net_device *dev) -{ - int m; - int probed = 0; - int found = 0; - - SET_MODULE_OWNER(dev); - - ARLAN_DEBUG_ENTRY("arlan_probe_everywhere"); - if (mem != 0 && numDevices == 1) /* Check a single specified location. */ - { - if (arlan_probe_here(dev, (int) phys_to_virt( mem) ) == 0) - return 0; - else - return -ENODEV; - } - for (m = (int)phys_to_virt(lastFoundAt) + 0x2000; m <= (int)phys_to_virt(0xDE000); m += 0x2000) - { - if (arlan_probe_here(dev, m) == 0) - { - found++; - lastFoundAt = (int)virt_to_phys((void*)m); - break; - } - probed++; - } - if (found == 0 && probed != 0) - { - if (lastFoundAt == 0xbe000) - printk(KERN_ERR "arlan: No Arlan devices found \n"); - return -ENODEV; - } - else - return 0; - - ARLAN_DEBUG_EXIT("arlan_probe_everywhere"); - - return -ENODEV; } - static int arlan_change_mtu(struct net_device *dev, int new_mtu) { struct arlan_private *priv = dev->priv; @@ -1085,47 +1038,14 @@ - -static int __init - arlan_allocate_device(int num, struct net_device *devs) +static void __init arlan_setup_device(struct net_device *dev, int num) { + struct arlan_private *ap = dev->priv; - struct net_device *dev; - struct arlan_private *ap; + ARLAN_DEBUG_ENTRY("arlan_setup_device"); - ARLAN_DEBUG_ENTRY("arlan_allocate_device"); + ap->conf = (struct arlan_shmem *)(ap+1); - if (!devs) { - dev = init_etherdev(0, sizeof(struct arlan_private) + sizeof(struct arlan_shmem)); - if (!dev) { - printk(KERN_ERR "ARLAN: init_etherdev failed\n"); - return 0; - } - ap = dev->priv; - ap->conf = dev->priv + sizeof(struct arlan_private); - ap->init_etherdev_alloc = 1; - } else { - dev = devs; - dev->priv = kmalloc(sizeof(struct arlan_private) + sizeof(struct arlan_shmem), GFP_KERNEL); - if (!dev->priv) { - printk(KERN_ERR "ARLAN: kmalloc of dev->priv failed\n"); - return 0; - } - ap = dev->priv; - ap->conf = dev->priv + sizeof(struct arlan_private); - memset(ap, 0, sizeof(*ap)); - } - - /* Fill in the 'dev' fields. */ - dev->base_addr = 0; - dev->mem_start = 0; - dev->mem_end = 0; - dev->mtu = 1500; - dev->flags = 0; /* IFF_BROADCAST & IFF_MULTICAST & IFF_PROMISC; */ - dev->irq = 0; - dev->dma = 0; - dev->tx_queue_len = tx_queue_len; - ether_setup(dev); dev->tx_queue_len = tx_queue_len; dev->open = arlan_open; dev->stop = arlan_close; @@ -1145,34 +1065,29 @@ ap->Conf->rx_tweak1 = 30; ap->Conf->rx_tweak2 = 0; - ARLAN_DEBUG_EXIT("arlan_allocate_device"); - return (int) dev; + ARLAN_DEBUG_EXIT("arlan_setup_device"); } - -static int __init arlan_probe_here(struct net_device *dev, int memaddr) +static int __init arlan_probe_here(struct net_device *dev, + unsigned long memaddr) { - volatile struct arlan_shmem *arlan; + struct arlan_private *ap = dev->priv; ARLAN_DEBUG_ENTRY("arlan_probe_here"); if (arlan_check_fingerprint(memaddr)) return -ENODEV; - printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, (int) virt_to_phys((void*)memaddr)); - - if (!arlan_allocate_device(arlans_found, dev)) - return -1; - - ((struct arlan_private *) dev->priv)->card = (struct arlan_shmem *) memaddr; - arlan = (void *) memaddr; + printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, + (int) virt_to_phys((void*)memaddr)); + ap->card = (void *) memaddr; dev->mem_start = memaddr; - dev->mem_end = memaddr + 0x1FFF; + dev->mem_end = memaddr + ARLAN_SHMEM_SIZE-1; if (dev->irq < 2) { - READSHM(dev->irq, arlan->irqLevel, u_char); + READSHM(dev->irq, ap->card->irqLevel, u_char); } else if (dev->irq == 2) dev->irq = 9; @@ -1183,8 +1098,6 @@ } - - static int arlan_open(struct net_device *dev) { struct arlan_private *priv = dev->priv; @@ -1193,12 +1106,6 @@ ARLAN_DEBUG_ENTRY("arlan_open"); - if (dev->mem_start == 0) - ret = arlan_probe_everywhere(dev); - if (ret != 0) - return ret; - - arlan = priv->card; ret = request_irq(dev->irq, &arlan_interrupt, 0, dev->name, dev); if (ret) { @@ -1768,14 +1675,9 @@ { struct arlan_private *priv = dev->priv; - if (!priv) - { - printk(KERN_CRIT "arlan: No Device priv \n"); - return 0; - } ARLAN_DEBUG_ENTRY("arlan_close"); - del_timer(&priv->timer); + del_timer_sync(&priv->timer); arlan_command(dev, ARLAN_COMMAND_POWERDOWN); @@ -1867,39 +1769,68 @@ } -int __init arlan_probe(struct net_device *dev) +struct net_device * __init arlan_probe(int unit) { - printk("Arlan driver %s\n", arlan_version); + struct net_device *dev; + int m; - if (arlan_probe_everywhere(dev)) - return -ENODEV; + ARLAN_DEBUG_ENTRY("arlan_probe"); - arlans_found++; - return 0; -} + if (arlans_found == MAX_ARLANS) + return ERR_PTR(-ENODEV); -#ifdef MODULE + /* + * Reserve space for local data and a copy of the shared memory + * that is used by the /proc interface. + */ + dev = alloc_etherdev(sizeof(struct arlan_private) + + sizeof(struct arlan_shmem)); + if (!dev) + return ERR_PTR(-ENOMEM); -static int probe = probeUNKNOWN; + SET_MODULE_OWNER(dev); -static int __init arlan_find_devices(void) -{ - int m; - int found = 0; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + if (dev->mem_start) { + if (arlan_probe_here(dev, dev->mem_start) == 0) + goto found; + goto not_found; + } + + } - ARLAN_DEBUG_ENTRY("arlan_find_devices"); - if (mem != 0 && numDevices == 1) /* Check a single specified location. */ - return 1; - for (m =(int) phys_to_virt(0xc0000); m <=(int) phys_to_virt(0xDE000); m += 0x2000) + + for (m = (int)phys_to_virt(lastFoundAt) + ARLAN_SHMEM_SIZE; + m <= (int)phys_to_virt(0xDE000); + m += ARLAN_SHMEM_SIZE) { - if (arlan_check_fingerprint(m) == 0) - found++; + if (arlan_probe_here(dev, m) == 0) + { + lastFoundAt = (int)virt_to_phys((void*)m); + goto found; + } + } + + if (lastFoundAt == 0xbe000) + printk(KERN_ERR "arlan: No Arlan devices found \n"); + + not_found: + free_netdev(dev); + return ERR_PTR(-ENODEV); + + found: + arlan_setup_device(dev, arlans_found++); + if (arlans_found == 1) { + printk(KERN_INFO "Arlan driver %s\n", arlan_version); } - ARLAN_DEBUG_EXIT("arlan_find_devices"); - return found; + return dev; } +#ifdef MODULE int init_module(void) { int i = 0; @@ -1909,21 +1840,11 @@ if (channelSet != channelSetUNKNOWN || channelNumber != channelNumberUNKNOWN || systemId != systemIdUNKNOWN) return -EINVAL; - numDevices = arlan_find_devices(); - if (numDevices == 0) - return -ENODEV; + for (i = 0; i < MAX_ARLANS; i++) { + struct net_device *dev = arlan_probe(i); - for (i = 0; i < numDevices && i < MAX_ARLANS; i++) - { - if (!arlan_allocate_device(i, NULL)) - return -ENOMEM; - - if (arlan_device[i] == NULL) - return -ENOMEM; - - if (probe) - arlan_probe_everywhere(arlan_device[i]); -// arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); + if (IS_ERR(dev)) + return PTR_ERR(dev); } init_arlan_proc(); printk(KERN_INFO "Arlan driver %s\n", arlan_version); @@ -1935,7 +1856,7 @@ void cleanup_module(void) { int i = 0; - struct arlan_private *ap; + struct net_device *dev; ARLAN_DEBUG_ENTRY("cleanup_module"); @@ -1946,22 +1867,18 @@ for (i = 0; i < MAX_ARLANS; i++) { - if (arlan_device[i]) - { - arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); - -// release_mem_region(virt_to_phys(arlan_device[i]->mem_start), 0x2000 ); - unregister_netdev(arlan_device[i]); - ap = arlan_device[i]->priv; - if (ap->init_etherdev_alloc) { - free_netdev(arlan_device[i]); - arlan_device[i] = NULL; - } else { - kfree(ap); - ap = NULL; - } + dev = arlan_device[i]; + if (dev) { + arlan_command(dev, ARLAN_COMMAND_POWERDOWN ); + + unregister_netdev(dev); + release_mem_region(virt_to_phys((void *) dev->mem_start), + ARLAN_SHMEM_SIZE); + free_netdev(dev); + arlan_device[i] = NULL; } } + ARLAN_DEBUG_EXIT("cleanup_module"); } diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h --- a/drivers/net/wireless/arlan.h Tue Oct 14 14:35:00 2003 +++ b/drivers/net/wireless/arlan.h Tue Oct 14 14:35:00 2003 @@ -57,12 +57,8 @@ #define SIDUNKNOWN -1 #define radioNodeIdUNKNOWN -1 -#define encryptionKeyUNKNOWN '\0'; #define irqUNKNOWN 0 -#define memUNKNOWN 0 #define debugUNKNOWN 0 -#define probeUNKNOWN 1 -#define numDevicesUNKNOWN 1 #define testMemoryUNKNOWN 1 #define spreadingCodeUNKNOWN 0 #define channelNumberUNKNOWN 0 @@ -81,6 +77,8 @@ #else #define ARLAN_DEBUG(a,b) #endif + +#define ARLAN_SHMEM_SIZE 0x2000 struct arlan_shmem { From shemminger@osdl.org Tue Oct 14 16:03:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 16:04:33 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9EN3n25005308 for ; Tue, 14 Oct 2003 16:03:49 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9EMYAo30162; Tue, 14 Oct 2003 15:34:10 -0700 Date: Tue, 14 Oct 2003 15:34:10 -0700 From: Stephen Hemminger Message-Id: <200310142234.h9EMYAo30162@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (06/12) Probe2 -- sk16 Cc: netdev@oss.sgi.com X-archive-position: 844 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 Content-Length: 8095 Lines: 313 from viro NE17-sk16 * switched sk_g16 to dynamic allocation * sk_g16: embedded ->priv * sk_g16: fixed buggy check for signature (|| instead of &&, somebody forgot to replace it when inverting the test). * sk_g16: fixed use after kfree() * sk_g16: fixed init_etherdev() race Additional: * add free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:44:51 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:44:51 2003 @@ -72,7 +72,7 @@ extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); -extern int SK_init(struct net_device *); +extern struct net_device *SK_init(int unit); extern int seeq8005_probe(struct net_device *); extern int smc_init( struct net_device * ); extern int atarilance_probe(struct net_device *); @@ -277,13 +277,13 @@ #ifdef CONFIG_ELPLUS /* 3c505 */ {elplus_probe, 0}, #endif -#ifdef CONFIG_SK_G16 - {SK_init, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_SK_G16 + {SK_init, 0}, +#endif #ifdef CONFIG_NI5010 {ni5010_probe, 0}, #endif diff -Nru a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c --- a/drivers/net/sk_g16.c Mon Sep 29 09:44:51 2003 +++ b/drivers/net/sk_g16.c Mon Sep 29 09:44:51 2003 @@ -457,8 +457,6 @@ /* static variables */ static SK_RAM *board; /* pointer to our memory mapped board components */ -static struct net_device *SK_dev; -unsigned long SK_ioaddr; static spinlock_t SK_lock = SPIN_LOCK_UNLOCKED; /* Macros */ @@ -472,7 +470,6 @@ * See for short explanation of each function its definitions header. */ -int SK_init(struct net_device *dev); static int SK_probe(struct net_device *dev, short ioaddr); static void SK_timeout(struct net_device *dev); @@ -530,84 +527,71 @@ * YY/MM/DD uid Description -*/ +static int io; /* 0 == probe */ + /* * Check for a network adaptor of this type, and return '0' if one exists. * If dev->base_addr == 0, probe all likely locations. * If dev->base_addr == 1, always return failure. */ -int __init SK_init(struct net_device *dev) +struct net_device * __init SK_init(int unit) { - int ioaddr; /* I/O port address used for POS regs */ int *port, ports[] = SK_IO_PORTS; /* SK_G16 supported ports */ static unsigned version_printed; + struct net_device *dev = alloc_etherdev(sizeof(struct priv)); + int err = -ENODEV; + + if (!dev) + return ERR_PTR(-ENOMEM); - /* get preconfigured base_addr from dev which is done in Space.c */ - int base_addr = dev->base_addr; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + } if (version_printed++ == 0) PRINTK(("%s: %s", SK_NAME, rcsid)); - if (base_addr > 0x0ff) /* Check a single specified address */ - { - int rc = -ENODEV; - - ioaddr = base_addr; + if (io > 0xff) { /* Check a single specified address */ + err = -EBUSY; + /* Check if on specified address is a SK_G16 */ + if (request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) { + err = SK_probe(dev, io); + if (!err) + goto got_it; + release_region(io, ETHERCARD_TOTAL_SIZE); + } + } else if (io > 0) { /* Don't probe at all */ + err = -ENXIO; + } else { + /* Autoprobe base_addr */ + for (port = &ports[0]; *port; port++) { + io = *port; + + /* Check if I/O Port region is used by another board */ + if (!request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) + continue; /* Try next Port address */ + + /* Check if at ioaddr is a SK_G16 */ + if (SK_probe(dev, io) == 0) + goto got_it; - /* Check if on specified address is a SK_G16 */ - if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16")) - return -EBUSY; - - if ( (inb(SK_POS0) == SK_IDLOW) || - (inb(SK_POS1) == SK_IDHIGH) ) - { - rc = SK_probe(dev, ioaddr); - } - - if (rc) - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - return rc; + release_region(io, ETHERCARD_TOTAL_SIZE); + } } - else if (base_addr > 0) /* Don't probe at all */ - { - return -ENXIO; +err_out: + free_netdev(dev); + return ERR_PTR(err); + +got_it: + err = register_netdev(dev); + if (err) { + release_region(dev->base_addr, ETHERCARD_TOTAL_SIZE); + goto err_out; } - - /* Autoprobe base_addr */ - - for (port = &ports[0]; *port; port++) - { - ioaddr = *port; /* we need ioaddr for accessing POS regs */ - - /* Check if I/O Port region is used by another board */ - - if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16")) - { - continue; /* Try next Port address */ - } - - /* Check if at ioaddr is a SK_G16 */ - - if ( !(inb(SK_POS0) == SK_IDLOW) || - !(inb(SK_POS1) == SK_IDHIGH) ) - { - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - continue; /* Try next Port address */ - } - - dev->base_addr = ioaddr; /* Set I/O Port Address */ - - if (SK_probe(dev, ioaddr) == 0) - { - return 0; /* Card found and initialized */ - } - - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - } - - dev->base_addr = base_addr; /* Write back original base_addr */ - - return -ENODEV; /* Failed to find or init driver */ + return dev; } /* End of SK_init */ @@ -620,54 +604,22 @@ #ifdef MODULE -static int io; /* 0 == probe */ - static int __init SK_init_module (void) { - int rc; - - SK_dev = init_etherdev (NULL, 0); - if (!SK_dev) - return -ENOMEM; - - SK_dev->base_addr = io; - - rc = SK_init (SK_dev); - if (rc) { - unregister_netdev (SK_dev); - kfree (SK_dev); - SK_dev = NULL; - } - - return rc; + SK_dev = SK_init(-1); + return IS_ERR(SK_dev) ? PTR_ERR(SK_dev) : 0; } -#endif /* MODULE */ - static void __exit SK_cleanup_module (void) { - if (SK_dev) { - if (SK_dev->priv) { - kfree(SK_dev->priv); - SK_dev->priv = NULL; - } - unregister_netdev(SK_dev); - free_netdev(SK_dev); - SK_dev = NULL; - } - if (SK_ioaddr) { - release_region(SK_ioaddr, ETHERCARD_TOTAL_SIZE); - SK_ioaddr = 0; - } - + unregister_netdev(SK_dev); + release_region(SK_dev->base_addr, ETHERCARD_TOTAL_SIZE); + free_netdev(SK_dev); } - -#ifdef MODULE module_init(SK_init_module); -#endif module_exit(SK_cleanup_module); - +#endif /*- @@ -695,7 +647,11 @@ int sk_addr_flag = 0; /* SK ADDR correct? 1 - no, 0 - yes */ unsigned int rom_addr; /* used to store RAM address used for POS_ADDR */ - struct priv *p; /* SK_G16 private structure */ + struct priv *p = dev->priv; /* SK_G16 private structure */ + + if (inb(SK_POS0) != SK_IDLOW || inb(SK_POS1) != SK_IDHIGH) + return -ENODEV; + dev->base_addr = ioaddr; if (SK_ADDR & 0x3fff || SK_ADDR < 0xa0000) { @@ -837,12 +793,6 @@ dev->dev_addr[4], dev->dev_addr[5]); - /* Allocate memory for private structure */ - p = dev->priv = (void *) kmalloc(sizeof(struct priv), GFP_KERNEL); - if (p == NULL) { - printk("%s: ERROR - no memory for driver data!\n", dev->name); - return -ENOMEM; - } memset((char *) dev->priv, 0, sizeof(struct priv)); /* clear memory */ /* Assign our Device Driver functions */ @@ -856,10 +806,6 @@ dev->watchdog_timeo = HZ/7; - /* Set the generic fields of the device structure */ - - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; /* Initialize private structure */ @@ -884,12 +830,7 @@ SK_print_pos(dev, "End of SK_probe"); SK_print_ram(dev); #endif - - SK_dev = dev; - SK_ioaddr = ioaddr; - return 0; /* Initialization done */ - } /* End of SK_probe() */ @@ -1280,7 +1221,7 @@ memcpy_toio((tmdp->u.buffer & 0x00ffffff), skb->data, skb->len); if (len != skb->len) - memcpy_toio((tmdp->u.buffer & 0x00ffffff) + sb->len, pad, len-skb->len); + memcpy_toio((tmdp->u.buffer & 0x00ffffff) + skb->len, pad, len-skb->len); writew(-len, &tmdp->blen); /* set length to transmit */ From davem@pizda.ninka.net Tue Oct 14 16:35:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 16:35:55 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ENZ925010804 for ; Tue, 14 Oct 2003 16:35:21 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA10150; Tue, 14 Oct 2003 16:28:42 -0700 Date: Tue, 14 Oct 2003 16:28:42 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] (1/12) Probe2 infrastructure for 2.6 experimental Message-Id: <20031014162842.79fcf239.davem@redhat.com> In-Reply-To: <200310142234.h9EMYAL30146@mail.osdl.org> References: <200310142234.h9EMYAL30146@mail.osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 845 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: 415 Lines: 13 On Tue, 14 Oct 2003 15:34:10 -0700 Stephen Hemminger wrote: > New infrastructure to allow probing older builtin drivers (like ISA) > Originally by Al Viro, updated to apply agains jgarzik/net-drivers-2.5-exp All of this looks fine to me, in fact I'm seeing some of these changes for the 4th or 5th time :-) Jeff please add them to your tree unless you have a major objection. Thanks guys. From dlstevens@us.ibm.com Tue Oct 14 20:57:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 20:57:56 -0700 (PDT) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9F3vG25020555 for ; Tue, 14 Oct 2003 20:57:23 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9F3usbl365728; Tue, 14 Oct 2003 23:56:54 -0400 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9F3urIn158816; Tue, 14 Oct 2003 21:56:54 -0600 Importance: Normal Sensitivity: Subject: 6to4/SIT and IP DF To: r.venning@telstra.com, nate@thebog.net, davem@redhat.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Tue, 14 Oct 2003 20:56:48 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 10/14/2003 21:56:54 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 846 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 736 Lines: 22 I was trying out 6to4 and noticed that the v4 encapsulating header has DF set, which RFC3056 says should not be set. Because ICMPv4 won't, in general, include enough packet to determine the original v6 sender, end-to-end PMTU won't work. The possible use I could see is if the tunnel MTU is modified based on the PTMU (I didn't check), but that's probably not a good idea for any tunnels that have "any" as the remote v4 address. Doing that would force all MTU's to the lowest of any v4 destination's path. So, I think it's appropriate to always clear IP DF in the IPv4 header generated by SIT, but I thought I'd see if anyone else has a comment on that before I submit the trivial patch. :-) Any thoughts? +-DLS From pekkas@netcore.fi Tue Oct 14 23:28:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 14 Oct 2003 23:29:34 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9F6Sq25023931 for ; Tue, 14 Oct 2003 23:28:53 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h9F6STE15893; Wed, 15 Oct 2003 09:28:29 +0300 Date: Wed, 15 Oct 2003 09:28:28 +0300 (EEST) From: Pekka Savola To: David Stevens cc: r.venning@telstra.com, , , Subject: Re: 6to4/SIT and IP DF In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 847 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 1381 Lines: 31 On Tue, 14 Oct 2003, David Stevens wrote: > I was trying out 6to4 and noticed that the v4 encapsulating header has DF > set, which RFC3056 says should not be set. > > Because ICMPv4 won't, in general, include enough packet to determine the > original v6 sender, end-to-end PMTU won't work. The possible use I could > see is if the tunnel MTU is modified based on the PTMU (I didn't check), > but that's probably not a good idea for any tunnels that have "any" as > the remote v4 address. Doing that would force all MTU's to the lowest of > any v4 destination's path. > > So, I think it's appropriate to always clear IP DF in the IPv4 header > generated by SIT, but I thought I'd see if anyone else has a comment on > that before I submit the trivial patch. :-) > > Any thoughts? Seems like a good idea. The only thing I'm worried about is when someone is attached to a network of at least 1500 MTU (at IPv6 level), and uses 6to4 -- then basically every IPv6 packet over 1480 bytes will be fragmented in the network, even though it could potentially be chopped to smaller pieces already in the end-nodes. Just wondering how our 6to4 implementation handles this case at the moment.. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From ja@ssi.bg Wed Oct 15 00:01:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 00:02:03 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9F71P25025070 for ; Wed, 15 Oct 2003 00:01:28 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h9F71T001453; Wed, 15 Oct 2003 10:01:31 +0300 Date: Wed, 15 Oct 2003 10:01:29 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: kuznet@ms2.inr.ac.ru, , Subject: Re: [2.4/2.6 PATCHES] Change some ip_fragment checks to help IPVS In-Reply-To: <20031014155152.275270c1.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 848 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Content-Length: 758 Lines: 26 Hello, On Tue, 14 Oct 2003, David S. Miller wrote: > > One related question: is ip_fragment() backport from 2.6 > > to 2.4 planned? > > No, it only makes sense in the 2.6.x stack. > > 2.4.x and 2.6.x networking are wildly different beasts and > you'll therefore need to make the IPVS implementation cope > with that in each tree. ok. But my subject is wrong. In fact, it covers the general case of forwarded packets after calling ip_defrag. It means, for example, that if ip_conntrack is running in 2.4 then all packets with total_length>mtu are refragmented or linearized. This includes the case with 60k packets containing frags where each frag fits in mtu. But I see, it is a dangerous place to change. Regards -- Julian Anastasov From mika.penttila@kolumbus.fi Wed Oct 15 00:12:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 00:13:29 -0700 (PDT) Received: from fep07-app.kolumbus.fi (fep07-0.kolumbus.fi [193.229.0.51]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9F7Cm25025685 for ; Wed, 15 Oct 2003 00:12:49 -0700 Received: from mta.imail.kolumbus.fi ([193.229.5.109]) by fep07-app.kolumbus.fi with ESMTP id <20031015071247.BUXK7495.fep07-app.kolumbus.fi@mta.imail.kolumbus.fi>; Wed, 15 Oct 2003 10:12:47 +0300 X-Mailer: Openwave WebEngine, version 2.8.10 (webedge20-101-191-20030113) From: To: Pekka Savola , David Stevens CC: , , , Subject: Re: Re: 6to4/SIT and IP DF Date: Wed, 15 Oct 2003 10:12:46 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-Id: <20031015071247.BUXK7495.fep07-app.kolumbus.fi@mta.imail.kolumbus.fi> X-archive-position: 849 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev Content-Length: 1629 Lines: 42 > > Lähettäjä: Pekka Savola > Päiväys: 2003/10/15 ke AM 09:28:28 GMT+03:00 > Vastaanottaja: David Stevens > Kopio: r.venning@telstra.com, , , > > Aihe: Re: 6to4/SIT and IP DF > > On Tue, 14 Oct 2003, David Stevens wrote: > > I was trying out 6to4 and noticed that the v4 encapsulating header has DF > > set, which RFC3056 says should not be set. > > > > Because ICMPv4 won't, in general, include enough packet to determine the > > original v6 sender, end-to-end PMTU won't work. The possible use I could > > see is if the tunnel MTU is modified based on the PTMU (I didn't check), > > but that's probably not a good idea for any tunnels that have "any" as > > the remote v4 address. Doing that would force all MTU's to the lowest of > > any v4 destination's path. > > > > So, I think it's appropriate to always clear IP DF in the IPv4 header > > generated by SIT, but I thought I'd see if anyone else has a comment on > > that before I submit the trivial patch. :-) > > > > Any thoughts? > > Seems like a good idea. The only thing I'm worried about is when someone > is attached to a network of at least 1500 MTU (at IPv6 level), and uses > 6to4 -- then basically every IPv6 packet over 1480 bytes will be > fragmented in the network, even though it could potentially be chopped to > smaller pieces already in the end-nodes. > > Just wondering how our 6to4 implementation handles this case at the > moment.. > > -- I think we send icmp TOOBIG by default for packets longer than (pmtu - iphdr). --Mika From dlstevens@us.ibm.com Wed Oct 15 00:15:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 00:16:10 -0700 (PDT) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9F7FX25026027 for ; Wed, 15 Oct 2003 00:15:34 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9F7FSxu470218; Wed, 15 Oct 2003 03:15:28 -0400 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9F7FQlA198898; Wed, 15 Oct 2003 01:15:27 -0600 Importance: Normal Sensitivity: Subject: Re: 6to4/SIT and IP DF To: Pekka Savola Cc: r.venning@telstra.com, , , X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Wed, 15 Oct 2003 00:15:21 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 10/15/2003 01:15:27 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 850 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1690 Lines: 47 Pekka Savola writes: >Seems like a good idea. The only thing I'm worried about is when someone >is attached to a network of at least 1500 MTU (at IPv6 level), and uses >6to4 -- then basically every IPv6 packet over 1480 bytes will be >fragmented in the network, even though it could potentially be chopped to >smaller pieces already in the end-nodes. > >Just wondering how our 6to4 implementation handles this case at the >moment.. The tunnel device does subtract the enscapsulating header, so v6-only PMTU should work up to the tunnel endpoint, and a v6 source should only generate 1480 (because that's what the tunnel endpoint MTU would be) if the entire path is 1500. But if the destination path is something less than the tunnel endpoint's MTU, then I expect every packet bigger than that PMTU would be fragmented. I'm concerned that with DF set, as it is now, every packet in that range would be dropped, if the IPv4 Frag-Needed-But-DF-Set (FNBDFS :-)) does not include enough v6 header & payload to identify the v6 sender. I haven't looked enough at the this code to see what's done (if anything) with PMTU in this case-- for example, if it tries to adjust the tunnel endpoint MTU, or translate the v4 PMTU to v6 when there is enough included. Or trigger a v6 PMTU message based on a v4 route's PMTU and not the tunnel's MTU. I really don't know what it does now for this case, and it may be good already, or some of those options may be more appropriate-- really just seeing if anyone's been through this already. :-) The technical violation of setting DF may be better than not setting it, if the right goodies are already there-- anybody know? +-DLS From laforge@netfilter.org Wed Oct 15 03:08:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 03:08:50 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FA8D25002938 for ; Wed, 15 Oct 2003 03:08:14 -0700 Received: from uucp by coruscant.gnumonks.org with local-bsmtp (Exim 4.22) id 1A9iZf-0008J4-9k for netdev@oss.sgi.com; Wed, 15 Oct 2003 12:08:11 +0200 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 1A9iGE-0003X8-00; Wed, 15 Oct 2003 11:48:06 +0200 Date: Wed, 15 Oct 2003 11:48:06 +0200 From: Harald Welte To: Florian Zwoch Cc: linux-kernel@vger.kernel.org, Netfilter Mailinglist , Netfilter Development Mailinglist , netdev@oss.sgi.com Subject: Re: why does netfilter make upload very slow? (was: Re: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction) Message-ID: <20031015094805.GH9880@obroa-skai.de.gnumonks.org> Reply-To: netfilter-devel@lists.netfilter.org Mail-Followup-To: Harald Welte , Florian Zwoch , linux-kernel@vger.kernel.org, Netfilter Mailinglist , Netfilter Development Mailinglist , netdev@oss.sgi.com References: <20031008153237.GC25743@sunbeam.de.gnumonks.org> <3F8D0542.1060101@backendmedia.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="54ZiyWcDhi/7bWb8" Content-Disposition: inline In-Reply-To: <3F8D0542.1060101@backendmedia.com> X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.4.23-pre5-ben0 X-Date: Today is Boomtime, the 68th day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-archive-position: 851 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 Content-Length: 3226 Lines: 91 --54ZiyWcDhi/7bWb8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Florian! I'm Cc'ing all the mailinglists in order to keep them posted about the question you've raised there. All further discussion will move to netfilter-devel, so for those interested: Please continue there. On Wed, Oct 15, 2003 at 10:28:50AM +0200, Florian Zwoch wrote: > >a) CONFIG_NETFILTER disabled. you won't even have the netfilter hooks > > in the network stack (so certainly no netfilter-using modules loaded) > no problem >=20 > >b) CONFIG_NETFILTER enabled, but _no_ modules (iptable_filter, > > ip_conntrack, ...) attached to the netfilter hook > no problem >=20 > >c) CONFIG_NETFILTER enabled and iptable_filter.o (which pulls ip_tables.= o) > > loaded, NO RULES in the table > no problem >=20 > >d) CONFIG_NETFILTER enabled and iptable_filter.o (which pulls ip_tables.= o) > > loaded, RULES in the table > no problem (as long as i dont load any rules that require ip_conntrack) >=20 > >e) CONFIG_NETFILTER enabled and ip_conntrack.o loaded, iptable_filter > > loaded or not, rules or not > *boink* So It's clearly the connection tracking subsystem. This is on one hand good (because it means it's neither netfilter nor iptables). =20 > whenever i try to load ip_conntrack the nic performance drops from 5mb/s= =20 > to 200k/s. On the other hand, this is definitely way worse than you would expect. Can you please tell me more information about: - number of connections you have? (cat /proc/net/ip_conntrack | wc -l) - number of buckets and ip_conntrack_max (printed at ip_conntrack loadtime - your traffic pattern. Are you spraying udp packets with random src/dst? What kind of connections (protocol, application) are you testing with? - what about the hardware (cpu, memory, smp?) Even the worst tests we've had so far (random UDP packets) 'only' reduced the througput by about 50%. Maybe we can do better than 50% worst case behaviour, but you will always observe a visible impact as soon as you start connection tracking for every single packet (which is what 'insmod ip_conntrack' implies). > still using 2.6.0-test6. Have you observed this behaviour with other kernel versions? Was there a performance change between 2.4 and 2.6? Or did you always observe this grave performance loss? > regards, > Florian --=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 --54ZiyWcDhi/7bWb8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/jRfVXaXGVTD0i/8RAooiAJ9KsqxBOUWjMrm7zk5JHwiRL6cE4QCeMybJ oDYc8U/PkIQqk89TXSHrf2Q= =nLuA -----END PGP SIGNATURE----- --54ZiyWcDhi/7bWb8-- From acme@conectiva.com.br Wed Oct 15 04:37:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 04:37:36 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FBav25007781 for ; Wed, 15 Oct 2003 04:36:59 -0700 Received: from w933.funklan.uni-saarland.de ([134.96.207.165] helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A9k96-0000U9-00; Wed, 15 Oct 2003 09:48:52 -0200 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id AD6771966D; Wed, 15 Oct 2003 11:36:49 +0000 (UTC) Date: Wed, 15 Oct 2003 08:36:48 -0300 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] fixing the cases where tcp_tw_bucket was accessed as a sock Message-ID: <20031015113648.GD1174@conectiva.com.br> References: <20031012131344.GH16182@conectiva.com.br> <20031013124930.0e75a325.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031013124930.0e75a325.davem@redhat.com> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 852 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: 2015 Lines: 59 Em Mon, Oct 13, 2003 at 12:49:30PM -0700, David S. Miller escreveu: > On Sun, 12 Oct 2003 10:13:44 -0300 > Arnaldo Carvalho de Melo wrote: > > > The WARN_ON is just to be paranoid for a while, I should have done > > that a loooong time ago :-\ > > I appreciate the intentions here but the resulting code is > really a mess. We have this thing now in in.h called > "inet_something()" that tests TCP state, and then we have > something similar for ipv6 in addrconf.c :-) > > Let's do one thing at a time. First, fix the original bug > in tcp_ipv4.c by just putting your inet_rcv_saddr() shorthand > right there in tcp_ipv4.c and name it tcp4_rcv_saddr() or > something like that. > > Then we can move onto the rest of the changes and try to find > a common place for the helper routines. > > See what happens when you try to do too many things at one > time :-) :) Here is the first part: ===== net/ipv4/tcp_ipv4.c 1.69 vs edited ===== --- 1.69/net/ipv4/tcp_ipv4.c Wed Oct 8 12:27:40 2003 +++ edited/net/ipv4/tcp_ipv4.c Wed Oct 15 09:26:29 2003 @@ -178,9 +178,15 @@ tcp_sk(sk)->bind_hash = tb; } +static inline const u32 tcp_v4_rcv_saddr(const struct sock *sk) +{ + return likely(sk->sk_state != TCP_TIME_WAIT) ? + inet_sk(sk)->rcv_saddr : tcptw_sk(sk)->tw_rcv_saddr; +} + static inline int tcp_bind_conflict(struct sock *sk, struct tcp_bind_bucket *tb) { - struct inet_opt *inet = inet_sk(sk); + const u32 sk_rcv_saddr = tcp_v4_rcv_saddr(sk); struct sock *sk2; struct hlist_node *node; int reuse = sk->sk_reuse; @@ -193,9 +199,9 @@ sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) { if (!reuse || !sk2->sk_reuse || sk2->sk_state == TCP_LISTEN) { - struct inet_opt *inet2 = inet_sk(sk2); - if (!inet2->rcv_saddr || !inet->rcv_saddr || - inet2->rcv_saddr == inet->rcv_saddr) + const u32 sk2_rcv_saddr = tcp_v4_rcv_saddr(sk2); + if (!sk2_rcv_saddr || !sk_rcv_saddr || + sk2_rcv_saddr == sk_rcv_saddr) break; } } From vandrove@vc.cvut.cz Wed Oct 15 10:11:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 10:12:10 -0700 (PDT) Received: from vana.vc.cvut.cz (root@vana.vc.cvut.cz [147.32.240.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FHBE25023496 for ; Wed, 15 Oct 2003 10:11:36 -0700 Received: from vana.vc.cvut.cz (smmsp@localhost [127.0.0.1]) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-4) with ESMTP id h9FHBC0Q003002; Wed, 15 Oct 2003 19:11:12 +0200 Received: (from root@localhost) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-4) id h9FHBCPM002998; Wed, 15 Oct 2003 19:11:12 +0200 Date: Wed, 15 Oct 2003 19:11:12 +0200 From: Petr Vandrovec To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH?] Fix sniffing of ARP replies Message-ID: <20031015171112.GA2469@vana.vc.cvut.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i X-archive-position: 853 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vandrove@vc.cvut.cz Precedence: bulk X-list: netdev Content-Length: 1138 Lines: 29 Hi Dave, after recent changes in packet_type interface I stopped setting af_packet_priv - as you told that it is only for AF_PACKET, for nobody else. And - things stopped working. After some debugging I found that there are skb's with ->sk == NULL - namely ARP replies - and if af_packet_priv == NULL, these skbs are not delivered to the registered ptype. Is change below correct, or should I simple set af_packet_priv to non-NULL value, like I did before (and like I have to do it again for older kernels, in the light of problems I'm seeing now)? Thanks, Petr Vandrovec diff -urdN linux/net/core/dev.c linux/net/core/dev.c --- linux/net/core/dev.c 2003-10-15 14:05:23.000000000 +0000 +++ linux/net/core/dev.c 2003-10-15 16:52:41.000000000 +0000 @@ -942,7 +942,8 @@ * they originated from - MvS (miquels@drinkel.ow.org) */ if ((ptype->dev == dev || !ptype->dev) && - (struct sock *)ptype->af_packet_priv != skb->sk) { + (ptype->af_packet_priv == NULL || + (struct sock *)ptype->af_packet_priv != skb->sk)) { struct sk_buff *skb2= skb_clone(skb, GFP_ATOMIC); if (!skb2) break; From rddunlap@osdl.org Wed Oct 15 11:06:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 11:07:24 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FI6R25026932 for ; Wed, 15 Oct 2003 11:06:47 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9FI6Lo04936; Wed, 15 Oct 2003 11:06:21 -0700 Date: Wed, 15 Oct 2003 11:05:20 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH] init_netdev missing locking Message-Id: <20031015110520.0206e327.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 854 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1113 Lines: 41 It looks like the call to dev_alloc_name() in init_netdev() isn't protected by the required locking. This patch adds rtnl_lock/unlock around the call to dev_alloc_name(). Comments? or please apply. -- ~Randy description: add required locking to init_netdev()'s call to dev_alloc_name() patch_name: netinit_alloc_lock.patch product_versions: Linux 2.6.0-test7 maintainer: davem@redhat.com author: Randy.Dunlap patch_version: 2003-10-15.10:55:51 diffstat:= drivers/net/net_init.c | 3 +++ 1 files changed, 3 insertions(+) diff -Naurp ./drivers/net/net_init.c~dev_alloc_lock ./drivers/net/net_init.c --- ./drivers/net/net_init.c~dev_alloc_lock 2003-10-15 10:53:02.000000000 -0700 +++ ./drivers/net/net_init.c 2003-10-15 10:53:34.000000000 -0700 @@ -148,11 +148,14 @@ static struct net_device *init_netdev(st if (dev->name[0] == '\0' || dev->name[0] == ' ') { strcpy(dev->name, mask); + rtnl_lock(); if (dev_alloc_name(dev, mask)<0) { + rtnl_unlock(); if (new_device) kfree(dev); return NULL; } + rtnl_unlock(); } netdev_boot_setup_check(dev); From greg@kroah.com Wed Oct 15 11:42:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 11:42:53 -0700 (PDT) Received: from perch.kroah.org (mail.kroah.org [65.200.24.183]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FIfs25028060 for ; Wed, 15 Oct 2003 11:42:15 -0700 Received: from DYN318262BLD.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 h9FIdjh12600; Wed, 15 Oct 2003 11:39:46 -0700 Received: from greg by echidna.kroah.org with local (masqmail 0.2.19) id 1A9qa0-5pW-00; Wed, 15 Oct 2003 11:41:04 -0700 Date: Wed, 15 Oct 2003 11:41:04 -0700 From: Greg KH To: Matthew Wilcox Cc: Linus Torvalds , "David S. Miller" , Jeff Garzik , linux-pci@atrey.karlin.mff.cuni.cz, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pci_get_slot() Message-ID: <20031015184104.GA22373@kroah.com> References: <20031015183213.GG16535@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031015183213.GG16535@parcelfarce.linux.theplanet.co.uk> User-Agent: Mutt/1.4.1i X-archive-position: 855 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 Content-Length: 2205 Lines: 67 On Wed, Oct 15, 2003 at 07:32:13PM +0100, Matthew Wilcox wrote: > > Hi Linus. > > tg3.c has a bug where it can find the wrong 5704 peer on a machine with > PCI domains. The problem is that pci_find_slot() can't distinguish > whether it has the correct domain or not. The check of: if (dev->bus->number == bus && dev->devfn == devfn) in pci_find_slot() doesn't check for the domain? > > This patch fixes that problem by introducing pci_get_slot() and converts > tg3 to use it. It also fixes another problem where tg3 wouldn't find > a peer on function 7 (0 to <8, not 0 to <7). Ah, nice. After telling you I would not accept this patch right now, until after 2.6.0 comes out, you send it to Linus. Really appreciate that... Anyway, is there any other way you can fix this in the tg3 driver only for right now? I agree adding the pci function is "cleaner", but a bit late for right now. > /** > + * pci_get_slot - locate PCI device for a given PCI slot > + * @bus: PCI bus on which desired PCI device resides > + * @devfn: encodes number of PCI slot in which the desired PCI > + * device resides and the logical device number within that slot > + * in case of multi-function devices. > + * > + * Given a PCI bus and slot/function number, the desired PCI device > + * is located in the list of PCI devices. > + * If the device is found, its reference count is increased and this > + * function returns a pointer to its data structure. The caller must > + * decrement the reference count by calling pci_dev_put(). > + * If no device is found, %NULL is returned. > + */ > +struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn) > +{ > + struct list_head *tmp; > + struct pci_dev *dev; > + > + WARN_ON(in_interrupt()); > + spin_lock(&pci_bus_lock); > + > + list_for_each(tmp, &bus->children) { > + dev = pci_dev_b(tmp); > + if (dev->devfn == devfn) > + goto out; > + } > + > + dev = NULL; > + out: > + pci_dev_get(dev); > + spin_unlock(&pci_bus_lock); > + return dev; > +} How does this differ from pci_find_slot()? (becides the pci_dev_get() call)? pci_find_slot() asks for the bus number, which can be determined from the pci_bus structure, right? thanks, greg k-h From willy@www.linux.org.uk Wed Oct 15 11:51:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 11:51:49 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FIot25029015 for ; Wed, 15 Oct 2003 11:51:15 -0700 Received: from willy by www.linux.org.uk with local (Exim 4.22) id 1A9qjV-0001jr-F6; Wed, 15 Oct 2003 19:50:53 +0100 Date: Wed, 15 Oct 2003 19:50:53 +0100 From: Matthew Wilcox To: Greg KH Cc: Matthew Wilcox , Linus Torvalds , "David S. Miller" , Jeff Garzik , linux-pci@atrey.karlin.mff.cuni.cz, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pci_get_slot() Message-ID: <20031015185053.GH16535@parcelfarce.linux.theplanet.co.uk> References: <20031015183213.GG16535@parcelfarce.linux.theplanet.co.uk> <20031015184104.GA22373@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031015184104.GA22373@kroah.com> User-Agent: Mutt/1.4.1i X-archive-position: 856 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: willy@debian.org Precedence: bulk X-list: netdev Content-Length: 1244 Lines: 28 On Wed, Oct 15, 2003 at 11:41:04AM -0700, Greg KH wrote: > The check of: > if (dev->bus->number == bus && dev->devfn == devfn) > in pci_find_slot() doesn't check for the domain? No, it would also need to check pci_domain_nr(dev->bus) .. and it doesn't have anything to check it against as that information isn't passed into the function. > Anyway, is there any other way you can fix this in the tg3 driver only > for right now? I agree adding the pci function is "cleaner", but a bit > late for right now. The only real way to do it is to inline pci_get_slot() into tg3. Since I also have a need for it in sym2, that doesn't seem like a sensible idea. It would also be racy since it wouldn't take the pci_bus_lock. > How does this differ from pci_find_slot()? (becides the pci_dev_get() > call)? pci_find_slot() asks for the bus number, which can be determined > from the pci_bus structure, right? The pci_bus knows which domain it's in. We don't have to check it since we only walk its children. -- "It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk From torvalds@osdl.org Wed Oct 15 12:14:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 12:14:35 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FJE225029794 for ; Wed, 15 Oct 2003 12:14:02 -0700 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9FJDco22862; Wed, 15 Oct 2003 12:13:38 -0700 Date: Wed, 15 Oct 2003 12:13:37 -0700 (PDT) From: Linus Torvalds To: Greg KH cc: Matthew Wilcox , "David S. Miller" , Jeff Garzik , , , Subject: Re: [PATCH] pci_get_slot() In-Reply-To: <20031015184104.GA22373@kroah.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 857 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev Content-Length: 269 Lines: 12 On Wed, 15 Oct 2003, Greg KH wrote: > > The check of: > if (dev->bus->number == bus && dev->devfn == devfn) > in pci_find_slot() doesn't check for the domain? No, and it doesn't even have anything to check _against_. We don't pass the domain down to it. Linus From shemminger@osdl.org Wed Oct 15 12:21:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 12:22:16 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FJLe25000520 for ; Wed, 15 Oct 2003 12:21:43 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9FJLYo24525; Wed, 15 Oct 2003 12:21:34 -0700 Date: Wed, 15 Oct 2003 12:21:21 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] trivial -- remove unused prototype from Space.c Message-Id: <20031015122121.658d652e.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 859 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 Content-Length: 572 Lines: 18 The prototype for iph5526_probe is no longer used, it is a left over from when fiber channel probed in Space.c Jeff, you may just want to put this in net-2.5-exp diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Wed Oct 15 12:19:11 2003 +++ b/drivers/net/Space.c Wed Oct 15 12:19:11 2003 @@ -98,9 +98,6 @@ /* Detachable devices ("pocket adaptors") */ extern int de620_probe(struct net_device *); -/* Fibre Channel adapters */ -extern int iph5526_probe(struct net_device *dev); - /* SBNI adapters */ extern int sbni_probe(int unit); From willy@www.linux.org.uk Wed Oct 15 12:21:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 12:21:57 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FJLK25000509 for ; Wed, 15 Oct 2003 12:21:21 -0700 Received: from willy by www.linux.org.uk with local (Exim 4.22) id 1A9qRR-0001B9-GF; Wed, 15 Oct 2003 19:32:13 +0100 Date: Wed, 15 Oct 2003 19:32:13 +0100 From: Matthew Wilcox To: Linus Torvalds Cc: Greg KH , "David S. Miller" , Jeff Garzik , linux-pci@atrey.karlin.mff.cuni.cz, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [PATCH] pci_get_slot() Message-ID: <20031015183213.GG16535@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 858 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: willy@debian.org Precedence: bulk X-list: netdev Content-Length: 4617 Lines: 130 Hi Linus. tg3.c has a bug where it can find the wrong 5704 peer on a machine with PCI domains. The problem is that pci_find_slot() can't distinguish whether it has the correct domain or not. This patch fixes that problem by introducing pci_get_slot() and converts tg3 to use it. It also fixes another problem where tg3 wouldn't find a peer on function 7 (0 to <8, not 0 to <7). Index: linux-2.6/drivers/net/tg3.c =================================================================== RCS file: /var/cvs/linux-2.6/drivers/net/tg3.c,v retrieving revision 1.5 diff -u -p -r1.5 tg3.c --- linux-2.6/drivers/net/tg3.c 8 Sep 2003 21:42:12 -0000 1.5 +++ linux-2.6/drivers/net/tg3.c 15 Oct 2003 18:18:28 -0000 @@ -7462,23 +7462,24 @@ static char * __devinit tg3_phy_string(s static struct pci_dev * __devinit tg3_find_5704_peer(struct tg3 *tp) { - struct pci_dev *peer = NULL; - unsigned int func; + struct pci_dev *peer; + unsigned int func, devnr = tp->pdev->devfn & ~7; - for (func = 0; func < 7; func++) { - unsigned int devfn = tp->pdev->devfn; - - devfn &= ~7; - devfn |= func; - - if (devfn == tp->pdev->devfn) - continue; - peer = pci_find_slot(tp->pdev->bus->number, devfn); - if (peer) + for (func = 0; func < 8; func++) { + peer = pci_get_slot(tp->pdev->bus, devnr | func); + if (peer && peer != tp->pdev) break; + pci_dev_put(peer); } if (!peer || peer == tp->pdev) BUG(); + + /* + * We don't need to keep the refcount elevated; there's no way + * to remove one half of this device without removing the other + */ + pci_dev_put(peer); + return peer; } Index: linux-2.6/drivers/pci/search.c =================================================================== RCS file: /var/cvs/linux-2.6/drivers/pci/search.c,v retrieving revision 1.1 diff -u -p -r1.1 search.c --- linux-2.6/drivers/pci/search.c 29 Jul 2003 17:01:25 -0000 1.1 +++ linux-2.6/drivers/pci/search.c 15 Oct 2003 18:18:28 -0000 @@ -104,6 +104,41 @@ pci_find_slot(unsigned int bus, unsigned } /** + * pci_get_slot - locate PCI device for a given PCI slot + * @bus: PCI bus on which desired PCI device resides + * @devfn: encodes number of PCI slot in which the desired PCI + * device resides and the logical device number within that slot + * in case of multi-function devices. + * + * Given a PCI bus and slot/function number, the desired PCI device + * is located in the list of PCI devices. + * If the device is found, its reference count is increased and this + * function returns a pointer to its data structure. The caller must + * decrement the reference count by calling pci_dev_put(). + * If no device is found, %NULL is returned. + */ +struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn) +{ + struct list_head *tmp; + struct pci_dev *dev; + + WARN_ON(in_interrupt()); + spin_lock(&pci_bus_lock); + + list_for_each(tmp, &bus->children) { + dev = pci_dev_b(tmp); + if (dev->devfn == devfn) + goto out; + } + + dev = NULL; + out: + pci_dev_get(dev); + spin_unlock(&pci_bus_lock); + return dev; +} + +/** * pci_find_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids @@ -319,3 +354,4 @@ EXPORT_SYMBOL(pci_find_slot); EXPORT_SYMBOL(pci_find_subsys); EXPORT_SYMBOL(pci_get_device); EXPORT_SYMBOL(pci_get_subsys); +EXPORT_SYMBOL(pci_get_slot); Index: linux-2.6/include/linux/pci.h =================================================================== RCS file: /var/cvs/linux-2.6/include/linux/pci.h,v retrieving revision 1.5 diff -u -p -r1.5 pci.h --- linux-2.6/include/linux/pci.h 8 Oct 2003 20:53:03 -0000 1.5 +++ linux-2.6/include/linux/pci.h 15 Oct 2003 18:18:34 -0000 @@ -607,6 +607,8 @@ struct pci_dev *pci_get_device (unsigned struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device, unsigned int ss_vendor, unsigned int ss_device, struct pci_dev *from); +struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn); + int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val); int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val); int pci_bus_read_config_dword (struct pci_bus *bus, unsigned int devfn, int where, u32 *val); -- "It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk From shemminger@osdl.org Wed Oct 15 12:24:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 12:24:43 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FJOA25001235 for ; Wed, 15 Oct 2003 12:24:10 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9FJO3o24854; Wed, 15 Oct 2003 12:24:03 -0700 Date: Wed, 15 Oct 2003 12:23:48 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] trivial -- skfp_probe should be static Message-Id: <20031015122348.6453c0f0.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 860 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 Content-Length: 2619 Lines: 80 skfp_probe used to be called from Space.c but isn't any more. Therefore it no longer needs to be global. All the calls to insert_device() pass skfp_probe as a second arg, so just use it directly. Jeff, this also is janitor type stuff, so just put it in net-2.5-exp diff -Nru a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c --- a/drivers/net/skfp/skfddi.c Wed Oct 15 12:19:23 2003 +++ b/drivers/net/skfp/skfddi.c Wed Oct 15 12:19:23 2003 @@ -106,14 +106,9 @@ #include "h/smtstate.h" -// Define global routines -int skfp_probe(struct net_device *dev); - - // Define module-wide (static) routines static struct net_device *alloc_device(struct net_device *dev, u_long iobase); -static struct net_device *insert_device(struct net_device *dev, - int (*init) (struct net_device *)); +static struct net_device *insert_device(struct net_device *dev); static int fddi_dev_index(unsigned char *s); static void init_dev(struct net_device *dev, u_long iobase); static void link_modules(struct net_device *dev, struct net_device *tmp); @@ -259,7 +254,7 @@ * initialized and the board resources are read and stored in * the device structure. */ -int skfp_probe(struct net_device *dev) +static int skfp_probe(struct net_device *dev) { int i; /* used in for loops */ struct pci_dev *pdev = NULL; /* PCI device structure */ @@ -453,7 +448,7 @@ num_fddi = fddi_dev_index(dev->name); if (loading_module) { num_fddi++; - dev = insert_device(dev, skfp_probe); + dev = insert_device(dev); return dev; } while (1) { @@ -484,7 +479,7 @@ (dev->base_addr != 0)) && !fixed) || new_dev) { num_fddi++; /* New device */ - dev = insert_device(dev, skfp_probe); + dev = insert_device(dev); } if (dev) { if (!dev->priv) { @@ -550,8 +545,7 @@ * one up. If memory could not be allocated, print an error message. * ************************/ -static struct net_device *insert_device(struct net_device *dev, - int (*init) (struct net_device *)) +static struct net_device *insert_device(struct net_device *dev) { struct net_device *new; int len; @@ -566,7 +560,7 @@ } else { memset((char *) new, 0, len); new->priv = (struct s_smc *) (new + 1); - new->init = init; /* initialisation routine */ + new->init = skfp_probe; if (!loading_module) { new->next = dev->next; dev->next = new; @@ -2545,7 +2539,7 @@ { struct net_device *p; - if ((mdev = insert_device(NULL, skfp_probe)) == NULL) + if ((mdev = insert_device(NULL)) == NULL) return -ENOMEM; for (p = mdev; p != NULL; p = ((struct s_smc *)p->priv)->os.next_module) { From greg@kroah.com Wed Oct 15 12:35:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 12:36:16 -0700 (PDT) Received: from perch.kroah.org (mail.kroah.org [65.200.24.183]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FJZf25001816 for ; Wed, 15 Oct 2003 12:35:41 -0700 Received: from DYN318262BLD.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 h9FJXeh26169; Wed, 15 Oct 2003 12:33:40 -0700 Received: from greg by echidna.kroah.org with local (masqmail 0.2.19) id 1A9rQ7-8V1-00; Wed, 15 Oct 2003 12:34:55 -0700 Date: Wed, 15 Oct 2003 12:34:55 -0700 From: Greg KH To: Matthew Wilcox Cc: Linus Torvalds , "David S. Miller" , Jeff Garzik , linux-pci@atrey.karlin.mff.cuni.cz, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pci_get_slot() Message-ID: <20031015193455.GA23727@kroah.com> References: <20031015183213.GG16535@parcelfarce.linux.theplanet.co.uk> <20031015184104.GA22373@kroah.com> <20031015185053.GH16535@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031015185053.GH16535@parcelfarce.linux.theplanet.co.uk> User-Agent: Mutt/1.4.1i X-archive-position: 861 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 Content-Length: 1065 Lines: 27 On Wed, Oct 15, 2003 at 07:50:53PM +0100, Matthew Wilcox wrote: > On Wed, Oct 15, 2003 at 11:41:04AM -0700, Greg KH wrote: > > The check of: > > if (dev->bus->number == bus && dev->devfn == devfn) > > in pci_find_slot() doesn't check for the domain? > > No, it would also need to check pci_domain_nr(dev->bus) .. and it doesn't > have anything to check it against as that information isn't passed into > the function. Ah, missed that. I need to get myself a ppc64 box so I have to worry about the pci domain stuff :) > > Anyway, is there any other way you can fix this in the tg3 driver only > > for right now? I agree adding the pci function is "cleaner", but a bit > > late for right now. > > The only real way to do it is to inline pci_get_slot() into tg3. Since I > also have a need for it in sym2, that doesn't seem like a sensible idea. > It would also be racy since it wouldn't take the pci_bus_lock. Ok, fair enough. I'll add it to my tree to be sent to Linus after 2.6.0 is out, if Jeff and David agree it's an ok tg3.c patch. thanks, greg k-h From shemminger@osdl.org Wed Oct 15 13:48:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 13:48:41 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FKm425004913 for ; Wed, 15 Oct 2003 13:48:07 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9FKltw11805; Wed, 15 Oct 2003 13:47:55 -0700 Date: Wed, 15 Oct 2003 13:47:55 -0700 From: Stephen Hemminger Message-Id: <200310152047.h9FKltw11805@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (1/6) tokenring probing change Cc: netdev@oss.sgi.com X-archive-position: 862 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 Content-Length: 1848 Lines: 86 Convert ISA token ring drivers to the new probe2 infrastructure that allows driver to allocate network device in the same way for both modular and non-modular cases. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Oct 13 13:08:06 2003 +++ b/drivers/net/Space.c Mon Oct 13 13:08:06 2003 @@ -430,26 +430,6 @@ {NULL, 0}, }; -static __init int trif_probe(int unit) -{ - struct net_device *dev; - int err = -ENODEV; - - dev = alloc_trdev(0); - if (!dev) - return -ENOMEM; - - sprintf(dev->name, "tr%d", unit); - netdev_boot_setup_check(dev); - if ( - 0 ) - err = register_netdev(dev); - - if (err) - free_netdev(dev); - return err; - -} static void __init trif_probe2(int unit) { @@ -484,8 +464,7 @@ #endif #ifdef CONFIG_TR for (num = 0; num < 8; ++num) - if (!trif_probe(num)) - trif_probe2(num); + trif_probe2(num); #endif for (num = 0; num < 8; ++num) if (!ethif_probe(num)) This applies against net-2.5-exp diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Fri Oct 10 11:27:32 2003 +++ b/drivers/net/Space.c Fri Oct 10 11:27:32 2003 @@ -414,6 +414,10 @@ extern int proteon_probe(struct net_device *); extern int smctr_probe(struct net_device *); +static struct devprobe2 tr_probes2[] __initdata = { + {NULL, 0}, +}; + static __init int trif_probe(int unit) { struct net_device *dev; @@ -446,6 +450,15 @@ return err; } + +static void __init trif_probe2(int unit) +{ + unsigned long base_addr = netdev_boot_base("tr", unit); + + if (base_addr == 1) + return; + probe_list2(unit, tr_probes2, base_addr == 0); +} #endif @@ -471,7 +484,8 @@ #endif #ifdef CONFIG_TR for (num = 0; num < 8; ++num) - trif_probe(num); + if (!trif_probe(num)) + trif_probe2(num); #endif for (num = 0; num < 8; ++num) if (!ethif_probe(num)) From shemminger@osdl.org Wed Oct 15 13:48:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 13:48:49 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FKmG25004928 for ; Wed, 15 Oct 2003 13:48:17 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9FKmAs11913; Wed, 15 Oct 2003 13:48:10 -0700 Date: Wed, 15 Oct 2003 13:48:10 -0700 From: Stephen Hemminger Message-Id: <200310152048.h9FKmAs11913@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (4/6) skisa -- probe2 Cc: netdev@oss.sgi.com X-archive-position: 865 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 Content-Length: 7822 Lines: 324 Convert the SK-NET TMS380 ISA card to the new probe2 format. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Oct 13 15:10:32 2003 +++ b/drivers/net/Space.c Mon Oct 13 15:10:32 2003 @@ -410,11 +410,14 @@ #ifdef CONFIG_TR /* Token-ring device probe */ extern int ibmtr_probe(struct net_device *); -extern int sk_isa_probe(struct net_device *); +extern struct net_device *sk_isa_probe(int unit); extern struct net_device *proteon_probe(int unit); extern struct net_device *smctr_probe(int unit); static struct devprobe2 tr_probes2[] __initdata = { +#ifdef CONFIG_SKISA + {sk_isa_probe, 0}, +#endif #ifdef CONFIG_PROTEON {proteon_probe, 0}, #endif @@ -438,9 +441,6 @@ if ( #ifdef CONFIG_IBMTR ibmtr_probe(dev) == 0 || -#endif -#ifdef CONFIG_SKISA - sk_isa_probe(dev) == 0 || #endif 0 ) err = register_netdev(dev); diff -Nru a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c --- a/drivers/net/tokenring/skisa.c Mon Oct 13 15:10:32 2003 +++ b/drivers/net/tokenring/skisa.c Mon Oct 13 15:10:32 2003 @@ -56,7 +56,7 @@ /* A zero-terminated list of IRQs to be probed. * Used again after initial probe for sktr_chipset_init, called from sktr_open. */ -static unsigned short irqlist[] = { +static const unsigned short irqlist[] = { 3, 5, 9, 10, 11, 12, 15, 0 }; @@ -69,7 +69,6 @@ static char isa_cardname[] = "SK NET TR 4/16 ISA\0"; -int sk_isa_probe(struct net_device *dev); static int sk_isa_open(struct net_device *dev); static int sk_isa_close(struct net_device *dev); static void sk_isa_read_eeprom(struct net_device *dev); @@ -95,17 +94,14 @@ outw(val, dev->base_addr + reg); } -struct sk_isa_card { - struct net_device *dev; - struct sk_isa_card *next; -}; - -static struct sk_isa_card *sk_isa_card_list; -static int __init sk_isa_probe1(int ioaddr) +static int __init sk_isa_probe1(struct net_device *dev, int ioaddr) { unsigned char old, chk1, chk2; + if (!request_region(ioaddr, SK_ISA_IO_EXTENT, isa_cardname)) + return -ENODEV; + old = inb(ioaddr + SIFADR); /* Get the old SIFADR value */ chk1 = 0; /* Begin with check value 0 */ @@ -122,8 +118,10 @@ chk2 = inb(ioaddr + SIFADD); chk2 ^= 0x0FE; - if(chk1 != chk2) - return (-1); /* No adapter */ + if(chk1 != chk2) { + release_region(ioaddr, SK_ISA_IO_EXTENT); + return -ENODEV; + } chk1 -= 2; } while(chk1 != 0); /* Repeat 128 times (all byte values) */ @@ -131,58 +129,45 @@ /* Restore the SIFADR value */ outb(old, ioaddr + SIFADR); - return (0); + dev->base_addr = ioaddr; + return 0; } -int __init sk_isa_probe(struct net_device *dev) +struct net_device * __init sk_isa_probe(int unit) { - static int versionprinted; + struct net_device *dev = alloc_trdev(sizeof(struct net_local)); struct net_local *tp; - int i,j; - struct sk_isa_card *card; + static int versionprinted; + const unsigned *port; + int j, err = 0; -#ifndef MODULE - netdev_boot_setup_check(dev); - tr_setup(dev); -#endif + if (!dev) + return ERR_PTR(-ENOMEM); - SET_MODULE_OWNER(dev); - if (!dev->base_addr) - { - for(i = 0; portlist[i]; i++) - { - if (!request_region(portlist[i], SK_ISA_IO_EXTENT, isa_cardname)) - continue; - - if(sk_isa_probe1(portlist[i])) - { - release_region(dev->base_addr, SK_ISA_IO_EXTENT); - continue; - } + if (unit >= 0) { + sprintf(dev->name, "tr%d", unit); + netdev_boot_setup_check(dev); + } - dev->base_addr = portlist[i]; - break; + SET_MODULE_OWNER(dev); + if (dev->base_addr) /* probe specific location */ + err = sk_isa_probe1(dev, dev->base_addr); + else { + for (port = portlist; *port; port++) { + err = sk_isa_probe1(dev, *port); + if (!err) + break; } - if(!dev->base_addr) - return -1; } - else - { - if (!request_region(dev->base_addr, SK_ISA_IO_EXTENT, isa_cardname)) - return -1; - - if(sk_isa_probe1(dev->base_addr)) - { - release_region(dev->base_addr, SK_ISA_IO_EXTENT); - return -1; - } - } + if (err) + goto out4; /* At this point we have found a valid card. */ if (versionprinted++ == 0) printk(KERN_DEBUG "%s", version); + err = -EIO; if (tmsdev_init(dev, ISA_MAX_ADDRESS, NULL)) goto out4; @@ -284,14 +269,11 @@ printk(KERN_DEBUG "%s: IO: %#4lx IRQ: %d DMA: %d\n", dev->name, dev->base_addr, dev->irq, dev->dma); - /* Enlist in the card list */ - card = kmalloc(sizeof(struct sk_isa_card), GFP_KERNEL); - if (!card) + err = register_netdev(dev); + if (err) goto out; - card->next = sk_isa_card_list; - sk_isa_card_list = card; - card->dev = dev; - return 0; + + return dev; out: free_dma(dev->dma); out2: @@ -300,7 +282,8 @@ tmsdev_term(dev); out4: release_region(dev->base_addr, SK_ISA_IO_EXTENT); - return -1; + free_netdev(dev); + return ERR_PTR(err); } /* @@ -373,6 +356,8 @@ #define ISATR_MAX_ADAPTERS 3 +static struct net_device *sk_isa_dev[ISATR_MAX_ADAPTERS]; + static int io[ISATR_MAX_ADAPTERS]; static int irq[ISATR_MAX_ADAPTERS]; static int dma[ISATR_MAX_ADAPTERS]; @@ -383,50 +368,54 @@ MODULE_PARM(irq, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i"); MODULE_PARM(dma, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i"); -static int __init setup_card(unsigned long io, unsigned irq, unsigned char dma) +static struct net_device * __init setup_card(unsigned long io, unsigned irq, unsigned char dma) { - int res = -ENOMEM; - struct sk_isa_card *this_card; - struct net_device *dev = alloc_trdev(0); - - if (dev) { - dev->base_addr = io; - dev->irq = irq; - dev->dma = dma; - res = -ENODEV; - if (sk_isa_probe(dev) == 0) { - res = register_netdev(dev); - if (!res) - return 0; - release_region(dev->base_addr, SK_ISA_IO_EXTENT); - free_irq(dev->irq, dev); - free_dma(dev->dma); - tmsdev_term(dev); - this_card = sk_isa_card_list; - sk_isa_card_list = this_card->next; - kfree(this_card); - } - kfree(dev); - } - return res; + struct net_device *dev = alloc_trdev(sizeof(struct net_local)); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + dev->base_addr = io; + dev->irq = irq; + dev->dma = dma; + + err = sk_isa_probe1(dev, io); + if (err) + goto out; + + err = register_netdev(dev); + if (err) + goto out1; + return dev; + + out1: + release_region(dev->base_addr, SK_ISA_IO_EXTENT); + free_irq(dev->irq, dev); + free_dma(dev->dma); + tmsdev_term(dev); + out: + free_netdev(dev); + return ERR_PTR(err); } int init_module(void) { + struct net_device *dev; int i, num; num = 0; - if (io[0]) { /* Only probe addresses from command line */ - for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) { - if (io[i] && setup_card(io[i], irq[i], dma[i]) == 0) - num++; - } - } else { - for(i = 0; num < ISATR_MAX_ADAPTERS && portlist[i]; i++) { - if (setup_card(portlist[i], irq[num], dma[num]) == 0) - num++; + for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) { + if (io[0]) /* Only probe addresses from command line */ + dev = setup_card(io[i], irq[i], dma[i]); + else + dev = sk_isa_probe(-1); + if (!IS_ERR(dev)) { + sk_isa_dev[i] = dev; + ++num; } } + printk(KERN_NOTICE "skisa.c: %d cards found.\n", num); /* Probe for cards. */ if (num == 0) { @@ -438,11 +427,13 @@ void cleanup_module(void) { - struct net_device *dev; - struct sk_isa_card *this_card; + int i; + + for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) { + struct net_device *dev = sk_isa_dev[i]; - while (sk_isa_card_list) { - dev = sk_isa_card_list->dev; + if (!dev) + continue; unregister_netdev(dev); release_region(dev->base_addr, SK_ISA_IO_EXTENT); @@ -450,9 +441,6 @@ free_dma(dev->dma); tmsdev_term(dev); free_netdev(dev); - this_card = sk_isa_card_list; - sk_isa_card_list = this_card->next; - kfree(this_card); } } #endif /* MODULE */ From shemminger@osdl.org Wed Oct 15 13:48:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 13:48:56 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FKmN25004943 for ; Wed, 15 Oct 2003 13:48:23 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9FKmF811928; Wed, 15 Oct 2003 13:48:15 -0700 Date: Wed, 15 Oct 2003 13:48:15 -0700 From: Stephen Hemminger Message-Id: <200310152048.h9FKmF811928@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (5/6) ibmtr -- probe2 Cc: netdev@oss.sgi.com X-archive-position: 866 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 Content-Length: 7267 Lines: 264 Convert IBM ISA tokenring driver to new probing. Also, need to deal with the fact that the PCMCIA ibmtr_cs driver was calling the same probe routine. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Wed Oct 15 13:34:56 2003 +++ b/drivers/net/Space.c Wed Oct 15 13:34:56 2003 @@ -409,12 +409,15 @@ #ifdef CONFIG_TR /* Token-ring device probe */ -extern int ibmtr_probe(struct net_device *); +extern struct net_device *ibmtr_probe(int unit); extern struct net_device *sk_isa_probe(int unit); extern struct net_device *proteon_probe(int unit); extern struct net_device *smctr_probe(int unit); static struct devprobe2 tr_probes2[] __initdata = { +#ifdef CONFIG_IBMTR + {ibmtr_probe, 0}, +#endif #ifdef CONFIG_SKISA {sk_isa_probe, 0}, #endif @@ -439,9 +442,6 @@ sprintf(dev->name, "tr%d", unit); netdev_boot_setup_check(dev); if ( -#ifdef CONFIG_IBMTR - ibmtr_probe(dev) == 0 || -#endif 0 ) err = register_netdev(dev); diff -Nru a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c --- a/drivers/net/pcmcia/ibmtr_cs.c Wed Oct 15 13:34:56 2003 +++ b/drivers/net/pcmcia/ibmtr_cs.c Wed Oct 15 13:34:56 2003 @@ -125,18 +125,17 @@ static dev_link_t *dev_list; -extern int ibmtr_probe(struct net_device *dev); extern int trdev_init(struct net_device *dev); extern irqreturn_t tok_interrupt (int irq, void *dev_id, struct pt_regs *regs); /*====================================================================*/ typedef struct ibmtr_dev_t { + struct tok_info ti; /* must be first! */ dev_link_t link; struct net_device *dev; dev_node_t node; window_handle_t sram_win_handle; - struct tok_info ti; } ibmtr_dev_t; static void netdev_get_drvinfo(struct net_device *dev, @@ -149,6 +148,13 @@ .get_drvinfo = netdev_get_drvinfo, }; +static int ibmtr_init(struct net_device *dev) +{ + extern int ibmtr_probe1(struct net_device *, int); + + return ibmtr_probe1(dev, dev->base_addr); +} + /*====================================================================== ibmtr_attach() creates an "instance" of the driver, allocating @@ -194,7 +200,8 @@ link->irq.Instance = info->dev = dev; - dev->init = &ibmtr_probe; + dev->init = ibmtr_init; + SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); /* Register with Card Services */ diff -Nru a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c --- a/drivers/net/tokenring/ibmtr.c Wed Oct 15 13:34:56 2003 +++ b/drivers/net/tokenring/ibmtr.c Wed Oct 15 13:34:56 2003 @@ -187,8 +187,7 @@ #define TRC_INITV 0x02 /* verbose init trace points */ unsigned char ibmtr_debug_trace = 0; -int ibmtr_probe(struct net_device *dev); -static int ibmtr_probe1(struct net_device *dev, int ioaddr); +int ibmtr_probe1(struct net_device *dev, int ioaddr); static unsigned char get_sram_size(struct tok_info *adapt_info); static int trdev_init(struct net_device *dev); static int tok_open(struct net_device *dev); @@ -325,29 +324,57 @@ * which references it. ****************************************************************************/ -int __devinit ibmtr_probe(struct net_device *dev) +struct net_device * __devinit ibmtr_probe(int unit) { - int i; - int base_addr = dev->base_addr; + struct net_device *dev = alloc_trdev(sizeof(struct tok_info)); + const int *port; + int err = 0; - if (base_addr && base_addr <= 0x1ff) /* Don't probe at all. */ - return -ENXIO; - if (base_addr > 0x1ff) { /* Check a single specified location. */ - if (!ibmtr_probe1(dev, base_addr)) return 0; - return -ENODEV; + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) { + sprintf(dev->name, "tr%d", unit); + netdev_boot_setup_check(dev); } - find_turbo_adapters(ibmtr_portlist); - for (i = 0; ibmtr_portlist[i]; i++) { - int ioaddr = ibmtr_portlist[i]; - if (!ibmtr_probe1(dev, ioaddr)) return 0; + if (dev->base_addr > 0x1ff) /* Check a single specified location. */ + err = ibmtr_probe1(dev, dev->base_addr); + else if (dev->base_addr != 0) /* Don't probe at all. */ + err = -ENXIO; + else { + find_turbo_adapters(ibmtr_portlist); + for (port = ibmtr_portlist; *port; port++) { + err = ibmtr_probe1(dev, *port); + if (!err) + break; + } + } + if (err) + goto out; + + err = register_netdev(dev); + if (err) + goto out1; + + return 0; + out1: + release_region(dev->base_addr, IBMTR_IO_EXTENT); +#ifndef PCMCIA + { + struct tok_info *ti = dev->priv; + iounmap((u32 *)ti->mmio); + iounmap((u32 *)ti->sram_virt); } - return -ENODEV; +#endif + out: + free_netdev(dev); + return ERR_PTR(err); } /*****************************************************************************/ -static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) +int ibmtr_probe1(struct net_device *dev, int PIOaddr) { unsigned char segment, intr=0, irq=0, i, j, cardpresent=NOTOK, temp=0; @@ -1918,7 +1945,8 @@ static int __init ibmtr_init(void) { - int i; + struct net_device *dev; + int i, err; int count=0; find_turbo_adapters(io); @@ -1926,26 +1954,29 @@ for (i = 0; io[i] && (i < IBMTR_MAX_ADAPTERS); i++) { irq[i] = 0; mem[i] = 0; - dev_ibmtr[i] = alloc_trdev(sizeof(struct tok_info)); - if (dev_ibmtr[i] == NULL) { - if (i == 0) - return -ENOMEM; - break; - } - dev_ibmtr[i]->base_addr = io[i]; - dev_ibmtr[i]->irq = irq[i]; - dev_ibmtr[i]->mem_start = mem[i]; - dev_ibmtr[i]->init = &ibmtr_probe; - if (register_netdev(dev_ibmtr[i]) != 0) { - kfree(dev_ibmtr[i]); - dev_ibmtr[i] = NULL; + + dev = alloc_trdev(sizeof(struct tok_info)); + if (!dev) continue; + SET_MODULE_OWNER(dev); + + dev->irq = irq[i]; + dev->mem_start = mem[i]; + err = ibmtr_probe1(dev, io[i]); + if (err) { + free_netdev(dev); + continue; + } + err = register_netdev(dev); + if (err) { + printk("ibmtr: register_netdev() returned %d.\n", err); + break; } count++; + dev_ibmtr[i] = dev; } - if (count) return 0; - printk("ibmtr: register_netdev() returned non-zero.\n"); - return -EIO; + + return count ? 0 : -ENODEV; } module_init(ibmtr_init); @@ -1954,29 +1985,30 @@ int i; for (i = 0; i < IBMTR_MAX_ADAPTERS; i++){ - if (!dev_ibmtr[i]) + struct net_device *dev = dev_ibmtr[i]; + + if (!dev) continue; - if (dev_ibmtr[i]->base_addr) { - outb(0,dev_ibmtr[i]->base_addr+ADAPTRESET); + if (dev->base_addr) { + outb(0,dev->base_addr+ADAPTRESET); schedule_timeout(TR_RST_TIME); /* wait 50ms */ - outb(0,dev_ibmtr[i]->base_addr+ADAPTRESETREL); + outb(0,dev->base_addr+ADAPTRESETREL); } - unregister_netdev(dev_ibmtr[i]); - free_irq(dev_ibmtr[i]->irq, dev_ibmtr[i]); - release_region(dev_ibmtr[i]->base_addr, IBMTR_IO_EXTENT); + unregister_netdev(dev); + free_irq(dev->irq, dev); + release_region(dev->base_addr, IBMTR_IO_EXTENT); #ifndef PCMCIA { - struct tok_info *ti = (struct tok_info *) - dev_ibmtr[i]->priv; + struct tok_info *ti = dev->priv; iounmap((u32 *)ti->mmio); iounmap((u32 *)ti->sram_virt); } #endif - free_netdev(dev_ibmtr[i]); - dev_ibmtr[i] = NULL; + free_netdev(dev); + dev_ibmtr[i] = 0; } } module_exit(ibmtr_cleanup); From shemminger@osdl.org Wed Oct 15 13:48:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 13:49:00 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FKmQ25004946 for ; Wed, 15 Oct 2003 13:48:26 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9FKmKH11939; Wed, 15 Oct 2003 13:48:20 -0700 Date: Wed, 15 Oct 2003 13:48:20 -0700 From: Stephen Hemminger Message-Id: <200310152048.h9FKmKH11939@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (6/6) tokenring -- get rid of old probe Cc: netdev@oss.sgi.com X-archive-position: 867 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 Content-Length: 852 Lines: 43 Now that all the old drivers are gone from trif_probe, it can be deleted. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Oct 13 13:08:06 2003 +++ b/drivers/net/Space.c Mon Oct 13 13:08:06 2003 @@ -430,26 +430,6 @@ {NULL, 0}, }; -static __init int trif_probe(int unit) -{ - struct net_device *dev; - int err = -ENODEV; - - dev = alloc_trdev(0); - if (!dev) - return -ENOMEM; - - sprintf(dev->name, "tr%d", unit); - netdev_boot_setup_check(dev); - if ( - 0 ) - err = register_netdev(dev); - - if (err) - free_netdev(dev); - return err; - -} static void __init trif_probe2(int unit) { @@ -484,8 +464,7 @@ #endif #ifdef CONFIG_TR for (num = 0; num < 8; ++num) - if (!trif_probe(num)) - trif_probe2(num); + trif_probe2(num); #endif for (num = 0; num < 8; ++num) if (!ethif_probe(num)) From shemminger@osdl.org Wed Oct 15 13:48:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 13:48:47 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FKmE25004921 for ; Wed, 15 Oct 2003 13:48:14 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9FKm5511905; Wed, 15 Oct 2003 13:48:05 -0700 Date: Wed, 15 Oct 2003 13:48:05 -0700 From: Stephen Hemminger Message-Id: <200310152048.h9FKm5511905@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (3/6) proteon -- probe2 Cc: netdev@oss.sgi.com X-archive-position: 864 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 Content-Length: 7282 Lines: 303 Convert proteon token ring driver to new probing. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Oct 13 14:10:06 2003 +++ b/drivers/net/Space.c Mon Oct 13 14:10:06 2003 @@ -411,10 +411,13 @@ /* Token-ring device probe */ extern int ibmtr_probe(struct net_device *); extern int sk_isa_probe(struct net_device *); -extern int proteon_probe(struct net_device *); +extern struct net_device *proteon_probe(int unit); extern struct net_device *smctr_probe(int unit); static struct devprobe2 tr_probes2[] __initdata = { +#ifdef CONFIG_PROTEON + {proteon_probe, 0}, +#endif #ifdef CONFIG_SMCTR {smctr_probe, 0}, #endif @@ -438,9 +441,6 @@ #endif #ifdef CONFIG_SKISA sk_isa_probe(dev) == 0 || -#endif -#ifdef CONFIG_PROTEON - proteon_probe(dev) == 0 || #endif 0 ) err = register_netdev(dev); diff -Nru a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c --- a/drivers/net/tokenring/proteon.c Mon Oct 13 14:10:06 2003 +++ b/drivers/net/tokenring/proteon.c Mon Oct 13 14:10:06 2003 @@ -63,7 +63,7 @@ static char cardname[] = "Proteon 1392\0"; -int proteon_probe(struct net_device *dev); +struct net_device *proteon_probe(int unit); static int proteon_open(struct net_device *dev); static int proteon_close(struct net_device *dev); static void proteon_read_eeprom(struct net_device *dev); @@ -89,80 +89,69 @@ outw(val, dev->base_addr + reg); } -struct proteon_card { - struct net_device *dev; - struct proteon_card *next; -}; - -static struct proteon_card *proteon_card_list; - -static int __init proteon_probe1(int ioaddr) +static int __init proteon_probe1(struct net_device *dev, int ioaddr) { unsigned char chk1, chk2; int i; + if (!request_region(ioaddr, PROTEON_IO_EXTENT, cardname)) + return -ENODEV; + + chk1 = inb(ioaddr + 0x1f); /* Get Proteon ID reg 1 */ - if (chk1 != 0x1f) - return (-1); + if (chk1 != 0x1f) + goto nodev; + chk1 = inb(ioaddr + 0x1e) & 0x07; /* Get Proteon ID reg 0 */ for (i=0; i<16; i++) { chk2 = inb(ioaddr + 0x1e) & 0x07; if (((chk1 + 1) & 0x07) != chk2) - return (-1); + goto nodev; chk1 = chk2; } + + dev->base_addr = ioaddr; return (0); +nodev: + release_region(ioaddr, PROTEON_IO_EXTENT); + return -ENODEV; } -int __init proteon_probe(struct net_device *dev) +struct net_device * __init proteon_probe(int unit) { - static int versionprinted; + struct net_device *dev = alloc_trdev(sizeof(struct net_local)); struct net_local *tp; - int i,j; - struct proteon_card *card; - -#ifndef MODULE - netdev_boot_setup_check(dev); - tr_setup(dev); -#endif + static int versionprinted; + const unsigned *port; + int j,err = 0; - SET_MODULE_OWNER(dev); - if (!dev->base_addr) - { - for(i = 0; portlist[i]; i++) - { - if (!request_region(portlist[i], PROTEON_IO_EXTENT, cardname)) - continue; + if (!dev) + return ERR_PTR(-ENOMEM); - if(proteon_probe1(portlist[i])) - { - release_region(dev->base_addr, PROTEON_IO_EXTENT); - continue; - } + if (unit >= 0) { + sprintf(dev->name, "tr%d", unit); + netdev_boot_setup_check(dev); + } - dev->base_addr = portlist[i]; - break; + SET_MODULE_OWNER(dev); + if (dev->base_addr) /* probe specific location */ + err = proteon_probe1(dev, dev->base_addr); + else { + for (port = portlist; *port; port++) { + err = proteon_probe1(dev, *port); + if (!err) + break; } - if(!dev->base_addr) - return -1; } - else - { - if (!request_region(dev->base_addr, PROTEON_IO_EXTENT, cardname)) - return -1; - - if(proteon_probe1(dev->base_addr)) - { - release_region(dev->base_addr, PROTEON_IO_EXTENT); - return -1; - } - } + if (err) + goto out4; /* At this point we have found a valid card. */ if (versionprinted++ == 0) printk(KERN_DEBUG "%s", version); + err = -EIO; if (tmsdev_init(dev, ISA_MAX_ADDRESS, NULL)) goto out4; @@ -264,14 +253,11 @@ printk(KERN_DEBUG "%s: IO: %#4lx IRQ: %d DMA: %d\n", dev->name, dev->base_addr, dev->irq, dev->dma); - /* Enlist in the card list */ - card = kmalloc(sizeof(struct proteon_card), GFP_KERNEL); - if (!card) + err = register_netdev(dev); + if (err) goto out; - card->next = proteon_card_list; - proteon_card_list = card; - card->dev = dev; - return 0; + + return dev; out: free_dma(dev->dma); out2: @@ -280,7 +266,8 @@ tmsdev_term(dev); out4: release_region(dev->base_addr, PROTEON_IO_EXTENT); - return -1; + free_netdev(dev); + return ERR_PTR(err); } /* @@ -370,50 +357,50 @@ MODULE_PARM(irq, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i"); MODULE_PARM(dma, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i"); -static int __init setup_card(unsigned long io, unsigned irq, unsigned char dma) +static struct net_device *proteon_dev[ISATR_MAX_ADAPTERS]; + +static struct net_device * __init setup_card(unsigned long io, unsigned irq, unsigned char dma) { - int res = -ENOMEM; - struct proteon_card *this_card; - struct net_device *dev = alloc_trdev(0); - - if (dev) { - dev->base_addr = io; - dev->irq = irq; - dev->dma = dma; - res = -ENODEV; - if (proteon_probe(dev) == 0) { - res = register_netdev(dev); - if (!res) - return 0; - release_region(dev->base_addr, PROTEON_IO_EXTENT); - free_irq(dev->irq, dev); - free_dma(dev->dma); - tmsdev_term(dev); - this_card = proteon_card_list; - proteon_card_list = this_card->next; - kfree(this_card); - } - kfree(dev); - } - return res; + struct net_device *dev = alloc_trdev(sizeof(struct net_local)); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + dev->irq = irq; + dev->dma = dma; + err = proteon_probe1(dev, io); + if (err) + goto out; + + err = register_netdev(dev); + if (err) + goto out1; + return dev; + out1: + release_region(dev->base_addr, PROTEON_IO_EXTENT); + free_irq(dev->irq, dev); + free_dma(dev->dma); + tmsdev_term(dev); + out: + free_netdev(dev); + return ERR_PTR(err); } int init_module(void) { - int i, num; + struct net_device *dev; + int i, num = 0; - num = 0; - if (io[0]) { /* Only probe addresses from command line */ - for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) { - if (io[i] && setup_card(io[i], irq[i], dma[i]) == 0) - num++; - } - } else { - for(i = 0; num < ISATR_MAX_ADAPTERS && portlist[i]; i++) { - if (setup_card(portlist[i], irq[num], dma[num]) == 0) - num++; + for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) { + dev = io[0] ? setup_card(io[i], irq[i], dma[i]) + : proteon_probe(-1); + if (!IS_ERR(dev)) { + proteon_dev[i] = dev; + ++num; } } + printk(KERN_NOTICE "proteon.c: %d cards found.\n", num); /* Probe for cards. */ if (num == 0) { @@ -425,11 +412,13 @@ void cleanup_module(void) { - struct net_device *dev; - struct proteon_card *this_card; + int i; - while (proteon_card_list) { - dev = proteon_card_list->dev; + for (i = 0; i < ISATR_MAX_ADAPTERS ; i++) { + struct net_device *dev = proteon_dev[i]; + + if (!dev) + continue; unregister_netdev(dev); release_region(dev->base_addr, PROTEON_IO_EXTENT); @@ -437,9 +426,6 @@ free_dma(dev->dma); tmsdev_term(dev); free_netdev(dev); - this_card = proteon_card_list; - proteon_card_list = this_card->next; - kfree(this_card); } } #endif /* MODULE */ From shemminger@osdl.org Wed Oct 15 13:48:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 13:48:42 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FKm925004916 for ; Wed, 15 Oct 2003 13:48:09 -0700 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id h9FKm0911880; Wed, 15 Oct 2003 13:48:00 -0700 Date: Wed, 15 Oct 2003 13:48:00 -0700 From: Stephen Hemminger Message-Id: <200310152048.h9FKm0911880@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (2/6) smctr -- probe2 Cc: netdev@oss.sgi.com X-archive-position: 863 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 Content-Length: 8149 Lines: 309 Convert the SMC tokenring driver to new probing. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Wed Oct 15 13:33:05 2003 +++ b/drivers/net/Space.c Wed Oct 15 13:33:05 2003 @@ -412,9 +412,12 @@ extern int ibmtr_probe(struct net_device *); extern int sk_isa_probe(struct net_device *); extern int proteon_probe(struct net_device *); -extern int smctr_probe(struct net_device *); +extern struct net_device *smctr_probe(int unit); static struct devprobe2 tr_probes2[] __initdata = { +#ifdef CONFIG_SMCTR + {smctr_probe, 0}, +#endif {NULL, 0}, }; @@ -438,9 +441,6 @@ #endif #ifdef CONFIG_PROTEON proteon_probe(dev) == 0 || -#endif -#ifdef CONFIG_SMCTR - smctr_probe(dev) == 0 || #endif 0 ) err = register_netdev(dev); diff -Nru a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c --- a/drivers/net/tokenring/smctr.c Wed Oct 15 13:33:05 2003 +++ b/drivers/net/tokenring/smctr.c Wed Oct 15 13:33:05 2003 @@ -69,13 +69,6 @@ #define SMCTR_IO_EXTENT 20 -/* A zero-terminated list of I/O addresses to be probed. */ -static unsigned int smctr_portlist[] __initdata = { - 0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0, 0x300, - 0x320, 0x340, 0x360, 0x380, - 0 -}; - #ifdef CONFIG_MCA static unsigned int smctr_posid = 0x6ec6; #endif @@ -219,7 +212,7 @@ static int smctr_open_tr(struct net_device *dev); /* P */ -int __init smctr_probe (struct net_device *dev); +struct net_device *smctr_probe(int unit); static int __init smctr_probe1(struct net_device *dev, int ioaddr); static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, struct net_device *dev, __u16 rx_status); @@ -3583,71 +3576,72 @@ return (err); } -/* Check for a network adapter of this type, and return '0 if one exists. - * If dev->base_addr == 0, probe all likely locations. - * If dev->base_addr == 1, always return failure. +/* Check for a network adapter of this type, + * and return device structure if one exists. */ -int __init smctr_probe (struct net_device *dev) +struct net_device __init *smctr_probe(int unit) { - int i; - int base_addr; + struct net_device *dev = alloc_trdev(sizeof(struct net_local)); + static const unsigned ports[] = { + 0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0, 0x300, + 0x320, 0x340, 0x360, 0x380, 0 + }; + const unsigned *port; + int err = 0; -#ifndef MODULE - netdev_boot_setup_check(dev); - tr_setup(dev); -#endif + if (!dev) + return ERR_PTR(-ENOMEM); - base_addr = dev->base_addr; - if(base_addr > 0x1ff) /* Check a single specified location. */ - return (smctr_probe1(dev, base_addr)); - else if(base_addr != 0) /* Don't probe at all. */ - return (-ENXIO); + SET_MODULE_OWNER(dev); - for(i = 0; smctr_portlist[i]; i++) - { - int ioaddr = smctr_portlist[i]; - if (!smctr_probe1(dev, ioaddr)) - return (0); - } - - return (-ENODEV); -} + if (unit >= 0) { + sprintf(dev->name, "tr%d", unit); + netdev_boot_setup_check(dev); + } -static void cleanup_card(struct net_device *dev) -{ + if (dev->base_addr > 0x1ff) /* Check a single specified location. */ + err = smctr_probe1(dev, dev->base_addr); + else if(dev->base_addr != 0) /* Don't probe at all. */ + err =-ENXIO; + else { + for (port = ports; *port; port++) { + err = smctr_probe1(dev, *port); + if (!err) + break; + } + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: #ifdef CONFIG_MCA - struct net_local *tp = (struct net_local *)dev->priv; - if (tp->slot_num) + { struct net_local *tp = (struct net_local *)dev->priv; + if (tp->slot_num) mca_mark_as_unused(tp->slot_num); + } #endif release_region(dev->base_addr, SMCTR_IO_EXTENT); - if (dev->irq) - free_irq(dev->irq, dev); - if (dev->priv) - kfree(dev->priv); + free_irq(dev->irq, dev); +out: + free_netdev(dev); + return ERR_PTR(err); } + static int __init smctr_probe1(struct net_device *dev, int ioaddr) { static unsigned version_printed; - struct net_local *tp; + struct net_local *tp = dev->priv; int err; __u32 *ram; if(smctr_debug && version_printed++ == 0) printk(version); - /* Setup this devices private information structure */ - tp = (struct net_local *)kmalloc(sizeof(struct net_local), - GFP_KERNEL); - if(tp == NULL) { - err = -ENOMEM; - goto out; - } - memset(tp, 0, sizeof(struct net_local)); spin_lock_init(&tp->lock); - - dev->priv = tp; dev->base_addr = ioaddr; /* Actually detect an adapter now. */ @@ -3656,7 +3650,7 @@ { if ((err = smctr_chk_mca(dev)) < 0) { err = -ENODEV; - goto out_tp; + goto out; } } @@ -3671,7 +3665,6 @@ if(err != UCODE_PRESENT && err != SUCCESS) { printk(KERN_ERR "%s: Firmware load failed (%d)\n", dev->name, err); - cleanup_card(dev); err = -EIO; goto out; } @@ -3696,8 +3689,6 @@ dev->set_multicast_list = &smctr_set_multicast_list; return (0); -out_tp: - kfree(tp); out: return err; } @@ -5669,47 +5660,59 @@ static struct net_device* dev_smctr[SMCTR_MAX_ADAPTERS]; static int io[SMCTR_MAX_ADAPTERS]; static int irq[SMCTR_MAX_ADAPTERS]; -static int mem[SMCTR_MAX_ADAPTERS]; MODULE_LICENSE("GPL"); -MODULE_PARM(io, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i"); +MODULE_PARM(io, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i"); -MODULE_PARM(mem, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i"); -MODULE_PARM(ringspeed, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i"); +MODULE_PARM(ringspeed, "i"); + +static struct net_device *setup_card(int n) +{ + struct net_device *dev = alloc_trdev(sizeof(struct net_local)); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + dev->irq = irq[n]; + err = smctr_probe1(dev, io[n]); + if (err) + goto out; + + err = register_netdev(dev); + if (err) + goto out1; + return dev; + out1: +#ifdef CONFIG_MCA + { struct net_local *tp = (struct net_local *)dev->priv; + if (tp->slot_num) + mca_mark_as_unused(tp->slot_num); + } +#endif + release_region(dev->base_addr, SMCTR_IO_EXTENT); + free_irq(dev->irq, dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} + int init_module(void) { - int i; + int i, found = 0; + struct net_device *dev; for(i = 0; i < SMCTR_MAX_ADAPTERS; i++) { - struct net_device *dev = alloc_trdev(0); - irq[i] = 0; - mem[i] = 0; - if (!dev) - return -ENOMEM; - dev->base_addr = io[i]; - dev->irq = irq[i]; - dev->mem_start = mem[i]; - - if (smctr_probe(dev) != 0) { - kfree(dev); - if (i == 0) { - printk(KERN_ERR "%s: smctr_probe failed.\n", - cardname); - return -EIO; - } - return 0; - } - if (register_netdev(dev) != 0) { - cleanup_card(dev); - kfree(dev); - continue; - } - dev_smctr[i] = dev; + dev = io[0]? setup_card(i) : smctr_probe(-1); + if (!IS_ERR(dev)) { + ++found; + dev_smctr[i] = dev; + } } - return (0); + return found ? 0 : -ENODEV; } void cleanup_module(void) @@ -5718,9 +5721,20 @@ for(i = 0; i < SMCTR_MAX_ADAPTERS; i++) { struct net_device *dev = dev_smctr[i]; + if (dev) { + unregister_netdev(dev); - cleanup_card(dev); +#ifdef CONFIG_MCA + { struct net_local *tp = dev->priv; + if (tp->slot_num) + mca_mark_as_unused(tp->slot_num); + } +#endif + release_region(dev->base_addr, SMCTR_IO_EXTENT); + if (dev->irq) + free_irq(dev->irq, dev); + free_netdev(dev); } } From shemminger@osdl.org Wed Oct 15 13:53:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 13:53:55 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FKrM25007029 for ; Wed, 15 Oct 2003 13:53:22 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9FKrGo13126; Wed, 15 Oct 2003 13:53:16 -0700 Date: Wed, 15 Oct 2003 13:53:03 -0700 From: Stephen Hemminger To: jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (1/6) tokenring probing change Message-Id: <20031015135303.705974a4.shemminger@osdl.org> In-Reply-To: <200310152047.h9FKltw11805@mail.osdl.org> References: <200310152047.h9FKltw11805@mail.osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 868 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 Content-Length: 1200 Lines: 48 Ugh, two patches got crossed. This is the correct first one. ------------------------------------------------------------------- Convert ISA token ring drivers to the new probe2 infrastructure that allows driver to allocate network device in the same way for both modular and non-modular cases. This applies against net-2.5-exp diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Fri Oct 10 11:27:32 2003 +++ b/drivers/net/Space.c Fri Oct 10 11:27:32 2003 @@ -414,6 +414,10 @@ extern int proteon_probe(struct net_device *); extern int smctr_probe(struct net_device *); +static struct devprobe2 tr_probes2[] __initdata = { + {NULL, 0}, +}; + static __init int trif_probe(int unit) { struct net_device *dev; @@ -446,6 +450,15 @@ return err; } + +static void __init trif_probe2(int unit) +{ + unsigned long base_addr = netdev_boot_base("tr", unit); + + if (base_addr == 1) + return; + probe_list2(unit, tr_probes2, base_addr == 0); +} #endif @@ -471,7 +484,8 @@ #endif #ifdef CONFIG_TR for (num = 0; num < 8; ++num) - trif_probe(num); + if (!trif_probe(num)) + trif_probe2(num); #endif for (num = 0; num < 8; ++num) if (!ethif_probe(num)) From jgarzik@pobox.com Wed Oct 15 14:22:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 14:23:26 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9FLMm25008311 for ; Wed, 15 Oct 2003 14:22:49 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:37580 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9rkX-0004oX-MB; Wed, 15 Oct 2003 20:56:01 +0100 Message-ID: <3F8DA644.50403@pobox.com> Date: Wed, 15 Oct 2003 15:55:48 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Greg KH CC: Matthew Wilcox , Linus Torvalds , "David S. Miller" , linux-pci@atrey.karlin.mff.cuni.cz, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pci_get_slot() References: <20031015183213.GG16535@parcelfarce.linux.theplanet.co.uk> <20031015184104.GA22373@kroah.com> <20031015185053.GH16535@parcelfarce.linux.theplanet.co.uk> <20031015193455.GA23727@kroah.com> In-Reply-To: <20031015193455.GA23727@kroah.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 869 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: 587 Lines: 20 Greg KH wrote: > On Wed, Oct 15, 2003 at 07:50:53PM +0100, Matthew Wilcox wrote: >>The only real way to do it is to inline pci_get_slot() into tg3. Since I >>also have a need for it in sym2, that doesn't seem like a sensible idea. >>It would also be racy since it wouldn't take the pci_bus_lock. > > > Ok, fair enough. I'll add it to my tree to be sent to Linus after 2.6.0 > is out, if Jeff and David agree it's an ok tg3.c patch. I'm OK with it... I guess we'll be shipping tg3 and sym2 known-broken on PCI domain boxes? Admittedly it's an uncommon case for tg3... Jeff From davem@pizda.ninka.net Wed Oct 15 20:51:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 20:52:00 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9G3pO25021411 for ; Wed, 15 Oct 2003 20:51:24 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA02460; Wed, 15 Oct 2003 20:47:05 -0700 Date: Wed, 15 Oct 2003 20:47:04 -0700 From: "David S. Miller" To: Petr Vandrovec Cc: netdev@oss.sgi.com Subject: Re: [PATCH?] Fix sniffing of ARP replies Message-Id: <20031015204704.06637fbe.davem@redhat.com> In-Reply-To: <20031015171112.GA2469@vana.vc.cvut.cz> References: <20031015171112.GA2469@vana.vc.cvut.cz> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 870 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: 548 Lines: 15 On Wed, 15 Oct 2003 19:11:12 +0200 Petr Vandrovec wrote: > after recent changes in packet_type interface I stopped setting > af_packet_priv - as you told that it is only for AF_PACKET, for nobody > else. And - things stopped working. "Where" did you stop doing this? Nothing in the current kernel should be broken at all by said changes I did to 2.6.x If it has broken something you are working on external to the tree you have to say what it is. I can only guess that it's making assumptions that never truly existed. From davem@pizda.ninka.net Wed Oct 15 21:43:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 21:43:44 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9G4h325023082 for ; Wed, 15 Oct 2003 21:43:03 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id VAA02593; Wed, 15 Oct 2003 21:38:40 -0700 Date: Wed, 15 Oct 2003 21:38:40 -0700 From: "David S. Miller" To: David Stevens Cc: pekkas@netcore.fi, r.venning@telstra.com, nate@thebog.net, netdev@oss.sgi.com Subject: Re: 6to4/SIT and IP DF Message-Id: <20031015213840.4f1f809e.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 871 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: 1309 Lines: 32 On Wed, 15 Oct 2003 00:15:21 -0700 David Stevens wrote: > I'm concerned that with DF set, as it is now, every packet in that > range would be dropped, if the IPv4 Frag-Needed-But-DF-Set (FNBDFS :-)) > does not include enough v6 header & payload to identify the v6 sender. Who cares? The PMTU as seen by the SIT tunnel is apsect of the IPV4 path not the IPV6 one. IPV6 is merely communicating over a device having a particular MTU. When the ipv4 ICMP arrives, the IPV4 route to the other end of the SIT tunnel is updated as appropriate. (this is what the comment in sit.c saying "Soft state for pmtu is maintained by IP core." is talking about) After this, the next time something is attempted to be sent over the SIT tunnel, we'll see the updated PMTU for the ipv4 route to the SIT tunnel destination and act accordingly. If the IPV6 packet is too big for this new IPV4 PMTU, the SIT driver will emit an ICMPV6_PKT_TOOBIG icmp6 message back to the ipv6 packet's origin. It's this piece of code in sit.c:ipip6_tunnel_xmit(): if (skb->len > mtu) { icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, dev); ip_rt_put(rt); goto tx_error; } In short I think all of the cases you're mentioning are taken care of just fine. From davem@pizda.ninka.net Wed Oct 15 22:14:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 22:15:15 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9G5Ef25024135 for ; Wed, 15 Oct 2003 22:14:41 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA02674; Wed, 15 Oct 2003 22:10:20 -0700 Date: Wed, 15 Oct 2003 22:10:20 -0700 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: Re: [PATCH] fixing the cases where tcp_tw_bucket was accessed as a sock Message-Id: <20031015221020.098f9779.davem@redhat.com> In-Reply-To: <20031015113648.GD1174@conectiva.com.br> References: <20031012131344.GH16182@conectiva.com.br> <20031013124930.0e75a325.davem@redhat.com> <20031015113648.GD1174@conectiva.com.br> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 872 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: 447 Lines: 14 On Wed, 15 Oct 2003 08:36:48 -0300 Arnaldo Carvalho de Melo wrote: > Em Mon, Oct 13, 2003 at 12:49:30PM -0700, David S. Miller escreveu: > > Let's do one thing at a time. First, fix the original bug > > in tcp_ipv4.c by just putting your inet_rcv_saddr() shorthand > > right there in tcp_ipv4.c and name it tcp4_rcv_saddr() or > > something like that. ... > :) Here is the first part: Perfect, patch applied. Thanks. From dlstevens@us.ibm.com Wed Oct 15 22:21:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 22:22:21 -0700 (PDT) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9G5Ll25024651 for ; Wed, 15 Oct 2003 22:21:48 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9G5Lf1K386300; Thu, 16 Oct 2003 01:21:41 -0400 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9G5LeHd152348; Wed, 15 Oct 2003 23:21:41 -0600 Importance: Normal Sensitivity: Subject: Re: 6to4/SIT and IP DF To: "David S. Miller" Cc: pekkas@netcore.fi, r.venning@telstra.com, nate@thebog.net, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Wed, 15 Oct 2003 22:21:37 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 10/15/2003 23:21:41 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 873 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 684 Lines: 23 That doesn't sound terrible, but won't it have to drop a minimum of 2 packets per tunnel on an MTU change (or initial probe with a large packet)? So, it wouldn't be a good idea to connect multiple v6 clouds in series, with 6to4 tunnels between them and decreasing MTU's and then try to send a large packet from one end to the other; you might run out of retransmits before you get to the other end. :-) But using v4 PMTU info is probably almost always better than fragmenting everything. A "fragment, but tell me about it" ICMP message would come in handy here. And a requirement that ICMPv4 with tunnels include encapsulated headers +8. Thanks, Dave, +-DLS From davem@pizda.ninka.net Wed Oct 15 22:31:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 22:32:04 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9G5VV25025213 for ; Wed, 15 Oct 2003 22:31:31 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA02726; Wed, 15 Oct 2003 22:27:12 -0700 Date: Wed, 15 Oct 2003 22:27:12 -0700 From: "David S. Miller" To: David Stevens Cc: pekkas@netcore.fi, r.venning@telstra.com, nate@thebog.net, netdev@oss.sgi.com Subject: Re: 6to4/SIT and IP DF Message-Id: <20031015222712.18d1434f.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 874 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: 710 Lines: 17 On Wed, 15 Oct 2003 22:21:37 -0700 David Stevens wrote: > That doesn't sound terrible, but won't it have to drop a minimum of > 2 packets per tunnel on an MTU change (or initial probe with a large > packet)? Welcome to the real world where most routers don't quote enough information. :) What we do is the only sane way to handle this problem. All of our ipv4 tunnels work this way due to that quoting size issue. The "fragment but tell me about it" isn't such a great idea. You'll run into all kinds of difficult decisions about behavior in the cases where a too-big packet overruns multiple hops on the path. This is why the original implementors didn't put this into the RFCs. From davem@pizda.ninka.net Wed Oct 15 22:37:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 22:38:10 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9G5ba25025739 for ; Wed, 15 Oct 2003 22:37:36 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA02765; Wed, 15 Oct 2003 22:33:18 -0700 Date: Wed, 15 Oct 2003 22:33:18 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] init_netdev missing locking Message-Id: <20031015223318.597494ed.davem@redhat.com> In-Reply-To: <20031015110520.0206e327.rddunlap@osdl.org> References: <20031015110520.0206e327.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 875 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: 537 Lines: 14 On Wed, 15 Oct 2003 11:05:20 -0700 "Randy.Dunlap" wrote: > It looks like the call to dev_alloc_name() in init_netdev() > isn't protected by the required locking. > This patch adds rtnl_lock/unlock around the call to dev_alloc_name(). > > Comments? or please apply. Your fix is correct, so I've applied it. Stephen is working to deprecate the one thing that uses this function (init_etherdev()). Please in the future properly root your patch, I had to fix this one up before my automated scripts would eat it :) From davem@pizda.ninka.net Wed Oct 15 22:42:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 15 Oct 2003 22:42:35 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9G5g125026200 for ; Wed, 15 Oct 2003 22:42:01 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA02800; Wed, 15 Oct 2003 22:37:34 -0700 Date: Wed, 15 Oct 2003 22:37:33 -0700 From: "David S. Miller" To: Shirley Ma Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable Message-Id: <20031015223733.5483da9d.davem@redhat.com> In-Reply-To: <200310141038.04322.mashirle@us.ibm.com> References: <20031008130016.559b8047.davem@redhat.com> <200310081706.09485.mashirle@us.ibm.com> <200310141038.04322.mashirle@us.ibm.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 876 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: 370 Lines: 12 On Tue, 14 Oct 2003 10:38:04 -0700 Shirley Ma wrote: > This is the modified new patch for IPv6 MIB: ipv6AddressTable. > This patch has been tested against linux-2.6.0-test6-bk8 kernel. Please configure KMAIL so that it doesn't corrupt the patches you send by auto-wrapping newlines. I can't use the patch you've posted because of this. Thanks. From jgarzik@pobox.com Thu Oct 16 00:28:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 00:29:15 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9G7Sd25031861 for ; Thu, 16 Oct 2003 00:28:40 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36383 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9TfX-000586-A5; Tue, 14 Oct 2003 19:13:15 +0100 Message-ID: <3F8C3CB0.9090502@pobox.com> Date: Tue, 14 Oct 2003 14:13:04 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andi Kleen CC: netdev@oss.sgi.com Subject: Re: [PATCH] Fix 64bit warnings in rtl8139too References: <20031007175638.GA1754@averell> In-Reply-To: <20031007175638.GA1754@averell> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 877 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: 660 Lines: 23 Andi Kleen wrote: > Fix a harmless 64bit pointer/integer mismatch warning in 8139too. > > diff -u linux-2.5-cleanup/drivers/net/8139too.c-o linux-2.5-cleanup/drivers/net/8139too.c > --- linux-2.5-cleanup/drivers/net/8139too.c-o 2003-09-08 00:02:03.000000000 +0200 > +++ linux-2.5-cleanup/drivers/net/8139too.c 2003-12-02 17:13:24.634752560 +0100 > @@ -746,7 +746,8 @@ > u8 tmp8; > int rc; > unsigned int i; > - u32 pio_start, pio_end, pio_flags, pio_len; > + unsigned long pio_start; > + u32 pio_end, pio_flags, pio_len; > unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; > u32 version; Why not just make this look like mmio_*? Jeff From VANDROVE@vc.cvut.cz Thu Oct 16 03:07:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 03:08:13 -0700 (PDT) Received: from mailgw.cvut.cz (mailgw.cvut.cz [147.32.3.235]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GA7a25008922 for ; Thu, 16 Oct 2003 03:07:37 -0700 Received: from mailgw.cvut.cz (localhost [127.0.0.1]) by mailgw.cvut.cz (Postfix) with SMTP id 7878413B624; Thu, 16 Oct 2003 12:07:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mailgw.cvut.cz (Postfix) with ESMTP id 51B6513B784; Thu, 16 Oct 2003 12:07:35 +0200 (CEST) Received: from mailgw.cvut.cz ([127.0.0.1]) by localhost (mailgw [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 17266-01-67; Thu, 16 Oct 2003 12:07:34 +0200 (CEST) Received: from vcnet.vc.cvut.cz (vcnet.vc.cvut.cz [147.32.240.61]) by mailgw.cvut.cz (Postfix) with ESMTP id 1E5FD13B624; Thu, 16 Oct 2003 12:07:34 +0200 (CEST) Received: from VCNET/SpoolDir by vcnet.vc.cvut.cz (Mercury 1.48); 16 Oct 03 12:07:37 +0200 Received: from SpoolDir by VCNET (Mercury 1.48); 16 Oct 03 12:07:32 +0200 From: "Petr Vandrovec" Organization: CC CTU Prague To: "David S. Miller" Date: Thu, 16 Oct 2003 12:07:23 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: [PATCH?] Fix sniffing of ARP replies Cc: netdev@oss.sgi.com Priority: normal X-mailer: Pegasus Mail v3.50 Message-ID: <32A9D366A0B@vcnet.vc.cvut.cz> X-archive-position: 878 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: VANDROVE@vc.cvut.cz Precedence: bulk X-list: netdev Content-Length: 1656 Lines: 36 On 15 Oct 03 at 20:47, David S. Miller wrote: > On Wed, 15 Oct 2003 19:11:12 +0200 > Petr Vandrovec wrote: > > > after recent changes in packet_type interface I stopped setting > > af_packet_priv - as you told that it is only for AF_PACKET, for nobody > > else. And - things stopped working. > > "Where" did you stop doing this? vmnet. http://platan.vc.cvut.cz/ftp/pub/vmware/vmware-any-any-update42.tar.gz, vmnet.tar -> bridge.c. > Nothing in the current kernel should be broken at all by said > changes I did to 2.6.x > > If it has broken something you are working on external to the tree > you have to say what it is. I can only guess that it's making > assumptions that never truly existed. It behaves same way it behaved. But recently you renamed packet_type.data to packet_type.af_packet_priv, saying that af_packet_priv should be used only by AF_PACKET code, by nobody else. So I trusted you, removed packet_type.data (and packet_type.af_packet_priv) references from the code - and things stopped working, as with af_packet_priv==NULL ARP replies are not delivered to the registered packet_type callback, as these packets match skb->sk == pt->af_packet_priv for af_packet_priv == NULL. I can of course set 'af_packet_priv' to some non-NULL value - but in such case I do not understand why you renamed it, if semantic is same as it was before. Best regards, Petr Vandrovec vandrove@vc.cvut.cz From chas@cmf.nrl.navy.mil Thu Oct 16 04:22:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 04:23:16 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GBMf25014037 for ; Thu, 16 Oct 2003 04:22:42 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9GBMWkT010658; Thu, 16 Oct 2003 07:22:33 -0400 (EDT) Message-Id: <200310161122.h9GBMWkT010658@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: change ifdef inlanai_ioctl Reply-To: chas3@users.sourceforge.net Date: Thu, 16 Oct 2003 07:22:33 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 880 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1344 Lines: 45 please apply to 2.6 --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1442 -> 1.1443 # drivers/atm/lanai.c 1.31 -> 1.32 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/13 chas@relax.cmf.nrl.navy.mil 1.1443 # [ATM]: change ifdef in lanai_ioctl # -------------------------------------------- # diff -Nru a/drivers/atm/lanai.c b/drivers/atm/lanai.c --- a/drivers/atm/lanai.c Wed Oct 15 14:49:49 2003 +++ b/drivers/atm/lanai.c Wed Oct 15 14:49:49 2003 @@ -2432,11 +2432,11 @@ return result; } +#if 0 /* ioctl operations for card */ /* NOTE: these are all DEBUGGING ONLY currently */ static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void *arg) { -#if 0 int result = 0; struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data; switch(cmd) { @@ -2514,11 +2514,10 @@ result = -ENOIOCTLCMD; } return result; +} #else /* !0 */ - (void) atmdev; (void) cmd; (void) arg; /* no compiler warnings */ - return -ENOIOCTLCMD; +#define lanai_ioctl NULL #endif /* 0 */ -} static int lanai_send(struct atm_vcc *atmvcc, struct sk_buff *skb) { From chas@cmf.nrl.navy.mil Thu Oct 16 04:22:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 04:22:38 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GBLh25014002 for ; Thu, 16 Oct 2003 04:22:03 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9GBLckT010649; Thu, 16 Oct 2003 07:21:39 -0400 (EDT) Message-Id: <200310161121.h9GBLckT010649@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: sdh should be off by default Reply-To: chas3@users.sourceforge.net Date: Thu, 16 Oct 2003 07:21:39 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 879 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1280 Lines: 40 please apply to 2.6 --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1441 -> 1.1442 # drivers/atm/he.c 1.29 -> 1.30 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/10 chas@relax.cmf.nrl.navy.mil 1.1442 # [ATM]: sdh should be off by default # -------------------------------------------- # diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c Wed Oct 15 14:49:01 2003 +++ b/drivers/atm/he.c Wed Oct 15 14:49:01 2003 @@ -158,7 +158,7 @@ static short nvcibits = -1; static short rx_skb_reserve = 16; static short irq_coalesce = 1; -static short sdh = 1; +static short sdh = 0; static struct atmdev_ops he_ops = { @@ -1556,11 +1556,10 @@ if (sdh) { /* this really should be in suni.c but for now... */ - int val; val = he_phy_get(he_dev->atm_dev, SUNI_TPOP_APM); - val = (val & ~SUNI_TPOP_APM_S) | ( 0x2 << SUNI_TPOP_APM_S_SHIFT); + val = (val & ~SUNI_TPOP_APM_S) | (SUNI_TPOP_S_SDH << SUNI_TPOP_APM_S_SHIFT); he_phy_put(he_dev->atm_dev, val, SUNI_TPOP_APM); } From chas@cmf.nrl.navy.mil Thu Oct 16 04:23:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 04:24:38 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GBNw25014803 for ; Thu, 16 Oct 2003 04:23:59 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9GBNskT010685; Thu, 16 Oct 2003 07:23:54 -0400 (EDT) Message-Id: <200310161123.h9GBNskT010685@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: remove vcc reference on outstanding skbs (from ulrich.u.muller@nokia.com) Reply-To: chas3@users.sourceforge.net Date: Thu, 16 Oct 2003 07:23:55 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 881 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1810 Lines: 56 please apply to 2.6 --thanks [note, this isnt the right way to fix this problem but the real fix is a bit off in the future.] # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1439 -> 1.1440 # drivers/atm/nicstar.c 1.23 -> 1.24 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/10 chas@relax.cmf.nrl.navy.mil 1.1440 # [ATM]: remove vcc reference on outstanding skbs (from ulrich.u.muller@nokia.com) # -------------------------------------------- # diff -Nru a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c --- a/drivers/atm/nicstar.c Wed Oct 15 14:49:23 2003 +++ b/drivers/atm/nicstar.c Wed Oct 15 14:49:23 2003 @@ -1676,6 +1676,25 @@ free_scq(vc->scq, vcc); } + /* remove all references to vcc before deleting it */ + if (vcc->qos.txtp.traffic_class != ATM_NONE) + { + unsigned long flags; + scq_info *scq = card->scq0; + + ns_grab_scq_lock(card, scq, flags); + + for(i = 0; i < scq->num_entries; i++) { + if(scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) { + ATM_SKB(scq->skb[i])->vcc = NULL; + atm_return(vcc, scq->skb[i]->truesize); + PRINTK("nicstar: deleted pending vcc mapping\n"); + } + } + + spin_unlock_irqrestore(&scq->lock, flags); + } + vcc->dev_data = NULL; clear_bit(ATM_VF_PARTIAL,&vcc->flags); clear_bit(ATM_VF_ADDR,&vcc->flags); @@ -2074,7 +2093,7 @@ if (skb != NULL) { vcc = ATM_SKB(skb)->vcc; - if (vcc->pop != NULL) { + if (vcc && vcc->pop != NULL) { vcc->pop(vcc, skb); } else { dev_kfree_skb_irq(skb); From chas@cmf.nrl.navy.mil Thu Oct 16 04:25:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 04:26:10 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GBPZ25015595 for ; Thu, 16 Oct 2003 04:25:36 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h9GBPVkT010703; Thu, 16 Oct 2003 07:25:31 -0400 (EDT) Message-Id: <200310161125.h9GBPVkT010703@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: minor cleanup for vcc_hash conversion Reply-To: chas3@users.sourceforge.net Date: Thu, 16 Oct 2003 07:25:32 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 882 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 2136 Lines: 56 please apply to 2.6 --thanks the original patch i sent printed the bucket index but normal users shouldnt be bothered with this. further, i let an used variable in fore200e.c after conversion. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1437 -> 1.1438 # net/atm/proc.c 1.35 -> 1.36 # drivers/atm/fore200e.c 1.27 -> 1.28 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/09 chas@relax.cmf.nrl.navy.mil 1.1438 # [ATM]: minor cleanup for vcc_hash conversion # -------------------------------------------- # diff -Nru a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c --- a/drivers/atm/fore200e.c Wed Oct 15 14:50:27 2003 +++ b/drivers/atm/fore200e.c Wed Oct 15 14:50:27 2003 @@ -1071,7 +1071,6 @@ struct sock *s; struct atm_vcc* vcc; struct hlist_node *node; - int i; read_lock(&vcc_sklist_lock); diff -Nru a/net/atm/proc.c b/net/atm/proc.c --- a/net/atm/proc.c Wed Oct 15 14:50:27 2003 +++ b/net/atm/proc.c Wed Oct 15 14:50:27 2003 @@ -219,10 +219,10 @@ default: seq_printf(seq, "%3d", vcc->sk->sk_family); } - seq_printf(seq, " %04lx %5d %7d/%7d %7d/%7d [%d] 0x%x\n", vcc->flags, vcc->sk->sk_err, + seq_printf(seq, " %04lx %5d %7d/%7d %7d/%7d [%d]\n", vcc->flags, vcc->sk->sk_err, atomic_read(&vcc->sk->sk_wmem_alloc),vcc->sk->sk_sndbuf, atomic_read(&vcc->sk->sk_rmem_alloc),vcc->sk->sk_rcvbuf, - atomic_read(&vcc->sk->sk_refcnt), vcc->sk->sk_hashent); + atomic_read(&vcc->sk->sk_refcnt)); } static void svc_info(struct seq_file *seq, struct atm_vcc *vcc) @@ -320,7 +320,7 @@ if (v == (void *)1) { seq_printf(seq, sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s", "Address ", "Itf VPI VCI Fam Flags Reply " - "Send buffer Recv buffer\n"); + "Send buffer Recv buffer [refcnt]\n"); } else { struct vcc_state *state = seq->private; struct atm_vcc *vcc = atm_sk(state->sk); From mashirle@us.ibm.com Thu Oct 16 09:57:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 09:57:58 -0700 (PDT) Received: from linux2.suntekindustrial.com (wbar1.sjo1-4-4-004-065.sjo1.dsl-verizon.net [4.4.4.65]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GGvG25028168 for ; Thu, 16 Oct 2003 09:57:23 -0700 Received: from ibm-mxl (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated bits=0) by linux2.suntekindustrial.com (8.12.8/8.12.8) with ESMTP id h9GH9Fo7031247; Thu, 16 Oct 2003 10:09:16 -0700 From: Shirley Ma Organization: IBM Linux To: "David S. Miller" Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable Date: Thu, 16 Oct 2003 09:56:58 -0700 User-Agent: KMail/1.4.3 Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org References: <200310141038.04322.mashirle@us.ibm.com> <20031015223733.5483da9d.davem@redhat.com> In-Reply-To: <20031015223733.5483da9d.davem@redhat.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="------------Boundary-00=_YE0V4W20V8OD49K590AB" Message-Id: <200310160956.58462.mashirle@us.ibm.com> X-archive-position: 883 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 10196 Lines: 327 --------------Boundary-00=_YE0V4W20V8OD49K590AB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > I can't use the patch you've posted because of this. I am very sorry for wasting your time. In case of other mistake, I am giv= ing=20 you an attachment this time. I will fix my KMAIL later. Thanks Shirley Ma IBM Linux Technology Center --------------Boundary-00=_YE0V4W20V8OD49K590AB Content-Type: text/x-diff; charset="iso-8859-1"; name="ipv6mib4-2.6.0-test6-bk8.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ipv6mib4-2.6.0-test6-bk8.patch" diff -urN linux-2.6.0-test6/include/linux/rtnetlink.h linux-2.6.0-test6-ipv6mib4/include/linux/rtnetlink.h --- linux-2.6.0-test6/include/linux/rtnetlink.h 2003-09-27 17:50:40.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/include/linux/rtnetlink.h 2003-10-08 00:15:38.000000000 -0700 @@ -352,8 +352,10 @@ struct ifa_cacheinfo { - __s32 ifa_prefered; - __s32 ifa_valid; + __u32 ifa_prefered; + __u32 ifa_valid; + __u32 cstamp; /* created timestamp, hundredths of seconds */ + __u32 tstamp; /* updated timestamp, hundredths of seconds */ }; diff -urN linux-2.6.0-test6/include/net/if_inet6.h linux-2.6.0-test6-ipv6mib4/include/net/if_inet6.h --- linux-2.6.0-test6/include/net/if_inet6.h 2003-09-27 17:51:07.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/include/net/if_inet6.h 2003-10-08 00:15:38.000000000 -0700 @@ -34,7 +34,8 @@ __u32 valid_lft; __u32 prefered_lft; - unsigned long tstamp; + unsigned long cstamp; /* created timestamp */ + unsigned long tstamp; /* updated timestamp */ atomic_t refcnt; spinlock_t lock; @@ -111,6 +112,8 @@ atomic_t mca_refcnt; spinlock_t mca_lock; unsigned char mca_crcount; + unsigned long mca_cstamp; + unsigned long mca_tstamp; }; /* Anycast stuff */ @@ -130,6 +133,8 @@ int aca_users; atomic_t aca_refcnt; spinlock_t aca_lock; + unsigned long aca_cstamp; + unsigned long aca_tstamp; }; #define IFA_HOST IPV6_ADDR_LOOPBACK diff -urN linux-2.6.0-test6/net/ipv6/addrconf.c linux-2.6.0-test6-ipv6mib4/net/ipv6/addrconf.c --- linux-2.6.0-test6/net/ipv6/addrconf.c 2003-09-27 17:51:02.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/addrconf.c 2003-10-09 12:28:54.000000000 -0700 @@ -92,6 +92,9 @@ #define ADBG(x) #endif +#define INFINITY_LIFE_TIME 0xFFFFFFFF +#define TIME_DELTA(a,b) ((unsigned long)((long)(a) - (long)(b))) + #ifdef CONFIG_SYSCTL static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p); static void addrconf_sysctl_unregister(struct ipv6_devconf *p); @@ -505,6 +508,7 @@ ifa->scope = scope; ifa->prefix_len = pfxlen; ifa->flags = flags | IFA_F_TENTATIVE; + ifa->cstamp = ifa->tstamp = jiffies; read_lock(&addrconf_lock); if (idev->dead) { @@ -707,6 +711,7 @@ ift->ifpub = ifp; ift->valid_lft = tmp_valid_lft; ift->prefered_lft = tmp_prefered_lft; + ift->cstamp = ifp->cstamp; ift->tstamp = ifp->tstamp; spin_unlock_bh(&ift->lock); addrconf_dad_start(ift, 0); @@ -1412,6 +1417,7 @@ } update_lft = create = 1; + ifp->cstamp = jiffies; addrconf_dad_start(ifp, RTF_ADDRCONF|RTF_PREFIX_RT); } @@ -2447,14 +2453,95 @@ if (!(ifa->flags&IFA_F_PERMANENT)) { ci.ifa_prefered = ifa->prefered_lft; ci.ifa_valid = ifa->valid_lft; - if (ci.ifa_prefered != 0xFFFFFFFF) { + if (ci.ifa_prefered != INFINITY_LIFE_TIME) { long tval = (jiffies - ifa->tstamp)/HZ; ci.ifa_prefered -= tval; - if (ci.ifa_valid != 0xFFFFFFFF) + if (ci.ifa_valid != INFINITY_LIFE_TIME) ci.ifa_valid -= tval; } - RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + } else { + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; } + ci.cstamp = (__u32)(TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) / HZ * 100 + + TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); + ci.tstamp = (__u32)(TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) / HZ * 100 + + TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifmca->mca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifmca->idev->dev->ifindex; + RTA_PUT(skb, IFA_ADDRESS, 16, &ifmca->mca_addr); + ci.cstamp = (__u32)(TIME_DELTA(ifmca->mca_cstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifmca->mca_cstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.tstamp = (__u32)(TIME_DELTA(ifmca->mca_tstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifmca->mca_tstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifacaddr(struct sk_buff *skb, struct ifacaddr6 *ifaca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifaca->aca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifaca->aca_idev->dev->ifindex; + RTA_PUT(skb, IFA_ADDRESS, 16, &ifaca->aca_addr); + ci.cstamp = (__u32)(TIME_DELTA(ifaca->aca_cstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifaca->aca_cstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.tstamp = (__u32)(TIME_DELTA(ifaca->aca_tstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifaca->aca_tstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); nlh->nlmsg_len = skb->tail - b; return skb->len; @@ -2468,33 +2555,79 @@ { int idx, ip_idx; int s_idx, s_ip_idx; - struct inet6_ifaddr *ifa; - + int err = 1; + struct net_device *dev; + struct inet6_dev *idev = NULL; + struct inet6_ifaddr *ifa; + struct ifmcaddr6 *ifmca; + struct ifacaddr6 *ifaca; + s_idx = cb->args[0]; s_ip_idx = ip_idx = cb->args[1]; - - for (idx=0; idx < IN6_ADDR_HSIZE; idx++) { + read_lock(&dev_base_lock); + + for (dev = dev_base, idx = 0; dev; dev = dev->next, idx++) { if (idx < s_idx) continue; if (idx > s_idx) s_ip_idx = 0; - read_lock_bh(&addrconf_hash_lock); - for (ifa=inet6_addr_lst[idx], ip_idx = 0; ifa; - ifa = ifa->lst_next, ip_idx++) { + ip_idx = 0; + if ((idev = in6_dev_get(dev)) == NULL) + continue; + read_lock_bh(&idev->lock); + /* unicast address */ + for (ifa = idev->addr_list; ifa; + ifa = ifa->if_next, ip_idx++) { if (ip_idx < s_ip_idx) continue; - if (inet6_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR) <= 0) { - read_unlock_bh(&addrconf_hash_lock); + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) goto done; - } } - read_unlock_bh(&addrconf_hash_lock); + /* temp addr */ +#ifdef CONFIG_IPV6_PRIVACY + for (ifa = idev->tempaddr_list; ifa; + ifa = ifua->tmp_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } +#endif + /* multicast address */ + for (ifmca = idev->mc_list; ifmca; + ifmca = ifmca->next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifmcaddr(skb, ifmca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } + /* anycast address */ + for (ifaca = idev->ac_list; ifaca; + ifaca = ifaca->aca_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifacaddr(skb, ifaca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } + read_unlock_bh(&idev->lock); + in6_dev_put(idev); } done: + if (err <= 0) { + read_unlock_bh(&idev->lock); + in6_dev_put(idev); + } + read_unlock(&dev_base_lock); cb->args[0] = idx; cb->args[1] = ip_idx; - return skb->len; } diff -urN linux-2.6.0-test6/net/ipv6/anycast.c linux-2.6.0-test6-ipv6mib4/net/ipv6/anycast.c --- linux-2.6.0-test6/net/ipv6/anycast.c 2003-09-27 17:50:06.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/anycast.c 2003-10-08 00:15:38.000000000 -0700 @@ -343,6 +343,8 @@ ipv6_addr_copy(&aca->aca_addr, addr); aca->aca_idev = idev; aca->aca_users = 1; + /* aca_tstamp should be updated upon changes */ + aca->aca_cstamp = aca->aca_tstamp = jiffies; atomic_set(&aca->aca_refcnt, 2); aca->aca_lock = SPIN_LOCK_UNLOCKED; diff -urN linux-2.6.0-test6/net/ipv6/mcast.c linux-2.6.0-test6-ipv6mib4/net/ipv6/mcast.c --- linux-2.6.0-test6/net/ipv6/mcast.c 2003-09-27 17:50:53.000000000 -0700 +++ linux-2.6.0-test6-ipv6mib4/net/ipv6/mcast.c 2003-10-08 00:15:38.000000000 -0700 @@ -830,6 +830,8 @@ ipv6_addr_copy(&mc->mca_addr, addr); mc->idev = idev; mc->mca_users = 1; + /* mca_stamp should be updated upon changes */ + mc->mca_cstamp = mc->mca_tstamp = jiffies; atomic_set(&mc->mca_refcnt, 2); mc->mca_lock = SPIN_LOCK_UNLOCKED; --------------Boundary-00=_YE0V4W20V8OD49K590AB-- From shemminger@osdl.org Thu Oct 16 10:28:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 10:29:29 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GHSt25029194 for ; Thu, 16 Oct 2003 10:28:55 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9GHSho03141; Thu, 16 Oct 2003 10:28:43 -0700 Date: Thu, 16 Oct 2003 10:28:31 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] mark init_etherdev as deprecated Message-Id: <20031016102831.589d9e20.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 884 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 Content-Length: 1914 Lines: 48 For 2.6.0-test7-bk latest, mark init_etherdev as deprecated because it is implicitly racy, and has been replaced by using alloc_etherdev. diff -Nru a/drivers/net/net_init.c b/drivers/net/net_init.c --- a/drivers/net/net_init.c Thu Oct 16 10:20:46 2003 +++ b/drivers/net/net_init.c Thu Oct 16 10:20:46 2003 @@ -197,9 +197,13 @@ * * If an empty string area is passed as dev->name, or a new structure is made, * a new name string is constructed. + * + * Deprecated because of exposed window between device registration + * and interfaces pointers that need to be set by driver. + * Use alloc_etherdev and register_netdev instead. */ -struct net_device *init_etherdev(struct net_device *dev, int sizeof_priv) +struct net_device *__init_etherdev(struct net_device *dev, int sizeof_priv) { return init_netdev(dev, sizeof_priv, "eth%d", ether_setup); } @@ -222,7 +226,7 @@ return alloc_netdev(sizeof_priv, "eth%d", ether_setup); } -EXPORT_SYMBOL(init_etherdev); +EXPORT_SYMBOL(__init_etherdev); EXPORT_SYMBOL(alloc_etherdev); static int eth_mac_addr(struct net_device *dev, void *p) diff -Nru a/include/linux/etherdevice.h b/include/linux/etherdevice.h --- a/include/linux/etherdevice.h Thu Oct 16 10:20:46 2003 +++ b/include/linux/etherdevice.h Thu Oct 16 10:20:46 2003 @@ -38,7 +38,13 @@ struct hh_cache *hh); extern int eth_header_parse(struct sk_buff *skb, unsigned char *haddr); -extern struct net_device *init_etherdev(struct net_device *dev, int sizeof_priv); +extern struct net_device *__init_etherdev(struct net_device *dev, int sizeof_priv); +static inline __deprecated struct net_device *init_etherdev(struct net_device *dev, + int sizeof_priv) +{ + return __init_etherdev(dev, sizeof_priv); +} + extern struct net_device *alloc_etherdev(int sizeof_priv); static inline void eth_copy_and_sum (struct sk_buff *dest, unsigned char *src, int len, int base) { From epasejazun@kulichki.ru Thu Oct 16 10:54:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 10:55:01 -0700 (PDT) Received: from mail.agava.net (mail.agava.net [195.161.118.4]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GHsO25030180 for ; Thu, 16 Oct 2003 10:54:26 -0700 Received: from [80.58.4.111] (account ) by mail.agava.net (CommuniGate Pro WebUser 4.0.2) with HTTP id 10036984; Thu, 16 Oct 2003 21:48:20 +0400 From: "Cawa" Subject: =?koi8-r?B?4tXE2CDNz8nNINDB0tTOo9LPzQ==?= From: "Cawa" To: Cawa =?KOI8-R?Q?=0A=C1=D3?= =?KOI8-R?Q?_=D0=D2=C9=D7=C5=D4=D3=D4=D7=D5=C5=D4?= =?KOI8-R?Q?_=CB=CF=CD=D0=C1=CE=C9=D1?= Webra! X-Mailer: CommuniGate Pro Web Mailer v.4.0.2 Date: Thu, 16 Oct 2003 21:48:20 +0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="KOI8-R"; format="flowed" Content-Transfer-Encoding: 8bit X-archive-position: 885 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: epasejazun@kulichki.ru Precedence: bulk X-list: netdev Content-Length: 727 Lines: 23 ÁÓ ÐÒÉ×ÅÔÓÔ×ÕÅÔ ËÏÍÐÁÎÉÑ Webra! Webra ÏÂÌÁÄÁÅÔ ÓÁÍÙÍ ÜÆÆÅËÔÉ×ÎÙÍ ÎÁ ÄÁÎÎÙÊ ÍÏÍÅÎÔ ÉÎÓÔÒÕÍÅÎÔÏÍ ÐÏ ÒÅËÌÁÍÅ × ÉÎÔÅÒÎÅÔ: ÍÁÓÓÏ×ÏÊ ÒÁÓÓÙÌËÏÊ ÷ÁÛÅÇÏ ÐÒÅÄÌÏÖÅÎÉÑ. îÉ ÏÄÉÎ ÄÒÕÇÏÊ ×ÉÄ ÒÅËÌÁÍÙ ÎÅ ÏÂÌÁÄÁÅÔ ÓÔÏÌØ ÓÉÌØÎÙÍ ×ÏÚÄÅÊÓÔ×ÉÅÍ ÎÁÐÏÌÕÞÁÔÅÌÑ ÒÅËÌÁÍÙ. õ Webra óÁÍÁÑ ÓÏ×ÅÒÛÅÎÎÁÑ ÒÁÓÓÙÌËÁ, Å£ ÐÒÅÉÍÕÝÅÓÔ×Á ÐÏ ÔÅÌÅÆÏÎÁÍ: 782-47-94 ÉÌÉ 748-83-20 Webra ÐÒÅÄÌÁÇÁÅÔ: - ÎÁÊÔÉ ÎÏ×ÙÈ ÐÁÒÔΣÒÏ× É ËÌÉÅÎÔÏ× - ÎÁÊÔÉ ÎÏ×ÙÅ ÒÙÎËÉ ÓÂÙÔÁ ÷ÁÛÅÊ ÐÒÏÄÕËÃÉÉ - ÏÂÅÓÐÅÞÅÎÉÅ ÓÁÍÏÇÏ ËÏÒÏÔËÏÇÏ ÐÕÔÉ ÏÔ ÷ÁÓ Ë ËÌÉÅÎÔÕ - ÓÏÔÒÕÄÎÉÞÅÓÔ×Ï × éÎÔÅÒÎÅÔ ïÄÉÎ Ú×ÏÎÏË ÉÚÍÅÎÉÔ ÷ÁÛÉ ÐÒÅÄÓÔÁ×ÌÅÎÉÑ Ï ÍÁÓÓÏ×ÏÊ ÒÁÓÓÙÌËÅ: 748-83-20 ÉÌÉ 782-47-94 ðÒÏÓÉÍ ÐÒÏÝÅÎÉÑ ÚÁ ÄÏÓÔÁ×ÌÅÎÎÙÅ ÷ÁÍ ÎÅÕÄÏÂÓÔ×Á. óÐÁÓÉÂÏ. From shemminger@osdl.org Thu Oct 16 11:04:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 11:05:17 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GI4g25030827 for ; Thu, 16 Oct 2003 11:04:43 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9GI4So11303; Thu, 16 Oct 2003 11:04:28 -0700 Date: Thu, 16 Oct 2003 11:04:17 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] bugtrap for network drivers that don't register properly. Message-Id: <20031016110417.0774e1c7.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 886 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 Content-Length: 2284 Lines: 83 This patch adds checks for network devices that set there statistics pointer after registration. It is a common error and has already burned netdev sysfs unregister a couple of times. Rather than trapping it on module unload which is infrequent and unlikely to be tested on all devices, this patch traps it when the device is brought up. Tested on 2.6.0-test7 by buggering the e100 driver. diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h Thu Oct 16 11:00:47 2003 +++ b/include/linux/netdevice.h Thu Oct 16 11:00:47 2003 @@ -469,6 +469,7 @@ /* class/net/name entry */ struct class_device class_dev; + struct net_device_stats* (*last_stats)(struct net_device *); }; #define SET_MODULE_OWNER(dev) do { } while (0) diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Thu Oct 16 11:00:47 2003 +++ b/net/core/dev.c Thu Oct 16 11:00:47 2003 @@ -713,6 +713,19 @@ return 1; } + +/* + * Some old buggy device drivers change get_stats after registering + * the device. Try and trap them here. + * This can be elimnated when all devices are known fixed. + */ +static inline int get_stats_changed(struct net_device *dev) +{ + int changed = dev->last_stats != dev->get_stats; + dev->last_stats = dev->get_stats; + return changed; +} + /** * dev_open - prepare an interface for use. * @dev: device to open @@ -737,6 +750,14 @@ return 0; /* + * Check for broken device drivers. + */ + if (get_stats_changed(dev) && net_ratelimit()) { + printk(KERN_ERR "%s: driver changed get_stats after register\n", + dev->name); + } + + /* * Is it even present? */ if (!netif_device_present(dev)) @@ -753,6 +774,14 @@ } /* + * Check for more broken device drivers. + */ + if (get_stats_changed(dev) && net_ratelimit()) { + printk(KERN_ERR "%s: driver changed get_stats in open\n", + dev->name); + } + + /* * If it went open OK then: */ diff -Nru a/net/core/net-sysfs.c b/net/core/net-sysfs.c --- a/net/core/net-sysfs.c Thu Oct 16 11:00:47 2003 +++ b/net/core/net-sysfs.c Thu Oct 16 11:00:47 2003 @@ -419,6 +419,7 @@ } + net->last_stats = net->get_stats; if (net->get_stats && (ret = sysfs_create_group(&class_dev->kobj, &netstat_group))) goto out_unreg; From jmorris@redhat.com Thu Oct 16 12:14:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 12:15:13 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GJEa25004914 for ; Thu, 16 Oct 2003 12:14:37 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h9GJEYM07305; Thu, 16 Oct 2003 15:14:34 -0400 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.64.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9GJEXr26058; Thu, 16 Oct 2003 15:14:33 -0400 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.65.238]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id h9GJEXnw013703; Thu, 16 Oct 2003 15:14:33 -0400 Date: Thu, 16 Oct 2003 15:15:00 -0400 (EDT) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Sebastian Piecha cc: LK-net , Subject: Re: oops in skbuff.c In-Reply-To: <3F8EF7B3.25278.5010BC6@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 887 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev Content-Length: 320 Lines: 15 On Thu, 16 Oct 2003, Sebastian Piecha wrote: > panics. Copying more than 4 GB to the samba share also lets the > kernel panic with an OOPS. Does the above cause a panic for the 2.6-test kernels? Do you have netfilter enabled, and if so, any iptables modules loaded? - James -- James Morris From Mike_Phillips@URSCorp.com Thu Oct 16 12:55:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 12:56:23 -0700 (PDT) Received: from smtp102.urscorp.com (smtp102.urscorp.com [65.207.129.233]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GJtg25009309; Thu, 16 Oct 2003 12:55:49 -0700 Subject: Re: [PATCH] (5/6) ibmtr -- probe2 To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mike_Phillips@URSCorp.com Date: Thu, 16 Oct 2003 15:52:50 -0700 X-MIMETrack: Serialize by Router on SMTP102/URSCorp(Release 5.0.11 |July 24, 2002) at 10/16/2003 03:55:23 PM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-archive-position: 888 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Mike_Phillips@URSCorp.com Precedence: bulk X-list: netdev Content-Length: 1101 Lines: 33 > typedef struct ibmtr_dev_t { > + struct tok_info ti; /* must be first! */ Why must this be first ?? Sounds like an alignment issue, we shouldn't assume some is aligned correctly just because it's the first entry. >+ if (err) >+ goto out1; >+ >+ return 0; >+ out1: Replace with: if (!err) return 0; instead of the extra lines of code. There also a patch of code at the end that changes stuff from dev_ibmtr[i] to dev and then sets dev_ibmtr[i] = dev. Is there a really good reason for this. I can't see any real reason for the change. A small note for some of the reasoning behind the strangeness of the probing. T/R ISA devices typically live on port A20, some old legacy system only have 23 bit, not 24 bit addressing here and an automatic probe on A20 will conflict with anything on 220 (ie soundcard) and lock the machine solid. Hence the ability to absolutely specify the port to be probed. (The probing years ago used to be really, really simple, you just probed A20 and A24 and saw if the card was there) Mike From spi@gmxpro.de Thu Oct 16 13:01:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 13:01:56 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GK1J25009774 for ; Thu, 16 Oct 2003 13:01:22 -0700 Received: (qmail 13957 invoked by uid 65534); 16 Oct 2003 20:01:10 -0000 Received: from pD9E60218.dip.t-dialin.net (EHLO d800) (217.230.2.24) by mail.gmx.net (mp006) with SMTP; 16 Oct 2003 22:01:10 +0200 X-Authenticated: #555711 From: "Sebastian Piecha" To: James Morris , LK-net , Date: Thu, 16 Oct 2003 22:01:19 +0200 MIME-Version: 1.0 Subject: Re: oops in skbuff.c Message-ID: <3F8F152F.4147.5743B2C@localhost> Priority: normal In-reply-to: References: <3F8EF7B3.25278.5010BC6@localhost> X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-archive-position: 889 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: spi@gmxpro.de Precedence: bulk X-list: netdev Content-Length: 548 Lines: 18 On 16 Oct 2003 at 15:15, James Morris wrote: > On Thu, 16 Oct 2003, Sebastian Piecha wrote: > > > panics. Copying more than 4 GB to the samba share also lets the > > kernel panic with an OOPS. > > Does the above cause a panic for the 2.6-test kernels? > Do you have netfilter enabled, and if so, any iptables modules loaded? > No. Only in 2.4-kernels. No netfilter. No iptables. Just samba sharing some reiserfs directories on a Promise attached ide harddisk. Mit freundlichen Gruessen/Best regards, Sebastian Piecha EMail: spi@gmxpro.de From shemminger@osdl.org Thu Oct 16 13:09:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 13:10:07 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GK9V25011252; Thu, 16 Oct 2003 13:09:32 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9GK99o03208; Thu, 16 Oct 2003 13:09:09 -0700 Date: Thu, 16 Oct 2003 13:08:58 -0700 From: Stephen Hemminger To: Mike_Phillips@URSCorp.com Cc: jgarzik@pobox.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com Subject: Re: [PATCH] (5/6) ibmtr -- probe2 Message-Id: <20031016130858.1751ce27.shemminger@osdl.org> In-Reply-To: References: Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 890 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 Content-Length: 455 Lines: 16 On Thu, 16 Oct 2003 15:52:50 -0700 Mike_Phillips@URSCorp.com wrote: > > > typedef struct ibmtr_dev_t { > > + struct tok_info ti; /* must be first! */ > > Why must this be first ?? Sounds like an alignment issue, we shouldn't > assume some is aligned correctly just because it's the first entry. Because ibmtr_cs calls ibmtr_probe1 function which does: struct tok_info *ti = dev->priv; and dereferences it in a couple of places. From jmorris@redhat.com Thu Oct 16 13:36:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 13:37:25 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GKal25012899 for ; Thu, 16 Oct 2003 13:36:48 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h9GKagM00350; Thu, 16 Oct 2003 16:36:42 -0400 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.64.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9GKafr22261; Thu, 16 Oct 2003 16:36:41 -0400 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.65.238]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id h9GKaenw017995; Thu, 16 Oct 2003 16:36:40 -0400 Date: Thu, 16 Oct 2003 16:37:07 -0400 (EDT) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Sebastian Piecha cc: LK-net , Subject: Re: oops in skbuff.c In-Reply-To: <3F8F152F.4147.5743B2C@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 891 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev Content-Length: 540 Lines: 20 On Thu, 16 Oct 2003, Sebastian Piecha wrote: > On 16 Oct 2003 at 15:15, James Morris wrote: > > On Thu, 16 Oct 2003, Sebastian Piecha wrote: > > > > Does the above cause a panic for the 2.6-test kernels? > > Do you have netfilter enabled, and if so, any iptables modules loaded? > > > No. Only in 2.4-kernels. No netfilter. No iptables. Just samba > sharing some reiserfs directories on a Promise attached ide harddisk. Are you able to test with a different NIC to the onboard 3C905B? - James -- James Morris From spi@gmxpro.de Thu Oct 16 14:11:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 14:12:20 -0700 (PDT) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GLBj25014357 for ; Thu, 16 Oct 2003 14:11:46 -0700 Received: (qmail 4741 invoked by uid 65534); 16 Oct 2003 21:11:37 -0000 Received: from pD9E60218.dip.t-dialin.net (EHLO d800) (217.230.2.24) by mail.gmx.net (mp002) with SMTP; 16 Oct 2003 23:11:37 +0200 X-Authenticated: #555711 From: "Sebastian Piecha" To: James Morris , LK-net , Date: Thu, 16 Oct 2003 23:11:54 +0200 MIME-Version: 1.0 Subject: Re: oops in skbuff.c Message-ID: <3F8F25BA.16275.5B4D703@localhost> Priority: normal In-reply-to: References: <3F8F152F.4147.5743B2C@localhost> X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-archive-position: 892 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: spi@gmxpro.de Precedence: bulk X-list: netdev Content-Length: 891 Lines: 27 On 16 Oct 2003 at 16:37, James Morris wrote: > On Thu, 16 Oct 2003, Sebastian Piecha wrote: > > > On 16 Oct 2003 at 15:15, James Morris wrote: > > > On Thu, 16 Oct 2003, Sebastian Piecha wrote: > > > > > > Does the above cause a panic for the 2.6-test kernels? > > > Do you have netfilter enabled, and if so, any iptables modules loaded? > > > > > No. Only in 2.4-kernels. No netfilter. No iptables. Just samba > > sharing some reiserfs directories on a Promise attached ide harddisk. > > Are you able to test with a different NIC to the onboard 3C905B? > > Unfortunately I only have 3com NICs. Do you think it's the adapter? But why it's working in kernel 2.6? There are different changes in skbuff.c between kernel 2.4.22-ac4 and 2.6.0-test7. Is there any slight chance to port it back to 2.4.x? Mit freundlichen Gruessen/Best regards, Sebastian Piecha EMail: spi@gmxpro.de From davem@pizda.ninka.net Thu Oct 16 15:26:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 15:26:42 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GMQ425019791 for ; Thu, 16 Oct 2003 15:26:04 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA16652; Thu, 16 Oct 2003 15:21:36 -0700 Date: Thu, 16 Oct 2003 15:21:36 -0700 From: "David S. Miller" To: "Petr Vandrovec" Cc: netdev@oss.sgi.com Subject: Re: [PATCH?] Fix sniffing of ARP replies Message-Id: <20031016152136.50e2a389.davem@redhat.com> In-Reply-To: <32A9D366A0B@vcnet.vc.cvut.cz> References: <32A9D366A0B@vcnet.vc.cvut.cz> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 893 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: 840 Lines: 15 On Thu, 16 Oct 2003 12:07:23 +0200 "Petr Vandrovec" wrote: > It behaves same way it behaved. But recently you renamed packet_type.data > to packet_type.af_packet_priv, saying that af_packet_priv should be used > only by AF_PACKET code, by nobody else. So I trusted you, removed > packet_type.data (and packet_type.af_packet_priv) references from the > code - and things stopped working, as with af_packet_priv==NULL ARP > replies are not delivered to the registered packet_type callback, as > these packets match skb->sk == pt->af_packet_priv for af_packet_priv == NULL. vmware was trying to influence the behavior of input packet delivery by setting ->data in a way which was never defined. That facility existed and continues to exist for the sake of AF_PACKET solely, what vmware was doing just happened to work. From joe@perches.com Thu Oct 16 15:41:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 15:42:05 -0700 (PDT) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GMfU25020349 for ; Thu, 16 Oct 2003 15:41:30 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id QAA29953; Thu, 16 Oct 2003 16:14:30 -0700 Subject: Re: [PATCH?] Fix sniffing of ARP replies From: Joe Perches To: David S Miller Cc: Petr Vandrovec , netdev@oss.sgi.com In-Reply-To: <20031016152136.50e2a389.davem@redhat.com> References: <32A9D366A0B@vcnet.vc.cvut.cz> <20031016152136.50e2a389.davem@redhat.com> Content-Type: text/plain Message-Id: <1066344060.2232.9.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Thu, 16 Oct 2003 15:41:00 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 894 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: 1502 Lines: 34 On Thu, 2003-10-16 at 15:21, David S. Miller wrote: > On Thu, 16 Oct 2003 12:07:23 +0200 > "Petr Vandrovec" wrote: > > > It behaves same way it behaved. But recently you renamed packet_type.data > > to packet_type.af_packet_priv, saying that af_packet_priv should be used > > only by AF_PACKET code, by nobody else. So I trusted you, removed > > packet_type.data (and packet_type.af_packet_priv) references from the > > code - and things stopped working, as with af_packet_priv==NULL ARP > > replies are not delivered to the registered packet_type callback, as > > these packets match skb->sk == pt->af_packet_priv for af_packet_priv == NULL. > > vmware was trying to influence the behavior of input packet > delivery by setting ->data in a way which was never defined. > That facility existed and continues to exist for the sake > of AF_PACKET solely, what vmware was doing just happened to work. vmware wasn't just trying to influence, it used the implementation. So tell me, where was this definition again? If it was just how the code functioned, you have no basis for that argument. If you have commentary, design docs or even externally published discussions, that's a different story. I diddn't find any. Code is code, readable or intentionally obscured. Function is function. Peter's code worked before, it stopped working after the packet.h/PKT_CAN_SHARE_SKB removal. You can change the implementation, but your argument is made hollow by not having any docs. From davem@pizda.ninka.net Thu Oct 16 15:50:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 15:50:38 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GMo425020889 for ; Thu, 16 Oct 2003 15:50:04 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA16769; Thu, 16 Oct 2003 15:45:37 -0700 Date: Thu, 16 Oct 2003 15:45:37 -0700 From: "David S. Miller" To: Joe Perches Cc: VANDROVE@vc.cvut.cz, netdev@oss.sgi.com Subject: Re: [PATCH?] Fix sniffing of ARP replies Message-Id: <20031016154537.2bcf7404.davem@redhat.com> In-Reply-To: <1066344060.2232.9.camel@localhost.localdomain> References: <32A9D366A0B@vcnet.vc.cvut.cz> <20031016152136.50e2a389.davem@redhat.com> <1066344060.2232.9.camel@localhost.localdomain> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 895 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: 244 Lines: 7 On Thu, 16 Oct 2003 15:41:00 -0700 Joe Perches wrote: > On Thu, 2003-10-16 at 15:21, David S. Miller wrote: > vmware wasn't just trying to influence, it used the implementation. It just so happened to be usable in this way. From davem@pizda.ninka.net Thu Oct 16 16:33:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 16:34:26 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GNXf25002551 for ; Thu, 16 Oct 2003 16:33:46 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA16888; Thu, 16 Oct 2003 16:29:12 -0700 Date: Thu, 16 Oct 2003 16:29:12 -0700 From: "David S. Miller" To: Shirley Ma Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable Message-Id: <20031016162912.6a5943eb.davem@redhat.com> In-Reply-To: <200310160956.58462.mashirle@us.ibm.com> References: <200310141038.04322.mashirle@us.ibm.com> <20031015223733.5483da9d.davem@redhat.com> <200310160956.58462.mashirle@us.ibm.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 896 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: 37 Lines: 1 Patch applied, thanks a lot Shirley. From davem@pizda.ninka.net Thu Oct 16 16:36:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 16:36:39 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GNa225002807 for ; Thu, 16 Oct 2003 16:36:03 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA16921; Thu, 16 Oct 2003 16:31:33 -0700 Date: Thu, 16 Oct 2003 16:31:33 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] mark init_etherdev as deprecated Message-Id: <20031016163133.47987b85.davem@redhat.com> In-Reply-To: <20031016102831.589d9e20.shemminger@osdl.org> References: <20031016102831.589d9e20.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 897 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: 251 Lines: 7 On Thu, 16 Oct 2003 10:28:31 -0700 Stephen Hemminger wrote: > For 2.6.0-test7-bk latest, mark init_etherdev as deprecated because it is > implicitly racy, and has been replaced by using alloc_etherdev. Applied, thanks Stephen. From davem@pizda.ninka.net Thu Oct 16 16:37:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 16:37:38 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GNbP25003256 for ; Thu, 16 Oct 2003 16:37:25 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA16943; Thu, 16 Oct 2003 16:32:59 -0700 Date: Thu, 16 Oct 2003 16:32:59 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] bugtrap for network drivers that don't register properly. Message-Id: <20031016163259.231a6817.davem@redhat.com> In-Reply-To: <20031016110417.0774e1c7.shemminger@osdl.org> References: <20031016110417.0774e1c7.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 898 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: 516 Lines: 12 On Thu, 16 Oct 2003 11:04:17 -0700 Stephen Hemminger wrote: > This patch adds checks for network devices that set there statistics pointer > after registration. It is a common error and has already burned netdev sysfs > unregister a couple of times. Rather than trapping it on module unload which > is infrequent and unlikely to be tested on all devices, this patch traps it > when the device is brought up. > > Tested on 2.6.0-test7 by buggering the e100 driver. Applied, thanks Stephen. From vandrove@vc.cvut.cz Thu Oct 16 16:48:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 16 Oct 2003 16:49:23 -0700 (PDT) Received: from vana.vc.cvut.cz (root@vana.vc.cvut.cz [147.32.240.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9GNmn25004013 for ; Thu, 16 Oct 2003 16:48:50 -0700 Received: from vana.vc.cvut.cz (smmsp@localhost [127.0.0.1]) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-4) with ESMTP id h9GNml0Q018480; Fri, 17 Oct 2003 01:48:47 +0200 Received: (from root@localhost) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-4) id h9GNmlh3018477; Fri, 17 Oct 2003 01:48:47 +0200 Date: Fri, 17 Oct 2003 01:48:47 +0200 From: Petr Vandrovec To: "David S. Miller" Cc: Joe Perches , netdev@oss.sgi.com Subject: Re: [PATCH?] Fix sniffing of ARP replies Message-ID: <20031016234847.GA17048@vana.vc.cvut.cz> References: <32A9D366A0B@vcnet.vc.cvut.cz> <20031016152136.50e2a389.davem@redhat.com> <1066344060.2232.9.camel@localhost.localdomain> <20031016154537.2bcf7404.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031016154537.2bcf7404.davem@redhat.com> User-Agent: Mutt/1.5.4i X-archive-position: 899 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vandrove@vc.cvut.cz Precedence: bulk X-list: netdev Content-Length: 1129 Lines: 27 On Thu, Oct 16, 2003 at 03:45:37PM -0700, David S. Miller wrote: > On Thu, 16 Oct 2003 15:41:00 -0700 > Joe Perches wrote: > > > On Thu, 2003-10-16 at 15:21, David S. Miller wrote: > > vmware wasn't just trying to influence, it used the implementation. > > It just so happened to be usable in this way. > I do not understand. At least on hardware and configurations I tested code still works if I set af_packet_priv member to some non-NULL value. It looked to me like that it is not intentional that ARP replies are not delivered to the sniffer - from your reply it looks to me like that only allowed user of whole packet_type, not only af_packet_priv member, is AF_PACKET, and that for correct functionality af_packet_priv member must be non-NULL. Otherwise semantic of this call is ungrokable by me (it is ungrokable anyway as vital information where checksum should be placed is lost, but you already said that it is intentional that tcpdump sees it wrong). For now I understand that I should set af_packet_priv to non-NULL value. Best regards, Petr Vandrovec vandrove@vc.cvut.cz From davem@pizda.ninka.net Fri Oct 17 00:00:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 00:00:52 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9H70625016348 for ; Fri, 17 Oct 2003 00:00:18 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA17797; Thu, 16 Oct 2003 23:55:29 -0700 Date: Thu, 16 Oct 2003 23:55:29 -0700 From: "David S. Miller" To: Petr Vandrovec Cc: joe@perches.com, netdev@oss.sgi.com Subject: Re: [PATCH?] Fix sniffing of ARP replies Message-Id: <20031016235529.1a0cded0.davem@redhat.com> In-Reply-To: <20031016234847.GA17048@vana.vc.cvut.cz> References: <32A9D366A0B@vcnet.vc.cvut.cz> <20031016152136.50e2a389.davem@redhat.com> <1066344060.2232.9.camel@localhost.localdomain> <20031016154537.2bcf7404.davem@redhat.com> <20031016234847.GA17048@vana.vc.cvut.cz> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 900 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: 479 Lines: 13 On Fri, 17 Oct 2003 01:48:47 +0200 Petr Vandrovec wrote: > It looked to me like that it is not intentional that ARP replies are not > delivered to the sniffer - from your reply it looks to me like that > only allowed user of whole packet_type, not only af_packet_priv member, > is AF_PACKET, and that for correct functionality af_packet_priv member > must be non-NULL. I relooked at this, and you may have a point. Let me study this some more. Thanks. From davem@pizda.ninka.net Fri Oct 17 00:14:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 00:15:26 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9H7El25016992 for ; Fri, 17 Oct 2003 00:14:47 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA17865; Fri, 17 Oct 2003 00:10:13 -0700 Date: Fri, 17 Oct 2003 00:10:13 -0700 From: "David S. Miller" To: Petr Vandrovec Cc: netdev@oss.sgi.com Subject: Re: [PATCH?] Fix sniffing of ARP replies Message-Id: <20031017001013.306f1cd2.davem@redhat.com> In-Reply-To: <20031015171112.GA2469@vana.vc.cvut.cz> References: <20031015171112.GA2469@vana.vc.cvut.cz> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 901 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: 400 Lines: 12 On Wed, 15 Oct 2003 19:11:12 +0200 Petr Vandrovec wrote: > - (struct sock *)ptype->af_packet_priv != skb->sk) { > + (ptype->af_packet_priv == NULL || > + (struct sock *)ptype->af_packet_priv != skb->sk)) { Ok, after studying this some more, I think this patch makes sense and I'll apply it to 2.6.x Thanks for being patient with my idiocy this afternoon. :-) From jgarzik@pobox.com Fri Oct 17 00:30:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 00:31:10 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9H7UX25020359 for ; Fri, 17 Oct 2003 00:30:34 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36690 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A9Ylp-0004Yg-Kq; Wed, 15 Oct 2003 00:40:05 +0100 Message-ID: <3F8C894A.8070907@pobox.com> Date: Tue, 14 Oct 2003 19:39:54 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [PATCH] (1/12) Probe2 infrastructure for 2.6 experimental References: <200310142234.h9EMYAL30146@mail.osdl.org> <20031014162842.79fcf239.davem@redhat.com> In-Reply-To: <20031014162842.79fcf239.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 902 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: 613 Lines: 26 David S. Miller wrote: > On Tue, 14 Oct 2003 15:34:10 -0700 > Stephen Hemminger wrote: > > >>New infrastructure to allow probing older builtin drivers (like ISA) >>Originally by Al Viro, updated to apply agains jgarzik/net-drivers-2.5-exp > > > All of this looks fine to me, in fact I'm seeing some of these > changes for the 4th or 5th time :-) > > Jeff please add them to your tree unless you have a major > objection. I tried a couple times, and each time they didn't apply... They did now, and, I already have :) Just pushed them out to net-drivers-2.5-exp in fact... Jeff From davem@pizda.ninka.net Fri Oct 17 01:18:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 01:18:42 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9H8I825021617 for ; Fri, 17 Oct 2003 01:18:08 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA18170; Fri, 17 Oct 2003 01:10:06 -0700 Date: Fri, 17 Oct 2003 01:10:06 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: minor cleanup for vcc_hash conversion Message-Id: <20031017011006.5a21268e.davem@redhat.com> In-Reply-To: <200310161125.h9GBPVkT010703@ginger.cmf.nrl.navy.mil> References: <200310161125.h9GBPVkT010703@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 903 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: 56 Lines: 2 All 2.6.x ATM patches from today applied, thanks Chas. From spi@gmxpro.de Fri Oct 17 01:37:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 01:37:39 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9H8b625022551 for ; Fri, 17 Oct 2003 01:37:06 -0700 Received: (qmail 16887 invoked by uid 65534); 17 Oct 2003 08:36:58 -0000 Received: from p50831958.dip.t-dialin.net (EHLO d800) (80.131.25.88) by mail.gmx.net (mp023) with SMTP; 17 Oct 2003 10:36:58 +0200 X-Authenticated: #555711 From: "Sebastian Piecha" To: netdev@oss.sgi.com Date: Fri, 17 Oct 2003 10:37:16 +0200 MIME-Version: 1.0 Subject: oops in skbuff.c Message-ID: <3F8FC65C.339.828500F@localhost> Priority: normal X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-archive-position: 904 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: spi@gmxpro.de Precedence: bulk X-list: netdev Content-Length: 6358 Lines: 167 Hello, this is a copy of a mail I sent to the linux-net mailing list. Every time accessing an huge amount of data from a Win XP client to a linux server via samba I'm getting an oops. Different mailings to the linux kernel mailling list or samba bugzilla didn't help. Any help would be appreciated. Please CC me on all further mail traffic. I'm getting the oops in kernel 2.4.20, 2.4.22-ac4 and 2.4.23pre1. No oops occurred in 2.6.0test1 and 2.6.0test7. I'm using samba 2.2.8a (samba 2.2.7a showed same behaviour). The oops happened all time in skb_drop_fraglist. I run memtest for about 25 hours without any error. I have the dim feeling that skbuff.c is the source of evil. Comparing the Promise drivers in 2.4.22-ac4 and 2.6.0-test7 shows only few differences (but maybe the important one). In skbuff.c a lot of things changed. I don't have a clue what the changes are for. If just for fixing bugs skbuff.c could maybe easily be ported back to 2.4? Capture of an oops in 2.4.22-ac4: Oops: 0000 CPU: 0 EIP: 0010:[] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00010206 eax: c525e660 ebx: 00200000 ecx: 00000000 edx: 00200000 esi: c5c97d40 edi: c5c97da0 ebp: c038ba24 esp: c034ff18 ds: 0018 es: 0018 ss: 0018 Process swapper (pid: 0, stackpage=c034f000) Stack: c5c97d40 c025194b c5c97d40 c5c97d40 c5c97d40 c025196c c5c97d40 c5c97d40 c5c97d40 c0251ab4 c5c97d40 c57acd00 00000000 c0255103 c5c97d40 c038b4c8 00000001 fffffffd c03ac328 d3051000 c011e2cd c038b4c8 c03ac320 c03729c0 Call Trace: [] [] [] [] [] [] [] [] [] [] [] [] [] [] Code: 8b 1b 8b 42 74 83 f8 01 74 0b f0 ff 4a 74 0f 94 c0 84 c0 74 >>EIP; c02518a3 <===== >>eax; c525e660 <_end+4e6fe3c/14cc883c> >>esi; c5c97d40 <_end+58a951c/14cc883c> >>edi; c5c97da0 <_end+58a957c/14cc883c> >>ebp; c038ba24 >>esp; c034ff18 Trace; c025194b Trace; c025196c Trace; c0251ab4 <__kfree_skb+ec/f4> Trace; c0255103 Trace; c011e2cd Trace; c010a32d Trace; c0106d70 Trace; c0105000 <_stext+0/0> Trace; c010c7d8 Trace; c0106d70 Trace; c0105000 <_stext+0/0> Trace; c0106d9c Trace; c0106deb Trace; c0105049 Code; c02518a3 00000000 <_EIP>: Code; c02518a3 <===== 0: 8b 1b mov (%ebx),%ebx <===== Code; c02518a5 2: 8b 42 74 mov 0x74(%edx),%eax Code; c02518a8 5: 83 f8 01 cmp $0x1,%eax Code; c02518ab 8: 74 0b je 15 <_EIP+0x15> Code; c02518ad a: f0 ff 4a 74 lock decl 0x74(%edx) Code; c02518b1 e: 0f 94 c0 sete %al Code; c02518b4 11: 84 c0 test %al,%al Code; c02518b6 13: 74 00 je 15 <_EIP+0x15> <0>Kernel panic: Aiee, killing interrupt handler! Full description: I'm using Samba to distribute some shares to Windows clients. One of the shares is an Image-directory where I'm storing PQDI Images of Windows clients. One of the created images is about 40GB of size and is split up to 56 files each of same size. When verifying this image from a Win XP client, PQDI stops with an error (error 1811, "Could not read from image file") and the Linux kernel panics. Verifying this image from DOS (with MS network client) is done without any error. Also verifying smaller images is done without any error. Another PQDI version (7.0) also reports an error and the Linux Kernel panics. Copying more than 4 GB to the samba share also lets the kernel panic with an OOPS. Copying data locally from the Linux console is done without an error. In the beginning I thought that the Promise controller is the source of problem, now I'm not sure. Maybe it's samba or the combination of samba and kernel version (--> skbuff.c?). The share is lying in a directory on a Reiser filesystem: share Images ReiserFS LVM (on /dev/md0 only, 120GB) RAID1 /dev/md0 (120GB) /dev/hda1 + /dev/hde1 (one primary partition of 120GB on each drive) /dev/hda + /dev/hde (each 120GB) IDE UDMA133-controller As IDE-controller I first used a Promise FastTrak TX2000 (which supports "hardware"-RAID). I tried the binary Promise-driver (1.03.0.1) and the source code-driver (1.02.0.25), both without success. All time the OOPS occurred. Then I replaced the controller and both Samsung SP1203N-hard drives (each 120GB) against a Promise UltraTrak 133 TX2 and two Maxtor drives (6Y120P0, each 120GB) and installed a Linux native software-RAID without any Promise-driver. But again the OOPS occurred. Of course I updated the Promise-firmware to the latest level. To eliminate the RAID and LVM-drivers as the source of problem I installed just a Reiser FS on one 120GB-primary partition on one of both Maxtor disks (after removing the drive from the RAID). But again the Linux kernel panicked. Trying ext3 instead of reiserfs didn't help. As I do not have enough space on my scsi-disks I can't verify this big image from a scsi-disk. Sometimes the Linux kernel panic occurs immediately some minutes after starting the verify, sometimes it happens after reading half of all image files. Samba doesn't report any error. I also tried a different PCI-slot for the Promise-adapter without any success. Environment: # Dell Optiplex GX1 400MTbr+, Intel II 400 MHz, 320 MB RAM # Adaptec AHA 2940UW as PCI-adapter with two hard drives (20GB and 4GB, /boot is on the first scsi-drive) and a Plextor CD-writer # onboard LAN (3com 3C905B) # Promise Ultra133 TX2 as PCI-adapter with two Maxtor-drives (each 120GB) # DVD-ROM at the onboard-IDE -- Mit freundlichen Gruessen/Best regards, Sebastian Piecha EMail: spi@gmxpro.de From Thomas.Svedberg@me.chalmers.se Fri Oct 17 02:12:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 02:13:33 -0700 (PDT) Received: from ny03.mtek.chalmers.se (ny03.mtek.chalmers.se [129.16.60.203]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9H9Cu25024427 for ; Fri, 17 Oct 2003 02:12:57 -0700 Received: (qmail 1065 invoked from network); 17 Oct 2003 09:12:54 -0000 Received: from thsvlap.am.chalmers.se (129.16.58.60) by ny03.mtek.chalmers.se with SMTP; 17 Oct 2003 09:12:54 -0000 Subject: Re: Hard lock with recent 2.6.0-test kernels From: Thomas Svedberg To: Thomas Svedberg Cc: Linux Kernel List , jgarzik@pobox.com, netdev@oss.sgi.com In-Reply-To: <1063272933.26472.16.camel@ampc545.am.chalmers.se> References: <1063272933.26472.16.camel@ampc545.am.chalmers.se> Content-Type: text/plain; charset=ISO-8859-1 Message-Id: <1066310622.1483.2.camel@thsvlap.swenox.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 17 Oct 2003 11:12:26 +0200 Content-Transfer-Encoding: 8bit X-archive-position: 905 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Thomas.Svedberg@me.chalmers.se Precedence: bulk X-list: netdev Content-Length: 1088 Lines: 29 I have tried a lot more of the recent kernels, and still have these lockups. The box is, however, completely stable if i switch from running 8139cp to 8139too. I am willing to test patches. tor 2003-09-11 klockan 11.35 skrev Thomas Svedberg: > I first experienced total lockup with 2.6.0-test4-mm5 and have now tried > a few different ones. -test4-mm4 works, test4-bk2 works, test4-mm5 > locks, test4-bk3 locks, test5-mm1 locks. > Nothing shows in the logs, and the lock occurs while doing random things > but only after a few seconds - minutes after i logged in to X. > sysrq don't work either. > It is an Compaq Evo 1020v and configs etc. can be found at: > http://www.am.chalmers.se/~thsv/laptop/ -- / Thomas ....................................................................... Thomas Svedberg Department of Applied Mechanics Chalmers University of Technology Address: SE-412 96 Göteborg, SWEDEN E-mail : thsv@am.chalmers.se, thsv@bigfoot.com Phone : +46 31 772 1522 Fax : +46 31 772 3827 ....................................................................... From spi@gmxpro.de Fri Oct 17 05:17:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 05:17:52 -0700 (PDT) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HCHG25002259 for ; Fri, 17 Oct 2003 05:17:17 -0700 Received: (qmail 16686 invoked by uid 65534); 17 Oct 2003 12:17:09 -0000 Received: from p50831958.dip.t-dialin.net (EHLO d800) (80.131.25.88) by mail.gmx.net (mp016) with SMTP; 17 Oct 2003 14:17:09 +0200 X-Authenticated: #555711 From: "Sebastian Piecha" To: James Morris , LK-net , Date: Fri, 17 Oct 2003 14:17:25 +0200 MIME-Version: 1.0 Subject: Re: oops in skbuff.c Message-ID: <3F8FF9F5.24611.8F1E08C@localhost> Priority: normal In-reply-to: References: <3F8EF7B3.25278.5010BC6@localhost> X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-archive-position: 906 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: spi@gmxpro.de Precedence: bulk X-list: netdev Content-Length: 522 Lines: 20 On 16 Oct 2003 at 15:15, James Morris wrote: > On Thu, 16 Oct 2003, Sebastian Piecha wrote: > > > panics. Copying more than 4 GB to the samba share also lets the > > kernel panic with an OOPS. > > Does the above cause a panic for the 2.6-test kernels? > Do you have netfilter enabled, and if so, any iptables modules loaded? > > I did a mistake. iptables is installed but no rules added. I'll remove iptables and rerun the check. -- Mit freundlichen Gruessen/Best regards, Sebastian Piecha EMail: spi@gmxpro.de From Mike_Phillips@URSCorp.com Fri Oct 17 06:37:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 06:37:53 -0700 (PDT) Received: from smtp102.urscorp.com (smtp102.urscorp.com [65.207.129.233]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HDbJ25004093; Fri, 17 Oct 2003 06:37:20 -0700 Subject: Re: [PATCH] (5/6) ibmtr -- probe2 To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mike_Phillips@URSCorp.com Date: Fri, 17 Oct 2003 10:34:54 -0300 X-MIMETrack: Serialize by Router on SMTP102/URSCorp(Release 5.0.11 |July 24, 2002) at 10/17/2003 09:36:53 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-archive-position: 907 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Mike_Phillips@URSCorp.com Precedence: bulk X-list: netdev Content-Length: 506 Lines: 19 >> >> > typedef struct ibmtr_dev_t { >> > + struct tok_info ti; /* must be first! */ >> >> Why must this be first ?? Sounds like an alignment issue, we shouldn't >> assume some is aligned correctly just because it's the first entry. >Because ibmtr_cs calls ibmtr_probe1 function which does: > struct tok_info *ti = dev->priv; >and dereferences it in a couple of places. Huh ?? All the patch did was move the definition of ti to the start of the struct ibmtr_dev_t Mike From Mike_Phillips@URSCorp.com Fri Oct 17 06:43:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 06:44:32 -0700 (PDT) Received: from smtp102.urscorp.com (smtp102.urscorp.com [65.207.129.233]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HDhw26004549; Fri, 17 Oct 2003 06:43:59 -0700 Subject: Re: [PATCH] (5/6) ibmtr -- probe2 To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mike_Phillips@URSCorp.com Date: Fri, 17 Oct 2003 10:40:18 -0300 X-MIMETrack: Serialize by Router on SMTP102/URSCorp(Release 5.0.11 |July 24, 2002) at 10/17/2003 09:43:32 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-archive-position: 909 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Mike_Phillips@URSCorp.com Precedence: bulk X-list: netdev Content-Length: 297 Lines: 13 On a more general note: ibmtr and ibmtr_cs are just plain evil and have lots of little quirks in them because of the multitude of different adapters available that actually use the tropic chipset. Jeff: Please don't apply until I get a chance to try this out with real hardware. Thanks Mike From Mike_Phillips@URSCorp.com Fri Oct 17 06:43:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 06:44:31 -0700 (PDT) Received: from smtp102.urscorp.com (smtp102.urscorp.com [65.207.129.233]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HDhw25004549; Fri, 17 Oct 2003 06:43:58 -0700 Subject: Re: [PATCH] (5/6) ibmtr -- probe2 To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mike_Phillips@URSCorp.com Date: Fri, 17 Oct 2003 10:37:41 -0300 X-MIMETrack: Serialize by Router on SMTP102/URSCorp(Release 5.0.11 |July 24, 2002) at 10/17/2003 09:43:31 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-archive-position: 908 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Mike_Phillips@URSCorp.com Precedence: bulk X-list: netdev Content-Length: 816 Lines: 31 In ibmtr_cs.c: >+static int ibmtr_init(struct net_device *dev) >+{ >+ extern int ibmtr_probe1(struct net_device *, int); >+ >+ return ibmtr_probe1(dev, dev->base_addr); >+} >+ > /*====================================================================== > ibmtr_attach() creates an "instance" of the driver, allocating >@@ -194,7 +200,8 @@ > link->irq.Instance = info->dev = dev; > >- dev->init = &ibmtr_probe; >+ dev->init = ibmtr_init; >+ This changes dev->init from calling ibmtr_probe to ibmtr_probe1. The probe routines are specifically split into two because of ibmtr_cs. It doesn't need to do second probe routing because all the memory spaces get allocated by the pcmcia driver. Trying to allocate the same IO mem area will fail because its already been allocated by ibmtr_cs. Mike From wsx@6com.sk Fri Oct 17 07:57:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 07:57:45 -0700 (PDT) Received: from mail.6com.sk (cement.ksp.edi.fmph.uniba.sk [158.195.16.151] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HEv825010240 for ; Fri, 17 Oct 2003 07:57:09 -0700 Received: by mail.6com.sk (Postfix, from userid 501) id 1E95F4C00086; Fri, 17 Oct 2003 10:57:05 -0400 (EDT) Date: Fri, 17 Oct 2003 16:57:05 +0200 From: Jan Oravec To: netdev@oss.sgi.com Subject: tg3: low performance on 4-port bcm5704c NIC with IRQ sharing Message-ID: <20031017145704.GA2515@wsx.ksp.sk> Reply-To: Jan Oravec Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 910 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev Content-Length: 2267 Lines: 57 Hello, I have 4-port BCM5704C NIC and this problem: Interfaces eth0 to eth3, where IRQs of eth0 to eth2 are 28 and IRQ of eth3 is 30. When using tg3 driver (v2.2 August 24, 2003), interfaces eth1 and eth2 are slow. The box is opteron, relevant parts of dmesg: eth0: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet eth1: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet eth2: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet eth3: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet tg3: eth1: Link is up at 1000 Mbps, full duplex. tg3: eth1: Flow control is on for TX and on for RX. What is strange is this: 64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=10.0 ms 64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=9.00 ms 64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=8.00 ms 64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=7.00 ms 64 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=6.00 ms 64 bytes from 10.0.0.1: icmp_seq=6 ttl=64 time=5.00 ms 64 bytes from 10.0.0.1: icmp_seq=7 ttl=64 time=4.00 ms 64 bytes from 10.0.0.1: icmp_seq=8 ttl=64 time=3.00 ms 64 bytes from 10.0.0.1: icmp_seq=9 ttl=64 time=2.00 ms 64 bytes from 10.0.0.1: icmp_seq=10 ttl=64 time=1.00 ms 64 bytes from 10.0.0.1: icmp_seq=11 ttl=64 time=99.9 ms 64 bytes from 10.0.0.1: icmp_seq=12 ttl=64 time=98.9 ms 64 bytes from 10.0.0.1: icmp_seq=13 ttl=64 time=97.9 ms 64 bytes from 10.0.0.1: icmp_seq=14 ttl=64 time=96.9 ms ... Even stranger is that when I run two pings, the times are not about equal, but each one starts at random number lower than 100 ms and is decreasing by 1ms. Interfaces eth0 and eth3 are OK. The other end of cable is also 5704C. I've tried also the Broadcom bcm5700-7.0.0 driver; with this one eth1 and eth2 do not work at all (when cable is plugged, interface isn't RUNNING). My opinion is that it can be something with IRQ sharing on the same NIC. I tried to put more 2-port NICs and it works well if interrupts are shared between the NICs. The motherboard is Tyan S2880; kernel is 2.6.0-test7-bk8. Best Regards, -- Jan Oravec 6COM s.r.o. http://www.6com.sk From jmorris@redhat.com Fri Oct 17 08:33:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 08:34:02 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HFXR25014491 for ; Fri, 17 Oct 2003 08:33:28 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h9HFXKM30069; Fri, 17 Oct 2003 11:33:20 -0400 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.64.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9HFXJr18943; Fri, 17 Oct 2003 11:33:19 -0400 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.65.238]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id h9HFXInw000969; Fri, 17 Oct 2003 11:33:18 -0400 Date: Fri, 17 Oct 2003 11:33:47 -0400 (EDT) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Sebastian Piecha cc: LK-net , Subject: Re: oops in skbuff.c In-Reply-To: <3F8F25BA.16275.5B4D703@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 911 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev Content-Length: 280 Lines: 15 On Thu, 16 Oct 2003, Sebastian Piecha wrote: > > Are you able to test with a different NIC to the onboard 3C905B? > > > Unfortunately I only have 3com NICs. Do you think it's the adapter? Not sure, just trying to rule it out. - James -- James Morris From wsx@6com.sk Fri Oct 17 09:05:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 09:06:28 -0700 (PDT) Received: from mail.6com.sk (cement.ksp.edi.fmph.uniba.sk [158.195.16.151] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HG5o25016305 for ; Fri, 17 Oct 2003 09:05:50 -0700 Received: by mail.6com.sk (Postfix, from userid 501) id 92D6D4C00086; Fri, 17 Oct 2003 12:05:49 -0400 (EDT) Date: Fri, 17 Oct 2003 18:05:49 +0200 From: Jan Oravec To: netdev@oss.sgi.com Subject: Re: tg3: low performance on 4-port bcm5704c NIC with IRQ sharing Message-ID: <20031017160549.GA2827@wsx.ksp.sk> Reply-To: Jan Oravec References: <20031017145704.GA2515@wsx.ksp.sk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031017145704.GA2515@wsx.ksp.sk> User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 912 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev Content-Length: 2525 Lines: 63 Another interesting thing is that eth1 and eth2 does not work if eth0 is down. On Fri, Oct 17, 2003 at 04:57:05PM +0200, Jan Oravec wrote: > Hello, > > > I have 4-port BCM5704C NIC and this problem: > > Interfaces eth0 to eth3, where IRQs of eth0 to eth2 are 28 and IRQ of eth3 > is 30. When using tg3 driver (v2.2 August 24, 2003), interfaces eth1 and > eth2 are slow. The box is opteron, relevant parts of dmesg: > > eth0: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet > eth1: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet > eth2: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet > eth3: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet > tg3: eth1: Link is up at 1000 Mbps, full duplex. > tg3: eth1: Flow control is on for TX and on for RX. > > What is strange is this: > > 64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=10.0 ms > 64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=9.00 ms > 64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=8.00 ms > 64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=7.00 ms > 64 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=6.00 ms > 64 bytes from 10.0.0.1: icmp_seq=6 ttl=64 time=5.00 ms > 64 bytes from 10.0.0.1: icmp_seq=7 ttl=64 time=4.00 ms > 64 bytes from 10.0.0.1: icmp_seq=8 ttl=64 time=3.00 ms > 64 bytes from 10.0.0.1: icmp_seq=9 ttl=64 time=2.00 ms > 64 bytes from 10.0.0.1: icmp_seq=10 ttl=64 time=1.00 ms > 64 bytes from 10.0.0.1: icmp_seq=11 ttl=64 time=99.9 ms > 64 bytes from 10.0.0.1: icmp_seq=12 ttl=64 time=98.9 ms > 64 bytes from 10.0.0.1: icmp_seq=13 ttl=64 time=97.9 ms > 64 bytes from 10.0.0.1: icmp_seq=14 ttl=64 time=96.9 ms > ... > > Even stranger is that when I run two pings, the times are not about equal, > but each one starts at random number lower than 100 ms and is decreasing by > 1ms. > > Interfaces eth0 and eth3 are OK. The other end of cable is also 5704C. > > > I've tried also the Broadcom bcm5700-7.0.0 driver; with this one eth1 and > eth2 do not work at all (when cable is plugged, interface isn't RUNNING). > > My opinion is that it can be something with IRQ sharing on the same NIC. I > tried to put more 2-port NICs and it works well if interrupts are shared > between the NICs. > > The motherboard is Tyan S2880; kernel is 2.6.0-test7-bk8. > > > Best Regards, > > -- > Jan Oravec > 6COM s.r.o. > http://www.6com.sk > From shemminger@osdl.org Fri Oct 17 10:26:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 10:27:12 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HHQb25020149 for ; Fri, 17 Oct 2003 10:26:38 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9HHQVo26622; Fri, 17 Oct 2003 10:26:31 -0700 Date: Fri, 17 Oct 2003 10:26:22 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: 8139cp NAPI race? Message-Id: <20031017102622.19a8511f.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 913 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 Content-Length: 492 Lines: 20 If I read the documentation (and other drivers) the two lines in 8139cp.c look backwards: static int cp_rx_poll (struct net_device *dev, int *budget) { ... /* if we did not reach work limit, then we're done with * this round of polling */ if (rx_work) { if (cpr16(IntrStatus) & cp_rx_intr_mask) goto rx_status_loop; <1> cpw16_f(IntrMask, cp_intr_mask); <2> netif_rx_complete(dev); return 0; /* done */ } Isn't re-enable supposed to be after rx_complete to avoid races. From felipewd@terra.com.br Fri Oct 17 12:57:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 12:57:41 -0700 (PDT) Received: from paiol.terra.com.br (paiol.terra.com.br [200.176.3.18]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HJv125028707 for ; Fri, 17 Oct 2003 12:57:03 -0700 Received: from itaim.terra.com.br (itaim.terra.com.br [200.176.3.76]) by paiol.terra.com.br (Postfix) with ESMTP id 752E58485DD; Fri, 17 Oct 2003 16:57:00 -0300 (BRT) Received: from terra.com.br (200-163-191-105.paemt7004.e.brasiltelecom.net.br [200.163.191.105]) (authenticated user felipewd) by itaim.terra.com.br (Postfix) with ESMTP id EE0352E0150; Fri, 17 Oct 2003 16:56:58 -0300 (BRT) Message-ID: <3F903C55.5020403@terra.com.br> Date: Fri, 17 Oct 2003 17:00:37 -0200 From: Felipe W Damasio User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik Cc: Linux Kernel Mailing List , linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] finer-grained locking in wan/lmc driver References: <3F81B086.9050905@terra.com.br> <3F8C3DFD.1050706@pobox.com> In-Reply-To: <3F8C3DFD.1050706@pobox.com> Content-Type: multipart/mixed; boundary="------------020001080300020004010000" X-archive-position: 914 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipewd@terra.com.br Precedence: bulk X-list: netdev Content-Length: 7699 Lines: 281 This is a multi-part message in MIME format. --------------020001080300020004010000 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Jeff, Jeff Garzik wrote: > conflicts with a just-applied patch... can you wait a few days, then > resend against the latest -bk snapshot? Resend against 2.6.0-test7-bk9. Please apply, Felipe --------------020001080300020004010000 Content-Type: text/plain; name="lmc-locking.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lmc-locking.patch" --- linux-2.6.0-test7-bk9/drivers/net/wan/lmc/lmc_main.c.orig 2003-10-17 16:57:28.000000000 -0200 +++ linux-2.6.0-test7-bk9/drivers/net/wan/lmc/lmc_main.c 2003-10-17 16:58:19.000000000 -0200 @@ -132,7 +132,6 @@ lmc_ctl_t ctl; int ret; u_int16_t regVal; - unsigned long flags; struct sppp *sp; @@ -142,12 +141,6 @@ lmc_trace(dev, "lmc_ioctl in"); - /* - * Most functions mess with the structure - * Disable interrupts while we do the polling - */ - spin_lock_irqsave(&sc->lmc_lock, flags); - switch (cmd) { /* * Return current driver state. Since we keep this up @@ -173,7 +166,8 @@ if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t))) return -EFAULT; - + + spin_lock_irq(&sc->lmc_lock); sc->lmc_media->set_status (sc, &ctl); if(ctl.crc_length != sc->ictl.crc_length) { @@ -188,9 +182,11 @@ sp->pp_flags &= ~PP_KEEPALIVE; /* Turn off */ else sp->pp_flags |= PP_KEEPALIVE; /* Turn on */ + + spin_unlock_irq(&sc->lmc_lock); ret = 0; - break; + break; case LMCIOCIFTYPE: /*fold01*/ { @@ -204,14 +200,14 @@ if (copy_from_user(&new_type, ifr->ifr_data, sizeof(u_int16_t))) return -EFAULT; - - + if (new_type == old_type) { - ret = 0 ; + ret = 0; break; /* no change */ } - + + spin_lock_irq(&sc->lmc_lock); lmc_proto_close(sc); lmc_proto_detach(sc); @@ -219,12 +215,14 @@ // lmc_proto_init(sc); lmc_proto_attach(sc); lmc_proto_open(sc); + spin_unlock_irq(&sc->lmc_lock); ret = 0 ; break ; } case LMCIOCGETXINFO: /*fold01*/ + spin_lock_irq(&sc->lmc_lock); sc->lmc_xinfo.Magic0 = 0xBEEFCAFE; sc->lmc_xinfo.PciCardType = sc->lmc_cardtype; @@ -240,6 +238,7 @@ sc->lmc_xinfo.Magic1 = 0xDEADBEEF; + spin_unlock_irq(&sc->lmc_lock); if (copy_to_user(ifr->ifr_data, &sc->lmc_xinfo, sizeof (struct lmc_xinfo))) return -EFAULT; @@ -248,6 +247,7 @@ break; case LMCIOCGETLMCSTATS: /*fold01*/ + spin_lock_irq(&sc->lmc_lock); if (sc->lmc_cardtype == LMC_CARDTYPE_T1){ lmc_mii_writereg (sc, 0, 17, T1FRAMER_FERR_LSB); sc->stats.framingBitErrorCount += @@ -271,6 +271,7 @@ sc->stats.severelyErroredFrameCount += regVal & T1FRAMER_SEF_MASK; } + spin_unlock_irq(&sc->lmc_lock); if (copy_to_user(ifr->ifr_data, &sc->stats, sizeof (struct lmc_statistics))) @@ -285,11 +286,13 @@ break; } + spin_lock_irq(&sc->lmc_lock); memset (&sc->stats, 0, sizeof (struct lmc_statistics)); sc->stats.check = STATCHECK; sc->stats.version_size = (DRIVER_VERSION << 16) + sizeof (struct lmc_statistics); sc->stats.lmc_cardtype = sc->lmc_cardtype; + spin_unlock_irq(&sc->lmc_lock); ret = 0; break; @@ -306,8 +309,11 @@ if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t))) return -EFAULT; - sc->lmc_media->set_circuit_type(sc, ctl.circuit_type); + + spin_lock_irq(&sc->lmc_lock); + sc->lmc_media->set_circuit_type(sc, ctl.circuit_type); sc->ictl.circuit_type = ctl.circuit_type; + spin_unlock_irq(&sc->lmc_lock); ret = 0; break; @@ -319,9 +325,11 @@ } /* Reset driver and bring back to current state */ + spin_lock_irq(&sc->lmc_lock); printk (" REG16 before reset +%04x\n", lmc_mii_readreg (sc, 0, 16)); lmc_running_reset (dev); printk (" REG16 after reset +%04x\n", lmc_mii_readreg (sc, 0, 16)); + spin_unlock_irq(&sc->lmc_lock); LMC_EVENT_LOG(LMC_EVENT_FORCEDRESET, LMC_CSR_READ (sc, csr_status), lmc_mii_readreg (sc, 0, 16)); @@ -364,6 +372,8 @@ case lmc_xilinx_reset: /*fold02*/ { u16 mii; + + spin_lock_irq(&sc->lmc_lock); mii = lmc_mii_readreg (sc, 0, 16); /* @@ -422,11 +432,8 @@ lmc_led_off(sc, LMC_DS3_LED2); } } - - - ret = 0x0; - + spin_unlock_irq(&sc->lmc_lock); } break; @@ -434,6 +441,7 @@ { u16 mii; int timeout = 500000; + spin_lock_irq(&sc->lmc_lock); mii = lmc_mii_readreg (sc, 0, 16); /* @@ -476,12 +484,10 @@ * stop driving Xilinx-related signals */ lmc_gpio_mkinput(sc, 0xff); - ret = 0x0; - + spin_unlock_irq(&sc->lmc_lock); break; - } case lmc_xilinx_load: /*fold02*/ @@ -505,12 +511,13 @@ if(copy_from_user(data, xc.data, xc.len)) { kfree(data); - ret = -ENOMEM; + ret = -EFAULT; break; } printk("%s: Starting load of data Len: %d at 0x%p == 0x%p\n", dev->name, xc.len, xc.data, data); + spin_lock_irq(&sc->lmc_lock); lmc_gpio_mkinput(sc, 0xff); /* @@ -609,8 +616,8 @@ kfree(data); + spin_unlock_irq(&sc->lmc_lock); ret = 0; - break; } default: /*fold02*/ @@ -619,7 +626,9 @@ } netif_wake_queue(dev); - sc->lmc_txfull = 0; + spin_lock_irq(&sc->lmc_lock); + sc->lmc_txfull = 0; + spin_unlock_irq(&sc->lmc_lock); } break; @@ -629,8 +638,6 @@ break; } - spin_unlock_irqrestore(&sc->lmc_lock, flags); /*fold01*/ - lmc_trace(dev, "lmc_ioctl out"); return ret; @@ -930,7 +937,10 @@ * later on, no one else will take our card away from * us. */ - request_region (ioaddr, LMC_REG_RANGE, dev->name); + if (!request_region (ioaddr, LMC_REG_RANGE, dev->name)) { + printk (KERN_WARNING "io port %3lX is busy", ioaddr); + return NULL; + } sc->lmc_cardtype = LMC_CARDTYPE_UNKNOWN; sc->lmc_timing = LMC_CTL_CLOCK_SOURCE_EXT; @@ -1060,8 +1070,7 @@ * Fix the two variables * */ - if (!(check_region (pci_ioaddr, LMC_REG_RANGE)) && - (vendor == CORRECT_VENDOR_ID) && + if ((vendor == CORRECT_VENDOR_ID) && (device == CORRECT_DEV_ID) && ((subvendor == PCI_VENDOR_LMC) || (subdevice == PCI_VENDOR_LMC))){ struct net_device *cur, *prev = NULL; --------------020001080300020004010000-- From spi@gmxpro.de Fri Oct 17 13:50:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 13:51:25 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HKon25030460 for ; Fri, 17 Oct 2003 13:50:51 -0700 Received: (qmail 24440 invoked by uid 65534); 17 Oct 2003 20:50:41 -0000 Received: from pD951873E.dip.t-dialin.net (EHLO d800) (217.81.135.62) by mail.gmx.net (mp026) with SMTP; 17 Oct 2003 22:50:41 +0200 X-Authenticated: #555711 From: "Sebastian Piecha" To: James Morris , LK-net , Date: Fri, 17 Oct 2003 22:50:58 +0200 MIME-Version: 1.0 Subject: Re: oops in skbuff.c Message-ID: <3F907252.1538.AC80B30@localhost> Priority: normal X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-archive-position: 915 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: spi@gmxpro.de Precedence: bulk X-list: netdev Content-Length: 647 Lines: 23 > > On Thu, 16 Oct 2003, Sebastian Piecha wrote: > > > > > panics. Copying more than 4 GB to the samba share also lets the > > > kernel panic with an OOPS. > > > > Does the above cause a panic for the 2.6-test kernels? > > Do you have netfilter enabled, and if so, any iptables modules loaded? > > > > > I did a mistake. iptables is installed but no rules added. I'll > remove iptables and rerun the check. For being sure I removed iptables but again the oops happened. I also tried kernel 2.4.18 without success. Does anybody have a clue how to go on? -- Mit freundlichen Gruessen/Best regards, Sebastian Piecha EMail: spi@gmxpro.de From da-x@gmx.net Fri Oct 17 14:32:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 14:33:23 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HLWf25031567 for ; Fri, 17 Oct 2003 14:32:42 -0700 Received: (qmail 26263 invoked by uid 65534); 17 Oct 2003 21:32:34 -0000 Received: from bzq-233-119.red.bezeqint.net (HELO callisto.yi.org) (212.179.233.119) by mail.gmx.net (mp006) with SMTP; 17 Oct 2003 23:32:34 +0200 X-Authenticated: #12437197 Date: Fri, 17 Oct 2003 23:32:35 +0200 From: Dan Aloni To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH 2.6] repost, fix sysctl breakage during network device renaming, for ipv4 Message-ID: <20031017213235.GA5278@callisto.yi.org> References: <20030901164624.GA26886@callisto.yi.org> <20030901094127.6a0f6878.davem@redhat.com> <20030901165559.GA27099@callisto.yi.org> <20030901113143.1ba34464.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030901113143.1ba34464.davem@redhat.com> User-Agent: Mutt/1.5.4i X-archive-position: 916 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: da-x@gmx.net Precedence: bulk X-list: netdev Content-Length: 12171 Lines: 387 On Mon, Sep 01, 2003 at 11:31:43AM -0700, David S. Miller wrote: > On Mon, 1 Sep 2003 19:55:59 +0300 > Dan Aloni wrote: > > > The private copy of strdup() is something that I'd also wouldn't > > want, but I don't have much choice. Please read a recent > > thread in lkml regarding strdup() consolidation. > > Ugh, I'm afraid to look... I guess the controversy is > over the allocation function, what GFP_* flags it should > use etc.? > > For now just call the thing in your patch netdev_name_dup() or > something like that. I can't handle having something named > "strdup()" in there :-) Here is the patch. I've compiled and tested it. 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.1292, 2003-10-17 22:39:48+02:00, da-x@gmx.net Sysctl assumes its ctl_table.procname field is const, but the networking points ctl_table.procname to dev->name. When renaming a network device using SIOCSIFNAME, dev->name is modified and sysctl's assumption breaks, causing this behaviour, at least: 1. sysctl wouldn't be able to remove the proc entry when the device requests to be unregistered, because it would be using the new name instead of the old one. 2. proc entries for devices remain with the old name after rename. This change includes allocating the current device name to a new copy upon registering with sysctl, plus re-registering with sysctl when the device is renamed. This only fixes IPv4, IPv6, and net/core/neightbour.c. Fixes for ax25 and decnet are also planned. include/linux/netdevice.h | 3 +++ net/core/neighbour.c | 29 ++++++++++++++++++++++++++--- net/core/sysctl_net_core.c | 13 +++++++++++++ net/ipv4/devinet.c | 40 +++++++++++++++++++++++++++++++++++----- net/ipv6/addrconf.c | 37 ++++++++++++++++++++++++++++++++++--- 5 files changed, 111 insertions(+), 11 deletions(-) diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h Fri Oct 17 22:40:18 2003 +++ b/include/linux/netdevice.h Fri Oct 17 22:40:18 2003 @@ -869,6 +869,9 @@ extern void dev_clear_fastroute(struct net_device *dev); #endif +#ifdef CONFIG_SYSCTL +extern char *net_sysctl_strdup(const char *s); +#endif #endif /* __KERNEL__ */ diff -Nru a/net/core/neighbour.c b/net/core/neighbour.c --- a/net/core/neighbour.c Fri Oct 17 22:40:18 2003 +++ b/net/core/neighbour.c Fri Oct 17 22:40:18 2003 @@ -1627,6 +1627,9 @@ int p_id, int pdev_id, char *p_name) { struct neigh_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL); + const char *dev_name_source = NULL; + char *dev_name = NULL; + int err = 0; if (!t) return -ENOBUFS; @@ -1643,8 +1646,10 @@ t->neigh_vars[9].data = &p->anycast_delay; t->neigh_vars[10].data = &p->proxy_delay; t->neigh_vars[11].data = &p->locktime; + + dev_name_source = t->neigh_dev[0].procname; if (dev) { - t->neigh_dev[0].procname = dev->name; + dev_name_source = dev->name; t->neigh_dev[0].ctl_name = dev->ifindex; memset(&t->neigh_vars[12], 0, sizeof(ctl_table)); } else { @@ -1653,6 +1658,15 @@ t->neigh_vars[14].data = (int *)(p + 1) + 2; t->neigh_vars[15].data = (int *)(p + 1) + 3; } + + dev_name = net_sysctl_strdup(dev_name_source); + if (!dev_name) { + err = -ENOBUFS; + goto free; + } + + t->neigh_dev[0].procname = dev_name; + t->neigh_neigh_dir[0].ctl_name = pdev_id; t->neigh_proto_dir[0].procname = p_name; @@ -1665,11 +1679,19 @@ t->sysctl_header = register_sysctl_table(t->neigh_root_dir, 0); if (!t->sysctl_header) { - kfree(t); - return -ENOBUFS; + err = -ENOBUFS; + goto free_procname; } p->sysctl_table = t; return 0; + + /* error path */ + free_procname: + kfree(dev_name); + free: + kfree(t); + + return err; } void neigh_sysctl_unregister(struct neigh_parms *p) @@ -1678,6 +1700,7 @@ struct neigh_sysctl_table *t = p->sysctl_table; p->sysctl_table = NULL; unregister_sysctl_table(t->sysctl_header); + kfree(t->neigh_dev[0].procname); kfree(t); } } diff -Nru a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c --- a/net/core/sysctl_net_core.c Fri Oct 17 22:40:18 2003 +++ b/net/core/sysctl_net_core.c Fri Oct 17 22:40:18 2003 @@ -33,6 +33,19 @@ extern char sysctl_divert_version[]; #endif /* CONFIG_NET_DIVERT */ +/* + * This strdup() is used for creating copies of network + * device names to be handed over to sysctl. + */ + +char *net_sysctl_strdup(const char *s) +{ + char *rv = kmalloc(strlen(s)+1, GFP_KERNEL); + if (rv) + strcpy(rv, s); + return rv; +} + ctl_table core_table[] = { #ifdef CONFIG_NET { diff -Nru a/net/ipv4/devinet.c b/net/ipv4/devinet.c --- a/net/ipv4/devinet.c Fri Oct 17 22:40:18 2003 +++ b/net/ipv4/devinet.c Fri Oct 17 22:40:18 2003 @@ -904,6 +904,14 @@ * not interesting to applications using netlink. */ inetdev_changename(dev, in_dev); + +#ifdef CONFIG_SYSCTL + devinet_sysctl_unregister(&in_dev->cnf); + neigh_sysctl_unregister(in_dev->arp_parms); + neigh_sysctl_register(dev, in_dev->arp_parms, NET_IPV4, + NET_IPV4_NEIGH, "ipv4"); + devinet_sysctl_register(in_dev, &in_dev->cnf); +#endif break; } out: @@ -1301,6 +1309,7 @@ int i; struct net_device *dev = in_dev ? in_dev->dev : NULL; struct devinet_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL); + char *dev_name = NULL; if (!t) return; @@ -1309,13 +1318,25 @@ t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf; t->devinet_vars[i].de = NULL; } + if (dev) { - t->devinet_dev[0].procname = dev->name; + dev_name = dev->name; t->devinet_dev[0].ctl_name = dev->ifindex; } else { - t->devinet_dev[0].procname = "default"; + dev_name = "default"; t->devinet_dev[0].ctl_name = NET_PROTO_CONF_DEFAULT; } + + /* + * Make a copy of dev_name, because '.procname' is regarded as const + * by sysctl and we wouldn't want anyone to change it under our feet + * (see SIOCSIFNAME). + */ + dev_name = net_sysctl_strdup(dev_name); + if (!dev_name) + goto free; + + t->devinet_dev[0].procname = dev_name; t->devinet_dev[0].child = t->devinet_vars; t->devinet_dev[0].de = NULL; t->devinet_conf_dir[0].child = t->devinet_dev; @@ -1327,9 +1348,17 @@ t->sysctl_header = register_sysctl_table(t->devinet_root_dir, 0); if (!t->sysctl_header) - kfree(t); - else - p->sysctl = t; + goto free_procname; + + p->sysctl = t; + return; + + /* error path */ + free_procname: + kfree(dev_name); + free: + kfree(t); + return; } static void devinet_sysctl_unregister(struct ipv4_devconf *p) @@ -1338,6 +1367,7 @@ struct devinet_sysctl_table *t = p->sysctl; p->sysctl = NULL; unregister_sysctl_table(t->sysctl_header); + kfree(t->devinet_dev[0].procname); kfree(t); } } diff -Nru a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c --- a/net/ipv6/addrconf.c Fri Oct 17 22:40:18 2003 +++ b/net/ipv6/addrconf.c Fri Oct 17 22:40:18 2003 @@ -1875,6 +1875,14 @@ break; case NETDEV_CHANGE: break; + case NETDEV_CHANGENAME: +#ifdef CONFIG_SYSCTL + addrconf_sysctl_unregister(&idev->cnf); + neigh_sysctl_unregister(idev->nd_parms); + neigh_sysctl_register(dev, idev->nd_parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6"); + addrconf_sysctl_register(idev, &idev->cnf); +#endif + break; }; return NOTIFY_OK; @@ -2815,6 +2823,7 @@ int i; struct net_device *dev = idev ? idev->dev : NULL; struct addrconf_sysctl_table *t; + char *dev_name = NULL; t = kmalloc(sizeof(*t), GFP_KERNEL); if (t == NULL) @@ -2826,12 +2835,24 @@ t->addrconf_vars[i].extra1 = idev; /* embedded; no ref */ } if (dev) { - t->addrconf_dev[0].procname = dev->name; + dev_name = dev->name; t->addrconf_dev[0].ctl_name = dev->ifindex; } else { - t->addrconf_dev[0].procname = "default"; + dev_name = "default"; t->addrconf_dev[0].ctl_name = NET_PROTO_CONF_DEFAULT; } + + /* + * Make a copy of dev_name, because '.procname' is regarded as const + * by sysctl and we wouldn't want anyone to change it under our feet + * (see SIOCSIFNAME). + */ + dev_name = net_sysctl_strdup(dev_name); + if (!dev_name) + goto free; + + t->addrconf_dev[0].procname = dev_name; + t->addrconf_dev[0].child = t->addrconf_vars; t->addrconf_dev[0].de = NULL; t->addrconf_conf_dir[0].child = t->addrconf_dev; @@ -2843,9 +2864,18 @@ t->sysctl_header = register_sysctl_table(t->addrconf_root_dir, 0); if (t->sysctl_header == NULL) - kfree(t); + goto free_procname; else p->sysctl = t; + return; + + /* error path */ + free_procname: + kfree(dev_name); + free: + kfree(t); + + return; } static void addrconf_sysctl_unregister(struct ipv6_devconf *p) @@ -2854,6 +2884,7 @@ struct addrconf_sysctl_table *t = p->sysctl; p->sysctl = NULL; unregister_sysctl_table(t->sysctl_header); + kfree(t->addrconf_dev[0].procname); kfree(t); } } =================================================================== This BitKeeper patch contains the following changesets: + ## Wrapped with gzip_uu ## M'XL( +)3D#\ ^59;6_;.!+^+/T*7@MD)%M^2]QL=W' )8%=B3/#9X;#9X;L:_0UYZ)C1*SY M8+Y&'[-<=HR[T4,KY1*>;[(,GMO];,3;$7MH#[A(^; ]3-+)0Y.VW.9])@8F M"%XS&?;1E(N\8Y"6-7\C'\>\8]RQ5+Y\6LURV_+%BWL4XM0:E%KYKB.XYH?$&D1&E"$ MK3;!;>(A2CM6T+']MYAV,$8J3,=E>-!;!S6Q^1/ZL4ZNY+UAKPU%EF8LA%'<<*'$4I@+$MSV4"]B42RSQ$8 'AJ99+T#HVS M)-VL+S,4\6GSG7IHH7_T>8H$AP>E!398945))2%'DUR-W%Y\/KF].+MZ__-I M8Z&O8(RR* %,$6)II SDVHLW>>''6"99BGJ"LT'>0"$KK,D^*/9XGTV3;"(: MB$DTY R2$/3A#\&"E';0?3891ND;">)(.:+P"S[*IEQ[K=Q"/)7B$=TK5\I( MZ)_2 <'_/>$Y! ,TP<@D%?PNR247/(+H<84)')'%3$JBTJ^P<@C)/2K\A9!S M%J$LUN\S4,A2WM(:M+5 D\#ZQ9DH(>0*,4M2=)_(_EQ1&V0Q )G/J!>B- 0).-'-!EG:I$+KY6B MQE$$N('&PXD"V%P3F"_F(K3E+$E>0HU:Q8III%DZ?(3T? "0%]=3NZ$^W8;. M"\BI=I@)WDYY7/5CU5JATS[2X"A5[H(Z6C7BH]AD3$)UAG@$^EJ9JID_( ML6PO,*\7;&(VO_/'-#'#YKMG=J^"FXRG=EOY"P^ML+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z@E\C\R;,]\*]+?.!?.-(24MX-N_8:_]+-_&O_3QXF7LK!Q>W&9@ZN1^Y% M)Q#?\X"%C9#!M@9>^W#Z2_?DX_NK\U.UUSK;R+F:=",[[\;-!5E%.Q+SDO2< ME=W%O^I<[!9M$;!CZBAPV%/6)]P0C?Z#04BAZ+;^W\S#U%4\H M0?V]E8=AW$:$_M_S\'S5GCGH4:"'(JYV4=\V'NM@U(=SZ@]GWF\U[J6^XRYS @[S8?%/E6_S<7]GDXR">C(]P+P\"CU/POI)7C0PX< -- Dan Aloni da-x@gmx.net From shemminger@osdl.org Fri Oct 17 15:39:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 15:40:24 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HMdn25000579 for ; Fri, 17 Oct 2003 15:39:50 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9HMdco23719; Fri, 17 Oct 2003 15:39:38 -0700 Date: Fri, 17 Oct 2003 15:39:34 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [RFT] NAPI for 8139too Message-Id: <20031017153934.6d48e578.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 917 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 Content-Length: 9850 Lines: 323 Modified the 2.6.0-test7 driver to use NAPI. It reduces the CPU load when getting excessive network traffic but doesn't change normal performance. I get the same numbers with netperf for send and receive as before, but when running a pktgen DOS style flood the CPU usage goes from 90+% down to 75% and the system is still usable. No problems found so far, but still needs more testing because some of the error paths might break. diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c --- a/drivers/net/8139too.c Fri Oct 17 15:32:35 2003 +++ b/drivers/net/8139too.c Fri Oct 17 15:32:35 2003 @@ -92,7 +92,7 @@ */ #define DRV_NAME "8139too" -#define DRV_VERSION "0.9.26" +#define DRV_VERSION "0.9.27" #include @@ -159,9 +159,6 @@ static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; -/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ -static int max_interrupt_work = 20; - /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). The RTL chips use a 64 element hash table based on the Ethernet CRC. */ static int multicast_filter_limit = 32; @@ -589,13 +586,11 @@ MODULE_LICENSE("GPL"); MODULE_PARM (multicast_filter_limit, "i"); -MODULE_PARM (max_interrupt_work, "i"); MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM (full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM (debug, "i"); MODULE_PARM_DESC (debug, "8139too bitmapped message enable number"); MODULE_PARM_DESC (multicast_filter_limit, "8139too maximum number of filtered multicast addresses"); -MODULE_PARM_DESC (max_interrupt_work, "8139too maximum events handled per interrupt"); MODULE_PARM_DESC (media, "8139too: Bits 4+9: force full duplex, bit 5: 100Mbps"); MODULE_PARM_DESC (full_duplex, "8139too: Force full duplex for board(s) (1)"); @@ -618,6 +613,7 @@ static void __set_rx_mode (struct net_device *dev); static void rtl8139_hw_start (struct net_device *dev); static struct ethtool_ops rtl8139_ethtool_ops; +static int rtl8139_poll(struct net_device *dev, int *budget); #ifdef USE_IO_OPS @@ -963,6 +959,8 @@ /* The Rtl8139-specific entries in the device structure. */ dev->open = rtl8139_open; dev->hard_start_xmit = rtl8139_start_xmit; + dev->poll = rtl8139_poll; + dev->weight = 16; dev->stop = rtl8139_close; dev->get_stats = rtl8139_get_stats; dev->set_multicast_list = rtl8139_set_rx_mode; @@ -1879,24 +1877,28 @@ #endif } -static void rtl8139_rx_interrupt (struct net_device *dev, - struct rtl8139_private *tp, void *ioaddr) +/* + * NAPI poll routine. + */ +static int rtl8139_poll(struct net_device *dev, int *budget) { + struct rtl8139_private *tp = dev->priv; + void *ioaddr = tp->mmio_addr; unsigned char *rx_ring; u16 cur_rx; + int rx, status; + unsigned long flags; - assert (dev != NULL); - assert (tp != NULL); - assert (ioaddr != NULL); - + spin_lock_irqsave(&tp->lock, flags); + rescan: rx_ring = tp->rx_ring; cur_rx = tp->cur_rx; - - DPRINTK ("%s: In rtl8139_rx(), current %4.4x BufAddr %4.4x," + rx = 0; + DPRINTK ("%s: In rtl8139_rx_poll(), current %4.4x BufAddr %4.4x," " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, RTL_R16 (RxBufAddr), RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); - + while ((RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { int ring_offset = cur_rx % RX_BUF_LEN; u32 rx_status; @@ -1943,18 +1945,13 @@ (rx_size < 8) || (!(rx_status & RxStatusOK))) { rtl8139_rx_err (rx_status, dev, tp, ioaddr); - return; + goto err; } - /* Malloc up new buffer, compatible with net-2e. */ - /* Omit the four octet CRC from the length. */ - - /* TODO: consider allocating skb's outside of - * interrupt context, both to speed interrupt processing, - * and also to reduce the chances of having to - * drop packets here under memory pressure. - */ + /* Drop lock so we can copy data with interrupts enabled. */ + spin_unlock_irqrestore(&tp->lock, flags); + /* Omit the four octet CRC from the length. */ skb = dev_alloc_skb (pkt_size + 2); if (skb) { skb->dev = dev; @@ -1964,22 +1961,35 @@ skb_put (skb, pkt_size); skb->protocol = eth_type_trans (skb, dev); - netif_rx (skb); + netif_receive_skb(skb); dev->last_rx = jiffies; tp->stats.rx_bytes += pkt_size; tp->stats.rx_packets++; } else { - printk (KERN_WARNING - "%s: Memory squeeze, dropping packet.\n", - dev->name); + /* Since this board has a small fixed rx_ring, + * it is better to toss packets than hold them + * in the ring. + */ + if (net_ratelimit()) + printk (KERN_WARNING + "%s: Memory squeeze, dropping packet.\n", + dev->name); tp->stats.rx_dropped++; } + spin_lock_irqsave(&tp->lock, flags); cur_rx = (cur_rx + rx_size + 4 + 3) & ~3; RTL_W16 (RxBufPtr, cur_rx - 16); - if (RTL_R16 (IntrStatus) & RxAckBits) + status = RTL_R16 (IntrStatus) & RxAckBits; + if (status & (RxFIFOOver | RxOverflow)) + tp->stats.rx_errors++; + + if (status) RTL_W16_F (IntrStatus, RxAckBits); + + if (++rx >= dev->quota) + break; } DPRINTK ("%s: Done rtl8139_rx(), current %4.4x BufAddr %4.4x," @@ -1988,6 +1998,23 @@ RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); tp->cur_rx = cur_rx; + err: + *budget -= rx; + + if ((dev->quota -= rx) <= 0) { + spin_unlock_irqrestore(&tp->lock, flags); + return 1; /* not done */ + } + + /* last gasp check if interrupt still pending */ + if (RTL_R16 (IntrStatus) & RxAckBits) { + DPRINTK("%s: going back for more work\n", dev->name); + goto rescan; + } + netif_rx_complete(dev); + RTL_W16 (IntrMask, rtl8139_intr_mask); + spin_unlock_irqrestore(&tp->lock, flags); + return 0; /* done */ } @@ -2013,9 +2040,7 @@ status &= ~RxUnderrun; } - /* XXX along with rtl8139_rx_err, are we double-counting errors? */ - if (status & - (RxUnderrun | RxOverflow | RxErr | RxFIFOOver)) + if (status & RxUnderrun) tp->stats.rx_errors++; if (status & PCSTimeout) @@ -2032,7 +2057,6 @@ } } - /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance, @@ -2040,73 +2064,66 @@ { struct net_device *dev = (struct net_device *) dev_instance; struct rtl8139_private *tp = dev->priv; - int boguscnt = max_interrupt_work; void *ioaddr = tp->mmio_addr; int ackstat, status; int link_changed = 0; /* avoid bogus "uninit" warning */ - int handled = 0; spin_lock (&tp->lock); - do { - status = RTL_R16 (IntrStatus); - - /* h/w no longer present (hotplug?) or major error, bail */ - if (status == 0xFFFF) - break; - - if ((status & - (PCIErr | PCSTimeout | RxUnderrun | RxOverflow | - RxFIFOOver | TxErr | TxOK | RxErr | RxOK)) == 0) - break; - - handled = 1; + status = RTL_R16 (IntrStatus); - /* Acknowledge all of the current interrupt sources ASAP, but - an first get an additional status bit from CSCR. */ - if (status & RxUnderrun) - link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; - - /* The chip takes special action when we clear RxAckBits, - * so we clear them later in rtl8139_rx_interrupt - */ - ackstat = status & ~(RxAckBits | TxErr); - RTL_W16 (IntrStatus, ackstat); + /* h/w no longer present (hotplug?) or major error, bail */ + if (unlikely(status == 0xFFFF)) { + spin_unlock(&tp->lock); + return IRQ_HANDLED; + } - DPRINTK ("%s: interrupt status=%#4.4x ackstat=%#4.4x new intstat=%#4.4x.\n", - dev->name, status, ackstat, RTL_R16 (IntrStatus)); + /* no interrupt source present */ + if (unlikely((status & rtl8139_intr_mask) == 0)) { + spin_unlock(&tp->lock); + return IRQ_NONE; + } - if (netif_running (dev) && (status & RxAckBits)) - rtl8139_rx_interrupt (dev, tp, ioaddr); + /* Acknowledge all of the current interrupt sources ASAP, but + an first get an additional status bit from CSCR. */ + if (unlikely(status & RxUnderrun)) + link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; - /* Check uncommon events with one test. */ - if (status & (PCIErr | PCSTimeout | RxUnderrun | RxOverflow | - RxFIFOOver | RxErr)) - rtl8139_weird_interrupt (dev, tp, ioaddr, - status, link_changed); - - if (netif_running (dev) && (status & (TxOK | TxErr))) { - rtl8139_tx_interrupt (dev, tp, ioaddr); - if (status & TxErr) - RTL_W16 (IntrStatus, TxErr); - } - - boguscnt--; - } while (boguscnt > 0); + /* The chip takes special action when we clear RxAckBits, + * so we clear them later in poll + */ + ackstat = status & ~(RxAckBits | TxErr); + RTL_W16 (IntrStatus, ackstat); - if (boguscnt <= 0) { - printk (KERN_WARNING "%s: Too much work at interrupt, " - "IntrStatus=0x%4.4x.\n", dev->name, status); + DPRINTK ("%s: interrupt status=%#4.4x ackstat=%#4.4x new intstat=%#4.4x.\n", + dev->name, status, ackstat, RTL_R16 (IntrStatus)); - /* Clear all interrupt sources. */ - RTL_W16 (IntrStatus, 0xffff); + /* If received interrupt, then disable furthur interrupts + * and enable NAPI polling. + */ + if (netif_running (dev) && (status & RxAckBits)) { + /* disable more receive interrupts */ + RTL_W16 (IntrMask, rtl8139_intr_mask & ~RxAckBits); + netif_rx_schedule(dev); + } + + /* Check uncommon events with one test. */ + if (unlikely(status & (PCIErr|PCSTimeout|RxUnderrun|RxOverflow))) { + rtl8139_weird_interrupt (dev, tp, ioaddr, + status, link_changed); + } + + if (netif_running (dev) && (status & (TxOK | TxErr))) { + rtl8139_tx_interrupt (dev, tp, ioaddr); + if (status & TxErr) + RTL_W16 (IntrStatus, TxErr); } spin_unlock (&tp->lock); DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n", dev->name, RTL_R16 (IntrStatus)); - return IRQ_RETVAL(handled); + return IRQ_HANDLED; } From shemminger@osdl.org Fri Oct 17 15:49:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 15:50:11 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HMnb25001050 for ; Fri, 17 Oct 2003 15:49:38 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9HMnPo25985; Fri, 17 Oct 2003 15:49:26 -0700 Date: Fri, 17 Oct 2003 15:49:21 -0700 From: Stephen Hemminger To: Mike_Phillips@URSCorp.com Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (5/6) ibmtr -- probe2 Message-Id: <20031017154921.7afa10f0.shemminger@osdl.org> In-Reply-To: References: Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 918 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 Content-Length: 1765 Lines: 52 On Fri, 17 Oct 2003 10:37:41 -0300 Mike_Phillips@URSCorp.com wrote: > > In ibmtr_cs.c: > > >+static int ibmtr_init(struct net_device *dev) > >+{ > >+ extern int ibmtr_probe1(struct net_device *, int); > >+ > >+ return ibmtr_probe1(dev, dev->base_addr); > >+} > >+ > > /*====================================================================== > > > ibmtr_attach() creates an "instance" of the driver, allocating > >@@ -194,7 +200,8 @@ > > > link->irq.Instance = info->dev = dev; > > > >- dev->init = &ibmtr_probe; > >+ dev->init = ibmtr_init; > >+ > > This changes dev->init from calling ibmtr_probe to ibmtr_probe1. The probe > routines are specifically split into two because of ibmtr_cs. It doesn't > need to do second probe routing because all the memory spaces get allocated > by the pcmcia driver. Trying to allocate the same IO mem area will fail > because its already been allocated by ibmtr_cs. The probe routine interface needs to change to return the device structure, and the interface that ibmtr_cs needs is one where the structure is allocated. If you look at the details, the new probe1 does pretty much the same thing the old probe did. Doesn't the PCMCIA infrastructure give the correct memory address and set it during the config routine. The problem with the structures was a BUG in the existing code! The PCMCIA code was setting dev->priv to a structure: struct ibmtr_dev_t { dev_link_t link; struct net_device *dev; dev_node_t node; window_handle_t sram_win_handle; struct tok_info ti; } and then later when registered, the dev->init callback goes to ibmtr_probe and then ibmtr_probe1 which expects dev->priv to point to 'struct tok_info' The code is broken in 2.6.0-test7. From brazilnut@us.ibm.com Fri Oct 17 15:59:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 15:59:44 -0700 (PDT) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HMxA25001427 for ; Fri, 17 Oct 2003 15:59:10 -0700 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9HMx4Xn337210; Fri, 17 Oct 2003 18:59:04 -0400 Received: from DYN318364.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9HMx21n225698; Fri, 17 Oct 2003 18:59:02 -0400 Received: (from donf@localhost) by DYN318364.beaverton.ibm.com (8.11.6/8.11.6) id h9HMsRS10951; Fri, 17 Oct 2003 15:54:27 -0700 From: Don Fry Message-Id: <200310172254.h9HMsRS10951@DYN318364.beaverton.ibm.com> Subject: [PATCH] fix for olympic cable pull induced hang To: Mike_Phillips@URSCorp.com Date: Fri, 17 Oct 2003 15:54:27 -0700 (PDT) Cc: netdev@oss.sgi.com X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 919 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brazilnut@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 13254 Lines: 361 A system hang occurs when the cable is pulled with the olympic driver. This was reported against 2.4.19 and this patch is against 2.6.0-test7. I have tested this against 2.4.20, 2.5.67, and 2.6.0-test7. The hang occurred when free_irq was done during interrupt handling of the adapter. I removed those calls, and modified the driver so that it can be brought back into operation without having to rmmod or reboot (if compiled into the kernel). The only anomaly I have seen is that if the olympic card is the only card on the ring and the cable is pulled, it takes two cycles of ifdown tr0, ifup tr0 to become operational again. After the first down/up the card immediately reports another 'Short circuit detected...' and a second down/up is needed. If other cards are on the ring then just one down/up will work. After that when the active monitor is removed from the ring another down/up cycle is required. --- linux-2.6.0-test7/drivers/net/tokenring/olympic.h Wed Oct 8 12:24:51 2003 +++ linux-2.6.0-test7p/drivers/net/tokenring/olympic.h Fri Oct 17 13:56:59 2003 @@ -286,6 +286,9 @@ u32 rx_status_ring_dma_addr; u32 tx_ring_dma_addr; u32 tx_status_ring_dma_addr; + + u16 init_srb; /* be16 */ + u16 reset_needed; /* reset and restart required to correct */ }; struct olympic_adapter_addr_table { --- linux-2.6.0-test7/drivers/net/tokenring/olympic.c Wed Oct 8 12:24:26 2003 +++ linux-2.6.0-test7p/drivers/net/tokenring/olympic.c Fri Oct 17 14:23:35 2003 @@ -65,6 +65,10 @@ * went into version 1.0.0 * 06/04/02 - Add correct start up sequence for the cardbus adapters. * Required for strict compliance with pci power mgmt specs. + * 10/17/03 - Removed free_irq calls which could cause a hang, added + * netif_carrier_{on|off}, if cable is removed then ifdown & ifup + * will bring adapter up, might recover from more errors without + * removing module. - * To Do: * * Wake on lan @@ -117,7 +121,7 @@ */ static char version[] __devinitdata = -"Olympic.c v1.0.5 6/04/02 - Peter De Schrijver & Mike Phillips" ; +"Olympic.c v1.0.6 10/17/03 - Peter De Schrijver & Mike Phillips" ; static char *open_maj_error[] = {"No error", "Lobe Media Test", "Physical Insertion", "Address Verification", "Neighbor Notification (Ring Poll)", @@ -179,7 +183,7 @@ static int olympic_probe(struct pci_dev *pdev, const struct pci_device_id *ent); -static int olympic_init(struct net_device *dev); +static int olympic_reset(struct net_device *dev); static int olympic_open(struct net_device *dev); static int olympic_xmit(struct sk_buff *skb, struct net_device *dev); static int olympic_close(struct net_device *dev); @@ -247,7 +251,12 @@ olympic_priv->olympic_message_level = message_level[card_no] ; olympic_priv->olympic_network_monitor = network_monitor[card_no]; - if ((i = olympic_init(dev))) { + spin_lock_init(&olympic_priv->olympic_lock) ; + + printk("%s \n", version); + printk("%s. I/O at %hx, MMIO at %p, LAP at %p, using irq %d\n", olympic_priv->olympic_card_name, (unsigned int) dev->base_addr,olympic_priv->olympic_mmio, olympic_priv->olympic_lap, dev->irq); + + if ((i = olympic_reset(dev))) { goto op_free_iomap; } @@ -288,7 +297,7 @@ return i; } -static int __devinit olympic_init(struct net_device *dev) +static int olympic_reset(struct net_device *dev) { struct olympic_private *olympic_priv; u8 *olympic_mmio, *init_srb,*adapter_addr; @@ -298,9 +307,6 @@ olympic_priv=(struct olympic_private *)dev->priv; olympic_mmio=olympic_priv->olympic_mmio; - printk("%s \n", version); - printk("%s. I/O at %hx, MMIO at %p, LAP at %p, using irq %d\n", olympic_priv->olympic_card_name, (unsigned int) dev->base_addr,olympic_priv->olympic_mmio, olympic_priv->olympic_lap, dev->irq); - writel(readl(olympic_mmio+BCTL) | BCTL_SOFTRESET,olympic_mmio+BCTL); t=jiffies; while((readl(olympic_mmio+BCTL)) & BCTL_SOFTRESET) { @@ -311,8 +317,6 @@ } } - spin_lock_init(&olympic_priv->olympic_lock) ; - /* Needed for cardbus */ if(!(readl(olympic_mmio+BCTL) & BCTL_MODE_INDICATOR)) { writel(readl(olympic_priv->olympic_mmio+FERMASK)|FERMASK_INT_BIT, olympic_mmio+FERMASK); @@ -384,7 +388,8 @@ printk("LAPWWO: %x, LAPA: %x\n",readl(olympic_mmio+LAPWWO), readl(olympic_mmio+LAPA)); #endif - init_srb=olympic_priv->olympic_lap + ((readw(olympic_mmio+LAPWWO)) & (~0xf800)); + olympic_priv->init_srb = ((readw(olympic_mmio+LAPWWO)) & (~0xf800)); + init_srb=olympic_priv->olympic_lap + olympic_priv->init_srb; #if OLYMPIC_DEBUG { @@ -442,7 +447,7 @@ DECLARE_WAITQUEUE(wait,current) ; - if(request_irq(dev->irq, &olympic_interrupt, SA_SHIRQ , "olympic", dev)) { + if (request_irq(dev->irq, &olympic_interrupt, SA_SHIRQ , dev->name, dev)) { return -EAGAIN; } @@ -451,6 +456,20 @@ printk("pending ints: %x\n",readl(olympic_mmio+SISR_RR)); #endif + if (olympic_priv->reset_needed) { + int i; + + olympic_priv->srb = olympic_priv->init_srb; + if ((i = olympic_reset(dev))) { + printk(KERN_WARNING "%s: Adapter really broken.\n", dev->name); + /* disable all interrupts */ + writel(0, olympic_mmio+SISR_MASK); + free_irq(dev->irq, dev); + return -EIO ; + } + olympic_priv->reset_needed = 0; + } + writel(SISR_MI,olympic_mmio+SISR_MASK_SUM); writel(SISR_MI | SISR_SRB_REPLY, olympic_mmio+SISR_MASK); /* more ints later, doesn't stop arb cmd interrupt */ @@ -470,7 +489,7 @@ do { int i; - for(i=0;iname) ; + /* disable all interrupts */ + writel(0, olympic_mmio+SISR_MASK); + free_irq(dev->irq, dev); + olympic_priv->reset_needed = 1; return -EIO ; } @@ -563,11 +586,15 @@ if (!olympic_priv->olympic_ring_speed && ((readb(init_srb+7) & 0x0f) == 0x0d)) { printk(KERN_WARNING "%s: Tried to autosense ring speed with no monitors present\n",dev->name); printk(KERN_WARNING "%s: Please try again with a specified ring speed \n",dev->name); + /* disable all interrupts */ + writel(0, olympic_mmio+SISR_MASK); free_irq(dev->irq, dev); return -EIO ; } printk(KERN_WARNING "%s: %s\n",dev->name,open_error); + /* disable all interrupts */ + writel(0, olympic_mmio+SISR_MASK); free_irq(dev->irq,dev) ; return -EIO ; @@ -581,10 +608,14 @@ olympic_priv->olympic_laa[3], olympic_priv->olympic_laa[4], olympic_priv->olympic_laa[5]) ; + /* disable all interrupts */ + writel(0, olympic_mmio+SISR_MASK); free_irq(dev->irq,dev) ; return -EIO ; } else { printk(KERN_WARNING "%s: Bad OPEN response: %x\n", dev->name,init_srb[2]); + /* disable all interrupts */ + writel(0, olympic_mmio+SISR_MASK); free_irq(dev->irq, dev); return -EIO; } @@ -638,6 +669,8 @@ if (i==0) { printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers. Adapter disabled\n",dev->name); + /* disable all interrupts */ + writel(0, olympic_mmio+SISR_MASK); free_irq(dev->irq, dev); return -EIO; } @@ -740,6 +773,7 @@ } netif_start_queue(dev); + netif_carrier_on(dev); return 0; } @@ -945,9 +979,8 @@ /* Hotswap gives us this on removal */ if (sisr == 0xffffffff) { printk(KERN_WARNING "%s: Hotswap adapter removal.\n",dev->name) ; - olympic_freemem(dev) ; - free_irq(dev->irq, dev) ; - dev->stop = NULL ; + netif_stop_queue(dev); + netif_carrier_off(dev); spin_unlock(&olympic_priv->olympic_lock) ; return IRQ_NONE; } @@ -958,13 +991,13 @@ /* If we ever get this the adapter is seriously dead. Only a reset is going to * bring it back to life. We're talking pci bus errors and such like :( */ if((sisr & SISR_ERR) && (readl(olympic_mmio+EISR) & EISR_MASK_OPTIONS)) { + netif_stop_queue(dev); + netif_carrier_off(dev); printk(KERN_ERR "Olympic: EISR Error, EISR=%08x\n",readl(olympic_mmio+EISR)) ; printk(KERN_ERR "The adapter must be reset to clear this condition.\n") ; printk(KERN_ERR "Please report this error to the driver maintainer and/\n") ; printk(KERN_ERR "or the linux-tr mailing list.\n") ; - olympic_freemem(dev) ; - free_irq(dev->irq, dev) ; - dev->stop = NULL ; + olympic_priv->reset_needed = 1; spin_unlock(&olympic_priv->olympic_lock) ; return IRQ_HANDLED; } /* SISR_ERR */ @@ -1003,13 +1036,12 @@ if (sisr & SISR_ADAPTER_CHECK) { netif_stop_queue(dev); + netif_carrier_off(dev); printk(KERN_WARNING "%s: Adapter Check Interrupt Raised, 8 bytes of information follow:\n", dev->name); writel(readl(olympic_mmio+LAPWWC),olympic_mmio+LAPA); adapter_check_area = olympic_priv->olympic_lap + ((readl(olympic_mmio+LAPWWC)) & (~0xf800)) ; printk(KERN_WARNING "%s: Bytes %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",dev->name, readb(adapter_check_area+0), readb(adapter_check_area+1), readb(adapter_check_area+2), readb(adapter_check_area+3), readb(adapter_check_area+4), readb(adapter_check_area+5), readb(adapter_check_area+6), readb(adapter_check_area+7)) ; - olympic_freemem(dev) ; - free_irq(dev->irq, dev) ; - dev->stop = NULL ; + olympic_priv->reset_needed = 1; spin_unlock(&olympic_priv->olympic_lock) ; return IRQ_HANDLED; } /* SISR_ADAPTER_CHECK */ @@ -1087,7 +1119,20 @@ DECLARE_WAITQUEUE(wait,current) ; netif_stop_queue(dev); + netif_carrier_off(dev); + t = jiffies ; + + /* if some other command is pending, wait for it */ + while (olympic_priv->srb_queued) { + schedule() ; + if ((jiffies-t) > 10*HZ) { + printk(KERN_WARNING "%s: SRB timed out. May not be fatal. \n",dev->name) ; + olympic_priv->srb_queued=0; + break ; + } + } + writel(olympic_priv->srb,olympic_mmio+LAPA); srb=olympic_priv->olympic_lap + (olympic_priv->srb & (~0xf800)); @@ -1106,9 +1151,9 @@ add_wait_queue(&olympic_priv->srb_wait,&wait) ; set_current_state(TASK_INTERRUPTIBLE) ; - while(olympic_priv->srb_queued) { + while (olympic_priv->srb_queued) { schedule() ; - if(signal_pending(current)) { + if (signal_pending(current)) { printk(KERN_WARNING "%s: SRB timed out.\n",dev->name); printk(KERN_WARNING "SISR=%x MISR=%x\n",readl(olympic_mmio+SISR),readl(olympic_mmio+LISR)); olympic_priv->srb_queued=0; @@ -1129,6 +1174,9 @@ olympic_freemem(dev) ; + /* disable all interrupts */ + writel(0, olympic_mmio+SISR_MASK); + /* reset tx/rx fifo's and busmaster logic */ writel(readl(olympic_mmio+BCTL)|(3<<13),olympic_mmio+BCTL); @@ -1506,37 +1554,24 @@ printk(KERN_WARNING "%s: Force remove MAC frame received\n",dev->name); /* Adapter has been closed by the hardware */ + netif_stop_queue(dev); + netif_carrier_off(dev); /* reset tx/rx fifo's and busmaster logic */ writel(readl(olympic_mmio+BCTL)|(3<<13),olympic_mmio+BCTL); udelay(1); writel(readl(olympic_mmio+BCTL)&~(3<<13),olympic_mmio+BCTL); - netif_stop_queue(dev); - olympic_priv->srb = readw(olympic_priv->olympic_lap + LAPWWO) ; - for(i=0;irx_ring_skb[olympic_priv->rx_status_last_received]); - if (olympic_priv->olympic_rx_ring[olympic_priv->rx_status_last_received].buffer != 0xdeadbeef) { - pci_unmap_single(olympic_priv->pdev, - le32_to_cpu(olympic_priv->olympic_rx_ring[olympic_priv->rx_status_last_received].buffer), - olympic_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE); - } - olympic_priv->rx_status_last_received++; - olympic_priv->rx_status_last_received&=OLYMPIC_RX_RING_SIZE-1; - } - /* unmap rings */ - pci_unmap_single(olympic_priv->pdev, olympic_priv->rx_status_ring_dma_addr, - sizeof(struct olympic_rx_status) * OLYMPIC_RX_RING_SIZE, PCI_DMA_FROMDEVICE); - pci_unmap_single(olympic_priv->pdev, olympic_priv->rx_ring_dma_addr, - sizeof(struct olympic_rx_desc) * OLYMPIC_RX_RING_SIZE, PCI_DMA_TODEVICE); - - pci_unmap_single(olympic_priv->pdev, olympic_priv->tx_status_ring_dma_addr, - sizeof(struct olympic_tx_status) * OLYMPIC_TX_RING_SIZE, PCI_DMA_FROMDEVICE); - pci_unmap_single(olympic_priv->pdev, olympic_priv->tx_ring_dma_addr, - sizeof(struct olympic_tx_desc) * OLYMPIC_TX_RING_SIZE, PCI_DMA_TODEVICE); + i = 0; + /* after a hardware close the LAPWWO takes time to settle */ + do { + olympic_priv->srb = readw(olympic_mmio+LAPWWO) ; + if (olympic_priv->srb == olympic_priv->init_srb) + break; + udelay(2); + } while ((i++) < 50); + olympic_priv->reset_needed = 1; - free_irq(dev->irq,dev); - dev->stop=NULL; printk(KERN_WARNING "%s: Adapter has been closed \n", dev->name) ; } /* If serious error */ @@ -1791,6 +1826,7 @@ pci_release_regions(pdev) ; pci_set_drvdata(pdev,NULL) ; free_netdev(dev) ; + pci_disable_device(pdev); } static struct pci_driver olympic_driver = { -- Don Fry brazilnut@us.ibm.com From jgarzik@pobox.com Fri Oct 17 16:38:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 16:38:50 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9HNcA25004888 for ; Fri, 17 Oct 2003 16:38:11 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39426 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AAeAX-0000fR-LX; Sat, 18 Oct 2003 00:38:05 +0100 Message-ID: <3F907D52.3010908@pobox.com> Date: Fri, 17 Oct 2003 19:37:54 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Don Fry , Mike_Phillips@URSCorp.com CC: netdev@oss.sgi.com Subject: Re: [PATCH] fix for olympic cable pull induced hang References: <200310172254.h9HMsRS10951@DYN318364.beaverton.ibm.com> In-Reply-To: <200310172254.h9HMsRS10951@DYN318364.beaverton.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 920 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: 158 Lines: 10 Thanks, I'll take a look at this. Mike, please let me know if this looks sane to you, too. (i would like your 'ack' before sending upstream...) Jeff From wensong@linux-vs.org Fri Oct 17 23:27:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 23:28:32 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9I6Rm25015169 for ; Fri, 17 Oct 2003 23:27:54 -0700 Received: from penguin.linux-vs.org ([211.136.72.122]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h9I6ROMP017309 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 18 Oct 2003 14:27:36 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h9I6OB2P006600; Sat, 18 Oct 2003 14:24:11 +0800 Date: Sat, 18 Oct 2003 14:24:11 +0800 (CST) From: Wensong Zhang To: netdev@oss.sgi.com cc: "David S. Miller" , Julian Anastasov Subject: [2.4 PATCH] Fix IPVS ftp to use cp->vaddr Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463760943-1531064384-1066458251=:6525" X-archive-position: 921 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev Content-Length: 2608 Lines: 58 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463760943-1531064384-1066458251=:6525 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, Here is a minor patch for IPVS in the kernel 2.4. It is to fix ip_vs_ftp to use cp->vaddr because iph->daddr is already mangled before calling ip_vs_ftp_in. Please check and apply it. Thanks, Wensong ---1463760943-1531064384-1066458251=:6525 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="linux-2.4-ipvs-ftp.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="linux-2.4-ipvs-ftp.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcG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W1lKGlwaC0+cHJv dG9jb2wpLA0KLQkJICBOSVBRVUFEKHRvKSwgbnRvaHMocG9ydCksIE5JUFFV QUQoaXBoLT5kYWRkciksIDApOw0KKwkJICBOSVBRVUFEKHRvKSwgbnRvaHMo cG9ydCksDQorCQkgIE5JUFFVQUQoY3AtPnZhZGRyKSwgbnRvaHMoY3AtPnZw b3J0KSAtIDEpOw0KIA0KIAluX2NwID0gaXBfdnNfY29ubl9pbl9nZXQoaXBo LT5wcm90b2NvbCwNCiAJCQkJIHRvLCBwb3J0LA0KLQkJCQkgaXBoLT5kYWRk ciwgaHRvbnMobnRvaHMoY3AtPnZwb3J0KS0xKSk7DQorCQkJCSBjcC0+dmFk ZHIsIGh0b25zKG50b2hzKGNwLT52cG9ydCktMSkpOw0KIAlpZiAoIW5fY3Ap IHsNCiAJCW5fY3AgPSBpcF92c19jb25uX25ldyhJUFBST1RPX1RDUCwNCiAJ CQkJICAgICAgdG8sIHBvcnQsDQo= ---1463760943-1531064384-1066458251=:6525-- From davem@pizda.ninka.net Fri Oct 17 23:46:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 17 Oct 2003 23:46:58 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9I6kN25015804 for ; Fri, 17 Oct 2003 23:46:24 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA00404; Fri, 17 Oct 2003 23:41:25 -0700 Date: Fri, 17 Oct 2003 23:41:25 -0700 From: "David S. Miller" To: Wensong Zhang Cc: netdev@oss.sgi.com, ja@ssi.bg Subject: Re: [2.4 PATCH] Fix IPVS ftp to use cp->vaddr Message-Id: <20031017234125.457d8ae9.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 922 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: 318 Lines: 10 On Sat, 18 Oct 2003 14:24:11 +0800 (CST) Wensong Zhang wrote: > Here is a minor patch for IPVS in the kernel 2.4. It is to fix ip_vs_ftp > to use cp->vaddr because iph->daddr is already mangled before calling > ip_vs_ftp_in. > > Please check and apply it. Patch applied, thank you Wensong. From zwane@arm.linux.org.uk Sat Oct 18 00:01:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 00:01:56 -0700 (PDT) Received: from montezuma.fsmlabs.com (User-1066460464@modemcable137.219-201-24.mtl.mc.videotron.ca [24.201.219.137]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9I71L25016434 for ; Sat, 18 Oct 2003 00:01:22 -0700 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by montezuma.fsmlabs.com (8.12.8/8.12.8) with ESMTP id h9I71319007935 for ; Sat, 18 Oct 2003 03:01:03 -0400 Date: Sat, 18 Oct 2003 03:01:03 -0400 (EDT) From: Zwane Mwaikambo To: netdev@oss.sgi.com Subject: [PATCH][2.6] fix compilation w/o CONFIG_XFRM Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 923 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: zwane@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 715 Lines: 18 Index: linux-2.6.0-test8/net/ipv6/sit.c =================================================================== RCS file: /build/cvsroot/linux-2.6.0-test8/net/ipv6/sit.c,v retrieving revision 1.1.1.1 diff -u -p -B -r1.1.1.1 sit.c --- linux-2.6.0-test8/net/ipv6/sit.c 18 Oct 2003 01:37:19 -0000 1.1.1.1 +++ linux-2.6.0-test8/net/ipv6/sit.c 18 Oct 2003 04:13:21 -0000 @@ -377,8 +377,10 @@ static int ipip6_rcv(struct sk_buff *skb read_lock(&ipip6_lock); if ((tunnel = ipip6_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) { +#ifdef CONFIG_XFRM secpath_put(skb->sp); skb->sp = NULL; +#endif skb->mac.raw = skb->nh.raw; skb->nh.raw = skb->data; memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); From davem@pizda.ninka.net Sat Oct 18 00:06:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 00:06:46 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9I76D25016889 for ; Sat, 18 Oct 2003 00:06:14 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA00530; Sat, 18 Oct 2003 00:01:31 -0700 Date: Sat, 18 Oct 2003 00:01:31 -0700 From: "David S. Miller" To: Dan Aloni Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH 2.6] repost, fix sysctl breakage during network device renaming, for ipv4 Message-Id: <20031018000131.52a13c98.davem@redhat.com> In-Reply-To: <20031017213235.GA5278@callisto.yi.org> References: <20030901164624.GA26886@callisto.yi.org> <20030901094127.6a0f6878.davem@redhat.com> <20030901165559.GA27099@callisto.yi.org> <20030901113143.1ba34464.davem@redhat.com> <20031017213235.GA5278@callisto.yi.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 924 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: 257 Lines: 11 On Fri, 17 Oct 2003 23:32:35 +0200 Dan Aloni wrote: > Here is the patch. I've compiled and tested it. But not with ipv6 modular :-) Please add the necessary module symbol export for net_sysctl_strdup() and resubmit the patch. Thank you. From davem@pizda.ninka.net Sat Oct 18 00:07:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 00:07:46 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9I77R25017084 for ; Sat, 18 Oct 2003 00:07:27 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA00553; Sat, 18 Oct 2003 00:02:44 -0700 Date: Sat, 18 Oct 2003 00:02:44 -0700 From: "David S. Miller" To: Zwane Mwaikambo Cc: netdev@oss.sgi.com Subject: Re: [PATCH][2.6] fix compilation w/o CONFIG_XFRM Message-Id: <20031018000244.2a92b64f.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 925 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: 30 Lines: 2 Patch applied, thanks Zwane. From da-x@gmx.net Sat Oct 18 04:20:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 04:21:00 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9IBKJ25029613 for ; Sat, 18 Oct 2003 04:20:22 -0700 Received: (qmail 28909 invoked by uid 65534); 18 Oct 2003 11:20:12 -0000 Received: from bzq-233-119.red.bezeqint.net (HELO callisto.yi.org) (212.179.233.119) by mail.gmx.net (mp010) with SMTP; 18 Oct 2003 13:20:12 +0200 X-Authenticated: #12437197 Date: Sat, 18 Oct 2003 13:20:11 +0200 From: Dan Aloni To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH 2.6] repost, fix sysctl breakage during network device renaming, for ipv4 Message-ID: <20031018112011.GA16613@callisto.yi.org> References: <20030901164624.GA26886@callisto.yi.org> <20030901094127.6a0f6878.davem@redhat.com> <20030901165559.GA27099@callisto.yi.org> <20030901113143.1ba34464.davem@redhat.com> <20031017213235.GA5278@callisto.yi.org> <20031018000131.52a13c98.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031018000131.52a13c98.davem@redhat.com> User-Agent: Mutt/1.5.4i X-archive-position: 926 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: da-x@gmx.net Precedence: bulk X-list: netdev Content-Length: 11978 Lines: 389 On Sat, Oct 18, 2003 at 12:01:31AM -0700, David S. Miller wrote: > On Fri, 17 Oct 2003 23:32:35 +0200 > Dan Aloni wrote: > > > Here is the patch. I've compiled and tested it. > > But not with ipv6 modular :-) Please add the necessary > module symbol export for net_sysctl_strdup() and resubmit > the patch. Of course, what was I thinking. 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.1365, 2003-10-18 13:08:35+02:00, da-x@gmx.net Sysctl assumes its ctl_table.procname field is const, but the networking points ctl_table.procname to dev->name. When renaming a network device using SIOCSIFNAME, dev->name is modified and sysctl's assumption breaks, causing this behaviour, at least: 1. sysctl wouldn't be able to remove the proc entry when the device requests to be unregistered, because it would be using the new name instead of the old one. 2. proc entries for devices remain with the old name after rename. This change includes allocating the current device name to a new copy upon registering with sysctl, plus re-registering with sysctl when the device is renamed. This only fixes IPv4, IPv6, and net/core/neightbour.c. Fixes for ax25 and decnet are also planned. include/linux/netdevice.h | 3 +++ net/core/neighbour.c | 29 ++++++++++++++++++++++++++--- net/core/sysctl_net_core.c | 16 ++++++++++++++++ net/ipv4/devinet.c | 40 +++++++++++++++++++++++++++++++++++----- net/ipv6/addrconf.c | 37 ++++++++++++++++++++++++++++++++++--- 5 files changed, 114 insertions(+), 11 deletions(-) diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h Sat Oct 18 13:16:14 2003 +++ b/include/linux/netdevice.h Sat Oct 18 13:16:14 2003 @@ -901,6 +901,9 @@ extern void dev_clear_fastroute(struct net_device *dev); #endif +#ifdef CONFIG_SYSCTL +extern char *net_sysctl_strdup(const char *s); +#endif #endif /* __KERNEL__ */ diff -Nru a/net/core/neighbour.c b/net/core/neighbour.c --- a/net/core/neighbour.c Sat Oct 18 13:16:14 2003 +++ b/net/core/neighbour.c Sat Oct 18 13:16:14 2003 @@ -1628,6 +1628,9 @@ int p_id, int pdev_id, char *p_name) { struct neigh_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL); + const char *dev_name_source = NULL; + char *dev_name = NULL; + int err = 0; if (!t) return -ENOBUFS; @@ -1644,8 +1647,10 @@ t->neigh_vars[9].data = &p->anycast_delay; t->neigh_vars[10].data = &p->proxy_delay; t->neigh_vars[11].data = &p->locktime; + + dev_name_source = t->neigh_dev[0].procname; if (dev) { - t->neigh_dev[0].procname = dev->name; + dev_name_source = dev->name; t->neigh_dev[0].ctl_name = dev->ifindex; memset(&t->neigh_vars[12], 0, sizeof(ctl_table)); } else { @@ -1654,6 +1659,15 @@ t->neigh_vars[14].data = (int *)(p + 1) + 2; t->neigh_vars[15].data = (int *)(p + 1) + 3; } + + dev_name = net_sysctl_strdup(dev_name_source); + if (!dev_name) { + err = -ENOBUFS; + goto free; + } + + t->neigh_dev[0].procname = dev_name; + t->neigh_neigh_dir[0].ctl_name = pdev_id; t->neigh_proto_dir[0].procname = p_name; @@ -1666,11 +1680,19 @@ t->sysctl_header = register_sysctl_table(t->neigh_root_dir, 0); if (!t->sysctl_header) { - kfree(t); - return -ENOBUFS; + err = -ENOBUFS; + goto free_procname; } p->sysctl_table = t; return 0; + + /* error path */ + free_procname: + kfree(dev_name); + free: + kfree(t); + + return err; } void neigh_sysctl_unregister(struct neigh_parms *p) @@ -1679,6 +1701,7 @@ struct neigh_sysctl_table *t = p->sysctl_table; p->sysctl_table = NULL; unregister_sysctl_table(t->sysctl_header); + kfree(t->neigh_dev[0].procname); kfree(t); } } diff -Nru a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c --- a/net/core/sysctl_net_core.c Sat Oct 18 13:16:14 2003 +++ b/net/core/sysctl_net_core.c Sat Oct 18 13:16:14 2003 @@ -33,6 +33,19 @@ extern char sysctl_divert_version[]; #endif /* CONFIG_NET_DIVERT */ +/* + * This strdup() is used for creating copies of network + * device names to be handed over to sysctl. + */ + +char *net_sysctl_strdup(const char *s) +{ + char *rv = kmalloc(strlen(s)+1, GFP_KERNEL); + if (rv) + strcpy(rv, s); + return rv; +} + ctl_table core_table[] = { #ifdef CONFIG_NET { @@ -162,4 +175,7 @@ #endif /* CONFIG_NET */ { .ctl_name = 0 } }; + +EXPORT_SYMBOL(net_sysctl_strdup); + #endif diff -Nru a/net/ipv4/devinet.c b/net/ipv4/devinet.c --- a/net/ipv4/devinet.c Sat Oct 18 13:16:14 2003 +++ b/net/ipv4/devinet.c Sat Oct 18 13:16:14 2003 @@ -905,6 +905,14 @@ * not interesting to applications using netlink. */ inetdev_changename(dev, in_dev); + +#ifdef CONFIG_SYSCTL + devinet_sysctl_unregister(&in_dev->cnf); + neigh_sysctl_unregister(in_dev->arp_parms); + neigh_sysctl_register(dev, in_dev->arp_parms, NET_IPV4, + NET_IPV4_NEIGH, "ipv4"); + devinet_sysctl_register(in_dev, &in_dev->cnf); +#endif break; } out: @@ -1302,6 +1310,7 @@ int i; struct net_device *dev = in_dev ? in_dev->dev : NULL; struct devinet_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL); + char *dev_name = NULL; if (!t) return; @@ -1310,13 +1319,25 @@ t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf; t->devinet_vars[i].de = NULL; } + if (dev) { - t->devinet_dev[0].procname = dev->name; + dev_name = dev->name; t->devinet_dev[0].ctl_name = dev->ifindex; } else { - t->devinet_dev[0].procname = "default"; + dev_name = "default"; t->devinet_dev[0].ctl_name = NET_PROTO_CONF_DEFAULT; } + + /* + * Make a copy of dev_name, because '.procname' is regarded as const + * by sysctl and we wouldn't want anyone to change it under our feet + * (see SIOCSIFNAME). + */ + dev_name = net_sysctl_strdup(dev_name); + if (!dev_name) + goto free; + + t->devinet_dev[0].procname = dev_name; t->devinet_dev[0].child = t->devinet_vars; t->devinet_dev[0].de = NULL; t->devinet_conf_dir[0].child = t->devinet_dev; @@ -1328,9 +1349,17 @@ t->sysctl_header = register_sysctl_table(t->devinet_root_dir, 0); if (!t->sysctl_header) - kfree(t); - else - p->sysctl = t; + goto free_procname; + + p->sysctl = t; + return; + + /* error path */ + free_procname: + kfree(dev_name); + free: + kfree(t); + return; } static void devinet_sysctl_unregister(struct ipv4_devconf *p) @@ -1339,6 +1368,7 @@ struct devinet_sysctl_table *t = p->sysctl; p->sysctl = NULL; unregister_sysctl_table(t->sysctl_header); + kfree(t->devinet_dev[0].procname); kfree(t); } } diff -Nru a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c --- a/net/ipv6/addrconf.c Sat Oct 18 13:16:14 2003 +++ b/net/ipv6/addrconf.c Sat Oct 18 13:16:14 2003 @@ -1874,6 +1874,14 @@ break; case NETDEV_CHANGE: break; + case NETDEV_CHANGENAME: +#ifdef CONFIG_SYSCTL + addrconf_sysctl_unregister(&idev->cnf); + neigh_sysctl_unregister(idev->nd_parms); + neigh_sysctl_register(dev, idev->nd_parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6"); + addrconf_sysctl_register(idev, &idev->cnf); +#endif + break; }; return NOTIFY_OK; @@ -2904,6 +2912,7 @@ int i; struct net_device *dev = idev ? idev->dev : NULL; struct addrconf_sysctl_table *t; + char *dev_name = NULL; t = kmalloc(sizeof(*t), GFP_KERNEL); if (t == NULL) @@ -2915,12 +2924,24 @@ t->addrconf_vars[i].extra1 = idev; /* embedded; no ref */ } if (dev) { - t->addrconf_dev[0].procname = dev->name; + dev_name = dev->name; t->addrconf_dev[0].ctl_name = dev->ifindex; } else { - t->addrconf_dev[0].procname = "default"; + dev_name = "default"; t->addrconf_dev[0].ctl_name = NET_PROTO_CONF_DEFAULT; } + + /* + * Make a copy of dev_name, because '.procname' is regarded as const + * by sysctl and we wouldn't want anyone to change it under our feet + * (see SIOCSIFNAME). + */ + dev_name = net_sysctl_strdup(dev_name); + if (!dev_name) + goto free; + + t->addrconf_dev[0].procname = dev_name; + t->addrconf_dev[0].child = t->addrconf_vars; t->addrconf_dev[0].de = NULL; t->addrconf_conf_dir[0].child = t->addrconf_dev; @@ -2932,9 +2953,18 @@ t->sysctl_header = register_sysctl_table(t->addrconf_root_dir, 0); if (t->sysctl_header == NULL) - kfree(t); + goto free_procname; else p->sysctl = t; + return; + + /* error path */ + free_procname: + kfree(dev_name); + free: + kfree(t); + + return; } static void addrconf_sysctl_unregister(struct ipv6_devconf *p) @@ -2943,6 +2973,7 @@ struct addrconf_sysctl_table *t = p->sysctl; p->sysctl = NULL; unregister_sysctl_table(t->sysctl_header); + kfree(t->addrconf_dev[0].procname); kfree(t); } } =================================================================== This BitKeeper patch contains the following changesets: + ## Wrapped with gzip_uu ## M'XL( /X@D3\ ^59;6_;.!+^+/T*7@MLD]262;W+08JTJ9,&FR9!TN[=8;LP M:(F.!=N2CZ*D)%M^2]QL][# .D%<23.C9X8SSPS9U^AKQGA;BVCS M07^-/J69:&MWXPO'^1M>/CM#)@"9W[)8)='2DBY1/ MZ2C*CJD8C-+$$)PFV9@):H3I>#87G9D8F_#C$,_"CCLC+K:]64@B0JA-6(1- MVW?MA36)V$BS:&2D_&[9C$4P<8AO>=B=V6Y@.OI'1 QBN0["5HO@%O$1L=K8 M;UO.6VRV,48R.L=E5-!;!S6Q_@']6.0G>HAN53 1S;)\S#(4BPS!=5?0WH@9 M$YZ&"1TSU(_9*$(Q/$N33#10+Q=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=*AU(,,))#*!'$0'+7U9MJUK0WEC[ALXI23F M#\2^1*)Q)G(H=;"ES/M$A;44V>(-:"[5^EH+_(Z*?V$SUH>TQ_@Q&,T&N_1C M[)D6=BW/=N'2#(*B9>Q8]L3]/[2,/]HOU)2QC0'6@O(2'K <")/>.M#103'+ ME^6S+T?].<@0MG%JXP$$)G'0/9$X:*! M9#.K*H)/#W59U))K@/V^Z9U_75_=?($6^?G#U<7>&B)53E59+$_0NY7#2V;W M)]K?AB%>-C\3YCZ8FUS;\_VB^>T\-SFHZ?SUFE^(;A;;TGI5/+DAA9:IMC$; M"F8Y<"^;K#Q%TAMG*]6SXEKZ+,X:]GZ*DZ[J7V'2EZFH%?2[+EC)43[I3B@? M9^O2RR6"\4L974*] M:: 5[.5,>$XL;,N6LF4N.)=#&#R7/1'V[:JW%]]:O6S)O,X@OD"]1D3RLI>QEC]S&S?D+=; MVH[3ROJ8HJM5K$TEX#GT\&KE5F<2^-3'$HBK18#I(&Z6)>.V;*TVAH#92?-= M&0&8U^:D>?C#)I.Y04!CK\PD6_RI324KYRD[\^_WG^7H0S[,QY0?YYD1]\9/ M&0/ZA6+ )NQZ9Q8TZX)^80[XZ7T6YQI;:;?>N1>M&'Q/1<(6 LI M5#10VL?.+]V33^\OSSJRS-K;>+EZZ49BWHV6"YZ*=N3D)>DY(;N+?]5IV"UH M>!7DTKLE"Z]SL*:IHW6H)9@1W2?(^*,9$+6]*K^W4[ 9F*00-,E3% S/@4K, MOST%SU?MF7VA&<@A6\9-?6_9!<)3#[:U/YQTO]5HUPQL9YEVM_D@>;?ZC[QP 6P,)AEH^/;.R%U(HB_7]+]PG5/1P -- Dan Aloni da-x@gmx.net From hirofumi@mail.parknet.co.jp Sat Oct 18 05:56:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 05:57:13 -0700 (PDT) Received: from mail.parknet.co.jp (mail.parknet.co.jp [210.171.160.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ICua25031380 for ; Sat, 18 Oct 2003 05:56:37 -0700 Received: from ibmpc.myhome.or.jp [210.171.161.166] by mail.parknet.co.jp with ESMTP (SMTPD32-4.10) id A92557C0132; Sat, 18 Oct 2003 21:55:01 +0900 Received: from devron.myhome.or.jp (devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.12.9/8.12.9/Debian-5) with ESMTP id h9ICuPXB016730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 18 Oct 2003 21:56:27 +0900 Received: from devron.myhome.or.jp (hirofumi@localhost [127.0.0.1]) by devron.myhome.or.jp (8.12.9/8.12.9/Debian-5) with ESMTP id h9ICuO8k007282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 18 Oct 2003 21:56:24 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.12.9/8.12.9/Debian-5) id h9ICuKXu007275; Sat, 18 Oct 2003 21:56:20 +0900 To: Stephen Hemminger Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [Fwd: [RFT] NAPI for 8139too] References: <3F9070B6.9090306@pobox.com> From: OGAWA Hirofumi Date: Sat, 18 Oct 2003 21:56:20 +0900 In-Reply-To: <3F9070B6.9090306@pobox.com> Message-ID: <873cdqbt6z.fsf@devron.myhome.or.jp> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-archive-position: 927 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hirofumi@mail.parknet.co.jp Precedence: bulk X-list: netdev Content-Length: 9246 Lines: 75 --=-=-= Hi, I also working for it (patches attached). So I have several comment. Jeff Garzik writes: > + dev->weight = 16; just question: Is there basis for believing that this value is rightness? Although I use 64, I don't have a reason for having chosen it at all. > dev->stop = rtl8139_close; > dev->get_stats = rtl8139_get_stats; > dev->set_multicast_list = rtl8139_set_rx_mode; > @@ -1879,24 +1877,28 @@ > #endif > } > > -static void rtl8139_rx_interrupt (struct net_device *dev, > - struct rtl8139_private *tp, void *ioaddr) > +/* > + * NAPI poll routine. > + */ > +static int rtl8139_poll(struct net_device *dev, int *budget) > { > + struct rtl8139_private *tp = dev->priv; > + void *ioaddr = tp->mmio_addr; > unsigned char *rx_ring; > u16 cur_rx; > + int rx, status; > + unsigned long flags; > > - assert (dev != NULL); > - assert (tp != NULL); > - assert (ioaddr != NULL); > - > + spin_lock_irqsave(&tp->lock, flags); I don't think lock of interrupt related path needed here. And this thinks that it has a bad influence on TX path. Instead of it, I think we need synchronize with ->tx_timeout because ->tx_timeout touch IntrMask. > + rescan: > rx_ring = tp->rx_ring; > cur_rx = tp->cur_rx; > - [...] > RTL_W16_F (IntrStatus, RxAckBits); > + > + if (++rx >= dev->quota) Shouldn't we use "min(dev->quota, *budget)" for this limit? Users can change "budget" via sysctl. > + /* If received interrupt, then disable furthur interrupts > + * and enable NAPI polling. > + */ > + if (netif_running (dev) && (status & RxAckBits)) { > + /* disable more receive interrupts */ > + RTL_W16 (IntrMask, rtl8139_intr_mask & ~RxAckBits); > + netif_rx_schedule(dev); > + } This style have problem on shutdowning interface path. Please see 8139too-napi-stop-fix.patch. Thanks. -- OGAWA Hirofumi --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=8139too.tar.gz Content-Transfer-Encoding: base64 H4sIAMU3kT8AA+1ca3PbRrL1V/JXdJSylzQJGuCbVuSsrMiJyrKspegb1/q6UBAxFLEiAQQPi7ob 57ff7p4BCPAl0ZaztRVOlUwS8+7p6XO6Z+Cu0ehFnvfs0TdMut6sd1ot/NSNTkvPfibpkd7pNJv1 RqPRbDzSjXqzZTyC1rccVJLiMLICgEdjJ/BG8dRZV+6u/P/S1FXr79MqGKb6qTluFKBgojjUxpZr Txz3quZb0XD8JX3ohq63m811619v1Y38+teNltF4BPpDT3ZV+ouvf/HD+eHg6JePo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lcgUedbQdxywynE9RKIazwExFVo L3C87KnUJak4+MWZ0nsYFr3Lg0rnRKlisg+FGqVq0XKiB+WNgK+wJhuEwwLk5yevadRkeY4OrARE 7f6ACHcA4hbtrMdOlrhh6HS4WsEvzS8IQnybwN8XBJG0+wWRtG2DSNrmIJKWBJE2npcpFSRtoquo eUsPUsohjKxJKKqoiX8Ls9iT1MxBUA0uvDmNj2As+P+qGlpxKJIKOfY+9OhgOxb0zofvC2q4pgo+ 48+FcMk9YmtLMpm/Mv0FMbW/ULhhl3Zpl3Zpl3Zpl3Zpl3Zpl3Zpl3Zpl3Zpl3Zpl3Zpl3Zpl3Zp l3Zpl3Zpl3Zpl3Zpl3Zpl3Zpl3Zplx4g/T+PiEtXAHgAAA== --=-=-=-- From rmk@arm.linux.org.uk Sat Oct 18 13:47:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 13:48:07 -0700 (PDT) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9IKlv25014575 for ; Sat, 18 Oct 2003 13:47:57 -0700 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.22) id 1AAxzK-0004H3-OB for netdev@oss.sgi.com; Sat, 18 Oct 2003 21:47:50 +0100 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.22) id 1AAxzJ-0004U6-Nt for netdev@oss.sgi.com; Sat, 18 Oct 2003 21:47:49 +0100 Date: Sat, 18 Oct 2003 21:47:49 +0100 From: Russell King To: netdev@oss.sgi.com Subject: Re: [PATCH] Prevent "eth0: driver changed get_stats after register" lying Message-ID: <20031018214749.C25375@flint.arm.linux.org.uk> References: <20031018214622.B25375@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031018214622.B25375@flint.arm.linux.org.uk>; from rmk@arm.linux.org.uk on Sat, Oct 18, 2003 at 09:46:22PM +0100 X-Message-Flag: Your copy of Microsoft Outlook is vulnerable to viruses. See www.mutt.org for more details. X-archive-position: 929 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 933 Lines: 21 On Sat, Oct 18, 2003 at 09:46:22PM +0100, Russell King wrote: > There appears to be a race condition between netdev_register_sysfs > and hotplug. I'm seeing the message in the subject upon initialisation > of pcnet_cs. > > We set "dev->last_stats" after we have registered the class device. > During class device registration, we trigger the hotplug scripts, > which can in turn bring up the interface. This in turn checks to > see if "dev->last_stats == dev->get_stats", and, since we haven't > set dev->last_stats yet, we complain. Incidentally, this also means that hotplug scripts can run before we've registered the class device attributes. Could that be another problem? It's probably something that the hotplug people should be aware of. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From rmk@arm.linux.org.uk Sat Oct 18 13:46:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 13:47:09 -0700 (PDT) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9IKkV25014444 for ; Sat, 18 Oct 2003 13:46:33 -0700 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.22) id 1AAxxw-0004Gx-D2 for netdev@oss.sgi.com; Sat, 18 Oct 2003 21:46:24 +0100 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.22) id 1AAxxu-0004JU-DX; Sat, 18 Oct 2003 21:46:22 +0100 Date: Sat, 18 Oct 2003 21:46:22 +0100 From: Russell King To: netdev@oss.sgi.com Subject: [PATCH] Prevent "eth0: driver changed get_stats after register" lying Message-ID: <20031018214622.B25375@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Message-Flag: Your copy of Microsoft Outlook is vulnerable to viruses. See www.mutt.org for more details. X-archive-position: 928 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 1272 Lines: 40 Hi, There appears to be a race condition between netdev_register_sysfs and hotplug. I'm seeing the message in the subject upon initialisation of pcnet_cs. We set "dev->last_stats" after we have registered the class device. During class device registration, we trigger the hotplug scripts, which can in turn bring up the interface. This in turn checks to see if "dev->last_stats == dev->get_stats", and, since we haven't set dev->last_stats yet, we complain. Here is a patch against 2.6.0-test8 which moves the initialisation of last_stats such that we avoid the race. --- orig/net/core/net-sysfs.c Sat Oct 18 00:00:38 2003 +++ linux/net/core/net-sysfs.c Sat Oct 18 21:23:15 2003 @@ -408,6 +408,7 @@ class_dev->class = &net_class; class_dev->class_data = net; + net->last_stats = net->get_stats; strlcpy(class_dev->class_id, net->name, BUS_ID_SIZE); if ((ret = class_device_register(class_dev))) @@ -419,7 +420,6 @@ } - net->last_stats = net->get_stats; if (net->get_stats && (ret = sysfs_create_group(&class_dev->kobj, &netstat_group))) goto out_unreg; -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From akpm@osdl.org Sat Oct 18 16:09:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 16:09:35 -0700 (PDT) Received: from mail.osdl.org ([65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9IN9125017903 for ; Sat, 18 Oct 2003 16:09:01 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9IN8Qo29570; Sat, 18 Oct 2003 16:08:27 -0700 Date: Sat, 18 Oct 2003 16:08:55 -0700 From: Andrew Morton To: simon@swat.me.uk Cc: netdev@oss.sgi.com Subject: Re: [Bugme-new] [Bug 1371] New: kernel fails to compile with ipv6 error Message-Id: <20031018160855.26fea7b8.akpm@osdl.org> In-Reply-To: <200310182118.h9ILIBMX001067@fire-1.osdl.org> References: <200310182118.h9ILIBMX001067@fire-1.osdl.org> X-Mailer: Sylpheed version 0.9.4 (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: 930 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 840 Lines: 29 bugme-daemon@osdl.org wrote: > > http://bugme.osdl.org/show_bug.cgi?id=1371 > > Summary: kernel fails to compile with ipv6 error > Kernel Version: 2.6.0-test8 > Status: NEW > Severity: blocking > Owner: bugme-janitors@lists.osdl.org > Submitter: simon@swat.me.uk > > > The following error is produced when compiling the kernel: > > AR arch/i386/lib/lib.a > GEN .version > CHK include/linux/compile.h > UPD include/linux/compile.h > CC init/version.o > LD init/built-in.o > LD .tmp_vmlinux1 > net/built-in.o(.text+0x57987): In function `ipip6_rcv': > : undefined reference to `__secpath_destroy' > make: *** [.tmp_vmlinux1] Error 1 > > This problem did not occur with test7 or previous kernels. > Odd. Please send your .config. From khc@pm.waw.pl Sat Oct 18 16:26:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 16:27:22 -0700 (PDT) Received: from hq.pm.waw.pl (hq.pm.waw.pl [195.116.170.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9INQl25021280 for ; Sat, 18 Oct 2003 16:26:48 -0700 Received: by hq.pm.waw.pl (Postfix, from userid 10) id 5A56A323B; Sun, 19 Oct 2003 01:26:41 +0200 (CEST) Received: by defiant.pm.waw.pl (Postfix, from userid 500) id 70DF6302FD; Sun, 19 Oct 2003 01:24:01 +0200 (CEST) To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: 2.6.0test8 Goramo PCI200SYN sync serial driver From: Krzysztof Halasa Date: 19 Oct 2003 01:24:00 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-archive-position: 931 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: khc@pm.waw.pl Precedence: bulk X-list: netdev Content-Length: 19955 Lines: 24 --=-=-= Hi, This is a 2.6.0test driver for Goramo PCI200SYN sync serial card, a dual V.35 port PCI card. This patch adds some defines to drivers/net/wan/hd64572.h header file, which is then shared between Cyclades PC300 and this driver (both cards use the same Hitachi SCA chip). This change: -#ifndef _HD64572_H -#define _HD64572_H +#ifndef __HD64572_H +#define __HD64572_H is required for proper detection of SCA chip version handled by .../wan/hd6457x.c file (SCA HD64570 used by n2.c and c101.c vs SCA-II HD64572 used by, for example, PCI200SYN). Compiles, works. Please apply. Thanks. -- Krzysztof Halasa, B*FH --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=pci200-2.6.0test8.patch --- linux-2.6.orig/drivers/net/wan/Makefile 2003-10-03 15:38:12.000000000 +0200 +++ linux-2.6/drivers/net/wan/Makefile 2003-10-03 16:28:07.000000000 +0200 @@ -67,6 +67,7 @@ obj-$(CONFIG_N2) += n2.o obj-$(CONFIG_C101) += c101.o obj-$(CONFIG_WANXL) += wanxl.o +obj-$(CONFIG_PCI200SYN) += pci200syn.o ifeq ($(CONFIG_WANXL_BUILD_FIRMWARE),y) ifeq ($(ARCH),m68k) --- linux-2.6.orig/drivers/net/wan/hd64572.h 2003-08-09 06:38:50.000000000 +0200 +++ linux-2.6/drivers/net/wan/hd64572.h 2003-10-03 16:22:06.000000000 +0200 @@ -23,8 +25,8 @@ * */ -#ifndef _HD64572_H -#define _HD64572_H +#ifndef __HD64572_H +#define __HD64572_H /* Illegal Access Register */ #define ILAR 0x00 @@ -59,6 +61,9 @@ #define IR0_M(val, chan) ((val)<<(8*(chan))) /* Int MSCI */ /* MSCI Channel Registers */ +#define MSCI0_OFFSET 0x00 +#define MSCI1_OFFSET 0x80 + #define MD0 0x138 /* Mode reg 0 */ #define MD1 0x139 /* Mode reg 1 */ #define MD2 0x13a /* Mode reg 2 */ @@ -107,6 +113,11 @@ #define RCR 0x156 /* Rx DMA Critical Request Reg */ /* Timer Registers */ +#define TIMER0RX_OFFSET 0x00 +#define TIMER0TX_OFFSET 0x10 +#define TIMER1RX_OFFSET 0x20 +#define TIMER1TX_OFFSET 0x30 + #define TCNTL 0x200 /* Timer Upcounter L */ #define TCNTH 0x201 /* Timer Upcounter H */ #define TCONRL 0x204 /* Timer Constant Register L */ @@ -132,6 +144,11 @@ #define DCR_TX(chan) (0x59 + 2*chan) /* DMA Command Reg (Tx) */ /* DMA Channel Registers */ +#define DMAC0RX_OFFSET 0x00 +#define DMAC0TX_OFFSET 0x20 +#define DMAC1RX_OFFSET 0x40 +#define DMAC1TX_OFFSET 0x60 + #define DARL 0x80 /* Dest Addr Register L (single-block, RX only) */ #define DARH 0x81 /* Dest Addr Register H (single-block, RX only) */ #define DARB 0x82 /* Dest Addr Register B (single-block, RX only) */ @@ -166,7 +184,17 @@ unsigned char filler[5]; /* alignment filler (16 bytes) */ } pcsca_bd_t; -/* +/* Block Descriptor Structure */ +typedef struct { + u32 cp; /* pointer to next block descriptor */ + u32 bp; /* buffer pointer */ + u16 len; /* data length */ + u8 stat; /* status */ + u8 unused; /* pads to 4-byte boundary */ +}pkt_desc; + + +/* Descriptor Status definitions: Bit Transmission Reception @@ -190,6 +218,23 @@ #define DST_SHRT 0x40 /* Short Frame */ #define DST_EOM 0x80 /* End of Message */ +/* Packet Descriptor Status bits */ + +#define ST_TX_EOM 0x80 /* End of frame */ +#define ST_TX_UNDRRUN 0x08 +#define ST_TX_OWNRSHP 0x02 +#define ST_TX_EOT 0x01 /* End of transmition */ + +#define ST_RX_EOM 0x80 /* End of frame */ +#define ST_RX_SHORT 0x40 /* Short frame */ +#define ST_RX_ABORT 0x20 /* Abort */ +#define ST_RX_RESBIT 0x10 /* Residual bit */ +#define ST_RX_OVERRUN 0x08 /* Overrun */ +#define ST_RX_CRC 0x04 /* CRC */ +#define ST_RX_OWNRSHP 0x02 + +#define ST_ERROR_MASK 0x7C + /* Status Counter Registers */ #define CMCR 0x158 /* Counter Master Ctl Reg */ #define TECNTL 0x160 /* Tx EOM Counter L */ @@ -246,11 +291,25 @@ #define MD0_BIT_SYNC 0x80 #define MD0_TRANSP 0xc0 +#define MD0_HDLC 0x80 /* Bit-sync HDLC mode */ + +#define MD0_CRC_NONE 0x00 +#define MD0_CRC_16_0 0x04 +#define MD0_CRC_16 0x05 +#define MD0_CRC_ITU32 0x06 +#define MD0_CRC_ITU 0x07 + #define MD1_NOADDR 0x00 #define MD1_SADDR1 0x40 #define MD1_SADDR2 0x80 #define MD1_DADDR 0xc0 +#define MD2_NRZI_IEEE 0x40 +#define MD2_MANCHESTER 0x80 +#define MD2_FM_MARK 0xA0 +#define MD2_FM_SPACE 0xC0 +#define MD2_LOOPBACK 0x03 /* Local data Loopback */ + #define MD2_F_DUPLEX 0x00 #define MD2_AUTO_ECHO 0x01 #define MD2_LOOP_HI_Z 0x02 @@ -274,6 +333,10 @@ #define CTL_URSKP 0x40 #define CTL_URCT 0x80 +#define CTL_NORTS 0x01 +#define CTL_NODTR 0x02 +#define CTL_IDLE 0x10 + #define RXS_BR0 0x01 #define RXS_BR1 0x02 #define RXS_BR2 0x04 @@ -302,6 +365,12 @@ #define EXS_TES1 0x20 #define EXS_TES2 0x40 +#define CLK_BRG_MASK 0x0F +#define CLK_PIN_OUT 0x80 +#define CLK_LINE 0x00 /* clock line input */ +#define CLK_BRG 0x40 /* internal baud rate generator */ +#define CLK_TX_RXCLK 0x60 /* TX clock from RX clock */ + #define CMD_RX_RST 0x11 #define CMD_RX_ENA 0x12 #define CMD_RX_DIS 0x13 @@ -324,6 +393,10 @@ #define CMD_SRCH_MODE 0x31 #define CMD_NOP 0x00 +#define CMD_RESET 0x21 +#define CMD_TX_ENABLE 0x02 +#define CMD_RX_ENABLE 0x12 + #define ST0_RXRDY 0x01 #define ST0_TXRDY 0x02 #define ST0_RXINTB 0x20 @@ -373,7 +446,9 @@ #define IE0_TXRDY 0x02 #define IE0_RXINTB 0x20 #define IE0_RXINTA 0x40 #define IE0_TXINT 0x80 +#define IE0_UDRN 0x00008000 /* TX underrun MSCI interrupt enable */ +#define IE0_CDCD 0x00000400 /* CD level change interrupt enable */ #define IE1_IDLD 0x01 #define IE1_ABTD 0x02 @@ -424,14 +499,28 @@ #define DIR_EOM 0x40 #define DIR_EOT 0x80 +#define DIR_REFE 0x04 +#define DIR_UDRFE 0x04 +#define DIR_COAE 0x08 +#define DIR_COFE 0x10 +#define DIR_BOFE 0x20 +#define DIR_EOME 0x40 +#define DIR_EOTE 0x80 + #define DMR_CNTE 0x02 #define DMR_NF 0x04 #define DMR_SEOME 0x08 #define DMR_TMOD 0x10 +#define DMER_DME 0x80 /* DMA Master Enable */ + #define DCR_SW_ABT 0x01 #define DCR_FCT_CLR 0x02 +#define DCR_ABORT 0x01 +#define DCR_CLEAR_EOF 0x02 + +#define PCR_COTE 0x80 #define PCR_PR0 0x01 #define PCR_PR1 0x02 #define PCR_PR2 0x04 @@ -440,4 +529,4 @@ #define PCR_OSB 0x40 #define PCR_BURST 0x80 -#endif /* (_HD64572_H) */ +#endif /* (__HD64572_H) */ --- linux-2.6.orig/drivers/net/wan/pci200syn.c 2003-10-03 16:29:06.000000000 +0200 +++ linux-2.6/drivers/net/wan/pci200syn.c 2003-10-03 16:22:06.000000000 +0200 @@ -0,0 +1,458 @@ +/* + * Goramo PCI200SYN synchronous serial card driver for Linux + * + * Copyright (C) 2002-2003 Krzysztof Halasa + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * For information see http://hq.pm.waw.pl/hdlc/ + * + * Sources of information: + * Hitachi HD64572 SCA-II User's Manual + * PLX Technology Inc. PCI9052 Data Book + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hd64572.h" + +static const char* version = "Goramo PCI200SYN driver version: 1.15"; +static const char* devname = "PCI200SYN"; + +#undef DEBUG_PKT +#define DEBUG_RINGS + +#define PCI200SYN_PLX_SIZE 0x80 /* PLX control window size (128b) */ +#define PCI200SYN_SCA_SIZE 0x400 /* SCA window size (1Kb) */ +#define ALL_PAGES_ALWAYS_MAPPED +#define NEED_DETECT_RAM +#define NEED_SCA_MSCI_INTR +#define MAX_TX_BUFFERS 10 + +static int pci_clock_freq = 33000000; +#define CLOCK_BASE pci_clock_freq + +#define PCI_VENDOR_ID_GORAMO 0x10B5 /* uses PLX:9050 ID - this card */ +#define PCI_DEVICE_ID_PCI200SYN 0x9050 /* doesn't have its own ID */ + + +/* + * PLX PCI9052 local configuration and shared runtime registers. + * This structure can be used to access 9052 registers (memory mapped). + */ +typedef struct { + u32 loc_addr_range[4]; /* 00-0Ch : Local Address Ranges */ + u32 loc_rom_range; /* 10h : Local ROM Range */ + u32 loc_addr_base[4]; /* 14-20h : Local Address Base Addrs */ + u32 loc_rom_base; /* 24h : Local ROM Base */ + u32 loc_bus_descr[4]; /* 28-34h : Local Bus Descriptors */ + u32 rom_bus_descr; /* 38h : ROM Bus Descriptor */ + u32 cs_base[4]; /* 3C-48h : Chip Select Base Addrs */ + u32 intr_ctrl_stat; /* 4Ch : Interrupt Control/Status */ + u32 init_ctrl; /* 50h : EEPROM ctrl, Init Ctrl, etc */ +}plx9052; + + + +typedef struct port_s { + hdlc_device hdlc; /* HDLC device struct - must be first */ + struct card_s *card; + spinlock_t lock; /* TX lock */ + sync_serial_settings settings; + int rxpart; /* partial frame received, next frame invalid*/ + unsigned short encoding; + unsigned short parity; + u16 rxin; /* rx ring buffer 'in' pointer */ + u16 txin; /* tx ring buffer 'in' and 'last' pointers */ + u16 txlast; + u8 rxs, txs, tmc; /* SCA registers */ + u8 phy_node; /* physical port # - 0 or 1 */ +}port_t; + + + +typedef struct card_s { + u32 ramphys; /* buffer memory base (physical) */ + u8* rambase; /* buffer memory base (virtual) */ + u32 ramsize; /* buffer memory size */ + u32 scaphys; /* SCA memory base (physical) */ + u8* scabase; /* SCA memory base (virtual) */ + u32 plxphys; /* PLX registers memory base (physical) */ + plx9052* plxbase; /* PLX registers memory base (virtual) */ + u16 rx_ring_buffers; /* number of buffers in a ring */ + u16 tx_ring_buffers; + u16 buff_offset; /* offset of first buffer of first channel */ + u8 irq; /* interrupt request level */ + + port_t ports[2]; +}card_t; + + +#define sca_in(reg, card) readb(card->scabase + (reg)) +#define sca_out(value, reg, card) writeb(value, card->scabase + (reg)) +#define sca_inw(reg, card) readw(card->scabase + (reg)) +#define sca_outw(value, reg, card) writew(value, card->scabase + (reg)) +#define sca_inl(reg, card) readl(card->scabase + (reg)) +#define sca_outl(value, reg, card) writel(value, card->scabase + (reg)) + +#define port_to_card(port) (port->card) +#define log_node(port) (port->phy_node) +#define phy_node(port) (port->phy_node) +#define winbase(card) (card->rambase) +#define get_port(card, port) (&card->ports[port]) +#define sca_flush(card) (sca_in(IER0, card)); + +static inline void new_memcpy_toio(char *dest, char *src, int length) +{ + int len; + do { + len = length > 256 ? 256 : length; + memcpy_toio(dest, src, len); + dest += len; + src += len; + length -= len; + readb(dest); + } while (len); +} + +#undef memcpy_toio +#define memcpy_toio new_memcpy_toio + +#include "hd6457x.c" + + +static void pci200_set_iface(port_t *port) +{ + card_t *card = port->card; + u16 msci = get_msci(port); + u8 rxs = port->rxs & CLK_BRG_MASK; + u8 txs = port->txs & CLK_BRG_MASK; + + sca_out(EXS_TES1, (phy_node(port) ? MSCI1_OFFSET : MSCI0_OFFSET) + EXS, + port_to_card(port)); + switch(port->settings.clock_type) { + case CLOCK_INT: + rxs |= CLK_BRG; /* BRG output */ + txs |= CLK_PIN_OUT | CLK_TX_RXCLK; /* RX clock */ + break; + + case CLOCK_TXINT: + rxs |= CLK_LINE; /* RXC input */ + txs |= CLK_PIN_OUT | CLK_BRG; /* BRG output */ + break; + + case CLOCK_TXFROMRX: + rxs |= CLK_LINE; /* RXC input */ + txs |= CLK_PIN_OUT | CLK_TX_RXCLK; /* RX clock */ + break; + + default: /* EXTernal clock */ + rxs |= CLK_LINE; /* RXC input */ + txs |= CLK_PIN_OUT | CLK_LINE; /* TXC input */ + break; + } + + port->rxs = rxs; + port->txs = txs; + sca_out(rxs, msci + RXS, card); + sca_out(txs, msci + TXS, card); + sca_set_port(port); +} + + + +static int pci200_open(struct net_device *dev) +{ + hdlc_device *hdlc = dev_to_hdlc(dev); + port_t *port = hdlc_to_port(hdlc); + + int result = hdlc_open(hdlc); + if (result) + return result; + + sca_open(hdlc); + pci200_set_iface(port); + sca_flush(port_to_card(port)); + return 0; +} + + + +static int pci200_close(struct net_device *dev) +{ + hdlc_device *hdlc = dev_to_hdlc(dev); + sca_close(hdlc); + sca_flush(port_to_card(dev_to_port(dev))); + hdlc_close(hdlc); + return 0; +} + + + +static int pci200_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +{ + const size_t size = sizeof(sync_serial_settings); + sync_serial_settings new_line, *line = ifr->ifr_settings.ifs_ifsu.sync; + hdlc_device *hdlc = dev_to_hdlc(dev); + port_t *port = hdlc_to_port(hdlc); + +#ifdef DEBUG_RINGS + if (cmd == SIOCDEVPRIVATE) { + sca_dump_rings(hdlc); + return 0; + } +#endif + if (cmd != SIOCWANDEV) + return hdlc_ioctl(dev, ifr, cmd); + + switch(ifr->ifr_settings.type) { + case IF_GET_IFACE: + ifr->ifr_settings.type = IF_IFACE_V35; + if (ifr->ifr_settings.size < size) { + ifr->ifr_settings.size = size; /* data size wanted */ + return -ENOBUFS; + } + if (copy_to_user(line, &port->settings, size)) + return -EFAULT; + return 0; + + case IF_IFACE_V35: + case IF_IFACE_SYNC_SERIAL: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + + if (copy_from_user(&new_line, line, size)) + return -EFAULT; + + if (new_line.clock_type != CLOCK_EXT && + new_line.clock_type != CLOCK_TXFROMRX && + new_line.clock_type != CLOCK_INT && + new_line.clock_type != CLOCK_TXINT) + return -EINVAL; /* No such clock setting */ + + if (new_line.loopback != 0 && new_line.loopback != 1) + return -EINVAL; + + memcpy(&port->settings, &new_line, size); /* Update settings */ + pci200_set_iface(port); + sca_flush(port_to_card(port)); + return 0; + + default: + return hdlc_ioctl(dev, ifr, cmd); + } +} + + + +static void pci200_pci_remove_one(struct pci_dev *pdev) +{ + int i; + card_t *card = pci_get_drvdata(pdev); + + for(i = 0; i < 2; i++) + if (card->ports[i].card) + unregister_hdlc_device(&card->ports[i].hdlc); + + if (card->irq) + free_irq(card->irq, card); + iounmap(card->rambase); + iounmap(card->scabase); + iounmap(card->plxbase); + pci_release_regions(pdev); + kfree(card); +} + + + +static int __devinit pci200_pci_init_one(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + card_t *card; + u8 rev_id; + u32 *p; + int i; + +#ifndef MODULE + static int printed_version; + if (!printed_version++) + printk(KERN_INFO "%s\n", version); +#endif + + i = pci_enable_device(pdev); + if (i) + return i; + + i = pci_request_regions(pdev, "PCI200SYN"); + if (i) + return i; + + card = kmalloc(sizeof(card_t), GFP_KERNEL); + if (card == NULL) { + printk(KERN_ERR "pci200syn: unable to allocate memory\n"); + return -ENOBUFS; + } + memset(card, 0, sizeof(card_t)); + pci_set_drvdata(pdev, card); + + pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); + if (pci_resource_len(pdev, 0) != PCI200SYN_PLX_SIZE || + pci_resource_len(pdev, 2) != PCI200SYN_SCA_SIZE || + pci_resource_len(pdev, 3) < 16384) { + printk(KERN_ERR "pci200syn: invalid card EEPROM parameters\n"); + kfree(card); + return -EFAULT; + } + + card->plxphys = pci_resource_start(pdev,0) & PCI_BASE_ADDRESS_MEM_MASK; + card->plxbase = ioremap(card->plxphys, PCI200SYN_PLX_SIZE); + + card->scaphys = pci_resource_start(pdev,2) & PCI_BASE_ADDRESS_MEM_MASK; + card->scabase = ioremap(card->scaphys, PCI200SYN_SCA_SIZE); + + card->ramphys = pci_resource_start(pdev,3) & PCI_BASE_ADDRESS_MEM_MASK; + card->rambase = ioremap(card->ramphys, pci_resource_len(pdev,3)); + + /* Reset PLX */ + p = &card->plxbase->init_ctrl; + writel(readl(p) | 0x40000000, p); + readl(p); /* Flush the write - do not use sca_flush */ + udelay(1); + + writel(readl(p) & ~0x40000000, p); + readl(p); /* Flush the write - do not use sca_flush */ + udelay(1); + + card->ramsize = sca_detect_ram(card, card->rambase, + pci_resource_len(pdev,3)); + + /* number of TX + RX buffers for one port - this is dual port card */ + i = card->ramsize / (2 * (sizeof(pkt_desc) + HDLC_MAX_MRU)); + card->tx_ring_buffers = min(i / 2, MAX_TX_BUFFERS); + card->rx_ring_buffers = i - card->tx_ring_buffers; + + card->buff_offset = 2 * sizeof(pkt_desc) * (card->tx_ring_buffers + + card->rx_ring_buffers); + + printk(KERN_INFO "pci200syn: %u KB RAM at 0x%x, IRQ%u, using %u TX +" + " %u RX packets rings\n", card->ramsize / 1024, + card->ramphys, pdev->irq, + card->tx_ring_buffers, card->rx_ring_buffers); + + if (card->tx_ring_buffers < 1) { + printk(KERN_ERR "pci200syn: RAM test failed\n"); + pci200_pci_remove_one(pdev); + return -EFAULT; + } + + /* Enable interrupts on the PCI bridge */ + p = &card->plxbase->intr_ctrl_stat; + writew(readw(p) | 0x0040, p); + + /* Allocate IRQ */ + if(request_irq(pdev->irq, sca_intr, SA_SHIRQ, devname, card)) { + printk(KERN_WARNING "pci200syn: could not allocate IRQ%d.\n", + pdev->irq); + pci200_pci_remove_one(pdev); + return -EBUSY; + } + card->irq = pdev->irq; + + sca_init(card, 0); + + for(i = 0; i < 2; i++) { + port_t *port = &card->ports[i]; + struct net_device *dev = hdlc_to_dev(&port->hdlc); + port->phy_node = i; + + spin_lock_init(&port->lock); + SET_MODULE_OWNER(dev); + dev->irq = card->irq; + dev->mem_start = card->ramphys; + dev->mem_end = card->ramphys + card->ramsize - 1; + dev->tx_queue_len = 50; + dev->do_ioctl = pci200_ioctl; + dev->open = pci200_open; + dev->stop = pci200_close; + port->hdlc.attach = sca_attach; + port->hdlc.xmit = sca_xmit; + port->settings.clock_type = CLOCK_EXT; + if(register_hdlc_device(&port->hdlc)) { + printk(KERN_ERR "pci200syn: unable to register hdlc " + "device\n"); + pci200_pci_remove_one(pdev); + return -ENOBUFS; + } + port->card = card; + sca_init_sync_port(port); /* Set up SCA memory */ + + printk(KERN_INFO "%s: PCI200SYN node %d\n", + hdlc_to_name(&port->hdlc), port->phy_node); + } + + sca_flush(card); + return 0; +} + + + +static struct pci_device_id pci200_pci_tbl[] __devinitdata = { + { PCI_VENDOR_ID_GORAMO, PCI_DEVICE_ID_PCI200SYN, PCI_ANY_ID, + PCI_ANY_ID, 0, 0, 0 }, + { 0, } +}; + + +static struct pci_driver pci200_pci_driver = { + name: "PCI200SYN", + id_table: pci200_pci_tbl, + probe: pci200_pci_init_one, + remove: pci200_pci_remove_one, +}; + + +static int __init pci200_init_module(void) +{ +#ifdef MODULE + printk(KERN_INFO "%s\n", version); +#endif + if (pci_clock_freq < 1000000 || pci_clock_freq > 80000000) { + printk(KERN_ERR "pci200syn: Invalid PCI clock frequency\n"); + return -EINVAL; + } + return pci_module_init(&pci200_pci_driver); +} + + + +static void __exit pci200_cleanup_module(void) +{ + pci_unregister_driver(&pci200_pci_driver); +} + +MODULE_AUTHOR("Krzysztof Halasa "); +MODULE_DESCRIPTION("Goramo PCI200SYN serial port driver"); +MODULE_LICENSE("GPL v2"); +MODULE_DEVICE_TABLE(pci, pci200_pci_tbl); +module_param(pci_clock_freq, int, 0444); +MODULE_PARM_DESC(pci_clock_freq, "System PCI clock frequency in Hz"); +module_init(pci200_init_module); +module_exit(pci200_cleanup_module); --- linux-2.6.orig/drivers/net/wan/Kconfig 2003-10-03 15:38:12.000000000 +0200 +++ linux-2.6/drivers/net/wan/Kconfig 2003-10-03 16:27:08.000000000 +0200 @@ -325,6 +325,21 @@ comment "X.25/LAPB support is disabled" depends on WAN && HDLC && (LAPB!=m || HDLC!=m) && LAPB!=y +config PCI200SYN + tristate "Goramo PCI200SYN support" + depends on HDLC && PCI + help + This driver is for PCI200SYN cards made by Goramo sp. j. + If you have such a card, say Y here and see + + + If you want to compile the driver as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read . The module + will be called pci200syn. + + If unsure, say N here. + config WANXL tristate "SBE Inc. wanXL support" depends on HDLC && PCI --=-=-=-- From akpm@osdl.org Sat Oct 18 17:27:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 17:27:50 -0700 (PDT) Received: from mail.osdl.org ([65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9J0RG25022488 for ; Sat, 18 Oct 2003 17:27:17 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9J0R6o08517; Sat, 18 Oct 2003 17:27:07 -0700 Date: Sat, 18 Oct 2003 17:27:36 -0700 From: Andrew Morton To: dtucker@zip.com.au Cc: netdev@oss.sgi.com Subject: Re: [Bugme-new] [Bug 1360] New: Can't access /proc/self/fd/0 from sshd when no pty allocated. Message-Id: <20031018172736.417bf89d.akpm@osdl.org> In-Reply-To: <200310151142.h9FBgi5k029003@fire-1.osdl.org> References: <200310151142.h9FBgi5k029003@fire-1.osdl.org> X-Mailer: Sylpheed version 0.9.4 (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: 932 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 2728 Lines: 76 bugme-daemon@osdl.org wrote: > > http://bugme.osdl.org/show_bug.cgi?id=1360 > > Summary: Can't access /proc/self/fd/0 from sshd when no pty > allocated. > Kernel Version: 2.6.0-test7 > Status: NEW > Severity: normal > Owner: bugme-janitors@lists.osdl.org > Submitter: dtucker@zip.com.au > > > Distribution: Redhat 8 w/2.6.0-test7 > Hardware Environment: AMD K6III/500, 256MB RAM > Software Environment: gcc-3.2-7, glibc-2.3.2-4.80.6, openssh-3.7.1p2 > Problem Description: > > Basically, processes lauched from sshd without a pty can't access /proc/self/fd/0. > > This is an update to bug #1357 which has been closed as invalid (because it was > a 2.4 vendor kernel). I can reproduce with a vanilla 2.6.0-test7 kernel but I > can't reopen the bug. > > I'm guessing this in an issue with /proc, hence the "Filesystem" category, > however I could be wrong. > > Steps to reproduce: > $ ssh testbox "uname -a" > Linux testbox 2.6.0-test7 #11 Wed Oct 15 20:35:16 EST 2003 i686 unknown > > $ echo test | ssh 192.168.32.108 "cat /proc/self/fd/0" > cat: /proc/self/fd/0: No such device or address > > $ echo test | ssh testbox "cat | cat /proc/self/fd/0 | cat" > test > > In the failing example, the descriptor is a socket. In the working example, the > descriptor is a pipe. I don't know if this is related. > > $ ssh testbox "ls -l /proc/self/fd/" > lrwx------ 1 root root 64 Oct 16 04:50 0 -> socket:[2474] > lrwx------ 1 root root 64 Oct 16 04:50 1 -> socket:[2474] > lrwx------ 1 root root 64 Oct 16 04:50 2 -> socket:[2476] > lr-x------ 1 root root 64 Oct 16 04:50 3 > ls: ls:/proc/self/fd/3: No such file or directory > > $ ssh testbox "cat | ls -l /proc/self/fd/ | cat" > lr-x------ 1 root root 64 Oct 16 04:51 0 -> pipe:[2556] > l-wx------ 1 root root 64 Oct 16 04:51 1 -> pipe:[2557] > lrwx------ 1 root root 64 Oct 16 04:51 2 -> socket:[2554] > lr-x------ 1 root root 64 Oct 16 04:51 3 > ls: ls:/proc/self/fd/3: No such file or directory > > (Also occurs on kernel-2.4.20-20.8, and self-made embedded system with VIA Ezra > CPU, 2.6.0-test7 kernel + uClibc-0.9.19 + busybox userspace) > > I have a stand-alone test case which I will attach. > This appears to be deliberate: /* * In theory you can't get an open on this inode, but /proc provides * a back door. Remember to keep it shut otherwise you'll let the * creepy crawlies in. */ static int sock_no_open(struct inode *irrelevant, struct file *dontcare) { return -ENXIO; } I do not know why; the comment is fairly useless. From akpm@osdl.org Sat Oct 18 18:48:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 18:48:41 -0700 (PDT) Received: from mail.osdl.org ([65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9J1m225024253 for ; Sat, 18 Oct 2003 18:48:03 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9J1lGo19489; Sat, 18 Oct 2003 18:47:16 -0700 Date: Sat, 18 Oct 2003 18:47:46 -0700 From: Andrew Morton To: Richard Procter Cc: jgarzik@pobox.com, felipewd@terra.com.br, netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: [PATCH] SMP support on 3c527 net driver for 2.6 Message-Id: <20031018184746.54a2e6b0.akpm@osdl.org> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.4 (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: 933 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 25794 Lines: 870 Richard Procter wrote: > > This patch against 2.6-test4 updates the 3c527 net driver for 2.6. > > It is tested, but only as a back-port to 2.4, as I was unable to > get my scsi driver booting on 2.6. > I've regenerated this against the current driver. I'll include it in test8-mm1. If the scsi problem is fixed could you please retest this driver on both SMP and UP builds? If the scsi problem is not fixed could you please be sure to shout at the right people about that? > Questions: > - > { > u16 x; > [...] > x=5; > } > > Is that x=5 atomic on SMP? It's a local variable? Yes, it is atomic. Partly because the compiler will probably align things but mainly because the stack is only used by one CPU at a time. If the u16 is a structure member then yes it is probably OK because the compiler will pad things. But if the next slut in the struct is also a u16 then it may not be atomic on some architectures. I do not know. It's best to avoid this. > - Is atomic_t atomic on SMP? Yes. From: Richard Procter This patch updates the 3c527 net driver for 2.6. It is tested, but only as a back-port to 2.4, as I was unable to get my scsi driver booting on 2.6. It also includes a number of trivial clean-ups. * Replaces sti/sleep_on/cli with semaphores+completions. This made me realise I could get rid of the state-machine, simplifying the code. It also meant avoiding having to do things like: while (state != state_wanted) { /* Manually Sleep */ } , because we give each state_wanted a separate semaphore/completion. Also, the above, inlined, increased mc32_command by 770% (438% non-inlined) over the semaphore version (at a cost of 1 sem + 2 completions per driver). * Removed mutex covering mc32_send_packet (hard_start_xmit). This lets the interrupt handler operate concurrently and removes unnecessary locking. It makes the code only slightly more brittle. Here is why I believe it works: - hard_start_xmit is serialised at a higher layer, so no reentrancy problems. - Other than tx_count and tx_ring_head, the interrupt handler will not touch the data structures being modified until we increment tx_ring_head to reveal the new queue entry. - This leaves tx_count and tx_ring_head. tx_count is atomic_t, so can be modified by both mc32_tx_ring() and mc32_send_packet without racing. mc32_send_packet is the only function to modify u16 tx_ring_head, and tx_ring_head=head; will execute atomically with respect to reads by the rest of the driver (line 1056). drivers/net/3c527.c | 372 ++++++++++++++++++++++------------------------------ drivers/net/3c527.h | 6 drivers/net/Kconfig | 2 3 files changed, 162 insertions(+), 218 deletions(-) diff -puN drivers/net/3c527.c~3c527-smp-update drivers/net/3c527.c --- 25/drivers/net/3c527.c~3c527-smp-update 2003-10-18 17:57:27.000000000 -0700 +++ 25-akpm/drivers/net/3c527.c 2003-10-18 17:57:27.000000000 -0700 @@ -1,9 +1,10 @@ -/* 3c527.c: 3Com Etherlink/MC32 driver for Linux 2.4 +/* 3c527.c: 3Com Etherlink/MC32 driver for Linux 2.4 and 2.6. * * (c) Copyright 1998 Red Hat Software Inc * Written by Alan Cox. * Further debugging by Carl Drougge. - * Modified by Richard Procter (rnp@netlink.co.nz) + * Initial SMP support by Felipe W Damasio + * Heavily modified by Richard Procter * * Based on skeleton.c written 1993-94 by Donald Becker and ne2.c * (for the MCA stuff) written by Wim Dumon. @@ -17,11 +18,11 @@ */ #define DRV_NAME "3c527" -#define DRV_VERSION "0.6a" -#define DRV_RELDATE "2001/11/17" +#define DRV_VERSION "0.7-SMP" +#define DRV_RELDATE "2003/09/17" static const char *version = -DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Proctor (rnp@netlink.co.nz)\n"; +DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Procter \n"; /** * DOC: Traps for the unwary @@ -100,7 +101,9 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELD #include #include #include +#include +#include #include #include #include @@ -141,19 +144,19 @@ static unsigned int mc32_debug = NET_DEB static const int WORKAROUND_82586=1; /* Pointers to buffers and their on-card records */ - struct mc32_ring_desc { volatile struct skb_header *p; struct sk_buff *skb; }; - /* Information that needs to be kept for each board. */ struct mc32_local { - struct net_device_stats net_stats; int slot; + + u32 base; + struct net_device_stats net_stats; volatile struct mc32_mailbox *rx_box; volatile struct mc32_mailbox *tx_box; volatile struct mc32_mailbox *exec_box; @@ -163,22 +166,23 @@ struct mc32_local u16 tx_len; /* Transmit list count */ u16 rx_len; /* Receive list count */ - u32 base; - u16 exec_pending; - u16 mc_reload_wait; /* a multicast load request is pending */ + u16 xceiver_desired_state; /* HALTED or RUNNING */ + u16 cmd_nonblocking; /* Thread is uninterested in command result */ + u16 mc_reload_wait; /* A multicast load request is pending */ u32 mc_list_valid; /* True when the mclist is set */ - u16 xceiver_state; /* Current transceiver state. bitmapped */ - u16 desired_state; /* The state we want the transceiver to be in */ - atomic_t tx_count; /* buffers left */ - wait_queue_head_t event; struct mc32_ring_desc tx_ring[TX_RING_LEN]; /* Host Transmit ring */ struct mc32_ring_desc rx_ring[RX_RING_LEN]; /* Host Receive ring */ - u16 tx_ring_tail; /* index to tx de-queue end */ - u16 tx_ring_head; /* index to tx en-queue end */ + atomic_t tx_count; /* buffers left */ + volatile u16 tx_ring_head; /* index to tx en-queue end */ + u16 tx_ring_tail; /* index to tx de-queue end */ u16 rx_ring_tail; /* index to rx de-queue end */ + + struct semaphore cmd_mutex; /* Serialises issuing of execute commands */ + struct completion execution_cmd; /* Card has completed an execute command */ + struct completion xceiver_cmd; /* Card has completed a tx or rx command */ }; /* The station (ethernet) address prefix, used for a sanity check. */ @@ -234,7 +238,6 @@ int __init mc32_probe(struct net_device { static int current_mca_slot = -1; int i; - int adapter_found = 0; SET_MODULE_OWNER(dev); @@ -245,11 +248,11 @@ int __init mc32_probe(struct net_device Autodetecting MCA cards is extremely simple. Just search for the card. */ - for(i = 0; (mc32_adapters[i].name != NULL) && !adapter_found; i++) { + for(i = 0; (mc32_adapters[i].name != NULL); i++) { current_mca_slot = mca_find_unused_adapter(mc32_adapters[i].id, 0); - if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) { + if(current_mca_slot != MCA_NOTFOUND) { if(!mc32_probe1(dev, current_mca_slot)) { mca_set_adapter_name(current_mca_slot, @@ -407,7 +410,7 @@ static int __init mc32_probe1(struct net * Grab the IRQ */ - i = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ, dev->name, dev); + i = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); if (i) { release_region(dev->base_addr, MC32_IO_EXTENT); printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq); @@ -496,7 +499,9 @@ static int __init mc32_probe1(struct net lp->tx_len = lp->exec_box->data[9]; /* Transmit list count */ lp->rx_len = lp->exec_box->data[11]; /* Receive list count */ - init_waitqueue_head(&lp->event); + init_MUTEX_LOCKED(&lp->cmd_mutex); + init_completion(&lp->execution_cmd); + init_completion(&lp->xceiver_cmd); printk("%s: Firmware Rev %d. %d RX buffers, %d TX buffers. Base of 0x%08X.\n", dev->name, lp->exec_box->data[12], lp->rx_len, lp->tx_len, lp->base); @@ -509,10 +514,6 @@ static int __init mc32_probe1(struct net dev->tx_timeout = mc32_timeout; dev->watchdog_timeo = HZ*5; /* Board does all the work */ dev->ethtool_ops = &netdev_ethtool_ops; - - lp->xceiver_state = HALTED; - - lp->tx_ring_tail=lp->tx_ring_head=0; /* Fill in the fields of the device structure with ethernet values. */ ether_setup(dev); @@ -537,7 +538,7 @@ err_exit_irq: * status of any pending commands and takes very little time at all. */ -static void mc32_ready_poll(struct net_device *dev) +static inline void mc32_ready_poll(struct net_device *dev) { int ioaddr = dev->base_addr; while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR)); @@ -552,31 +553,38 @@ static void mc32_ready_poll(struct net_d * @len: Length of the data block * * Send a command from interrupt state. If there is a command - * currently being executed then we return an error of -1. It simply - * isn't viable to wait around as commands may be slow. Providing we - * get in, we busy wait for the board to become ready to accept the - * command and issue it. We do not wait for the command to complete - * --- the card will interrupt us when it's done. + * currently being executed then we return an error of -1. It + * simply isn't viable to wait around as commands may be + * slow. This can theoretically be starved on SMP, but it's hard + * to see a realistic situation. We do not wait for the command + * to complete --- we rely on the interrupt handler to tidy up + * after us. */ static int mc32_command_nowait(struct net_device *dev, u16 cmd, void *data, int len) { struct mc32_local *lp = (struct mc32_local *)dev->priv; int ioaddr = dev->base_addr; + int ret = -1; - if(lp->exec_pending) - return -1; - - lp->exec_pending=3; - lp->exec_box->mbox=0; - lp->exec_box->mbox=cmd; - memcpy((void *)lp->exec_box->data, data, len); - barrier(); /* the memcpy forgot the volatile so be sure */ + if (down_trylock(&lp->cmd_mutex) == 0) + { + lp->cmd_nonblocking=1; + lp->exec_box->mbox=0; + lp->exec_box->mbox=cmd; + memcpy((void *)lp->exec_box->data, data, len); + barrier(); /* the memcpy forgot the volatile so be sure */ + + /* Send the command */ + mc32_ready_poll(dev); + outb(1<<6, ioaddr+HOST_CMD); - /* Send the command */ - while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR)); - outb(1<<6, ioaddr+HOST_CMD); - return 0; + ret = 0; + + /* Interrupt handler will signal mutex on completion */ + } + + return ret; } @@ -590,76 +598,47 @@ static int mc32_command_nowait(struct ne * Sends exec commands in a user context. This permits us to wait around * for the replies and also to wait for the command buffer to complete * from a previous command before we execute our command. After our - * command completes we will complete any pending multicast reload + * command completes we will attempt any pending multicast reload * we blocked off by hogging the exec buffer. * * You feed the card a command, you wait, it interrupts you get a * reply. All well and good. The complication arises because you use * commands for filter list changes which come in at bh level from things * like IPV6 group stuff. - * - * We have a simple state machine - * - * 0 - nothing issued - * - * 1 - command issued, wait reply - * - * 2 - reply waiting - reader then goes to state 0 - * - * 3 - command issued, trash reply. In which case the irq - * takes it back to state 0 - * */ static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len) { struct mc32_local *lp = (struct mc32_local *)dev->priv; int ioaddr = dev->base_addr; - unsigned long flags; int ret = 0; + down(&lp->cmd_mutex); + /* - * Wait for a command - */ - - save_flags(flags); - cli(); - - while(lp->exec_pending) - sleep_on(&lp->event); - - /* - * Issue mine + * My Turn */ - lp->exec_pending=1; - - restore_flags(flags); - + lp->cmd_nonblocking=0; lp->exec_box->mbox=0; lp->exec_box->mbox=cmd; memcpy((void *)lp->exec_box->data, data, len); barrier(); /* the memcpy forgot the volatile so be sure */ - /* Send the command */ - while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR)); - outb(1<<6, ioaddr+HOST_CMD); - - save_flags(flags); - cli(); + mc32_ready_poll(dev); + outb(1<<6, ioaddr+HOST_CMD); - while(lp->exec_pending!=2) - sleep_on(&lp->event); - lp->exec_pending=0; - restore_flags(flags); + wait_for_completion(&lp->execution_cmd); if(lp->exec_box->mbox&(1<<13)) ret = -1; + up(&lp->cmd_mutex); + /* - * A multicast set got blocked - do it now - */ - + * A multicast set got blocked - try it now + */ + if(lp->mc_reload_wait) { mc32_reset_multicast_list(dev); @@ -676,11 +655,9 @@ static int mc32_command(struct net_devic * This may be called from the interrupt state, where it is used * to restart the rx ring if the card runs out of rx buffers. * - * First, we check if it's ok to start the transceiver. We then show - * the card where to start in the rx ring and issue the - * commands to start reception and transmission. We don't wait - * around for these to complete. - */ + * We must first check if it's ok to (re)start the transceiver. See + * mc32_close for details. + */ static void mc32_start_transceiver(struct net_device *dev) { @@ -688,24 +665,20 @@ static void mc32_start_transceiver(struc int ioaddr = dev->base_addr; /* Ignore RX overflow on device closure */ - if (lp->desired_state==HALTED) + if (lp->xceiver_desired_state==HALTED) return; + /* Give the card the offset to the post-EOL-bit RX descriptor */ mc32_ready_poll(dev); - - lp->tx_box->mbox=0; lp->rx_box->mbox=0; - - /* Give the card the offset to the post-EOL-bit RX descriptor */ lp->rx_box->data[0]=lp->rx_ring[prev_rx(lp->rx_ring_tail)].p->next; - outb(HOST_CMD_START_RX, ioaddr+HOST_CMD); mc32_ready_poll(dev); + lp->tx_box->mbox=0; outb(HOST_CMD_RESTRT_TX, ioaddr+HOST_CMD); /* card ignores this on RX restart */ /* We are not interrupted on start completion */ - lp->xceiver_state=RUNNING; } @@ -725,25 +698,17 @@ static void mc32_halt_transceiver(struct { struct mc32_local *lp = (struct mc32_local *)dev->priv; int ioaddr = dev->base_addr; - unsigned long flags; mc32_ready_poll(dev); - - lp->tx_box->mbox=0; lp->rx_box->mbox=0; - outb(HOST_CMD_SUSPND_RX, ioaddr+HOST_CMD); + wait_for_completion(&lp->xceiver_cmd); + mc32_ready_poll(dev); + lp->tx_box->mbox=0; outb(HOST_CMD_SUSPND_TX, ioaddr+HOST_CMD); - - save_flags(flags); - cli(); - - while(lp->xceiver_state!=HALTED) - sleep_on(&lp->event); - - restore_flags(flags); -} + wait_for_completion(&lp->xceiver_cmd); +} /** @@ -754,7 +719,7 @@ static void mc32_halt_transceiver(struct * the point where mc32_start_transceiver() can be called. * * The card sets up the receive ring for us. We are required to use the - * ring it provides although we can change the size of the ring. + * ring it provides, although the size of the ring is configurable. * * We allocate an sk_buff for each ring entry in turn and * initalise its house-keeping info. At the same time, we read @@ -775,7 +740,7 @@ static int mc32_load_rx_ring(struct net_ rx_base=lp->rx_chain; - for(i=0;irx_ring[i].skb=alloc_skb(1532, GFP_KERNEL); skb_reserve(lp->rx_ring[i].skb, 18); @@ -812,21 +777,19 @@ static int mc32_load_rx_ring(struct net_ * * Free the buffer for each ring slot. This may be called * before mc32_load_rx_ring(), eg. on error in mc32_open(). + * Requires rx skb pointers to point to a valid skb, or NULL. */ static void mc32_flush_rx_ring(struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; - - struct sk_buff *skb; int i; for(i=0; i < RX_RING_LEN; i++) { - skb = lp->rx_ring[i].skb; - if (skb!=NULL) { - kfree_skb(skb); - skb=NULL; + if (lp->rx_ring[i].skb) { + dev_kfree_skb(lp->rx_ring[i].skb); + lp->rx_ring[i].skb = NULL; } lp->rx_ring[i].p=NULL; } @@ -858,7 +821,7 @@ static void mc32_load_tx_ring(struct net tx_base=lp->tx_box->data[0]; - for(i=0;itx_len;i++) + for(i=0 ; ibase+tx_base); lp->tx_ring[i].p=p; @@ -867,8 +830,8 @@ static void mc32_load_tx_ring(struct net tx_base=p->next; } - /* -1 so that tx_ring_head cannot "lap" tx_ring_tail, */ - /* which would be bad news for mc32_tx_ring as cur. implemented */ + /* -1 so that tx_ring_head cannot "lap" tx_ring_tail */ + /* see mc32_tx_ring */ atomic_set(&lp->tx_count, TX_RING_LEN-1); lp->tx_ring_head=lp->tx_ring_tail=0; @@ -879,45 +842,26 @@ static void mc32_load_tx_ring(struct net * mc32_flush_tx_ring - free transmit ring * @lp: Local data of 3c527 to flush the tx ring of * - * We have to consider two cases here. We want to free the pending - * buffers only. If the ring buffer head is past the start then the - * ring segment we wish to free wraps through zero. The tx ring - * house-keeping variables are then reset. + * If the ring is non-empty, zip over the it, freeing any + * allocated skb_buffs. The tx ring house-keeping variables are + * then reset. Requires rx skb pointers to point to a valid skb, + * or NULL. */ static void mc32_flush_tx_ring(struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; - - if(lp->tx_ring_tail!=lp->tx_ring_head) + int i; + + for (i=0; i < TX_RING_LEN; i++) { - int i; - if(lp->tx_ring_tail < lp->tx_ring_head) + if (lp->tx_ring[i].skb) { - for(i=lp->tx_ring_tail;itx_ring_head;i++) - { - dev_kfree_skb(lp->tx_ring[i].skb); - lp->tx_ring[i].skb=NULL; - lp->tx_ring[i].p=NULL; - } - } - else - { - for(i=lp->tx_ring_tail; itx_ring[i].skb); - lp->tx_ring[i].skb=NULL; - lp->tx_ring[i].p=NULL; - } - for(i=0; itx_ring_head; i++) - { - dev_kfree_skb(lp->tx_ring[i].skb); - lp->tx_ring[i].skb=NULL; - lp->tx_ring[i].p=NULL; - } + dev_kfree_skb(lp->tx_ring[i].skb); + lp->tx_ring[i].skb = NULL; } } - + atomic_set(&lp->tx_count, 0); lp->tx_ring_tail=lp->tx_ring_head=0; } @@ -956,6 +900,12 @@ static int mc32_open(struct net_device * regs|=HOST_CTRL_INTE; outb(regs, ioaddr+HOST_CTRL); + /* + * Allow ourselves to issue commands + */ + + up(&lp->cmd_mutex); + /* * Send the indications on command @@ -1008,7 +958,7 @@ static int mc32_open(struct net_device * return -ENOBUFS; } - lp->desired_state = RUNNING; + lp->xceiver_desired_state = RUNNING; /* And finally, set the ball rolling... */ mc32_start_transceiver(dev); @@ -1045,61 +995,64 @@ static void mc32_timeout(struct net_devi * Transmit a buffer. This normally means throwing the buffer onto * the transmit queue as the queue is quite large. If the queue is * full then we set tx_busy and return. Once the interrupt handler - * gets messages telling it to reclaim transmit queue entries we will + * gets messages telling it to reclaim transmit queue entries, we will * clear tx_busy and the kernel will start calling this again. * - * We use cli rather than spinlocks. Since I have no access to an SMP - * MCA machine I don't plan to change it. It is probably the top - * performance hit for this driver on SMP however. - */ - + * We do not disable interrupts or acquire any locks; this can + * run concurrently with mc32_tx_ring(), and the function itself + * is serialised at a higher layer. However, this makes it + * crucial that we update lp->tx_ring_head only after we've + * established a valid packet in the tx ring (and is why we mark + * tx_ring_head volatile). + * + **/ static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; - unsigned long flags; + u16 head = lp->tx_ring_head; volatile struct skb_header *p, *np; netif_stop_queue(dev); - save_flags(flags); - cli(); - - if(atomic_read(&lp->tx_count)==0) - { - restore_flags(flags); + if(atomic_read(&lp->tx_count)==0) { return 1; } + skb = skb_padto(skb, ETH_ZLEN); + + if (skb == NULL) { + netif_wake_queue(dev); + return 0; + } + atomic_dec(&lp->tx_count); /* P is the last sending/sent buffer as a pointer */ - p=lp->tx_ring[lp->tx_ring_head].p; + p=lp->tx_ring[head].p; - lp->tx_ring_head=next_tx(lp->tx_ring_head); + head = next_tx(head); /* NP is the buffer we will be loading */ - np=lp->tx_ring[lp->tx_ring_head].p; - - if (skb->len < ETH_ZLEN) { - skb = skb_padto(skb, ETH_ZLEN); - if (skb == NULL) - goto out; - } + np=lp->tx_ring[head].p; /* We will need this to flush the buffer out */ lp->tx_ring[lp->tx_ring_head].skb = skb; - np->length = (skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len; + np->length = unlikely(skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len; np->data = isa_virt_to_bus(skb->data); np->status = 0; np->control = CONTROL_EOP | CONTROL_EOL; wmb(); - p->control &= ~CONTROL_EOL; /* Clear EOL on p */ -out: - restore_flags(flags); + /* + * The new frame has been setup; we can now + * let the card and interrupt handler "see" it + */ + + p->control &= ~CONTROL_EOL; + lp->tx_ring_head= head; netif_wake_queue(dev); return 0; @@ -1180,10 +1133,11 @@ static void mc32_rx_ring(struct net_devi { struct mc32_local *lp=dev->priv; volatile struct skb_header *p; - u16 rx_ring_tail = lp->rx_ring_tail; - u16 rx_old_tail = rx_ring_tail; - + u16 rx_ring_tail; + u16 rx_old_tail; int x=0; + + rx_old_tail = rx_ring_tail = lp->rx_ring_tail; do { @@ -1273,7 +1227,12 @@ static void mc32_tx_ring(struct net_devi struct mc32_local *lp=(struct mc32_local *)dev->priv; volatile struct skb_header *np; - /* NB: lp->tx_count=TX_RING_LEN-1 so that tx_ring_head cannot "lap" tail here */ + /* + * We rely on head==tail to mean 'queue empty'. + * This is why lp->tx_count=TX_RING_LEN-1: in order to prevent + * tx_ring_head wrapping to tail and confusing a 'queue empty' + * condition with 'queue full' + */ while (lp->tx_ring_tail != lp->tx_ring_head) { @@ -1386,8 +1345,7 @@ static irqreturn_t mc32_interrupt(int ir break; case 3: /* Halt */ case 4: /* Abort */ - lp->xceiver_state |= TX_HALTED; - wake_up(&lp->event); + complete(&lp->xceiver_cmd); break; default: printk("%s: strange tx ack %d\n", dev->name, status&7); @@ -1402,8 +1360,7 @@ static irqreturn_t mc32_interrupt(int ir break; case 3: /* Halt */ case 4: /* Abort */ - lp->xceiver_state |= RX_HALTED; - wake_up(&lp->event); + complete(&lp->xceiver_cmd); break; case 6: /* Out of RX buffers stat */ @@ -1419,25 +1376,18 @@ static irqreturn_t mc32_interrupt(int ir status>>=3; if(status&1) { - - /* 0=no 1=yes 2=replied, get cmd, 3 = wait reply & dump it */ - - if(lp->exec_pending!=3) { - lp->exec_pending=2; - wake_up(&lp->event); - } - else - { - lp->exec_pending=0; - - /* A new multicast set may have been - blocked while the old one was - running. If so, do it now. */ + /* + * No thread is waiting: we need to tidy + * up ourself. + */ + if (lp->cmd_nonblocking) { + up(&lp->cmd_mutex); if (lp->mc_reload_wait) mc32_reset_multicast_list(dev); - else - wake_up(&lp->event); + } + else { + complete(&lp->execution_cmd); } } if(status&2) @@ -1491,12 +1441,12 @@ static irqreturn_t mc32_interrupt(int ir static int mc32_close(struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; - int ioaddr = dev->base_addr; + u8 regs; u16 one=1; - lp->desired_state = HALTED; + lp->xceiver_desired_state = HALTED; netif_stop_queue(dev); /* @@ -1509,11 +1459,10 @@ static int mc32_close(struct net_device mc32_halt_transceiver(dev); - /* Catch any waiting commands */ + /* Ensure we issue no more commands beyond this point */ + + down(&lp->cmd_mutex); - while(lp->exec_pending==1) - sleep_on(&lp->event); - /* Ok the card is now stopping */ regs=inb(ioaddr+HOST_CTRL); @@ -1540,12 +1489,9 @@ static int mc32_close(struct net_device static struct net_device_stats *mc32_get_stats(struct net_device *dev) { - struct mc32_local *lp; + struct mc32_local *lp = (struct mc32_local *)dev->priv; mc32_update_stats(dev); - - lp = (struct mc32_local *)dev->priv; - return &lp->net_stats; } diff -puN drivers/net/3c527.h~3c527-smp-update drivers/net/3c527.h --- 25/drivers/net/3c527.h~3c527-smp-update 2003-10-18 17:57:27.000000000 -0700 +++ 25-akpm/drivers/net/3c527.h 2003-10-18 17:57:27.000000000 -0700 @@ -27,10 +27,8 @@ #define HOST_RAMPAGE 8 -#define RX_HALTED (1<<0) -#define TX_HALTED (1<<1) -#define HALTED (RX_HALTED | TX_HALTED) -#define RUNNING 0 +#define HALTED 0 +#define RUNNING 1 struct mc32_mailbox { diff -puN drivers/net/Kconfig~3c527-smp-update drivers/net/Kconfig --- 25/drivers/net/Kconfig~3c527-smp-update 2003-10-18 17:58:21.000000000 -0700 +++ 25-akpm/drivers/net/Kconfig 2003-10-18 18:02:53.000000000 -0700 @@ -657,7 +657,7 @@ config ELMC config ELMC_II tristate "3c527 \"EtherLink/MC 32\" support (EXPERIMENTAL)" - depends on NET_VENDOR_3COM && MCA && EXPERIMENTAL && BROKEN_ON_SMP + depends on NET_VENDOR_3COM && MCA && MCA_LEGACY help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from _ From akpm@osdl.org Sat Oct 18 18:59:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 18 Oct 2003 19:00:29 -0700 (PDT) Received: from mail.osdl.org ([65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9J1xu25024974 for ; Sat, 18 Oct 2003 18:59:56 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9J1xho21075; Sat, 18 Oct 2003 18:59:44 -0700 Date: Sat, 18 Oct 2003 19:00:14 -0700 From: Andrew Morton To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: register_netdevice return val fix Message-Id: <20031018190014.60ad6344.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (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: 934 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1004 Lines: 40 If the driver's init function returns an error code (most likely -ENODEV), register_netdevice will stomp on it and will always return -EIO. You end up always getting an "Input/Output error" from modprobe, which is confusing. Fix register_netdevice() to return the init function's error code, if it looks sane. net/core/dev.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff -puN net/core/dev.c~register_netdevice-retval-fix net/core/dev.c --- 25/net/core/dev.c~register_netdevice-retval-fix 2003-10-18 18:50:52.000000000 -0700 +++ 25-akpm/net/core/dev.c 2003-10-18 18:51:39.000000000 -0700 @@ -2652,9 +2652,14 @@ int register_netdevice(struct net_device dev->iflink = -1; /* Init, if this function is available */ - ret = -EIO; - if (dev->init && dev->init(dev)) - goto out_err; + if (dev->init) { + ret = dev->init(dev); + if (ret) { + if (ret > 0) + ret = -EIO; + goto out_err; + } + } dev->ifindex = dev_new_index(); if (dev->iflink == -1) _ From davem@pizda.ninka.net Sun Oct 19 00:02:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 19 Oct 2003 00:03:08 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9J72X25001685 for ; Sun, 19 Oct 2003 00:02:33 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA14361; Sat, 18 Oct 2003 23:57:35 -0700 Date: Sat, 18 Oct 2003 23:57:35 -0700 From: "David S. Miller" To: Andrew Morton Cc: dtucker@zip.com.au, netdev@oss.sgi.com Subject: Re: [Bugme-new] [Bug 1360] New: Can't access /proc/self/fd/0 from sshd when no pty allocated. Message-Id: <20031018235735.52f5e15a.davem@redhat.com> In-Reply-To: <20031018172736.417bf89d.akpm@osdl.org> References: <200310151142.h9FBgi5k029003@fire-1.osdl.org> <20031018172736.417bf89d.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 935 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: 749 Lines: 26 On Sat, 18 Oct 2003 17:27:36 -0700 Andrew Morton wrote: > This appears to be deliberate: > > /* > * In theory you can't get an open on this inode, but /proc provides > * a back door. Remember to keep it shut otherwise you'll let the > * creepy crawlies in. > */ > > static int sock_no_open(struct inode *irrelevant, struct file *dontcare) > { > return -ENXIO; > } > > I do not know why; the comment is fairly useless. For many socket types there are no sane open() semantics. If I open() a unconnected socket, what does that mean? Should it connect, of do something like a dup()? This code has been this way for a long time, anyone who wants to change this needs to deal with and address all the aforementioned issues. From davem@pizda.ninka.net Sun Oct 19 00:08:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 19 Oct 2003 00:09:10 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9J78b25002167 for ; Sun, 19 Oct 2003 00:08:37 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA14393; Sun, 19 Oct 2003 00:03:41 -0700 Date: Sun, 19 Oct 2003 00:03:41 -0700 From: "David S. Miller" To: Andrew Morton Cc: simon@swat.me.uk, netdev@oss.sgi.com Subject: Re: [Bugme-new] [Bug 1371] New: kernel fails to compile with ipv6 error Message-Id: <20031019000341.5769859a.davem@redhat.com> In-Reply-To: <20031018160855.26fea7b8.akpm@osdl.org> References: <200310182118.h9ILIBMX001067@fire-1.osdl.org> <20031018160855.26fea7b8.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 936 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: 286 Lines: 10 On Sat, 18 Oct 2003 16:08:55 -0700 Andrew Morton wrote: > Odd. Please send your .config. Known issue, see the patch from Herbert Xu posted yesterday to linux-net (subject: "Re: [PATCH][2.6] fix compilation w/o CONFIG_XFRM"). It will cure this and other such issues. From davem@pizda.ninka.net Sun Oct 19 00:11:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 19 Oct 2003 00:12:20 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9J7Bg25002543 for ; Sun, 19 Oct 2003 00:11:43 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA14444; Sun, 19 Oct 2003 00:06:46 -0700 Date: Sun, 19 Oct 2003 00:06:46 -0700 From: "David S. Miller" To: Russell King Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Prevent "eth0: driver changed get_stats after register" lying Message-Id: <20031019000646.19f39f51.davem@redhat.com> In-Reply-To: <20031018214622.B25375@flint.arm.linux.org.uk> References: <20031018214622.B25375@flint.arm.linux.org.uk> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 937 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: 537 Lines: 13 On Sat, 18 Oct 2003 21:46:22 +0100 Russell King wrote: > We set "dev->last_stats" after we have registered the class device. > During class device registration, we trigger the hotplug scripts, > which can in turn bring up the interface. This in turn checks to > see if "dev->last_stats == dev->get_stats", and, since we haven't > set dev->last_stats yet, we complain. > > Here is a patch against 2.6.0-test8 which moves the initialisation > of last_stats such that we avoid the race. Looks ok, thanks Russell. From davem@pizda.ninka.net Sun Oct 19 00:12:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 19 Oct 2003 00:13:19 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9J7Ck25002683 for ; Sun, 19 Oct 2003 00:12:47 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA14471; Sun, 19 Oct 2003 00:07:55 -0700 Date: Sun, 19 Oct 2003 00:07:55 -0700 From: "David S. Miller" To: Andrew Morton Cc: netdev@oss.sgi.com Subject: Re: register_netdevice return val fix Message-Id: <20031019000755.56c63797.davem@redhat.com> In-Reply-To: <20031018190014.60ad6344.akpm@osdl.org> References: <20031018190014.60ad6344.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 938 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: 439 Lines: 15 On Sat, 18 Oct 2003 19:00:14 -0700 Andrew Morton wrote: > If the driver's init function returns an error code (most likely -ENODEV), > register_netdevice will stomp on it and will always return -EIO. > > You end up always getting an "Input/Output error" from modprobe, which is > confusing. > > Fix register_netdevice() to return the init function's error code, if it > looks sane. Looks fine, applied. Thanks Andrew. From amir.noam@intel.com Sun Oct 19 14:45:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 19 Oct 2003 14:46:15 -0700 (PDT) Received: from hermes.iil.intel.com (hermes.iil.intel.com [192.198.152.99]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9JLje25004597 for ; Sun, 19 Oct 2003 14:45:41 -0700 Received: from petasus.iil.intel.com (petasus.iil.intel.com [143.185.77.3]) by hermes.iil.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h9JFu2AI012076 for ; Sun, 19 Oct 2003 15:56:02 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h9JFxHG29665 for ; Sun, 19 Oct 2003 15:59:17 GMT Received: from hasmsx331.ger.corp.intel.com ([143.185.63.144]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003101917560127975 ; Sun, 19 Oct 2003 17:56:01 +0200 Received: from hasmsx403.ger.corp.intel.com ([143.185.63.109]) by hasmsx331.ger.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Sun, 19 Oct 2003 17:56:01 +0200 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: Changing bonding <-> ifenslave interface [was: Problem with current /proc entries] Date: Sun, 19 Oct 2003 17:56:01 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Bonding-devel] Problem with current /proc entries Thread-Index: AcOUJsUG6vvLKkldTVypUYK5DZgBDACLfMkQ From: "Noam, Amir" To: , X-OriginalArrivalTime: 19 Oct 2003 15:56:01.0834 (UTC) FILETIME=[7EB1C0A0:01C39659] X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h9JLje25004597 X-archive-position: 939 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev Content-Length: 2770 Lines: 71 [adding netdev to the discussion] "Chad N. Tindel" wrote: > > >I say that if people want to switch between 2.4 and 2.6, they can > > >write a script to create the appropriate ifenslave symbolic link. > > > > To clarify, I'm interpreting this to mean: > > > > 2.4.X ifenslave (where "X" is recent enough that it doesn't > > use SIOCDEVPRIVATE) should work with 2.6.anything. I disagree. See below. > > 2.4.X ifenslave (where "X" is old and it uses SIOCDEVPRIVATE) > > need not work with 2.6.anything. > > > > 2.6.X ifenslave (where "X" is 0 or better) should work with > > any 2.6 later than the one it was shipped with. Yes. > > 2.6.X ifenslave (where "X" is 0 or better) need not work with > > 2.4.anything. I disagree. I think that the latest version of ifenslave should work with all versions of the bonding module that we can reasonably expect people to use. This means that if ifenslave fails to use the new interface it can try the old one. (This is how I understood Jeff's position). However, I'm definitely in favor of dropping compatibility in the *module* in 2.6. This is because most recent distributions (Red Hat 9, for example) still use an antique version of ifenslave that still uses the SIOCDEVPRIVATE ioctls. If we remove support for these ioctls in 2.6 (as we should), then the bonding module will break compatibility with those ifenslave versions anyway. I see no point in trying to keep compatibility with the ifenslave version that is in the 2.4 kernel tree, while it is not yet in use by any distribution. > My opinion is this. What has worked in 2.4 in the past > should always work > for 2.4. Once you upgrade to 2.6, all bets for that are off. I agree, except that I think that if you upgrade to 2.6, and update your ifenslave accordingly, you shouldn't have to switch user space utilities when you boot into different kernels. That's why I said that once you update ifenslave it should work with old bonding as well. > > Amir, how close are you to having a first draft patch for > > inspection? I'm not concerned so much that it be fully baked > > as that > > it be something to look at and mess with for the usual gang. We can probably provide a version of bonding/ifenslave that works with the new interface within two weeks (hopefully less). This is, of course, assuming we reach a consensus on the compatibility issue. > > Am I nuts to want to get the new API stuff in for 2.6.0? It'd > > be nice to not be locked in to supporting the current > scheme because > > the first ifenslave in 2.6.0 uses it. > > I agree wholeheartedly. I also agree. The question is, can we really push such a change into bonding in 2.6, now that Linus only accepts bug fixes? Amir From noah@caltech.edu Sun Oct 19 22:04:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 19 Oct 2003 22:04:32 -0700 (PDT) Received: from water-ox.its.caltech.edu (SteeleMR-loadb-NAT-49.caltech.edu [131.215.49.69]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9K53x25021314 for ; Sun, 19 Oct 2003 22:03:59 -0700 Received: from earth-dog (earth-dog [192.168.1.3]) by water-ox-postvirus (Postfix) with ESMTP id 2ACDC26AD07; Sun, 19 Oct 2003 22:03:54 -0700 (PDT) Received: from earth-ox ([192.168.1.9]) by earth-dog (MailMonitor for SMTP v1.2.2 ) ; Sun, 19 Oct 2003 22:03:53 -0700 (PDT) Received: from clyde.its.caltech.edu (clyde.its.caltech.edu [131.215.48.174]) by earth-ox.its.caltech.edu (Postfix) with ESMTP id C35AE109A52; Sun, 19 Oct 2003 22:03:52 -0700 (PDT) Received: from localhost (noah@localhost) by clyde.its.caltech.edu (8.12.9/8.12.8) with ESMTP id h9K53qfD028121; Sun, 19 Oct 2003 22:03:52 -0700 (PDT) X-Authentication-Warning: clyde.its.caltech.edu: noah owned process doing -bs Date: Sun, 19 Oct 2003 22:03:52 -0700 (PDT) From: "Noah J. Misch" X-X-Sender: noah@clyde To: acme@conectiva.com.br Cc: rddunlap@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] Make LLC2 compile with PROC_FS=n Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 940 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: noah@caltech.edu Precedence: bulk X-list: netdev Content-Length: 4689 Lines: 139 Hello Arnaldo, This patch allows the LLC2 code to link properly when CONFIG_PROC_FS=n. The problem was that the Makefile only built llc_proc.c when PROC_FS=y/m, but af_llc.c called functions in that file in all cases. The log details how I fixed this. I think this is the best fix, but of course there are a number of less intrusive fixes, including (I think) one as simple as making llc_proc.c always compile. This one does apply cleanly to linux-2.5 BK as of 0400 UTC 10/20/2003 and passes allyesconfig and (allyesconfig - PROC_FS) compiles on i386. Please let me know if I should supply you with further information. Thanks, Noah # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1340.1.34 -> 1.1340.1.35 # net/llc/af_llc.c 1.50 -> 1.51 # net/llc/llc_proc.c 1.17 -> 1.18 # include/net/llc_proc.h 1.1 -> 1.3 net/llc/llc_proc.h (moved) # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/17 noah@caltech.edu 1.1340.1.35 # Move include/net/llc_proc.h to net/llc/llc_proc.h since it is a private # header file. Add static inline stub functions to that header and remove # the extern stub functions from llc_proc.c This fixes a link error and # saves space. Also mark two private structs in llc_proc.c static. # -------------------------------------------- # diff -Nru a/include/net/llc_proc.h b/include/net/llc_proc.h --- a/include/net/llc_proc.h Fri Oct 17 16:24:05 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,18 +0,0 @@ -#ifndef LLC_PROC_H -#define LLC_PROC_H -/* - * Copyright (c) 1997 by Procom Technology, Inc. - * 2002 by Arnaldo Carvalho de Melo - * - * This program can be redistributed or modified under the terms of the - * GNU General Public License as published by the Free Software Foundation. - * This program is distributed without any warranty or implied warranty - * of merchantability or fitness for a particular purpose. - * - * See the GNU General Public License for more details. - */ - -extern int llc_proc_init(void); -extern void llc_proc_exit(void); - -#endif /* LLC_PROC_H */ diff -Nru a/net/llc/af_llc.c b/net/llc/af_llc.c --- a/net/llc/af_llc.c Fri Oct 17 16:24:05 2003 +++ b/net/llc/af_llc.c Fri Oct 17 16:24:05 2003 @@ -30,7 +30,7 @@ #include #include #include -#include +#include "llc_proc.h" /* remember: uninitialized global data is zeroed because its in .bss */ static u16 llc_ui_sap_last_autoport = LLC_SAP_DYN_START; diff -Nru a/net/llc/llc_proc.c b/net/llc/llc_proc.c --- a/net/llc/llc_proc.c Fri Oct 17 16:24:05 2003 +++ b/net/llc/llc_proc.c Fri Oct 17 16:24:05 2003 @@ -14,7 +14,6 @@ #include #include -#ifdef CONFIG_PROC_FS #include #include #include @@ -193,14 +192,14 @@ return 0; } -struct seq_operations llc_seq_socket_ops = { +static struct seq_operations llc_seq_socket_ops = { .start = llc_seq_start, .next = llc_seq_next, .stop = llc_seq_stop, .show = llc_seq_socket_show, }; -struct seq_operations llc_seq_core_ops = { +static struct seq_operations llc_seq_core_ops = { .start = llc_seq_start, .next = llc_seq_next, .stop = llc_seq_stop, @@ -273,13 +272,3 @@ remove_proc_entry("core", llc_proc_dir); remove_proc_entry("llc", proc_net); } -#else /* CONFIG_PROC_FS */ -int __init llc_proc_init(void) -{ - return 0; -} - -void llc_proc_exit(void) -{ -} -#endif /* CONFIG_PROC_FS */ diff -Nru a/net/llc/llc_proc.h b/net/llc/llc_proc.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/net/llc/llc_proc.h Fri Oct 17 16:24:05 2003 @@ -0,0 +1,23 @@ +#ifndef LLC_PROC_H +#define LLC_PROC_H +/* + * Copyright (c) 1997 by Procom Technology, Inc. + * 2002 by Arnaldo Carvalho de Melo + * + * This program can be redistributed or modified under the terms of the + * GNU General Public License as published by the Free Software Foundation. + * This program is distributed without any warranty or implied warranty + * of merchantability or fitness for a particular purpose. + * + * See the GNU General Public License for more details. + */ + +#ifdef CONFIG_PROC_FS +extern int llc_proc_init(void); +extern void llc_proc_exit(void); +#else /* CONFIG_PROC_FS */ +static inline int llc_proc_init(void) { return 0; } +static inline void llc_proc_exit(void) { } +#endif /* CONFIG_PROC_FS */ + +#endif /* LLC_PROC_H */ From noah@caltech.edu Sun Oct 19 23:41:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 19 Oct 2003 23:41:43 -0700 (PDT) Received: from water-ox.its.caltech.edu (SteeleMR-loadb-NAT-49.caltech.edu [131.215.49.69]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9K6f925023459 for ; Sun, 19 Oct 2003 23:41:09 -0700 Received: from water-dog (water-dog [192.168.1.26]) by water-ox-postvirus (Postfix) with ESMTP id BEB6726AC74; Sun, 19 Oct 2003 23:41:03 -0700 (PDT) Received: from water-ox ([192.168.1.10]) by water-dog (MailMonitor for SMTP v1.2.2 ) ; Sun, 19 Oct 2003 23:41:02 -0700 (PDT) Received: from clyde.its.caltech.edu (clyde.its.caltech.edu [131.215.48.174]) by water-ox.its.caltech.edu (Postfix) with ESMTP id 5196926AC74; Sun, 19 Oct 2003 23:41:02 -0700 (PDT) Received: from localhost (noah@localhost) by clyde.its.caltech.edu (8.12.9/8.12.8) with ESMTP id h9K6f1OJ001392; Sun, 19 Oct 2003 23:41:02 -0700 (PDT) X-Authentication-Warning: clyde.its.caltech.edu: noah owned process doing -bs Date: Sun, 19 Oct 2003 23:41:01 -0700 (PDT) From: "Noah J. Misch" X-X-Sender: noah@clyde To: irda-users@lists.sourceforge.net Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [PATCH] Make VLSI FIR depend on X86 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 941 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: noah@caltech.edu Precedence: bulk X-list: netdev Content-Length: 1954 Lines: 47 Greetings, This is a trivial patch against the Kconfig entry for the VLSI FIR driver to make it depend on X86. The in-tree code guarantees that the driver will only build on X86, and according to the comments therein no machine of another architecture has this hardware anyway. Granted, no human intelligently configuring a kernel for his or her particular system would make this mistake, but perhaps someone building a distribution kernel would. I suggest this patch because it keeps the signal to noise ratio for those testing allyesconfig builds low. This patch applies to the linux-2.5 BK tree as of 0400 UTC 10/20/2003, and for some time before that as well. Please consider for eventual inclusion. It may be too much of a fringe case until 2.6.0 begins its stable series. Thanks, Noah # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1373 -> 1.1374 # drivers/net/irda/Kconfig 1.12 -> 1.13 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/16 noah@caltech.edu 1.1374 # Make VLSI_FIR depend on X86. Read the comment just above the #error in # include/net/irda/vlsi_ir.h for the reason; for now, this driver can never # compile elsewhere. # -------------------------------------------- # diff -Nru a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig --- a/drivers/net/irda/Kconfig Fri Oct 17 13:42:39 2003 +++ b/drivers/net/irda/Kconfig Fri Oct 17 13:42:39 2003 @@ -284,7 +284,7 @@ config VLSI_FIR tristate "VLSI 82C147 SIR/MIR/FIR (EXPERIMENTAL)" - depends on EXPERIMENTAL && IRDA && PCI + depends on EXPERIMENTAL && IRDA && PCI && X86 help Say Y here if you want to build support for the VLSI 82C147 PCI-IrDA Controller. This controller is used by the HP OmniBook 800 From Mike_Phillips@URSCorp.com Mon Oct 20 03:53:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 03:54:21 -0700 (PDT) Received: from smtp102.urscorp.com (smtp102.urscorp.com [65.207.129.233]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KArf25009947; Mon, 20 Oct 2003 03:53:41 -0700 Subject: Re: [PATCH] fix for olympic cable pull induced hang To: Jeff Garzik Cc: Don Fry , netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mike_Phillips@URSCorp.com Date: Mon, 20 Oct 2003 06:51:31 -0700 X-MIMETrack: Serialize by Router on SMTP102/URSCorp(Release 5.0.11 |July 24, 2002) at 10/20/2003 06:53:10 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-archive-position: 942 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Mike_Phillips@URSCorp.com Precedence: bulk X-list: netdev Content-Length: 1840 Lines: 45 > Thanks, I'll take a look at this. > Mike, please let me know if this looks sane to you, too. (i would like > your 'ack' before sending upstream...) *sigh*, yes there's a hang in the driver (it's been there since day one), but its only when its compiled up in SMP mode and you're not supposed to pull the cables out of token ring cards. The driver was specifically written to be nice to the rest of the machine. I could easily just have grabbed the interrupt on detection/module insertion and then free'd it up on removal, but it was written this way to only hold the interrupt when the card is actually open, it should release it when the card gets closed or an error condition occurs. A better fix is just to cure that particular bug. You can't call free_irq from the driver's own interrupt, true enough, a better fix is to set of a timer so that the interrrupt can return and then the timer function can free up the interrupt. This patch changes other stuff as well, I want to take a good look at it and check that it doesn't upset cardbus, which definitely needs to free the interrupt if it gets a card ejection notification. The driver was designed to be able to sit around even without an adapter in the machine. There is also another bug that's surfaced recently to do with timing out in open commands which I'm currently looking at. (For some reason on recent kernels, both 2.4 and 2.6 it's taking longer for the open command to return) Plus: > If other cards are on the ring then just one down/up will work. After that > when the active monitor is removed from the ring another down/up cycle is > required. What !!, the card should detect when an active monitor is removed from the ring, a contention method kicks in (at hardware level) and a different adapter becomes the active monitor - this USED to work. Mike From Mike_Phillips@URSCorp.com Mon Oct 20 04:09:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 04:09:53 -0700 (PDT) Received: from smtp102.urscorp.com (smtp102.urscorp.com [65.207.129.233]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KB9H25011010; Mon, 20 Oct 2003 04:09:18 -0700 Subject: Re: [PATCH] (5/6) ibmtr -- probe2 To: Stephen Hemminger Cc: netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mike_Phillips@URSCorp.com Date: Mon, 20 Oct 2003 07:07:10 -0700 X-MIMETrack: Serialize by Router on SMTP102/URSCorp(Release 5.0.11 |July 24, 2002) at 10/20/2003 07:08:46 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-archive-position: 943 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Mike_Phillips@URSCorp.com Precedence: bulk X-list: netdev Content-Length: 906 Lines: 29 >The problem with the structures was a BUG in the existing code! >The PCMCIA code was setting dev->priv to a structure: >struct ibmtr_dev_t { > dev_link_t link; > struct net_device *dev; > dev_node_t node; > window_handle_t sram_win_handle; > struct tok_info ti; >} >and then later when registered, the dev->init callback goes to ibmtr_probe and >then ibmtr_probe1 which expects dev->priv to point to 'struct tok_info' >The code is broken in 2.6.0-test7. Interesting that it's worked for 4 yrs then really ;) The fix is wrong too then, if the code is really set the pointer to the wrong location, then just moving the tok_info to the beginning of the struct is an ugly kludge. It should be fixed the right way. No worries, let me take a look at it all and remember exactly why it was written this way and test with hardware. Mike From pupilla@hotmail.com Mon Oct 20 04:25:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 04:26:23 -0700 (PDT) Received: from hotmail.com (sea2-dav19.sea2.hotmail.com [207.68.164.123]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KBPn25014325 for ; Mon, 20 Oct 2003 04:25:49 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 20 Oct 2003 04:25:44 -0700 Received: from 80.204.235.254 by sea2-dav19.sea2.hotmail.com with DAV; Mon, 20 Oct 2003 11:25:43 +0000 X-Originating-IP: [80.204.235.254] X-Originating-Email: [pupilla@hotmail.com] From: "Marco Berizzi" To: Subject: 3C905 + options=0x8 Date: Mon, 20 Oct 2003 13:25:41 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1123 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1123 Message-ID: X-OriginalArrivalTime: 20 Oct 2003 11:25:44.0291 (UTC) FILETIME=[E6B2D330:01C396FC] X-archive-position: 944 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pupilla@hotmail.com Precedence: bulk X-list: netdev Content-Length: 4203 Lines: 100 Hello. I have found a strange 3C905 behaviour on linux 2.4.22 (same behaviuor with 2.4.19 and 2.6.0-test7). When the linux box load the module with /etc/modules.conf containing: options 3c59x options=0x8,0x8 the 3C905 NICs don't receive/send packet. 3C905B NIC is working good. Here is the output from mii-diag: mii-diag.c:v2.09 9/06/2003 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Using the new SIOCGMIIPHY value on PHY 24 (BMCR 0x3100). The autonegotiated capability is 01e0. The autonegotiated media type is 100baseTx-FD. Basic mode control register 0x3100: Auto-negotiation enabled. Basic mode status register 0x786f ... 786f. Link status: established. This transceiver is capable of 100baseTx-FD 100baseTx 10baseT-FD 10baseT. Able to perform Auto-negotiation, negotiation complete. *** Link Jabber! *** Your link partner advertised 45e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT, w/ 802.3X flow control. End of basic transceiver information. MII PHY #24 transceiver registers: 3100 786f 2000 5c01 01e1 45e1 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 8060 8020 0cb8 0000 1800 a3b9 005d 0c05 001d Here is the output from vortex-diag vortex-diag.c:v2.14 12/28/2002 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Index #1: Found a 3c905 Boomerang 100baseTx adapter at 0xe400. Station address 00:60:97:d8:e5:01. Receive mode is 0x00: Unknown/invalid. MII PHY found at address 24, status 786f. MII PHY 0 at #24 transceiver registers: 3100 786f 2000 5c01 01e1 45e1 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 8060 8020 0cb8 0000 1800 a3b9 0063 5005 001d. vortex-diag.c:v2.14 12/28/2002 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Index #1: Found a 3c905 Boomerang 100baseTx adapter at 0xe400. Station address 00:60:97:d8:e5:01. Receive mode is 0x00: Unknown/invalid. Initial window 4, registers values by window: Window 0: 0000 0000 0000 0000 0000 00bf ffff 0000. Window 1: 0000 0000 0000 2000 8000 00ff 13fc 2000. Window 2: 6000 d897 01e5 0000 0000 0000 0000 4000. Window 3: 02d8 0163 0000 0000 e040 0bff 13ff 6000. Window 4: 0000 06d0 2000 0000 0003 8802 0000 8000. Window 5: 1ffc fffc 0000 1ffc 0000 0000 0000 a000. Window 6: 0000 0000 0000 0000 0000 0000 0000 c000. Window 7: 0000 0000 0000 0000 8000 00ff 0000 e000. Vortex chip registers at 0xe400 0xE410: 00800000 00000000 00008000 000013fc 0xE420: 00000000 00000000 00000000 ff000000 0xE430: 00000000 0000f7fb 00000000 00000000 Indication enable is 0000, interrupt enable is 0000. No interrupt sources are pending. Transceiver/media interfaces available: MII. Transceiver type in use: MII. MAC settings: half-duplex. Maximum packet size is 0. Station address set to 00:60:97:d8:e5:01. Configuration options 0000. vortex-diag.c:v2.14 12/28/2002 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Index #1: Found a 3c905 Boomerang 100baseTx adapter at 0xe400. Station address 00:60:97:d8:e5:01. Receive mode is 0x00: Unknown/invalid. EEPROM format 64x16, configuration table at offset 0: 00: 0060 97d8 e501 9050 c29c 0036 4848 6d50 0x08: 0418 0001 0060 97d8 e501 0020 0000 0000 0x10: 10a6 0000 02d8 0163 0000 0002 0000 00a4 0x18: ffff ffff ffff ffff ffff ffff ffff ffff ... The word-wide EEPROM checksum is 0x1ce4. Saved EEPROM settings of a 3Com Vortex/Boomerang: 3Com Node Address 00:60:97:D8:E5:01 (used as a unique ID only). OEM Station address 00:60:97:D8:E5:01 (used as the ethernet address). Device ID 9050, Manufacturer ID 6d50. Manufacture date (MM/DD/YYYY) 4/28/1997, division 6, product HH. No BIOS ROM is present. Transceiver selection: MII. Options: negotiated duplex, link beat required. PCI Subsystem IDs: Vendor 00a4 Device ffff. 100baseT4 100baseTx 100baseFx 10baseT 10base2 AUI MII . Vortex format checksum is correct (a4 vs. a4). Cyclone format checksum is incorrect (00 vs. 0xff). Hurricane format checksum is incorrect (00 vs. 0xff). Could you help me? Please cc me, I'm not subscribed to the list. From becker@scyld.com Mon Oct 20 08:37:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 08:38:27 -0700 (PDT) Received: from NewBlue.scyld.com ([64.237.107.19]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KFbp25025319 for ; Mon, 20 Oct 2003 08:37:52 -0700 Received: from training.scyld.com (h-66-134-106-242.MCLNVA23.covad.net [66.134.106.242]) by NewBlue.scyld.com (8.10.2/8.10.2) with ESMTP id h9KFaFA13302; Mon, 20 Oct 2003 11:36:15 -0400 Received: from localhost (becker@localhost) by training.scyld.com (8.11.6/8.11.6) with ESMTP id h9KFbsh27242; Mon, 20 Oct 2003 11:37:54 -0400 X-Authentication-Warning: training.scyld.com: becker owned process doing -bs Date: Mon, 20 Oct 2003 11:37:54 -0400 (EDT) From: Donald Becker To: Marco Berizzi cc: netdev@oss.sgi.com Subject: Re: 3C905 + options=0x8 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 945 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: becker@scyld.com Precedence: bulk X-list: netdev Content-Length: 1056 Lines: 30 On Mon, 20 Oct 2003, Marco Berizzi wrote: > I have found a strange 3C905 behaviour on linux 2.4.22 (same behaviuor > with 2.4.19 and 2.6.0-test7). > When the linux box load the module with /etc/modules.conf containing: > options 3c59x options=0x8,0x8 Baseline: what do you expect this option setting to do when used with the 3c905_ (no suffix)? Note that the 3c905 has an external MII transceiver (trasceiver type 6), while the 3c905B and 3c905C have on-chip transceivers (transceiver type 8). > the 3C905 NICs don't receive/send packet. 3C905B NIC is working good. I would say that the driver is working as you directed it to. You should not set driver options unless you have a non-standard configuration. Setting driver options "just to make sure" is a common source of problems. I suspect that just removing the module options will restore correct operation. -- Donald Becker becker@scyld.com Scyld Computing Corporation http://www.scyld.com 914 Bay Ridge Road, Suite 220 Scyld Beowulf cluster system Annapolis MD 21403 410-990-9993 From shemminger@osdl.org Mon Oct 20 08:42:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 08:42:34 -0700 (PDT) Received: from mail.osdl.org ([65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KFg025026032 for ; Mon, 20 Oct 2003 08:42:01 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9KFfno04257; Mon, 20 Oct 2003 08:41:49 -0700 Date: Mon, 20 Oct 2003 08:41:47 -0700 From: Stephen Hemminger To: OGAWA Hirofumi Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [Fwd: [RFT] NAPI for 8139too] Message-Id: <20031020084147.3bb5b25c.shemminger@osdl.org> In-Reply-To: <873cdqbt6z.fsf@devron.myhome.or.jp> References: <3F9070B6.9090306@pobox.com> <873cdqbt6z.fsf@devron.myhome.or.jp> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 946 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 Content-Length: 2534 Lines: 90 On Sat, 18 Oct 2003 21:56:20 +0900 OGAWA Hirofumi wrote: > Hi, > > I also working for it (patches attached). So I have several comment. > > Jeff Garzik writes: > > > + dev->weight = 16; > > just question: Is there basis for believing that this value is > rightness? Although I use 64, I don't have a reason for having chosen > it at all. I chose 16 only because that was in the sample NAPI documentation, but it probably doesn't matter a lot unless you have multiple NIC's using NAPI in the same machine, which is not common since this chipset seems to be used mostly in cheap boxes. > > > dev->stop = rtl8139_close; > > dev->get_stats = rtl8139_get_stats; > > dev->set_multicast_list = rtl8139_set_rx_mode; > > @@ -1879,24 +1877,28 @@ > > #endif > > } > > > > -static void rtl8139_rx_interrupt (struct net_device *dev, > > - struct rtl8139_private *tp, void *ioaddr) > > +/* > > + * NAPI poll routine. > > + */ > > +static int rtl8139_poll(struct net_device *dev, int *budget) > > { > > + struct rtl8139_private *tp = dev->priv; > > + void *ioaddr = tp->mmio_addr; > > unsigned char *rx_ring; > > u16 cur_rx; > > + int rx, status; > > + unsigned long flags; > > > > - assert (dev != NULL); > > - assert (tp != NULL); > > - assert (ioaddr != NULL); > > - > > + spin_lock_irqsave(&tp->lock, flags); > > I don't think lock of interrupt related path needed here. And this > thinks that it has a bad influence on TX path. > > Instead of it, I think we need synchronize with ->tx_timeout because > ->tx_timeout touch IntrMask. Locking in this version is more conservative than necessary, will think about how to do it better. > > + rescan: > > rx_ring = tp->rx_ring; > > cur_rx = tp->cur_rx; > > - > [...] > > RTL_W16_F (IntrStatus, RxAckBits); > > + > > + if (++rx >= dev->quota) > > Shouldn't we use "min(dev->quota, *budget)" for this limit? Users can > change "budget" via sysctl. Once again, this not what the documentation, or some other drivers do. > > > + /* If received interrupt, then disable furthur interrupts > > + * and enable NAPI polling. > > + */ > > + if (netif_running (dev) && (status & RxAckBits)) { > > + /* disable more receive interrupts */ > > + RTL_W16 (IntrMask, rtl8139_intr_mask & ~RxAckBits); > > + netif_rx_schedule(dev); > > + } > > This style have problem on shutdowning interface path. Please see > 8139too-napi-stop-fix.patch. > > Thanks. > -- > OGAWA Hirofumi > > From rdbrown@mira.net Mon Oct 20 09:24:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 09:25:13 -0700 (PDT) Received: from snoopy.pacific.net.au (snoopy.pacific.net.au [61.8.0.36]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KGOd25027846 for ; Mon, 20 Oct 2003 09:24:40 -0700 Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) by snoopy.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9KEWBUC016941; Tue, 21 Oct 2003 00:32:11 +1000 Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h9KEWAON023357; Tue, 21 Oct 2003 00:32:10 +1000 (EST) Received: from mira.net (ppp69.dyn141.pacific.net.au [210.23.141.69]) by wisma.pacific.net.au (8.12.9/8.12.9) with SMTP id h9KEW8fa009384; Tue, 21 Oct 2003 00:32:09 +1000 (EST) From: rdbrown@mira.net Date: Tue, 21 Oct 2003 00:32:08 +1000 To: netdev@oss.sgi.com Cc: rbrown64@csc.com.au Subject: Suggested patch to include attribution for faster CRC algorithm Message-ID: <20031020143208.GA576@urtur> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 947 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rdbrown@mira.net Precedence: bulk X-list: netdev Content-Length: 3662 Lines: 106 Patch to include attribution for the faster CRC algorithm used in lib/crc32.c . As I read it Richard Black implied a BSD style license as long as the Copyright was included. The source was based on his code. I think http://research.microsoft.com/users/rjblack/ may be the right person if he should be contacted. I don't like the long line for the URL - I guess you could lose the section part if preferred. Source modified from 2.6.0-test4, untested as a comment change. --- lib/crc32.c Sat Aug 23 09:50:53 2003 +++ lib/crc32.c Sun Oct 19 23:40:32 2003 @@ -1,6 +1,9 @@ /* * Oct 15, 2000 Matt Domsch * Nicer crc32 functions/docs submitted by linux@horizon.com. Thanks! + * CRC_?E_BITS == 8 forms based on Algorithm 4 from + * http://www.cl.cam.ac.uk/Research/SRG/bluebook/21/crc/node6.html#SECTION00064000000000000000 + * which is Copyright 1993 Richard Black, All rights reserved. * * Oct 12, 2000 Matt Domsch * Same crc32 function was used in 5 other places in the kernel. The statement from the web page (tex source) was \subsection{Algorithm four} This code is copyright~\copyright~1993 Richard Black. All rights are reserved. You may use this code only if it includes a statement to that effect. Following are excerpts from the mailing lists showing the history of the code. Following includes first use of Algorithm 4 http://www.ussg.iu.edu/hypermail/linux/kernel/0211.2/1895.html Re: [PATCH 2.5] crc32 static initialization From: Brian Murphy (brian@murphy.dk) Date: Fri Nov 22 2002 - 15:25:22 EST Joakim Tjernlund wrote: >Hi Brian > >Would you please also add the CRC32 patch I sent you earlier? >It is much faster. > > > Can you test the attached patch - especially on a big endian system. It should do the required thing, i.e. what you want and what I want :-) simultaneously. /Brian Earlier Algorithm 4 http://www.ussg.iu.edu/hypermail/linux/kernel/0211.2/1525.html Early crc32 initialization From: Joakim Tjernlund (joakim.tjernlund@lumentis.se) Date: Thu Nov 21 2002 - 05:16:48 EST Brian Murphy posted this on 8-Oct with no response. Quoting: Here is a patch to the crc32 library routine to allow explicit initialization of the tables used by the routines. I need this to be able to use the crc routines in the early start up code for my platform which saves crc protected information (clock speed, machine type) in an eeprom. The option CONFIG_CRC32_EXPLICIT is defined for the platforms which need it in the config.in file. I have removed dynamic allocation of memory because the memory subsystem is also not initialised at the stage where I need the crc functions. /Brian Hi Matt and Brian I have doen an optimiztion that improves scan time in JFFS2 with more that 25% for my PPC custom board. This patch needs to use __cpu_to_be32()/__cpu_to_le32() on the tables. That may cause problems if a static table is to be used. See below: Jocke Explicit reference to algorithm 4 http://lists.infradead.org/pipermail/linux-mtd/2002-November/006422.html crc32() optimization Joakim Tjernlund Joakim.Tjernlund at lumentis.se Sun Nov 10 21:04:11 GMT 2002 * Previous message: crc32() optimization * Next message: Building mkfs.jffs2 * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] hmm , maybe. I tried 16, 8 & 4 also, but 6 was a little faster for me. What would be great if someone that understands CRC better than me could take a look at Algorithm 4 at http://www.cl.cam.ac.uk/Research/SRG/bluebook/21/crc/node6.html#SECTION00060000000000000000 and apply that on linux CRC32 code. I tried but failed to get it correct. Jocke From fubar@us.ibm.com Mon Oct 20 09:43:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 09:43:57 -0700 (PDT) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KGhF25028549 for ; Mon, 20 Oct 2003 09:43:24 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e33.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9KGh1Bd377066; Mon, 20 Oct 2003 12:43:01 -0400 Received: from death.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9KGggRk055508; Mon, 20 Oct 2003 10:42:44 -0600 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h9KGgMXp027089; Mon, 20 Oct 2003 09:42:23 -0700 Message-Id: <200310201642.h9KGgMXp027089@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: "Noam, Amir" cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: Changing bonding <-> ifenslave interface [was: Problem with current /proc entries] In-Reply-To: Message from "Noam, Amir" of "Sun, 19 Oct 2003 17:56:01 +0200." Date: Mon, 20 Oct 2003 09:42:22 -0700 From: Jay Vosburgh X-archive-position: 948 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 4584 Lines: 111 The "To clarify, I'm interpreting" comments are mine (3 ">"); Chad's are one up and down (2 and 4 ">"). >"Chad N. Tindel" wrote: > >> > >I say that if people want to switch between 2.4 and 2.6, they can >> > >write a script to create the appropriate ifenslave symbolic link. >> > >> > To clarify, I'm interpreting this to mean: >> > >> > 2.4.X ifenslave (where "X" is recent enough that it doesn't >> > use SIOCDEVPRIVATE) should work with 2.6.anything. > >I disagree. See below. > >> > 2.4.X ifenslave (where "X" is old and it uses SIOCDEVPRIVATE) >> > need not work with 2.6.anything. >> > >> > 2.6.X ifenslave (where "X" is 0 or better) should work with >> > any 2.6 later than the one it was shipped with. > >Yes. > >> > 2.6.X ifenslave (where "X" is 0 or better) need not work with >> > 2.4.anything. > >I disagree. I think that the latest version of ifenslave should work >with all versions of the bonding module that we can reasonably expect >people to use. This means that if ifenslave fails to use the new >interface it can try the old one. (This is how I understood Jeff's >position). When we discussed this previously, my understanding was: An ifenslave only had to work forwards, it didn't need to go backwards. So, an ifenslave from 2.4.X would run on that version, as well as any future 2.4.Y (where Y > X). But, the reverse isn't true: ifenslave from 2.4.Y need not work on kernel 2.4.X (again, Y > X). Applying this to 2.6, a 2.6 ifenslave shouldn't need to control a 2.4 bonding driver, but a 2.4 ifenslave should control a 2.6 kernel (for reasonable ranges of 2.4.X, in particular excluding SIOCDEVPRIVATE). I was thinking that the 2.4 ifenslave should work with 2.4 or 2.6 (including the new shiny API, to make kernel upgrades less hassle), but the 2.6 ifenslave need not work with 2.4, so we could hopefully vacuum it clean of the various ABI gook once we have a new shiny interface. The 2.6 ifenslave presumably won't be included in a distro until they ship a 2.6 kernel, so that would theoretically be sufficient. >However, I'm definitely in favor of dropping compatibility in the >*module* in 2.6. This is because most recent distributions (Red Hat 9, >for example) still use an antique version of ifenslave that still uses >the SIOCDEVPRIVATE ioctls. If we remove support for these ioctls in >2.6 (as we should), then the bonding module will break compatibility >with those ifenslave versions anyway. I see no point in trying to keep >compatibility with the ifenslave version that is in the 2.4 kernel >tree, while it is not yet in use by any distribution. When you say "dropping compatibility" are you just referring to the SIOCDEVPRIVATE ioctls, or the full "old style" ifenslave to bonding API (which would be replaced by the new shiny interface you were talking about earlier)? >> My opinion is this. What has worked in 2.4 in the past >> should always work >> for 2.4. Once you upgrade to 2.6, all bets for that are off. > >I agree, except that I think that if you upgrade to 2.6, and update >your ifenslave accordingly, you shouldn't have to switch user space >utilities when you boot into different kernels. That's why I said that >once you update ifenslave it should work with old bonding as well. As I said above, I don't think we need to put ourselves in the position of supporting both backwards compatibility (old ifenslave, new bonding) and forwards compatibility (new ifenslave, old bonding). I'm thinking we should give the 2.4 ifenslave the "shiny new API" stuff (which is only applicable to the 2.6 bonding driver) so that it'll run with 2.6 for the forseeable future, and then excise the existing API from 2.6 (realistically, at some point in the future, probably when 2.6 becomes "the standard"). Comments? >We can probably provide a version of bonding/ifenslave that works with >the new interface within two weeks (hopefully less). This is, of course, >assuming we reach a consensus on the compatibility issue. Would that be dependant upon the cleanup stuff, or not? >> > Am I nuts to want to get the new API stuff in for 2.6.0? It'd >> > be nice to not be locked in to supporting the current >> scheme because >> > the first ifenslave in 2.6.0 uses it. >> >> I agree wholeheartedly. > >I also agree. The question is, can we really push such a change into >bonding in 2.6, now that Linus only accepts bug fixes? That I don't know. Most of this is moot if we can't mess with 2.6. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From shemminger@osdl.org Mon Oct 20 10:16:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 10:17:16 -0700 (PDT) Received: from mail.osdl.org ([65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KHGb25029697 for ; Mon, 20 Oct 2003 10:16:38 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9KHG9o28120; Mon, 20 Oct 2003 10:16:09 -0700 Date: Mon, 20 Oct 2003 10:16:07 -0700 From: Stephen Hemminger To: "Noah J. Misch" Cc: acme@conectiva.com.br, rddunlap@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] Make LLC2 compile with PROC_FS=n Message-Id: <20031020101607.76e02647.shemminger@osdl.org> In-Reply-To: References: Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 949 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 Content-Length: 2308 Lines: 77 Why make up a whole separate llc_proc.h file for two prototypes? Put them on the end of llc.h diff -Nru a/include/net/llc.h b/include/net/llc.h --- a/include/net/llc.h Mon Oct 20 10:14:56 2003 +++ b/include/net/llc.h Mon Oct 20 10:14:56 2003 @@ -88,4 +88,12 @@ extern int llc_station_init(void); extern void llc_station_exit(void); + +#ifdef CONFIG_PROC_FS +extern int llc_proc_init(void); +extern void llc_proc_exit(void); +#else +#define llc_proc_init() (0) +#define llc_proc_exit() do { } while(0) +#endif /* CONFIG_PROC_FS */ #endif /* LLC_H */ diff -Nru a/include/net/llc_proc.h b/include/net/llc_proc.h --- a/include/net/llc_proc.h Mon Oct 20 10:14:56 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,18 +0,0 @@ -#ifndef LLC_PROC_H -#define LLC_PROC_H -/* - * Copyright (c) 1997 by Procom Technology, Inc. - * 2002 by Arnaldo Carvalho de Melo - * - * This program can be redistributed or modified under the terms of the - * GNU General Public License as published by the Free Software Foundation. - * This program is distributed without any warranty or implied warranty - * of merchantability or fitness for a particular purpose. - * - * See the GNU General Public License for more details. - */ - -extern int llc_proc_init(void); -extern void llc_proc_exit(void); - -#endif /* LLC_PROC_H */ diff -Nru a/net/llc/af_llc.c b/net/llc/af_llc.c --- a/net/llc/af_llc.c Mon Oct 20 10:14:56 2003 +++ b/net/llc/af_llc.c Mon Oct 20 10:14:56 2003 @@ -30,7 +30,6 @@ #include #include #include -#include /* remember: uninitialized global data is zeroed because its in .bss */ static u16 llc_ui_sap_last_autoport = LLC_SAP_DYN_START; diff -Nru a/net/llc/llc_proc.c b/net/llc/llc_proc.c --- a/net/llc/llc_proc.c Mon Oct 20 10:14:56 2003 +++ b/net/llc/llc_proc.c Mon Oct 20 10:14:56 2003 @@ -14,7 +14,6 @@ #include #include -#ifdef CONFIG_PROC_FS #include #include #include @@ -273,13 +272,3 @@ remove_proc_entry("core", llc_proc_dir); remove_proc_entry("llc", proc_net); } -#else /* CONFIG_PROC_FS */ -int __init llc_proc_init(void) -{ - return 0; -} - -void llc_proc_exit(void) -{ -} -#endif /* CONFIG_PROC_FS */ From lists@mdiehl.de Mon Oct 20 10:32:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 10:33:30 -0700 (PDT) Received: from bart.webpack.hosteurope.de (bart.one-2-one.net [217.115.142.76]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KHWu25003424 for ; Mon, 20 Oct 2003 10:32:57 -0700 Received: from notebook.home.mdiehl.de (pD9E94C64.dip0.t-ipconnect.de [217.233.76.100]) (authenticated) by bart.webpack.hosteurope.de (8.11.6/8.11.6) with ESMTP id h9KHSTk30381; Mon, 20 Oct 2003 19:28:29 +0200 Received: from notebook.home.mdiehl.de (localhost.localdomain [127.0.0.1]) by notebook.home.mdiehl.de (8.12.1/8.12.1) with ESMTP id h9KHUY1m001354; Mon, 20 Oct 2003 19:30:35 +0200 Received: from localhost (martin@localhost) by notebook.home.mdiehl.de (8.12.1/8.12.1/Submit) with ESMTP id h9KHUXiP001351; Mon, 20 Oct 2003 19:30:34 +0200 X-Authentication-Warning: notebook.home.mdiehl.de: martin owned process doing -bs Date: Mon, 20 Oct 2003 19:30:33 +0200 (CEST) From: Martin Diehl X-X-Sender: martin@notebook.home.mdiehl.de To: "Noah J. Misch" cc: irda-users@lists.sourceforge.net, , Subject: Re: [irda-users] [PATCH] Make VLSI FIR depend on X86 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 950 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lists@mdiehl.de Precedence: bulk X-list: netdev Content-Length: 1332 Lines: 31 On Sun, 19 Oct 2003, Noah J. Misch wrote: > This is a trivial patch against the Kconfig entry for the VLSI FIR driver to > make it depend on X86. The in-tree code guarantees that the driver will only > build on X86, and according to the comments therein no machine of another > architecture has this hardware anyway. Well, it would work with any arch, _if_ there was a way to sync the streaming pci dma buffers before giving them back to hardware. Last time I checked there was no pci_dma api call to achieve this on all platforms. For X86 however it's trivial due to cache coherency. The guy is used with X86 notebooks only - unless whoever owns the controller design decides to make some CardBus PC-Card for people with notebooks lacking IrDA-support. > Granted, no human intelligently configuring a kernel for his or her particular > system would make this mistake, but perhaps someone building a distribution > kernel would. I suggest this patch because it keeps the signal to noise ratio > for those testing allyesconfig builds low. Valid point, yes. > This patch applies to the linux-2.5 BK tree as of 0400 UTC 10/20/2003, and for > some time before that as well. Please consider for eventual inclusion. It may > be too much of a fringe case until 2.6.0 begins its stable series. Thanks, second this. Martin From shmulik.hen@intel.com Mon Oct 20 11:21:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 11:22:02 -0700 (PDT) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KILN25007320 for ; Mon, 20 Oct 2003 11:21:23 -0700 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by caduceus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h9KILcXx002808 for ; Mon, 20 Oct 2003 18:21:38 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxv040-1.fm.intel.com [132.233.48.108]) by petasus.fm.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h9KICjP04485 for ; Mon, 20 Oct 2003 18:12:45 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs040.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003102011205907985 ; Mon, 20 Oct 2003 11:21:02 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "Jay Vosburgh" Subject: Re: Changing bonding <-> ifenslave interface [was: Problem with current /proc entries] Date: Mon, 20 Oct 2003 20:20:57 +0200 User-Agent: KMail/1.4.3 Cc: , References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310202020.57503.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 951 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 3731 Lines: 83 On Monday 20 October 2003 06:42 pm, Jay Vosburgh wrote: > > >I disagree. I think that the latest version of ifenslave should > > work with all versions of the bonding module that we can > > reasonably expect people to use. This means that if ifenslave > > fails to use the new interface it can try the old one. (This is > > how I understood Jeff's position). > > When we discussed this previously, my understanding was: > > An ifenslave only had to work forwards, it didn't need to > go backwards. So, an ifenslave from 2.4.X would run on that > version, as well as any future 2.4.Y (where Y > X). But, the > reverse isn't true: ifenslave from 2.4.Y need not work on kernel > 2.4.X (again, Y > X). Suppose a user updates an application package (in this case iputils). It seems unreasonable to require a kernel upgrade to make the updated app work. Likewise, if the user updates the kernel, existing apps should still work. The sole exception is when switching major kernel versions (and even this should be avoided where possible). This is similar to the modutils package that has to be updated to work with 2.6. (and once updated it works with 2.4 as well). This is how we've understood Jeff's approach when the ABI issue was first raised: [From ] On 12 May 2003, Jeff Garzik wrote: > FWIW the main worry is users booting into "new bonding" and "old > bonding" kernels, with the same userspace. (which of course > implies an ifenslave userspace upgrade, but that's ok) Based on the above assumptions, and on the fact that removing SIOCDEVPRIVATE support from bonding in 2.6 already breaks compatibility with existing ifenslave apps, we thought the sensible thing to do would be to drop all support of old interfaces from bonding in 2.6 (including the current SIOCBOND* ioctls), and thus force users that upgrade to 2.6 to use a new ifenslave (that can be found either in the 2.6 kernel tree or at sourceforge). This new ifenslave will also support any 2.4 bonding. After a while, we will probably backport the new interface into the 2.4 bonding module, so it too will benefit from the its new capabilities. > Applying this to 2.6, a 2.6 ifenslave shouldn't need to > control a 2.4 bonding driver, but a 2.4 ifenslave should control a > 2.6 kernel (for reasonable ranges of 2.4.X, in particular excluding > SIOCDEVPRIVATE). > > I was thinking that the 2.4 ifenslave should work with 2.4 > or 2.6 (including the new shiny API, to make kernel upgrades less > hassle), but the 2.6 ifenslave need not work with 2.4, so we could > hopefully vacuum it clean of the various ABI gook once we have a > new shiny interface. The 2.6 ifenslave presumably won't be > included in a distro until they ship a 2.6 kernel, so that would > theoretically be sufficient. The thing to note here is that there is no "2.6 ifenslave" and "2.4 ifenslave" per se. The ifenslave app lives in several places: the kernel source tree, the bonding sourceforge site, the iputils RPM, etc. The important thing is that updating this app should not require a kernel upgrade. > >We can probably provide a version of bonding/ifenslave that works > > with the new interface within two weeks (hopefully less). This > > is, of course, assuming we reach a consensus on the compatibility > > issue. > > Would that be dependant upon the cleanup stuff, or not? Yes, it will. We do all our code developement on top of the cleanup stuff. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From JCONLIN@novell.com Mon Oct 20 11:58:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 11:59:09 -0700 (PDT) Received: from prv-mail20.provo.novell.com (prv-mail20.provo.novell.com [137.65.81.122]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KIwY25009900 for ; Mon, 20 Oct 2003 11:58:34 -0700 Received: from INET-PRV-MTA by prv-mail20.provo.novell.com with Novell_GroupWise; Mon, 20 Oct 2003 12:58:29 -0600 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.2 Beta Date: Mon, 20 Oct 2003 12:58:19 -0600 From: "Joseph Conlin" To: Cc: Subject: Replace the Nagle Algorithm Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-archive-position: 952 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: JCONLIN@novell.com Precedence: bulk X-list: netdev Content-Length: 1909 Lines: 42 I see in the archives and the code that I have looked at (2.4.22, 2.6.0-test8) that the Minshall algorithm is being used to reduce the effects of Nagle/delayed ACK interaction. I haven't seen any mention of the following solution, proposed as an IETF draft RFC by Joe Doupnik (jrd@cc.usu.edu). http://netlab1.usu.edu/pub/misc/draft-doupnik-tcpimpl-nagle-mode-00.txt I quote the following from the abstract. A new TCP transmission policy is discussed in this memo which uses information known only to the transmitter about when to send segments. It groups octets based on filling segments and sending a small segment when the application indicates no more data are immediately available, not on arrival of ACKs. It works well with and avoids deadlocks with delayed ACKs. It is automatic and does not need to be turned off. It is a suitable replacement for Nagle mode. I also point you to the following location, which shows the code changes for FreeBSD 3.2, Linux 2.2.5-15, and also has the client software used for the testing mentioned in the document. http://netlab1.usu.edu/pub/misc/newpolicy.sources/ If anyone is interested, I have an Excel spreadsheet that shows some testing I did with FreeBSD using Nagle-off, Nagle-on, and Doupnik using HTTP requests. It shows that Doupnik gets the same packet-size efficiency as Nagle-on while getting better throughput than having Nagle-off. Let me know if you would like a copy. I have asked Joe Doupnik for his approval to ask this community to look at his algorithm. He said that he would be happy to answer any questions that anyone has on his algorithm, and if it looks like there is a good chance that it will be included in Linux, he could code the patch as well (from the looks of things, tcp.h has changed enough from 2.2.5-15 to current to warrant another pass to make sure the algorithm is correctly implemented). Joseph Conlin From fubar@us.ibm.com Mon Oct 20 12:17:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 12:18:12 -0700 (PDT) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KJHW25011483 for ; Mon, 20 Oct 2003 12:17:39 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9KJDFIl458142; Mon, 20 Oct 2003 15:13:15 -0400 Received: from death.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9KJDCjp190714; Mon, 20 Oct 2003 13:13:14 -0600 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h9KJCo7A027272; Mon, 20 Oct 2003 12:12:51 -0700 Message-Id: <200310201912.h9KJCo7A027272@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: shmulik.hen@intel.com cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: Changing bonding <-> ifenslave interface [was: Problem with current /proc entries] In-Reply-To: Message from Shmulik Hen of "Mon, 20 Oct 2003 20:20:57 +0200." <200310202020.57503.shmulik.hen@intel.com> Date: Mon, 20 Oct 2003 12:12:50 -0700 From: Jay Vosburgh X-archive-position: 953 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 2845 Lines: 62 [...] >Based on the above assumptions, and on the fact that removing >SIOCDEVPRIVATE support from bonding in 2.6 already breaks >compatibility with existing ifenslave apps, we thought the sensible >thing to do would be to drop all support of old interfaces from >bonding in 2.6 (including the current SIOCBOND* ioctls), and thus >force users that upgrade to 2.6 to use a new ifenslave (that can be >found either in the 2.6 kernel tree or at sourceforge). This new >ifenslave will also support any 2.4 bonding. > >After a while, we will probably backport the new interface into the >2.4 bonding module, so it too will benefit from the its new >capabilities. I was leaning towards supporting existing 2.4 ifenslaves (not the ancient ones using SIOCDEVPRIVATE, but more recent versions) so that end users could hypothetically dabble with the 2.6 bonding without messing with their 2.4 user space. In that way, the 2.6 (or "new ifenslave," if you prefer) ifenslave wouldn't have all of the old 2.4-style bonding API stuff in it. Anyway, I can live with the above; it does require an ifenslave upgrade to dabble with 2.6, but as long as the 2.4 reliability isn't affected, I don't see a problem with it. [...] >The thing to note here is that there is no "2.6 ifenslave" and "2.4 >ifenslave" per se. The ifenslave app lives in several places: the >kernel source tree, the bonding sourceforge site, the iputils RPM, >etc. The important thing is that updating this app should not require >a kernel upgrade. I'm having a thought here... Would it be both feasible and reasonable to pull ifenslave.c out of the kernel source, and maintain a separate bonding-utils package, wherein the shiny new API has some knowledge of ifenslave versions? In this way, the bonding kernel driver could enforce version requirements for ifenslave, possibly at a per-feature granularity (e.g., "need ifenslave version X for frog-blending mode"). In this way, we'd have just one ifenslave development line (not two), and somewhat better upgrade prospects over time. In the past, I'd thought this (a bonding-utils package for ifenslave) wasn't an especially good idea, because I didn't really see much advantage for us in doing it. Now, it looks like it is to our advantage to have just one ifenslave development line, distinct from the kernel development line (if the single ifenslave will be going both ways there's no reason to keep two separate copies in the 2.4 and 2.6 kernel trees). I really do like having ifenslave right there in the kernel source, it's very handy, but it may be better overall to pull it out and distribute it separately. Comments? Chad, you out there? I know you really like having ifenslave in the kernel source; what do you think about this? -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From shemminger@osdl.org Mon Oct 20 13:11:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 13:12:05 -0700 (PDT) Received: from mail.osdl.org ([65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KKBT25015807 for ; Mon, 20 Oct 2003 13:11:30 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9KKB7o01478; Mon, 20 Oct 2003 13:11:07 -0700 Date: Mon, 20 Oct 2003 13:11:06 -0700 From: Stephen Hemminger To: OGAWA Hirofumi Cc: Jeff Garzik , netdev@oss.sgi.com Subject: [RFT] merged 8139too NAPI Message-Id: <20031020131106.6862e951.shemminger@osdl.org> In-Reply-To: <873cdqbt6z.fsf@devron.myhome.or.jp> References: <3F9070B6.9090306@pobox.com> <873cdqbt6z.fsf@devron.myhome.or.jp> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 954 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 Content-Length: 12819 Lines: 450 This version merges hirofumi's and my changes. It includes: * fix DPRINTK() arguments that got out of date * likely/unlikely in interrupt path. * handle shared interrupts better. * need to block out bottom half in tx_timeout * exit receive loop if interface is brought down * avoid false activation of receive poll due to tx interrupts * don't need the local_irq_disable() in end of receive poll. This patch is against 2.6.0-test8 --- linux-2.5/drivers/net/8139too.c 2003-10-20 11:49:13.000000000 -0700 +++ desktop-2.5/drivers/net/8139too.c 2003-10-20 12:06:12.000000000 -0700 @@ -92,7 +92,7 @@ */ #define DRV_NAME "8139too" -#define DRV_VERSION "0.9.26" +#define DRV_VERSION "0.9.27" #include @@ -159,9 +159,6 @@ static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; -/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ -static int max_interrupt_work = 20; - /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). The RTL chips use a 64 element hash table based on the Ethernet CRC. */ static int multicast_filter_limit = 32; @@ -572,6 +569,7 @@ signed char phys[4]; /* MII device addresses. */ char twistie, twist_row, twist_col; /* Twister tune state. */ unsigned int default_port:4; /* Last dev->if_port value. */ + spinlock_t rx_lock; spinlock_t lock; chip_t chipset; pid_t thr_pid; @@ -589,13 +587,11 @@ MODULE_LICENSE("GPL"); MODULE_PARM (multicast_filter_limit, "i"); -MODULE_PARM (max_interrupt_work, "i"); MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM (full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM (debug, "i"); MODULE_PARM_DESC (debug, "8139too bitmapped message enable number"); MODULE_PARM_DESC (multicast_filter_limit, "8139too maximum number of filtered multicast addresses"); -MODULE_PARM_DESC (max_interrupt_work, "8139too maximum events handled per interrupt"); MODULE_PARM_DESC (media, "8139too: Bits 4+9: force full duplex, bit 5: 100Mbps"); MODULE_PARM_DESC (full_duplex, "8139too: Force full duplex for board(s) (1)"); @@ -609,6 +605,7 @@ static void rtl8139_init_ring (struct net_device *dev); static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev); +static int rtl8139_poll(struct net_device *dev, int *budget); static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance, struct pt_regs *regs); static int rtl8139_close (struct net_device *dev); @@ -681,6 +678,10 @@ PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK; +static const u16 rtl8139_norx_intr_mask = + PCIErr | PCSTimeout | RxUnderrun | + TxErr | TxOK | RxErr ; + #ifdef USE_BUF16K static const unsigned int rtl8139_rx_config = RxCfgRcv16K | RxNoWrap | @@ -867,9 +868,7 @@ match: DPRINTK ("chipset id (%d) == index %d, '%s'\n", - tmp, - tp->chipset, - rtl_chip_info[tp->chipset].name); + version, i, rtl_chip_info[i].name); if (tp->chipset >= CH_8139B) { u8 new_tmp8 = tmp8 = RTL_R8 (Config1); @@ -963,6 +962,8 @@ /* The Rtl8139-specific entries in the device structure. */ dev->open = rtl8139_open; dev->hard_start_xmit = rtl8139_start_xmit; + dev->poll = rtl8139_poll; + dev->weight = 64; dev->stop = rtl8139_close; dev->get_stats = rtl8139_get_stats; dev->set_multicast_list = rtl8139_set_rx_mode; @@ -985,6 +986,7 @@ /* note: tp->chipset set in rtl8139_init_board */ tp->drv_flags = board_info[ent->driver_data].hw_flags; tp->mmio_addr = ioaddr; + spin_lock_init (&tp->rx_lock); spin_lock_init (&tp->lock); init_waitqueue_head (&tp->thr_wait); init_completion (&tp->thr_exited); @@ -1319,6 +1321,8 @@ rtl8139_init_ring (dev); rtl8139_hw_start (dev); + netif_start_queue (dev); + DPRINTK ("%s: rtl8139_open() ioaddr %#lx IRQ %d" " GP Pins %2.2x %s-duplex.\n", dev->name, pci_resource_start (tp->pci_dev, 1), @@ -1406,8 +1410,6 @@ /* Enable all known interrupts by setting the interrupt mask. */ RTL_W16 (IntrMask, rtl8139_intr_mask); - - netif_start_queue (dev); } @@ -1655,6 +1657,7 @@ tp->xstats.tx_timeouts++; + spin_lock_bh(&tp->rx_lock); /* disable Tx ASAP, if not already */ tmp8 = RTL_R8 (ChipCmd); if (tmp8 & CmdTxEnb) @@ -1679,6 +1682,7 @@ /* ...and finally, reset everything */ rtl8139_hw_start (dev); + spin_unlock_bh(&tp->rx_lock); netif_wake_queue (dev); } @@ -1694,6 +1698,7 @@ /* Calculate the next Tx descriptor entry. */ entry = tp->cur_tx % NUM_TX_DESC; + /* Note: the chip doesn't have auto-pad! */ if (likely(len < TX_BUF_SIZE)) { if (len < ETH_ZLEN) memset(tp->tx_buf[entry], 0, ETH_ZLEN); @@ -1705,7 +1710,6 @@ return 0; } - /* Note: the chip doesn't have auto-pad! */ spin_lock_irq(&tp->lock); RTL_W32_F (TxStatus0 + (entry * sizeof (u32)), tp->tx_flag | max(len, (unsigned int)ETH_ZLEN)); @@ -1791,8 +1795,7 @@ if (tp->dirty_tx != dirty_tx) { tp->dirty_tx = dirty_tx; mb(); - if (netif_queue_stopped (dev)) - netif_wake_queue (dev); + netif_wake_queue (dev); } } @@ -1879,16 +1882,15 @@ #endif } -static void rtl8139_rx_interrupt (struct net_device *dev, - struct rtl8139_private *tp, void *ioaddr) +static inline int rtl8139_rx(struct net_device *dev, + struct rtl8139_private *tp, + int budget) { + void *ioaddr = tp->mmio_addr; + int received = 0; unsigned char *rx_ring; u16 cur_rx; - assert (dev != NULL); - assert (tp != NULL); - assert (ioaddr != NULL); - rx_ring = tp->rx_ring; cur_rx = tp->cur_rx; @@ -1897,7 +1899,10 @@ RTL_R16 (RxBufAddr), RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); - while ((RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { +rx_status_loop: + RTL_W16_F (IntrStatus, RxAckBits); + + while (budget > 0 && (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { int ring_offset = cur_rx % RX_BUF_LEN; u32 rx_status; unsigned int rx_size; @@ -1929,21 +1934,27 @@ * Theoretically, this should never happen * since EarlyRx is disabled. */ - if (rx_size == 0xfff0) { + if (unlikely(rx_size == 0xfff0)) { tp->xstats.early_rx++; break; } + /* + * Shutting down, network. + */ + if (unlikely(!netif_running(dev))) + goto done; + /* If Rx err or invalid rx_size/rx_status received * (which happens if we get lost in the ring), * Rx process gets reset, so we abort any further * Rx processing. */ - if ((rx_size > (MAX_ETH_FRAME_SIZE+4)) || - (rx_size < 8) || - (!(rx_status & RxStatusOK))) { + if (unlikely((rx_size > (MAX_ETH_FRAME_SIZE+4)) || + (rx_size < 8) || + (!(rx_status & RxStatusOK)))) { rtl8139_rx_err (rx_status, dev, tp, ioaddr); - return; + return -1; } /* Malloc up new buffer, compatible with net-2e. */ @@ -1964,7 +1975,7 @@ skb_put (skb, pkt_size); skb->protocol = eth_type_trans (skb, dev); - netif_rx (skb); + netif_receive_skb (skb); dev->last_rx = jiffies; tp->stats.rx_bytes += pkt_size; tp->stats.rx_packets++; @@ -1974,23 +1985,31 @@ dev->name); tp->stats.rx_dropped++; } + received++; + budget--; cur_rx = (cur_rx + rx_size + 4 + 3) & ~3; RTL_W16 (RxBufPtr, cur_rx - 16); - if (RTL_R16 (IntrStatus) & RxAckBits) + if (RTL_R16 (IntrStatus) & (RxFIFOOver | RxOverflow)) { RTL_W16_F (IntrStatus, RxAckBits); + tp->stats.rx_errors++; + } } + if (budget && (RTL_R16(IntrStatus) & RxAckBits)) + goto rx_status_loop; + done: + DPRINTK ("%s: Done rtl8139_rx(), current %4.4x BufAddr %4.4x," " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, RTL_R16 (RxBufAddr), RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); tp->cur_rx = cur_rx; + return received; } - static void rtl8139_weird_interrupt (struct net_device *dev, struct rtl8139_private *tp, void *ioaddr, @@ -2013,13 +2032,11 @@ status &= ~RxUnderrun; } - /* XXX along with rtl8139_rx_err, are we double-counting errors? */ - if (status & - (RxUnderrun | RxOverflow | RxErr | RxFIFOOver)) - tp->stats.rx_errors++; + if (status & (RxUnderrun | RxErr)) + tp->stats.rx_errors++; /* race with rtl8139_rx_err */ if (status & PCSTimeout) - tp->stats.rx_length_errors++; + tp->stats.rx_length_errors++; /* race with rtl8139_rx_err */ if (status & (RxUnderrun | RxFIFOOver)) tp->stats.rx_fifo_errors++; if (status & PCIErr) { @@ -2032,6 +2049,42 @@ } } +static int rtl8139_poll(struct net_device *dev, int *budget) +{ + struct rtl8139_private *tp = dev->priv; + void *ioaddr = tp->mmio_addr; + u16 status; + int orig_budget = min(*budget, dev->quota); + int done = 1; + + spin_lock(&tp->rx_lock); + + status = RTL_R16(IntrStatus); + + if (likely(status & RxAckBits)) { + int work_done; + + work_done = rtl8139_rx(dev, tp, orig_budget); + if (likely(work_done > 0)) { + *budget -= work_done; + dev->quota -= work_done; + done = (work_done < orig_budget); + } + } + + if (done) { + /* + * This order is important + * (see Documentation/networking/NAPI_HOWTO.txt) + */ + netif_rx_complete(dev); + RTL_W16_F(IntrMask, rtl8139_intr_mask); + } + + spin_unlock(&tp->rx_lock); + + return !done; +} /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ @@ -2040,76 +2093,56 @@ { struct net_device *dev = (struct net_device *) dev_instance; struct rtl8139_private *tp = dev->priv; - int boguscnt = max_interrupt_work; void *ioaddr = tp->mmio_addr; - int ackstat, status; + u16 status; int link_changed = 0; /* avoid bogus "uninit" warning */ int handled = 0; spin_lock (&tp->lock); + status = RTL_R16 (IntrStatus); - do { - status = RTL_R16 (IntrStatus); - - /* h/w no longer present (hotplug?) or major error, bail */ - if (status == 0xFFFF) - break; - - if ((status & - (PCIErr | PCSTimeout | RxUnderrun | RxOverflow | - RxFIFOOver | TxErr | TxOK | RxErr | RxOK)) == 0) - break; - - handled = 1; - - /* Acknowledge all of the current interrupt sources ASAP, but - an first get an additional status bit from CSCR. */ - if (status & RxUnderrun) - link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; - - /* The chip takes special action when we clear RxAckBits, - * so we clear them later in rtl8139_rx_interrupt + /* shared irq? */ + if (unlikely((status & rtl8139_intr_mask) == 0)) + goto out; + + handled = 1; + + /* h/w no longer present (hotplug?) or major error, bail */ + if (unlikely(status == 0xFFFF)) + goto out; + + /* Acknowledge all of the current interrupt sources ASAP, but + an first get an additional status bit from CSCR. */ + if (unlikely(status & RxUnderrun)) + link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; + + if (status & (RTL_R16 (IntrMask) & RxAckBits)) { + /* Disable furthur receive interrupts. + * receive packets are processed by poll routine. */ - ackstat = status & ~(RxAckBits | TxErr); - RTL_W16 (IntrStatus, ackstat); - - DPRINTK ("%s: interrupt status=%#4.4x ackstat=%#4.4x new intstat=%#4.4x.\n", - dev->name, status, ackstat, RTL_R16 (IntrStatus)); - - if (netif_running (dev) && (status & RxAckBits)) - rtl8139_rx_interrupt (dev, tp, ioaddr); - - /* Check uncommon events with one test. */ - if (status & (PCIErr | PCSTimeout | RxUnderrun | RxOverflow | - RxFIFOOver | RxErr)) - rtl8139_weird_interrupt (dev, tp, ioaddr, - status, link_changed); - - if (netif_running (dev) && (status & (TxOK | TxErr))) { - rtl8139_tx_interrupt (dev, tp, ioaddr); - if (status & TxErr) - RTL_W16 (IntrStatus, TxErr); - } - - boguscnt--; - } while (boguscnt > 0); + RTL_W16_F (IntrMask, rtl8139_norx_intr_mask); + netif_rx_schedule (dev); + } - if (boguscnt <= 0) { - printk (KERN_WARNING "%s: Too much work at interrupt, " - "IntrStatus=0x%4.4x.\n", dev->name, status); + /* Check uncommon events with one test. */ + if (unlikely(status & (PCIErr | PCSTimeout | RxUnderrun | RxOverflow))) + rtl8139_weird_interrupt (dev, tp, ioaddr, + status, link_changed); - /* Clear all interrupt sources. */ - RTL_W16 (IntrStatus, 0xffff); + if (netif_running (dev) && (status & (TxOK | TxErr))) { + rtl8139_tx_interrupt (dev, tp, ioaddr); + if (status & TxErr) + RTL_W16 (IntrStatus, TxErr); } + RTL_W16_F (IntrStatus, status & ~(RxAckBits | TxErr)); + + out: spin_unlock (&tp->lock); - DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n", - dev->name, RTL_R16 (IntrStatus)); return IRQ_RETVAL(handled); } - static int rtl8139_close (struct net_device *dev) { struct rtl8139_private *tp = dev->priv; @@ -2493,6 +2526,7 @@ pci_set_power_state (pdev, 0); rtl8139_init_ring (dev); rtl8139_hw_start (dev); + netif_start_queue (dev); netif_device_attach (dev); return 0; } From ctindel@calma.pair.com Mon Oct 20 14:21:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 14:22:03 -0700 (PDT) Received: from calma.pair.com (calma.pair.com [209.68.1.95]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KLLN25016841 for ; Mon, 20 Oct 2003 14:21:24 -0700 Received: (qmail 99060 invoked by uid 3059); 20 Oct 2003 21:21:23 -0000 Date: Mon, 20 Oct 2003 17:21:23 -0400 From: "Chad N. Tindel" To: Jay Vosburgh Cc: shmulik.hen@intel.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] Re: Changing bonding <-> ifenslave interface [was: Problem with current /proc entries] Message-ID: <20031020212123.GA98298@calma.pair.com> Mail-Followup-To: Jay Vosburgh , shmulik.hen@intel.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com References: <200310202020.57503.shmulik.hen@intel.com> <200310201912.h9KJCo7A027272@death.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200310201912.h9KJCo7A027272@death.ibm.com> User-Agent: Mutt/1.4i X-archive-position: 955 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chad@tindel.net Precedence: bulk X-list: netdev Content-Length: 1484 Lines: 30 > In the past, I'd thought this (a bonding-utils package for > ifenslave) wasn't an especially good idea, because I didn't really see > much advantage for us in doing it. Now, it looks like it is to our > advantage to have just one ifenslave development line, distinct from > the kernel development line (if the single ifenslave will be going > both ways there's no reason to keep two separate copies in the 2.4 and > 2.6 kernel trees). > > I really do like having ifenslave right there in the kernel > source, it's very handy, but it may be better overall to pull it out > and distribute it separately. > > Comments? Chad, you out there? I know you really like having > ifenslave in the kernel source; what do you think about this? I have had many numerous users email me specifically to say that they like to have the ifenslave.c in the kernel. They know that no matter what, when they upgrade their kernel, they can simply compile the ifenslave that is there and it will work. They don't want to have to go hunt around on some website to try to find a working ifenslave. In contrast, I have seen nothing but pain when trying to separate userspace from kernel space. Trying to get the right iputils package to match up with the kernel you are using is a pain; and it makes the iputils stuff just that much harder to maintain, for the same reasons we're discussing. I have never heard of anyone complaining that ifenslave.c is packaged with the kernel source. Chad From mashirle@us.ibm.com Mon Oct 20 16:00:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 16:01:09 -0700 (PDT) Received: from linux2.suntekindustrial.com (wbar1.sjo1-4-4-004-065.sjo1.dsl-verizon.net [4.4.4.65]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KN0Q25017987 for ; Mon, 20 Oct 2003 16:00:34 -0700 Received: from ibm-mxl (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated bits=0) by linux2.suntekindustrial.com (8.12.8/8.12.8) with ESMTP id h9KND9o7006979; Mon, 20 Oct 2003 16:13:11 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shirley Ma Organization: IBM Linux To: "David S. Miller" Subject: Re: [PATCH] New Patch Implementation for IPv6 MIB:ipv6InterfaceTable Date: Mon, 20 Oct 2003 16:00:09 -0700 User-Agent: KMail/1.4.3 Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com References: <200310141032.23998.mashirle@us.ibm.com> <20031014152441.1be6b336.davem@redhat.com> In-Reply-To: <20031014152441.1be6b336.davem@redhat.com> MIME-Version: 1.0 Message-Id: <200310201600.10016.mashirle@us.ibm.com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h9KN0Q25017987 X-archive-position: 956 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 11376 Lines: 329 This is the new patch for IPv6 MIBs:ipv6InterfaceTable. This patch has been tested against linux-2.6.0-test8 kernel plus xfmr patch. Please review it. Thanks Shirley Ma Linux Technology Center ==================== diff -urN linux-2.6.0-test8/include/linux/rtnetlink.h linux-2.6.0-test8-ipv6mib1/include/linux/rtnetlink.h --- linux-2.6.0-test8/include/linux/rtnetlink.h 2003-10-17 14:43:24.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/include/linux/rtnetlink.h 2003-10-20 12:52:29.000000000 -0700 @@ -557,9 +557,18 @@ IFLA_INET6_CONF, /* sysctl parameters */ IFLA_INET6_STATS, /* statistics */ IFLA_INET6_MCAST, /* MC things. What of them? */ + IFLA_INET6_CACHEINFO, /* time values and max reasm size */ }; -#define IFLA_INET6_MAX IFLA_INET6_MCAST +struct ifla_cacheinfo +{ + __u32 max_reasm_len; + __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ + __u32 reachable_time; + __u32 retrans_time; +}; + +#define IFLA_INET6_MAX IFLA_INET6_CACHEINFO /***************************************************************** * Traffic control messages. @@ -610,6 +619,7 @@ #define RTMGRP_IPV6_IFADDR 0x100 #define RTMGRP_IPV6_MROUTE 0x200 #define RTMGRP_IPV6_ROUTE 0x400 +#define RTMGRP_IPV6_IFINFO 0x800 #define RTMGRP_DECnet_IFADDR 0x1000 #define RTMGRP_DECnet_ROUTE 0x4000 diff -urN linux-2.6.0-test8/include/net/if_inet6.h linux-2.6.0-test8-ipv6mib1/include/net/if_inet6.h --- linux-2.6.0-test8/include/net/if_inet6.h 2003-10-17 14:43:34.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/include/net/if_inet6.h 2003-10-20 12:52:29.000000000 -0700 @@ -181,6 +181,7 @@ struct inet6_dev *next; struct ipv6_devconf cnf; struct ipv6_devstat stats; + unsigned long tstamp; /* ipv6InterfaceTable update timestamp */ }; extern struct ipv6_devconf ipv6_devconf; diff -urN linux-2.6.0-test8/include/net/ndisc.h linux-2.6.0-test8-ipv6mib1/include/net/ndisc.h --- linux-2.6.0-test8/include/net/ndisc.h 2003-10-17 14:43:24.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/include/net/ndisc.h 2003-10-20 12:52:29.000000000 -0700 @@ -98,6 +98,17 @@ extern void igmp6_cleanup(void); +#ifdef CONFIG_SYSCTL +extern int ndisc_ifinfo_sysctl_change(ctl_table *ctl, + int write, + struct file * filp, + void __user *buffer, + size_t *lenp); +#endif + +extern void inet6_ifinfo_notify(int event, + struct inet6_dev *idev); + static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr) { diff -urN linux-2.6.0-test8/include/net/neighbour.h linux-2.6.0-test8-ipv6mib1/include/net/neighbour.h --- linux-2.6.0-test8/include/net/neighbour.h 2003-10-17 14:43:34.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/include/net/neighbour.h 2003-10-20 14:39:37.000000000 -0700 @@ -47,6 +47,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) @@ -206,8 +207,11 @@ extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); extern void neigh_app_ns(struct neighbour *n); -extern int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, - int p_id, int pdev_id, char *p_name); +extern int neigh_sysctl_register(struct net_device *dev, + struct neigh_parms *p, + int p_id, int pdev_id, + char *p_name, + proc_handler *proc_handler); extern void neigh_sysctl_unregister(struct neigh_parms *p); /* diff -urN linux-2.6.0-test8/net/core/neighbour.c linux-2.6.0-test8-ipv6mib1/net/core/neighbour.c --- linux-2.6.0-test8/net/core/neighbour.c 2003-10-17 14:42:53.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/net/core/neighbour.c 2003-10-20 12:52:29.000000000 -0700 @@ -1625,7 +1625,8 @@ }; int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, - int p_id, int pdev_id, char *p_name) + int p_id, int pdev_id, char *p_name, + proc_handler *handler) { struct neigh_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL); @@ -1636,6 +1637,10 @@ t->neigh_vars[1].data = &p->ucast_probes; t->neigh_vars[2].data = &p->app_probes; t->neigh_vars[3].data = &p->retrans_time; + if (handler) { + t->neigh_vars[3].proc_handler = handler; + t->neigh_vars[3].extra1 = dev; + } t->neigh_vars[4].data = &p->base_reachable_time; t->neigh_vars[5].data = &p->delay_probe_time; t->neigh_vars[6].data = &p->gc_staletime; diff -urN linux-2.6.0-test8/net/ipv4/arp.c linux-2.6.0-test8-ipv6mib1/net/ipv4/arp.c --- linux-2.6.0-test8/net/ipv4/arp.c 2003-10-17 14:43:26.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/net/ipv4/arp.c 2003-10-20 12:52:29.000000000 -0700 @@ -1122,7 +1122,7 @@ arp_proc_init(); #ifdef CONFIG_SYSCTL neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, - NET_IPV4_NEIGH, "ipv4"); + NET_IPV4_NEIGH, "ipv4", NULL); #endif register_netdevice_notifier(&arp_netdev_notifier); } diff -urN linux-2.6.0-test8/net/ipv4/devinet.c linux-2.6.0-test8-ipv6mib1/net/ipv4/devinet.c --- linux-2.6.0-test8/net/ipv4/devinet.c 2003-10-17 14:42:56.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/net/ipv4/devinet.c 2003-10-20 12:52:29.000000000 -0700 @@ -155,7 +155,7 @@ dev_hold(dev); #ifdef CONFIG_SYSCTL neigh_sysctl_register(dev, in_dev->arp_parms, NET_IPV4, - NET_IPV4_NEIGH, "ipv4"); + NET_IPV4_NEIGH, "ipv4", NULL); #endif write_lock_bh(&inetdev_lock); dev->ip_ptr = in_dev; diff -urN linux-2.6.0-test8/net/ipv6/addrconf.c linux-2.6.0-test8-ipv6mib1/net/ipv6/addrconf.c --- linux-2.6.0-test8/net/ipv6/addrconf.c 2003-10-17 14:43:33.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/net/ipv6/addrconf.c 2003-10-20 15:36:54.000000000 -0700 @@ -373,9 +373,10 @@ write_unlock_bh(&addrconf_lock); ipv6_mc_init_dev(ndev); - + ndev->tstamp = jiffies; #ifdef CONFIG_SYSCTL - neigh_sysctl_register(dev, ndev->nd_parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6"); + neigh_sysctl_register(dev, ndev->nd_parms, NET_IPV6, + NET_IPV6_NEIGH, "ipv6", &ndisc_ifinfo_sysctl_change); addrconf_sysctl_register(ndev, &ndev->cnf); #endif } @@ -1854,6 +1855,8 @@ rt6_mtu_change(dev, dev->mtu); idev->cnf.mtu6 = dev->mtu; } + idev->tstamp = jiffies; + inet6_ifinfo_notify(RTM_NEWLINK, idev); /* If the changed mtu during down is lower than IPV6_MIN_MTU stop IPv6 on this interface. */ @@ -1972,7 +1975,10 @@ ipv6_mc_destroy_dev(idev); else ipv6_mc_down(idev); - + /* Step 5: netlink notification of this interface */ + idev->tstamp = jiffies; + inet6_ifinfo_notify(RTM_NEWLINK, idev); + /* Shot the device (if unregistered) */ if (how == 1) { @@ -2673,17 +2679,19 @@ #endif } -static int inet6_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, - struct inet6_dev *idev, - int type, u32 pid, u32 seq) +static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, + u32 pid, u32 seq, int event) { + struct net_device *dev = idev->dev; __s32 *array = NULL; struct ifinfomsg *r; struct nlmsghdr *nlh; unsigned char *b = skb->tail; struct rtattr *subattr; + __u32 mtu = dev->mtu; + struct ifla_cacheinfo ci; - nlh = NLMSG_PUT(skb, pid, seq, type, sizeof(*r)); + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*r)); if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; r = NLMSG_DATA(nlh); r->ifi_family = AF_INET6; @@ -2698,6 +2706,13 @@ RTA_PUT(skb, IFLA_IFNAME, strlen(dev->name)+1, dev->name); + if (dev->addr_len) + RTA_PUT(skb, IFLA_ADDRESS, dev->addr_len, dev->dev_addr); + + RTA_PUT(skb, IFLA_MTU, sizeof(mtu), &mtu); + if (dev->ifindex != dev->iflink) + RTA_PUT(skb, IFLA_LINK, sizeof(int), &dev->iflink); + subattr = (struct rtattr*)skb->tail; RTA_PUT(skb, IFLA_PROTINFO, 0, NULL); @@ -2705,6 +2720,14 @@ /* return the device flags */ RTA_PUT(skb, IFLA_INET6_FLAGS, sizeof(__u32), &idev->if_flags); + /* return interface cacheinfo */ + ci.max_reasm_len = IPV6_MAXPLEN; + ci.tstamp = (__u32)(TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) / HZ * 100 + + TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); + ci.reachable_time = idev->nd_parms->reachable_time; + ci.retrans_time = idev->nd_parms->retrans_time; + RTA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci); + /* return the device sysctl params */ if ((array = kmalloc(DEVCONF_MAX * sizeof(*array), GFP_ATOMIC)) == NULL) goto rtattr_failure; @@ -2739,8 +2762,8 @@ continue; if ((idev = in6_dev_get(dev)) == NULL) continue; - err = inet6_fill_ifinfo(skb, dev, idev, RTM_NEWLINK, - NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq); + err = inet6_fill_ifinfo(skb, idev, NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWLINK); in6_dev_put(idev); if (err <= 0) break; @@ -2751,6 +2774,26 @@ return skb->len; } +void inet6_ifinfo_notify(int event, struct inet6_dev *idev) +{ + struct sk_buff *skb; + /* 128 bytes ?? */ + int size = NLMSG_SPACE(sizeof(struct ifinfomsg)+128); + + skb = alloc_skb(size, GFP_ATOMIC); + if (!skb) { + netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFINFO, ENOBUFS); + return; + } + if (inet6_fill_ifinfo(skb, idev, 0, 0, event) < 0) { + kfree_skb(skb); + netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFINFO, EINVAL); + return; + } + NETLINK_CB(skb).dst_groups = RTMGRP_IPV6_IFINFO; + netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_IFINFO, GFP_ATOMIC); +} + static struct rtnetlink_link inet6_rtnetlink_table[RTM_MAX - RTM_BASE + 1] = { [RTM_GETLINK - RTM_BASE] = { .dumpit = inet6_dump_ifinfo, }, [RTM_NEWADDR - RTM_BASE] = { .doit = inet6_rtm_newaddr, }, diff -urN linux-2.6.0-test8/net/ipv6/ndisc.c linux-2.6.0-test8-ipv6mib1/net/ipv6/ndisc.c --- linux-2.6.0-test8/net/ipv6/ndisc.c 2003-10-17 14:43:18.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/net/ipv6/ndisc.c 2003-10-20 15:36:27.000000000 -0700 @@ -1109,6 +1109,8 @@ if (rtime < HZ/10) rtime = HZ/10; in6_dev->nd_parms->retrans_time = rtime; + in6_dev->tstamp = jiffies; + inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); } rtime = ntohl(ra_msg->reachable_time); @@ -1122,6 +1124,8 @@ in6_dev->nd_parms->base_reachable_time = rtime; in6_dev->nd_parms->gc_staletime = 3 * rtime; in6_dev->nd_parms->reachable_time = neigh_rand_reach_time(rtime); + in6_dev->tstamp = jiffies; + inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); } } } @@ -1487,6 +1491,21 @@ .notifier_call = ndisc_netdev_event, }; +#ifdef CONFIG_SYSCTL +int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * filp, void __user *buffer, size_t *lenp) +{ + struct net_device *dev = ctl->extra1; + struct inet6_dev *idev; + + if (write && dev && (idev = in6_dev_get(dev)) != NULL) { + idev->tstamp = jiffies; + inet6_ifinfo_notify(RTM_NEWLINK, idev); + in6_dev_put(idev); + } + return proc_dointvec(ctl, write, filp, buffer, lenp); +} +#endif + int __init ndisc_init(struct net_proto_family *ops) { struct ipv6_pinfo *np; @@ -1517,7 +1536,8 @@ neigh_table_init(&nd_tbl); #ifdef CONFIG_SYSCTL - neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6"); + neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, + "ipv6", &ndisc_ifinfo_sysctl_change); #endif register_netdevice_notifier(&ndisc_netdev_notifier); From mashirle@us.ibm.com Mon Oct 20 16:43:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 16:44:26 -0700 (PDT) Received: from linux2.suntekindustrial.com (wbar1.sjo1-4-4-004-065.sjo1.dsl-verizon.net [4.4.4.65]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9KNhj25021462 for ; Mon, 20 Oct 2003 16:43:52 -0700 Received: from ibm-mxl (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated bits=0) by linux2.suntekindustrial.com (8.12.8/8.12.8) with ESMTP id h9KNuao7007206; Mon, 20 Oct 2003 16:56:37 -0700 From: Shirley Ma Organization: IBM Linux To: "David S. Miller" Subject: Re: [PATCH] New Patch Implementation for IPv6 MIB:ipv6InterfaceTable Date: Mon, 20 Oct 2003 16:43:36 -0700 User-Agent: KMail/1.4.3 Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com References: <200310141032.23998.mashirle@us.ibm.com> <20031014152441.1be6b336.davem@redhat.com> <200310201600.10016.mashirle@us.ibm.com> In-Reply-To: <200310201600.10016.mashirle@us.ibm.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="------------Boundary-00=_OWX2VS19HYA5PIJUZMID" Message-Id: <200310201643.36382.mashirle@us.ibm.com> X-archive-position: 957 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 11765 Lines: 341 --------------Boundary-00=_OWX2VS19HYA5PIJUZMID Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable This is the attachment file for this patch, please use this one. Thanks Shirley Ma Linux Technology Center =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --------------Boundary-00=_OWX2VS19HYA5PIJUZMID Content-Type: text/x-diff; charset="iso-8859-1"; name="ipv6mib1-2.6.0-test8.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ipv6mib1-2.6.0-test8.patch" diff -urN linux-2.6.0-test8/include/linux/rtnetlink.h linux-2.6.0-test8-ipv6mib1/include/linux/rtnetlink.h --- linux-2.6.0-test8/include/linux/rtnetlink.h 2003-10-17 14:43:24.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/include/linux/rtnetlink.h 2003-10-20 12:52:29.000000000 -0700 @@ -557,9 +557,18 @@ IFLA_INET6_CONF, /* sysctl parameters */ IFLA_INET6_STATS, /* statistics */ IFLA_INET6_MCAST, /* MC things. What of them? */ + IFLA_INET6_CACHEINFO, /* time values and max reasm size */ }; -#define IFLA_INET6_MAX IFLA_INET6_MCAST +struct ifla_cacheinfo +{ + __u32 max_reasm_len; + __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ + __u32 reachable_time; + __u32 retrans_time; +}; + +#define IFLA_INET6_MAX IFLA_INET6_CACHEINFO /***************************************************************** * Traffic control messages. @@ -610,6 +619,7 @@ #define RTMGRP_IPV6_IFADDR 0x100 #define RTMGRP_IPV6_MROUTE 0x200 #define RTMGRP_IPV6_ROUTE 0x400 +#define RTMGRP_IPV6_IFINFO 0x800 #define RTMGRP_DECnet_IFADDR 0x1000 #define RTMGRP_DECnet_ROUTE 0x4000 diff -urN linux-2.6.0-test8/include/net/if_inet6.h linux-2.6.0-test8-ipv6mib1/include/net/if_inet6.h --- linux-2.6.0-test8/include/net/if_inet6.h 2003-10-17 14:43:34.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/include/net/if_inet6.h 2003-10-20 12:52:29.000000000 -0700 @@ -181,6 +181,7 @@ struct inet6_dev *next; struct ipv6_devconf cnf; struct ipv6_devstat stats; + unsigned long tstamp; /* ipv6InterfaceTable update timestamp */ }; extern struct ipv6_devconf ipv6_devconf; diff -urN linux-2.6.0-test8/include/net/ndisc.h linux-2.6.0-test8-ipv6mib1/include/net/ndisc.h --- linux-2.6.0-test8/include/net/ndisc.h 2003-10-17 14:43:24.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/include/net/ndisc.h 2003-10-20 12:52:29.000000000 -0700 @@ -98,6 +98,17 @@ extern void igmp6_cleanup(void); +#ifdef CONFIG_SYSCTL +extern int ndisc_ifinfo_sysctl_change(ctl_table *ctl, + int write, + struct file * filp, + void __user *buffer, + size_t *lenp); +#endif + +extern void inet6_ifinfo_notify(int event, + struct inet6_dev *idev); + static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr) { diff -urN linux-2.6.0-test8/include/net/neighbour.h linux-2.6.0-test8-ipv6mib1/include/net/neighbour.h --- linux-2.6.0-test8/include/net/neighbour.h 2003-10-17 14:43:34.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/include/net/neighbour.h 2003-10-20 14:39:37.000000000 -0700 @@ -47,6 +47,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) @@ -206,8 +207,11 @@ extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); extern void neigh_app_ns(struct neighbour *n); -extern int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, - int p_id, int pdev_id, char *p_name); +extern int neigh_sysctl_register(struct net_device *dev, + struct neigh_parms *p, + int p_id, int pdev_id, + char *p_name, + proc_handler *proc_handler); extern void neigh_sysctl_unregister(struct neigh_parms *p); /* diff -urN linux-2.6.0-test8/net/core/neighbour.c linux-2.6.0-test8-ipv6mib1/net/core/neighbour.c --- linux-2.6.0-test8/net/core/neighbour.c 2003-10-17 14:42:53.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/net/core/neighbour.c 2003-10-20 12:52:29.000000000 -0700 @@ -1625,7 +1625,8 @@ }; int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, - int p_id, int pdev_id, char *p_name) + int p_id, int pdev_id, char *p_name, + proc_handler *handler) { struct neigh_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL); @@ -1636,6 +1637,10 @@ t->neigh_vars[1].data = &p->ucast_probes; t->neigh_vars[2].data = &p->app_probes; t->neigh_vars[3].data = &p->retrans_time; + if (handler) { + t->neigh_vars[3].proc_handler = handler; + t->neigh_vars[3].extra1 = dev; + } t->neigh_vars[4].data = &p->base_reachable_time; t->neigh_vars[5].data = &p->delay_probe_time; t->neigh_vars[6].data = &p->gc_staletime; diff -urN linux-2.6.0-test8/net/ipv4/arp.c linux-2.6.0-test8-ipv6mib1/net/ipv4/arp.c --- linux-2.6.0-test8/net/ipv4/arp.c 2003-10-17 14:43:26.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/net/ipv4/arp.c 2003-10-20 12:52:29.000000000 -0700 @@ -1122,7 +1122,7 @@ arp_proc_init(); #ifdef CONFIG_SYSCTL neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, - NET_IPV4_NEIGH, "ipv4"); + NET_IPV4_NEIGH, "ipv4", NULL); #endif register_netdevice_notifier(&arp_netdev_notifier); } diff -urN linux-2.6.0-test8/net/ipv4/devinet.c linux-2.6.0-test8-ipv6mib1/net/ipv4/devinet.c --- linux-2.6.0-test8/net/ipv4/devinet.c 2003-10-17 14:42:56.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/net/ipv4/devinet.c 2003-10-20 12:52:29.000000000 -0700 @@ -155,7 +155,7 @@ dev_hold(dev); #ifdef CONFIG_SYSCTL neigh_sysctl_register(dev, in_dev->arp_parms, NET_IPV4, - NET_IPV4_NEIGH, "ipv4"); + NET_IPV4_NEIGH, "ipv4", NULL); #endif write_lock_bh(&inetdev_lock); dev->ip_ptr = in_dev; diff -urN linux-2.6.0-test8/net/ipv6/addrconf.c linux-2.6.0-test8-ipv6mib1/net/ipv6/addrconf.c --- linux-2.6.0-test8/net/ipv6/addrconf.c 2003-10-17 14:43:33.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/net/ipv6/addrconf.c 2003-10-20 15:36:54.000000000 -0700 @@ -373,9 +373,10 @@ write_unlock_bh(&addrconf_lock); ipv6_mc_init_dev(ndev); - + ndev->tstamp = jiffies; #ifdef CONFIG_SYSCTL - neigh_sysctl_register(dev, ndev->nd_parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6"); + neigh_sysctl_register(dev, ndev->nd_parms, NET_IPV6, + NET_IPV6_NEIGH, "ipv6", &ndisc_ifinfo_sysctl_change); addrconf_sysctl_register(ndev, &ndev->cnf); #endif } @@ -1854,6 +1855,8 @@ rt6_mtu_change(dev, dev->mtu); idev->cnf.mtu6 = dev->mtu; } + idev->tstamp = jiffies; + inet6_ifinfo_notify(RTM_NEWLINK, idev); /* If the changed mtu during down is lower than IPV6_MIN_MTU stop IPv6 on this interface. */ @@ -1972,7 +1975,10 @@ ipv6_mc_destroy_dev(idev); else ipv6_mc_down(idev); - + /* Step 5: netlink notification of this interface */ + idev->tstamp = jiffies; + inet6_ifinfo_notify(RTM_NEWLINK, idev); + /* Shot the device (if unregistered) */ if (how == 1) { @@ -2673,17 +2679,19 @@ #endif } -static int inet6_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, - struct inet6_dev *idev, - int type, u32 pid, u32 seq) +static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, + u32 pid, u32 seq, int event) { + struct net_device *dev = idev->dev; __s32 *array = NULL; struct ifinfomsg *r; struct nlmsghdr *nlh; unsigned char *b = skb->tail; struct rtattr *subattr; + __u32 mtu = dev->mtu; + struct ifla_cacheinfo ci; - nlh = NLMSG_PUT(skb, pid, seq, type, sizeof(*r)); + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*r)); if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; r = NLMSG_DATA(nlh); r->ifi_family = AF_INET6; @@ -2698,6 +2706,13 @@ RTA_PUT(skb, IFLA_IFNAME, strlen(dev->name)+1, dev->name); + if (dev->addr_len) + RTA_PUT(skb, IFLA_ADDRESS, dev->addr_len, dev->dev_addr); + + RTA_PUT(skb, IFLA_MTU, sizeof(mtu), &mtu); + if (dev->ifindex != dev->iflink) + RTA_PUT(skb, IFLA_LINK, sizeof(int), &dev->iflink); + subattr = (struct rtattr*)skb->tail; RTA_PUT(skb, IFLA_PROTINFO, 0, NULL); @@ -2705,6 +2720,14 @@ /* return the device flags */ RTA_PUT(skb, IFLA_INET6_FLAGS, sizeof(__u32), &idev->if_flags); + /* return interface cacheinfo */ + ci.max_reasm_len = IPV6_MAXPLEN; + ci.tstamp = (__u32)(TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) / HZ * 100 + + TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); + ci.reachable_time = idev->nd_parms->reachable_time; + ci.retrans_time = idev->nd_parms->retrans_time; + RTA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci); + /* return the device sysctl params */ if ((array = kmalloc(DEVCONF_MAX * sizeof(*array), GFP_ATOMIC)) == NULL) goto rtattr_failure; @@ -2739,8 +2762,8 @@ continue; if ((idev = in6_dev_get(dev)) == NULL) continue; - err = inet6_fill_ifinfo(skb, dev, idev, RTM_NEWLINK, - NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq); + err = inet6_fill_ifinfo(skb, idev, NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWLINK); in6_dev_put(idev); if (err <= 0) break; @@ -2751,6 +2774,26 @@ return skb->len; } +void inet6_ifinfo_notify(int event, struct inet6_dev *idev) +{ + struct sk_buff *skb; + /* 128 bytes ?? */ + int size = NLMSG_SPACE(sizeof(struct ifinfomsg)+128); + + skb = alloc_skb(size, GFP_ATOMIC); + if (!skb) { + netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFINFO, ENOBUFS); + return; + } + if (inet6_fill_ifinfo(skb, idev, 0, 0, event) < 0) { + kfree_skb(skb); + netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFINFO, EINVAL); + return; + } + NETLINK_CB(skb).dst_groups = RTMGRP_IPV6_IFINFO; + netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_IFINFO, GFP_ATOMIC); +} + static struct rtnetlink_link inet6_rtnetlink_table[RTM_MAX - RTM_BASE + 1] = { [RTM_GETLINK - RTM_BASE] = { .dumpit = inet6_dump_ifinfo, }, [RTM_NEWADDR - RTM_BASE] = { .doit = inet6_rtm_newaddr, }, diff -urN linux-2.6.0-test8/net/ipv6/ndisc.c linux-2.6.0-test8-ipv6mib1/net/ipv6/ndisc.c --- linux-2.6.0-test8/net/ipv6/ndisc.c 2003-10-17 14:43:18.000000000 -0700 +++ linux-2.6.0-test8-ipv6mib1/net/ipv6/ndisc.c 2003-10-20 15:36:27.000000000 -0700 @@ -1109,6 +1109,8 @@ if (rtime < HZ/10) rtime = HZ/10; in6_dev->nd_parms->retrans_time = rtime; + in6_dev->tstamp = jiffies; + inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); } rtime = ntohl(ra_msg->reachable_time); @@ -1122,6 +1124,8 @@ in6_dev->nd_parms->base_reachable_time = rtime; in6_dev->nd_parms->gc_staletime = 3 * rtime; in6_dev->nd_parms->reachable_time = neigh_rand_reach_time(rtime); + in6_dev->tstamp = jiffies; + inet6_ifinfo_notify(RTM_NEWLINK, in6_dev); } } } @@ -1487,6 +1491,21 @@ .notifier_call = ndisc_netdev_event, }; +#ifdef CONFIG_SYSCTL +int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * filp, void __user *buffer, size_t *lenp) +{ + struct net_device *dev = ctl->extra1; + struct inet6_dev *idev; + + if (write && dev && (idev = in6_dev_get(dev)) != NULL) { + idev->tstamp = jiffies; + inet6_ifinfo_notify(RTM_NEWLINK, idev); + in6_dev_put(idev); + } + return proc_dointvec(ctl, write, filp, buffer, lenp); +} +#endif + int __init ndisc_init(struct net_proto_family *ops) { struct ipv6_pinfo *np; @@ -1517,7 +1536,8 @@ neigh_table_init(&nd_tbl); #ifdef CONFIG_SYSCTL - neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6"); + neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, + "ipv6", &ndisc_ifinfo_sysctl_change); #endif register_netdevice_notifier(&ndisc_netdev_notifier); --------------Boundary-00=_OWX2VS19HYA5PIJUZMID-- From cacophonix@yahoo.com Mon Oct 20 17:36:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 17:36:40 -0700 (PDT) Received: from web14002.mail.yahoo.com (web14002.mail.yahoo.com [216.136.175.93]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L0a625022397 for ; Mon, 20 Oct 2003 17:36:06 -0700 Message-ID: <20031021003605.41403.qmail@web14002.mail.yahoo.com> Received: from [156.153.255.243] by web14002.mail.yahoo.com via HTTP; Mon, 20 Oct 2003 17:36:05 PDT Date: Mon, 20 Oct 2003 17:36:05 -0700 (PDT) From: Cacophonix Subject: Fwd: Re: Replace the Nagle Algorithm To: netdev@oss.sgi.com Cc: JCONLIN@novell.com, cacophonix@yahoo.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 958 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cacophonix@yahoo.com Precedence: bulk X-list: netdev Content-Length: 2983 Lines: 67 Thanks for the pointer, interesting idea. Some comments below. cheers, karthik > --- "Joseph Conlin" wrote: > I see in the archives and the code that I have looked at (2.4.22, > 2.6.0-test8) that the Minshall algorithm is being used to reduce the > effects of Nagle/delayed ACK interaction. I haven't seen any mention of > the following solution, proposed as an IETF draft RFC by Joe Doupnik > (jrd@c...). > > http://netlab1.usu.edu/pub/misc/draft-doupnik-tcpimpl-nagle-mode-00.txt > > > If anyone is interested, I have an Excel spreadsheet that shows some > testing I did with FreeBSD using Nagle-off, Nagle-on, and Doupnik using > HTTP requests. It shows that Doupnik gets the same packet-size > efficiency as Nagle-on while getting better throughput than having > Nagle-off. Let me know if you would like a copy. Yes please, but only if you have some comparisons with Linux 2.4+ which implements the Nagle+Minshall extensions, which should not have the perf problem reported in the draft (which measures Linux 2.2). Reading through the draft, the tradeoff the new proposal makes is in allowing greater control to the transmitter to send packets at it's (application's) whim, at the risk of larger number of small packets in transit at any point in time within the network. For example, as quoted within the draft: "In an extreme case the application may perform single octet writes in massive succession before reading a response. If the network can drain data faster than the application can create data (a classical queueing problem) then massive quantities of tiny segments will appear on the network. That imposes a very heavy load on both hosts and network communications" The current Linux Nagle+Minshall combo can have at most one "small" unacked packet in transit in the network at any given time, while in the new approach, if the tcp stack guesses application behavior incorrectly, it's possible that there could be numerous small packets flooding the network. (For example, think someone typing fast in a ssh/telnet session). In addition, more packets means potentially increased interrupt processing on the host (modulo napi or interrupt mitigation), thereby making me question the benefit to the transmitter. And IIRC, the whole point of Nagle was to conserve network bandwidth by not having applications flood the network with small packets. If I read this draft correctly, it tries to get the tcp stack to guess application behavior to accomplish the same result, but is liable to get it wrong. I'd love to see any perf numbers you have with linux 2.4. The intent of implementing the Minshall extensions was to eliminate the kind of Nagle problems described in the draft, and thus far, I haven't seen any reports of problems on linux-netdev (while still being a good network citizen). __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com From Mike_Phillips@URSCorp.com Mon Oct 20 17:52:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 17:53:32 -0700 (PDT) Received: from smtp102.urscorp.com (smtp102.urscorp.com [65.207.129.233]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L0qt25022886; Mon, 20 Oct 2003 17:52:55 -0700 Subject: Re: [PATCH] (5/6) ibmtr -- probe2 To: Stephen Hemminger Cc: netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mike_Phillips@URSCorp.com Date: Mon, 20 Oct 2003 21:50:38 -0300 X-MIMETrack: Serialize by Router on SMTP102/URSCorp(Release 5.0.11 |July 24, 2002) at 10/20/2003 08:53:07 PM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-archive-position: 959 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Mike_Phillips@URSCorp.com Precedence: bulk X-list: netdev Content-Length: 1101 Lines: 28 >The problem with the structures was a BUG in the existing code! >The PCMCIA code was setting dev->priv to a structure: AAARRRGGH, it got screwed up somewhere in the past, during 2.5 or 2.6 somewhere. Take a look at 2.4.22, dev-priv gets set to &info->ti. *sigh*, apologies, it doesn't help when the code you're looking at in the main tree isn't the same as my dev tree and what I remember. (Wonder if it works at all in 2.6, if it doesn't that shows just how many people are actually testing it ;) I *can* see what you're trying to do with the rest of the patch, although I need to grab net-2.5-exp to fully see how this all works. There's parts of the patch where I can see where the code was grabbed from but doesn't make total sense yet (like testing for #ifndef PCMCIA in ibmtr_probe when another part of the patch removed the call to ibmtr_probe from the pcmcia driver.) Bear with me, I think there's probably a cleaner solution. pcmcia allocating its own dev structures is a right pain, would be nice if this could go away too and it could all be done from the probe2 api. Mike From rnp@paradise.net.nz Mon Oct 20 21:05:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 21:05:49 -0700 (PDT) Received: from linda-1.paradise.net.nz (bm-1a.paradise.net.nz [202.0.58.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L45B25027408 for ; Mon, 20 Oct 2003 21:05:16 -0700 Received: from smtp-2.paradise.net.nz (smtp-2a.paradise.net.nz [202.0.32.195]) by linda-1.paradise.net.nz (Paradise.net.nz) with ESMTP id <0HN300C08A0LF4@linda-1.paradise.net.nz> for netdev@oss.sgi.com; Tue, 21 Oct 2003 17:05:10 +1300 (NZDT) Received: from ps2.local (203-79-92-141.cable.paradise.net.nz [203.79.92.141]) by smtp-2.paradise.net.nz (Postfix) with SMTP id 4C43B9E277 for ; Tue, 21 Oct 2003 17:05:07 +1300 (NZDT) Received: (qmail 552 invoked by uid 501); Tue, 21 Oct 2003 04:05:01 +0000 Date: Tue, 21 Oct 2003 17:05:01 +1300 (NZDT) From: Richard Procter Subject: Re: [PATCH] SMP support on 3c527 net driver for 2.6 In-reply-to: <20031018184746.54a2e6b0.akpm@osdl.org> X-Sender: rix@ps2.local. To: Andrew Morton Cc: jgarzik@pobox.com, felipewd@terra.com.br, netdev@oss.sgi.com, linux-net@vger.kernel.org Message-id: Content-id: MIME-version: 1.0 Content-type: MULTIPART/MIXED; BOUNDARY="-1463810815-1751553365-1066708907=:531" X-archive-position: 960 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rnp@paradise.net.nz Precedence: bulk X-list: netdev Content-Length: 10029 Lines: 195 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463810815-1751553365-1066708907=:531 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: On Sat, 18 Oct 2003, Andrew Morton wrote: > I've regenerated this against the current driver. I'll include it in > test8-mm1. > > If the scsi problem is fixed could you please retest this driver on both > SMP and UP builds? Thanks --- will do. Note that it's only tested on UP. I'm trying to find someone with the requisite hardware. (SMP + MCA + 3c527 + Linux = a rare beast). > If the scsi problem is not fixed could you please be sure to shout at the > right people about that? Sure thing. > It's a local variable? Yes, it is atomic. Partly because the compiler > will probably align things but mainly because the stack is only used by one > CPU at a time. Ah, of course. Thanks. > If the u16 is a structure member then yes it is probably OK because the > compiler will pad things. But if the next slut in the struct is also a u16 > then it may not be atomic on some architectures. I do not know. It's best > to avoid this. I do share a volatile u16 in the dev struct between hard_start_xmit and the interrupt handler. The only operations on it are 'set' on one hand, and 'read' on the other, so the only possible race would be one of reading an in-progress write. But it's not very obvious that's what's happening, looking at it with a fresh eye. I've replaced it with an atomic_t type; it makes things more explicit without hurting performance on x86. I've also included a fix for a small race pointed out by Manfred Spraul. Patch attached. best wishes, Richard. ---1463810815-1751553365-1066708907=:531 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="3c527.h-2003.10.20-rnp.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME="3c527.h-2003.10.20-rnp.patch" LS0tIGxpbnV4LTIuNi4wLXRlc3Q4L2RyaXZlcnMvbmV0LzNjNTI3Lmgub3Jp ZwkyMDAzLTEwLTIwIDIwOjE3OjQ2LjAwMDAwMDAwMCArMTMwMA0KKysrIGxp bnV4LTIuNi4wLXRlc3Q4L2RyaXZlcnMvbmV0LzNjNTI3LmgJMjAwMy0xMC0y MCAyMDozNDozNC4wMDAwMDAwMDAgKzEzMDANCkBAIC0yNyw5ICsyNyw3IEBA DQogDQogI2RlZmluZSBIT1NUX1JBTVBBR0UJCTgNCiANCi0jZGVmaW5lIFJY X0hBTFRFRCAoMTw8MCkNCi0jZGVmaW5lIFRYX0hBTFRFRCAoMTw8MSkgIA0K LSNkZWZpbmUgSEFMVEVEIChSWF9IQUxURUQgfCBUWF9IQUxURUQpDQorI2Rl ZmluZSBIQUxURUQgMQ0KICNkZWZpbmUgUlVOTklORyAwDQogDQogc3RydWN0 IG1jMzJfbWFpbGJveA0K ---1463810815-1751553365-1066708907=:531 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="3c527.c-2003.10.20-rnp.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME="3c527.c-2003.10.20-rnp.patch" LS0tIGxpbnV4LTIuNi4wLXRlc3Q4L2RyaXZlcnMvbmV0LzNjNTI3LmZlbGlw ZS5jCTIwMDMtMTAtMjAgMjA6Mjc6MjIuMDAwMDAwMDAwICsxMzAwDQorKysg bGludXgtMi42LjAtdGVzdDgvZHJpdmVycy9uZXQvM2M1MjcuYwkyMDAzLTEw LTIxIDE2OjQ3OjMyLjAwMDAwMDAwMCArMTMwMA0KQEAgLTE5LDcgKzE5LDcg QEANCiANCiAjZGVmaW5lIERSVl9OQU1FCQkiM2M1MjciDQogI2RlZmluZSBE UlZfVkVSU0lPTgkJIjAuNy1TTVAiDQotI2RlZmluZSBEUlZfUkVMREFURQkJ IjIwMDMvMTAvMDYiDQorI2RlZmluZSBEUlZfUkVMREFURQkJIjIwMDMvMTAv MjAiDQogDQogc3RhdGljIGNvbnN0IGNoYXIgKnZlcnNpb24gPQ0KIERSVl9O QU1FICIuYzp2IiBEUlZfVkVSU0lPTiAiICIgRFJWX1JFTERBVEUgIiBSaWNo YXJkIFByb2N0ZXI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izda.ninka.net Mon Oct 20 21:10:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 21:11:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L4A925027799 for ; Mon, 20 Oct 2003 21:10:26 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id VAA12972; Mon, 20 Oct 2003 21:04:33 -0700 Date: Mon, 20 Oct 2003 21:04:33 -0700 From: "David S. Miller" To: Shirley Ma Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: [PATCH] New Patch Implementation for IPv6 MIB:ipv6InterfaceTable Message-Id: <20031020210433.27e25240.davem@redhat.com> In-Reply-To: <200310201600.10016.mashirle@us.ibm.com> References: <200310141032.23998.mashirle@us.ibm.com> <20031014152441.1be6b336.davem@redhat.com> <200310201600.10016.mashirle@us.ibm.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 961 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: 404 Lines: 14 On Mon, 20 Oct 2003 16:00:09 -0700 Shirley Ma wrote: > This is the new patch for IPv6 MIBs:ipv6InterfaceTable. > This patch has been tested against linux-2.6.0-test8 kernel plus xfmr patch. > > Please review it. It looks fine but I cannot merge it at this time. Linus wants only critical bug fixes for nowin 2.6.x Maybe in 2.6.1, 2.6.2 or later we can merge this in. Thanks. From davem@pizda.ninka.net Mon Oct 20 21:22:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 21:22:54 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L4ML25028201 for ; Mon, 20 Oct 2003 21:22:22 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id VAA13004; Mon, 20 Oct 2003 21:17:07 -0700 Date: Mon, 20 Oct 2003 21:17:06 -0700 From: "David S. Miller" To: Martin Diehl Cc: noah@caltech.edu, irda-users@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [irda-users] [PATCH] Make VLSI FIR depend on X86 Message-Id: <20031020211706.5be33474.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 962 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: 316 Lines: 8 On Mon, 20 Oct 2003 19:30:33 +0200 (CEST) Martin Diehl wrote: > Well, it would work with any arch, _if_ there was a way to sync the > streaming pci dma buffers before giving them back to hardware. If pci_dma_sync() doesn't perform the operation you want, please describe what that operation is. From jgarzik@pobox.com Mon Oct 20 21:31:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 21:32:08 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L4VX25028792 for ; Mon, 20 Oct 2003 21:31:34 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:32842 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1ABoB9-0003aq-I9; Tue, 21 Oct 2003 05:31:31 +0100 Message-ID: <3F94B698.90508@pobox.com> Date: Tue, 21 Oct 2003 00:31:20 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Richard Procter CC: Andrew Morton , felipewd@terra.com.br, netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: [PATCH] SMP support on 3c527 net driver for 2.6 References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 963 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: 547 Lines: 23 Richard Procter wrote: > On Sat, 18 Oct 2003, Andrew Morton wrote: > > >>I've regenerated this against the current driver. I'll include it in >>test8-mm1. >> >>If the scsi problem is fixed could you please retest this driver on both >>SMP and UP builds? > > > Thanks --- will do. Note that it's only tested on UP. I'm trying to find > someone with the requisite hardware. > (SMP + MCA + 3c527 + Linux = a rare beast). You can boot an SMP kernel on a uniprocessor machine. In fact, doing so it a great test for deadlocks... Jeff From akpm@osdl.org Mon Oct 20 21:49:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 21:50:32 -0700 (PDT) Received: from mail.osdl.org ([65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L4nt25029260 for ; Mon, 20 Oct 2003 21:49:55 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9L4nHo08375; Mon, 20 Oct 2003 21:49:17 -0700 Date: Mon, 20 Oct 2003 21:49:27 -0700 From: Andrew Morton To: Richard Procter Cc: jgarzik@pobox.com, felipewd@terra.com.br, netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: [PATCH] SMP support on 3c527 net driver for 2.6 Message-Id: <20031020214927.11cd9d62.akpm@osdl.org> In-Reply-To: References: <20031018184746.54a2e6b0.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (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: 964 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 23782 Lines: 803 Richard Procter wrote: > > Patch attached. Not a very good one :( mnm:/usr/src/25> patch -p1 --dry-run < ~/2 (Stripping trailing CRs from patch.) patching file drivers/net/3c527.c Hunk #1 FAILED at 19. Hunk #2 FAILED at 176. Hunk #3 succeeded at 219 (offset -5 lines). Hunk #4 FAILED at 828. Hunk #5 succeeded at 926 with fuzz 1 (offset 58 lines). Hunk #6 FAILED at 1060. Hunk #7 FAILED at 1088. Hunk #8 FAILED at 1102. Hunk #9 FAILED at 1110. Hunk #10 FAILED at 1294. Hunk #11 FAILED at 1547. 9 out of 11 hunks FAILED -- saving rejects to file drivers/net/3c527.c.rej Here's my version again; please work against that (an incremental patch woud suit..). drivers/net/3c527.c | 372 ++++++++++++++++++++++------------------------------ drivers/net/3c527.h | 6 drivers/net/Kconfig | 2 3 files changed, 162 insertions(+), 218 deletions(-) diff -puN drivers/net/3c527.c~3c527-smp-update drivers/net/3c527.c --- 25/drivers/net/3c527.c~3c527-smp-update 2003-10-18 17:57:27.000000000 -0700 +++ 25-akpm/drivers/net/3c527.c 2003-10-18 17:57:27.000000000 -0700 @@ -1,9 +1,10 @@ -/* 3c527.c: 3Com Etherlink/MC32 driver for Linux 2.4 +/* 3c527.c: 3Com Etherlink/MC32 driver for Linux 2.4 and 2.6. * * (c) Copyright 1998 Red Hat Software Inc * Written by Alan Cox. * Further debugging by Carl Drougge. - * Modified by Richard Procter (rnp@netlink.co.nz) + * Initial SMP support by Felipe W Damasio + * Heavily modified by Richard Procter * * Based on skeleton.c written 1993-94 by Donald Becker and ne2.c * (for the MCA stuff) written by Wim Dumon. @@ -17,11 +18,11 @@ */ #define DRV_NAME "3c527" -#define DRV_VERSION "0.6a" -#define DRV_RELDATE "2001/11/17" +#define DRV_VERSION "0.7-SMP" +#define DRV_RELDATE "2003/09/17" static const char *version = -DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Proctor (rnp@netlink.co.nz)\n"; +DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Procter \n"; /** * DOC: Traps for the unwary @@ -100,7 +101,9 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELD #include #include #include +#include +#include #include #include #include @@ -141,19 +144,19 @@ static unsigned int mc32_debug = NET_DEB static const int WORKAROUND_82586=1; /* Pointers to buffers and their on-card records */ - struct mc32_ring_desc { volatile struct skb_header *p; struct sk_buff *skb; }; - /* Information that needs to be kept for each board. */ struct mc32_local { - struct net_device_stats net_stats; int slot; + + u32 base; + struct net_device_stats net_stats; volatile struct mc32_mailbox *rx_box; volatile struct mc32_mailbox *tx_box; volatile struct mc32_mailbox *exec_box; @@ -163,22 +166,23 @@ struct mc32_local u16 tx_len; /* Transmit list count */ u16 rx_len; /* Receive list count */ - u32 base; - u16 exec_pending; - u16 mc_reload_wait; /* a multicast load request is pending */ + u16 xceiver_desired_state; /* HALTED or RUNNING */ + u16 cmd_nonblocking; /* Thread is uninterested in command result */ + u16 mc_reload_wait; /* A multicast load request is pending */ u32 mc_list_valid; /* True when the mclist is set */ - u16 xceiver_state; /* Current transceiver state. bitmapped */ - u16 desired_state; /* The state we want the transceiver to be in */ - atomic_t tx_count; /* buffers left */ - wait_queue_head_t event; struct mc32_ring_desc tx_ring[TX_RING_LEN]; /* Host Transmit ring */ struct mc32_ring_desc rx_ring[RX_RING_LEN]; /* Host Receive ring */ - u16 tx_ring_tail; /* index to tx de-queue end */ - u16 tx_ring_head; /* index to tx en-queue end */ + atomic_t tx_count; /* buffers left */ + volatile u16 tx_ring_head; /* index to tx en-queue end */ + u16 tx_ring_tail; /* index to tx de-queue end */ u16 rx_ring_tail; /* index to rx de-queue end */ + + struct semaphore cmd_mutex; /* Serialises issuing of execute commands */ + struct completion execution_cmd; /* Card has completed an execute command */ + struct completion xceiver_cmd; /* Card has completed a tx or rx command */ }; /* The station (ethernet) address prefix, used for a sanity check. */ @@ -234,7 +238,6 @@ int __init mc32_probe(struct net_device { static int current_mca_slot = -1; int i; - int adapter_found = 0; SET_MODULE_OWNER(dev); @@ -245,11 +248,11 @@ int __init mc32_probe(struct net_device Autodetecting MCA cards is extremely simple. Just search for the card. */ - for(i = 0; (mc32_adapters[i].name != NULL) && !adapter_found; i++) { + for(i = 0; (mc32_adapters[i].name != NULL); i++) { current_mca_slot = mca_find_unused_adapter(mc32_adapters[i].id, 0); - if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) { + if(current_mca_slot != MCA_NOTFOUND) { if(!mc32_probe1(dev, current_mca_slot)) { mca_set_adapter_name(current_mca_slot, @@ -407,7 +410,7 @@ static int __init mc32_probe1(struct net * Grab the IRQ */ - i = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ, dev->name, dev); + i = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); if (i) { release_region(dev->base_addr, MC32_IO_EXTENT); printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq); @@ -496,7 +499,9 @@ static int __init mc32_probe1(struct net lp->tx_len = lp->exec_box->data[9]; /* Transmit list count */ lp->rx_len = lp->exec_box->data[11]; /* Receive list count */ - init_waitqueue_head(&lp->event); + init_MUTEX_LOCKED(&lp->cmd_mutex); + init_completion(&lp->execution_cmd); + init_completion(&lp->xceiver_cmd); printk("%s: Firmware Rev %d. %d RX buffers, %d TX buffers. Base of 0x%08X.\n", dev->name, lp->exec_box->data[12], lp->rx_len, lp->tx_len, lp->base); @@ -509,10 +514,6 @@ static int __init mc32_probe1(struct net dev->tx_timeout = mc32_timeout; dev->watchdog_timeo = HZ*5; /* Board does all the work */ dev->ethtool_ops = &netdev_ethtool_ops; - - lp->xceiver_state = HALTED; - - lp->tx_ring_tail=lp->tx_ring_head=0; /* Fill in the fields of the device structure with ethernet values. */ ether_setup(dev); @@ -537,7 +538,7 @@ err_exit_irq: * status of any pending commands and takes very little time at all. */ -static void mc32_ready_poll(struct net_device *dev) +static inline void mc32_ready_poll(struct net_device *dev) { int ioaddr = dev->base_addr; while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR)); @@ -552,31 +553,38 @@ static void mc32_ready_poll(struct net_d * @len: Length of the data block * * Send a command from interrupt state. If there is a command - * currently being executed then we return an error of -1. It simply - * isn't viable to wait around as commands may be slow. Providing we - * get in, we busy wait for the board to become ready to accept the - * command and issue it. We do not wait for the command to complete - * --- the card will interrupt us when it's done. + * currently being executed then we return an error of -1. It + * simply isn't viable to wait around as commands may be + * slow. This can theoretically be starved on SMP, but it's hard + * to see a realistic situation. We do not wait for the command + * to complete --- we rely on the interrupt handler to tidy up + * after us. */ static int mc32_command_nowait(struct net_device *dev, u16 cmd, void *data, int len) { struct mc32_local *lp = (struct mc32_local *)dev->priv; int ioaddr = dev->base_addr; + int ret = -1; - if(lp->exec_pending) - return -1; - - lp->exec_pending=3; - lp->exec_box->mbox=0; - lp->exec_box->mbox=cmd; - memcpy((void *)lp->exec_box->data, data, len); - barrier(); /* the memcpy forgot the volatile so be sure */ + if (down_trylock(&lp->cmd_mutex) == 0) + { + lp->cmd_nonblocking=1; + lp->exec_box->mbox=0; + lp->exec_box->mbox=cmd; + memcpy((void *)lp->exec_box->data, data, len); + barrier(); /* the memcpy forgot the volatile so be sure */ + + /* Send the command */ + mc32_ready_poll(dev); + outb(1<<6, ioaddr+HOST_CMD); - /* Send the command */ - while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR)); - outb(1<<6, ioaddr+HOST_CMD); - return 0; + ret = 0; + + /* Interrupt handler will signal mutex on completion */ + } + + return ret; } @@ -590,76 +598,47 @@ static int mc32_command_nowait(struct ne * Sends exec commands in a user context. This permits us to wait around * for the replies and also to wait for the command buffer to complete * from a previous command before we execute our command. After our - * command completes we will complete any pending multicast reload + * command completes we will attempt any pending multicast reload * we blocked off by hogging the exec buffer. * * You feed the card a command, you wait, it interrupts you get a * reply. All well and good. The complication arises because you use * commands for filter list changes which come in at bh level from things * like IPV6 group stuff. - * - * We have a simple state machine - * - * 0 - nothing issued - * - * 1 - command issued, wait reply - * - * 2 - reply waiting - reader then goes to state 0 - * - * 3 - command issued, trash reply. In which case the irq - * takes it back to state 0 - * */ static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len) { struct mc32_local *lp = (struct mc32_local *)dev->priv; int ioaddr = dev->base_addr; - unsigned long flags; int ret = 0; + down(&lp->cmd_mutex); + /* - * Wait for a command - */ - - save_flags(flags); - cli(); - - while(lp->exec_pending) - sleep_on(&lp->event); - - /* - * Issue mine + * My Turn */ - lp->exec_pending=1; - - restore_flags(flags); - + lp->cmd_nonblocking=0; lp->exec_box->mbox=0; lp->exec_box->mbox=cmd; memcpy((void *)lp->exec_box->data, data, len); barrier(); /* the memcpy forgot the volatile so be sure */ - /* Send the command */ - while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR)); - outb(1<<6, ioaddr+HOST_CMD); - - save_flags(flags); - cli(); + mc32_ready_poll(dev); + outb(1<<6, ioaddr+HOST_CMD); - while(lp->exec_pending!=2) - sleep_on(&lp->event); - lp->exec_pending=0; - restore_flags(flags); + wait_for_completion(&lp->execution_cmd); if(lp->exec_box->mbox&(1<<13)) ret = -1; + up(&lp->cmd_mutex); + /* - * A multicast set got blocked - do it now - */ - + * A multicast set got blocked - try it now + */ + if(lp->mc_reload_wait) { mc32_reset_multicast_list(dev); @@ -676,11 +655,9 @@ static int mc32_command(struct net_devic * This may be called from the interrupt state, where it is used * to restart the rx ring if the card runs out of rx buffers. * - * First, we check if it's ok to start the transceiver. We then show - * the card where to start in the rx ring and issue the - * commands to start reception and transmission. We don't wait - * around for these to complete. - */ + * We must first check if it's ok to (re)start the transceiver. See + * mc32_close for details. + */ static void mc32_start_transceiver(struct net_device *dev) { @@ -688,24 +665,20 @@ static void mc32_start_transceiver(struc int ioaddr = dev->base_addr; /* Ignore RX overflow on device closure */ - if (lp->desired_state==HALTED) + if (lp->xceiver_desired_state==HALTED) return; + /* Give the card the offset to the post-EOL-bit RX descriptor */ mc32_ready_poll(dev); - - lp->tx_box->mbox=0; lp->rx_box->mbox=0; - - /* Give the card the offset to the post-EOL-bit RX descriptor */ lp->rx_box->data[0]=lp->rx_ring[prev_rx(lp->rx_ring_tail)].p->next; - outb(HOST_CMD_START_RX, ioaddr+HOST_CMD); mc32_ready_poll(dev); + lp->tx_box->mbox=0; outb(HOST_CMD_RESTRT_TX, ioaddr+HOST_CMD); /* card ignores this on RX restart */ /* We are not interrupted on start completion */ - lp->xceiver_state=RUNNING; } @@ -725,25 +698,17 @@ static void mc32_halt_transceiver(struct { struct mc32_local *lp = (struct mc32_local *)dev->priv; int ioaddr = dev->base_addr; - unsigned long flags; mc32_ready_poll(dev); - - lp->tx_box->mbox=0; lp->rx_box->mbox=0; - outb(HOST_CMD_SUSPND_RX, ioaddr+HOST_CMD); + wait_for_completion(&lp->xceiver_cmd); + mc32_ready_poll(dev); + lp->tx_box->mbox=0; outb(HOST_CMD_SUSPND_TX, ioaddr+HOST_CMD); - - save_flags(flags); - cli(); - - while(lp->xceiver_state!=HALTED) - sleep_on(&lp->event); - - restore_flags(flags); -} + wait_for_completion(&lp->xceiver_cmd); +} /** @@ -754,7 +719,7 @@ static void mc32_halt_transceiver(struct * the point where mc32_start_transceiver() can be called. * * The card sets up the receive ring for us. We are required to use the - * ring it provides although we can change the size of the ring. + * ring it provides, although the size of the ring is configurable. * * We allocate an sk_buff for each ring entry in turn and * initalise its house-keeping info. At the same time, we read @@ -775,7 +740,7 @@ static int mc32_load_rx_ring(struct net_ rx_base=lp->rx_chain; - for(i=0;irx_ring[i].skb=alloc_skb(1532, GFP_KERNEL); skb_reserve(lp->rx_ring[i].skb, 18); @@ -812,21 +777,19 @@ static int mc32_load_rx_ring(struct net_ * * Free the buffer for each ring slot. This may be called * before mc32_load_rx_ring(), eg. on error in mc32_open(). + * Requires rx skb pointers to point to a valid skb, or NULL. */ static void mc32_flush_rx_ring(struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; - - struct sk_buff *skb; int i; for(i=0; i < RX_RING_LEN; i++) { - skb = lp->rx_ring[i].skb; - if (skb!=NULL) { - kfree_skb(skb); - skb=NULL; + if (lp->rx_ring[i].skb) { + dev_kfree_skb(lp->rx_ring[i].skb); + lp->rx_ring[i].skb = NULL; } lp->rx_ring[i].p=NULL; } @@ -858,7 +821,7 @@ static void mc32_load_tx_ring(struct net tx_base=lp->tx_box->data[0]; - for(i=0;itx_len;i++) + for(i=0 ; ibase+tx_base); lp->tx_ring[i].p=p; @@ -867,8 +830,8 @@ static void mc32_load_tx_ring(struct net tx_base=p->next; } - /* -1 so that tx_ring_head cannot "lap" tx_ring_tail, */ - /* which would be bad news for mc32_tx_ring as cur. implemented */ + /* -1 so that tx_ring_head cannot "lap" tx_ring_tail */ + /* see mc32_tx_ring */ atomic_set(&lp->tx_count, TX_RING_LEN-1); lp->tx_ring_head=lp->tx_ring_tail=0; @@ -879,45 +842,26 @@ static void mc32_load_tx_ring(struct net * mc32_flush_tx_ring - free transmit ring * @lp: Local data of 3c527 to flush the tx ring of * - * We have to consider two cases here. We want to free the pending - * buffers only. If the ring buffer head is past the start then the - * ring segment we wish to free wraps through zero. The tx ring - * house-keeping variables are then reset. + * If the ring is non-empty, zip over the it, freeing any + * allocated skb_buffs. The tx ring house-keeping variables are + * then reset. Requires rx skb pointers to point to a valid skb, + * or NULL. */ static void mc32_flush_tx_ring(struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; - - if(lp->tx_ring_tail!=lp->tx_ring_head) + int i; + + for (i=0; i < TX_RING_LEN; i++) { - int i; - if(lp->tx_ring_tail < lp->tx_ring_head) + if (lp->tx_ring[i].skb) { - for(i=lp->tx_ring_tail;itx_ring_head;i++) - { - dev_kfree_skb(lp->tx_ring[i].skb); - lp->tx_ring[i].skb=NULL; - lp->tx_ring[i].p=NULL; - } - } - else - { - for(i=lp->tx_ring_tail; itx_ring[i].skb); - lp->tx_ring[i].skb=NULL; - lp->tx_ring[i].p=NULL; - } - for(i=0; itx_ring_head; i++) - { - dev_kfree_skb(lp->tx_ring[i].skb); - lp->tx_ring[i].skb=NULL; - lp->tx_ring[i].p=NULL; - } + dev_kfree_skb(lp->tx_ring[i].skb); + lp->tx_ring[i].skb = NULL; } } - + atomic_set(&lp->tx_count, 0); lp->tx_ring_tail=lp->tx_ring_head=0; } @@ -956,6 +900,12 @@ static int mc32_open(struct net_device * regs|=HOST_CTRL_INTE; outb(regs, ioaddr+HOST_CTRL); + /* + * Allow ourselves to issue commands + */ + + up(&lp->cmd_mutex); + /* * Send the indications on command @@ -1008,7 +958,7 @@ static int mc32_open(struct net_device * return -ENOBUFS; } - lp->desired_state = RUNNING; + lp->xceiver_desired_state = RUNNING; /* And finally, set the ball rolling... */ mc32_start_transceiver(dev); @@ -1045,61 +995,64 @@ static void mc32_timeout(struct net_devi * Transmit a buffer. This normally means throwing the buffer onto * the transmit queue as the queue is quite large. If the queue is * full then we set tx_busy and return. Once the interrupt handler - * gets messages telling it to reclaim transmit queue entries we will + * gets messages telling it to reclaim transmit queue entries, we will * clear tx_busy and the kernel will start calling this again. * - * We use cli rather than spinlocks. Since I have no access to an SMP - * MCA machine I don't plan to change it. It is probably the top - * performance hit for this driver on SMP however. - */ - + * We do not disable interrupts or acquire any locks; this can + * run concurrently with mc32_tx_ring(), and the function itself + * is serialised at a higher layer. However, this makes it + * crucial that we update lp->tx_ring_head only after we've + * established a valid packet in the tx ring (and is why we mark + * tx_ring_head volatile). + * + **/ static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; - unsigned long flags; + u16 head = lp->tx_ring_head; volatile struct skb_header *p, *np; netif_stop_queue(dev); - save_flags(flags); - cli(); - - if(atomic_read(&lp->tx_count)==0) - { - restore_flags(flags); + if(atomic_read(&lp->tx_count)==0) { return 1; } + skb = skb_padto(skb, ETH_ZLEN); + + if (skb == NULL) { + netif_wake_queue(dev); + return 0; + } + atomic_dec(&lp->tx_count); /* P is the last sending/sent buffer as a pointer */ - p=lp->tx_ring[lp->tx_ring_head].p; + p=lp->tx_ring[head].p; - lp->tx_ring_head=next_tx(lp->tx_ring_head); + head = next_tx(head); /* NP is the buffer we will be loading */ - np=lp->tx_ring[lp->tx_ring_head].p; - - if (skb->len < ETH_ZLEN) { - skb = skb_padto(skb, ETH_ZLEN); - if (skb == NULL) - goto out; - } + np=lp->tx_ring[head].p; /* We will need this to flush the buffer out */ lp->tx_ring[lp->tx_ring_head].skb = skb; - np->length = (skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len; + np->length = unlikely(skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len; np->data = isa_virt_to_bus(skb->data); np->status = 0; np->control = CONTROL_EOP | CONTROL_EOL; wmb(); - p->control &= ~CONTROL_EOL; /* Clear EOL on p */ -out: - restore_flags(flags); + /* + * The new frame has been setup; we can now + * let the card and interrupt handler "see" it + */ + + p->control &= ~CONTROL_EOL; + lp->tx_ring_head= head; netif_wake_queue(dev); return 0; @@ -1180,10 +1133,11 @@ static void mc32_rx_ring(struct net_devi { struct mc32_local *lp=dev->priv; volatile struct skb_header *p; - u16 rx_ring_tail = lp->rx_ring_tail; - u16 rx_old_tail = rx_ring_tail; - + u16 rx_ring_tail; + u16 rx_old_tail; int x=0; + + rx_old_tail = rx_ring_tail = lp->rx_ring_tail; do { @@ -1273,7 +1227,12 @@ static void mc32_tx_ring(struct net_devi struct mc32_local *lp=(struct mc32_local *)dev->priv; volatile struct skb_header *np; - /* NB: lp->tx_count=TX_RING_LEN-1 so that tx_ring_head cannot "lap" tail here */ + /* + * We rely on head==tail to mean 'queue empty'. + * This is why lp->tx_count=TX_RING_LEN-1: in order to prevent + * tx_ring_head wrapping to tail and confusing a 'queue empty' + * condition with 'queue full' + */ while (lp->tx_ring_tail != lp->tx_ring_head) { @@ -1386,8 +1345,7 @@ static irqreturn_t mc32_interrupt(int ir break; case 3: /* Halt */ case 4: /* Abort */ - lp->xceiver_state |= TX_HALTED; - wake_up(&lp->event); + complete(&lp->xceiver_cmd); break; default: printk("%s: strange tx ack %d\n", dev->name, status&7); @@ -1402,8 +1360,7 @@ static irqreturn_t mc32_interrupt(int ir break; case 3: /* Halt */ case 4: /* Abort */ - lp->xceiver_state |= RX_HALTED; - wake_up(&lp->event); + complete(&lp->xceiver_cmd); break; case 6: /* Out of RX buffers stat */ @@ -1419,25 +1376,18 @@ static irqreturn_t mc32_interrupt(int ir status>>=3; if(status&1) { - - /* 0=no 1=yes 2=replied, get cmd, 3 = wait reply & dump it */ - - if(lp->exec_pending!=3) { - lp->exec_pending=2; - wake_up(&lp->event); - } - else - { - lp->exec_pending=0; - - /* A new multicast set may have been - blocked while the old one was - running. If so, do it now. */ + /* + * No thread is waiting: we need to tidy + * up ourself. + */ + if (lp->cmd_nonblocking) { + up(&lp->cmd_mutex); if (lp->mc_reload_wait) mc32_reset_multicast_list(dev); - else - wake_up(&lp->event); + } + else { + complete(&lp->execution_cmd); } } if(status&2) @@ -1491,12 +1441,12 @@ static irqreturn_t mc32_interrupt(int ir static int mc32_close(struct net_device *dev) { struct mc32_local *lp = (struct mc32_local *)dev->priv; - int ioaddr = dev->base_addr; + u8 regs; u16 one=1; - lp->desired_state = HALTED; + lp->xceiver_desired_state = HALTED; netif_stop_queue(dev); /* @@ -1509,11 +1459,10 @@ static int mc32_close(struct net_device mc32_halt_transceiver(dev); - /* Catch any waiting commands */ + /* Ensure we issue no more commands beyond this point */ + + down(&lp->cmd_mutex); - while(lp->exec_pending==1) - sleep_on(&lp->event); - /* Ok the card is now stopping */ regs=inb(ioaddr+HOST_CTRL); @@ -1540,12 +1489,9 @@ static int mc32_close(struct net_device static struct net_device_stats *mc32_get_stats(struct net_device *dev) { - struct mc32_local *lp; + struct mc32_local *lp = (struct mc32_local *)dev->priv; mc32_update_stats(dev); - - lp = (struct mc32_local *)dev->priv; - return &lp->net_stats; } diff -puN drivers/net/3c527.h~3c527-smp-update drivers/net/3c527.h --- 25/drivers/net/3c527.h~3c527-smp-update 2003-10-18 17:57:27.000000000 -0700 +++ 25-akpm/drivers/net/3c527.h 2003-10-18 17:57:27.000000000 -0700 @@ -27,10 +27,8 @@ #define HOST_RAMPAGE 8 -#define RX_HALTED (1<<0) -#define TX_HALTED (1<<1) -#define HALTED (RX_HALTED | TX_HALTED) -#define RUNNING 0 +#define HALTED 0 +#define RUNNING 1 struct mc32_mailbox { diff -puN drivers/net/Kconfig~3c527-smp-update drivers/net/Kconfig --- 25/drivers/net/Kconfig~3c527-smp-update 2003-10-18 17:58:21.000000000 -0700 +++ 25-akpm/drivers/net/Kconfig 2003-10-18 18:02:53.000000000 -0700 @@ -657,7 +657,7 @@ config ELMC config ELMC_II tristate "3c527 \"EtherLink/MC 32\" support (EXPERIMENTAL)" - depends on NET_VENDOR_3COM && MCA && EXPERIMENTAL && BROKEN_ON_SMP + depends on NET_VENDOR_3COM && MCA && MCA_LEGACY help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from _ From davem@pizda.ninka.net Mon Oct 20 22:38:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 22:38:41 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L5bu25030156 for ; Mon, 20 Oct 2003 22:38:01 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA13210; Mon, 20 Oct 2003 22:32:37 -0700 Date: Mon, 20 Oct 2003 22:32:37 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: noah@caltech.edu, acme@conectiva.com.br, rddunlap@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] Make LLC2 compile with PROC_FS=n Message-Id: <20031020223237.31854ab5.davem@redhat.com> In-Reply-To: <20031020101607.76e02647.shemminger@osdl.org> References: <20031020101607.76e02647.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 965 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: 306 Lines: 11 On Mon, 20 Oct 2003 10:16:07 -0700 Stephen Hemminger wrote: > Why make up a whole separate llc_proc.h file for two prototypes? > Put them on the end of llc.h I definitely prefer this version of the fix. Since Arnaldo appears to be busy, I'll apply this. Thanks Noah and Stephen. From davem@pizda.ninka.net Mon Oct 20 23:02:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 20 Oct 2003 23:03:04 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L62V25030713 for ; Mon, 20 Oct 2003 23:02:32 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA13295; Mon, 20 Oct 2003 22:57:17 -0700 Date: Mon, 20 Oct 2003 22:57:17 -0700 From: "David S. Miller" To: Dan Aloni Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH 2.6] repost, fix sysctl breakage during network device renaming, for ipv4 Message-Id: <20031020225717.5619e9bf.davem@redhat.com> In-Reply-To: <20031018112011.GA16613@callisto.yi.org> References: <20030901164624.GA26886@callisto.yi.org> <20030901094127.6a0f6878.davem@redhat.com> <20030901165559.GA27099@callisto.yi.org> <20030901113143.1ba34464.davem@redhat.com> <20031017213235.GA5278@callisto.yi.org> <20031018000131.52a13c98.davem@redhat.com> <20031018112011.GA16613@callisto.yi.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 966 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: 470 Lines: 16 On Sat, 18 Oct 2003 13:20:11 +0200 Dan Aloni wrote: > On Sat, Oct 18, 2003 at 12:01:31AM -0700, David S. Miller wrote: > > On Fri, 17 Oct 2003 23:32:35 +0200 > > Dan Aloni wrote: > > > > > Here is the patch. I've compiled and tested it. > > > > But not with ipv6 modular :-) Please add the necessary > > module symbol export for net_sysctl_strdup() and resubmit > > the patch. > > Of course, what was I thinking. Applied, thanks Dan. From lists@mdiehl.de Tue Oct 21 00:17:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 00:18:22 -0700 (PDT) Received: from bart.webpack.hosteurope.de (bart.one-2-one.net [217.115.142.76]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L7Hh25001346 for ; Tue, 21 Oct 2003 00:17:44 -0700 Received: from notebook.home.mdiehl.de (pD9E94909.dip0.t-ipconnect.de [217.233.73.9]) (authenticated) by bart.webpack.hosteurope.de (8.11.6/8.11.6) with ESMTP id h9L7AoU19646; Tue, 21 Oct 2003 09:10:50 +0200 Received: from notebook.home.mdiehl.de (localhost.localdomain [127.0.0.1]) by notebook.home.mdiehl.de (8.12.1/8.12.1) with ESMTP id h9L7Ct1m003516; Tue, 21 Oct 2003 09:12:55 +0200 Received: from localhost (martin@localhost) by notebook.home.mdiehl.de (8.12.1/8.12.1/Submit) with ESMTP id h9L7CsRs003513; Tue, 21 Oct 2003 09:12:55 +0200 X-Authentication-Warning: notebook.home.mdiehl.de: martin owned process doing -bs Date: Tue, 21 Oct 2003 09:12:53 +0200 (CEST) From: Martin Diehl X-X-Sender: martin@notebook.home.mdiehl.de To: "David S. Miller" cc: Martin Diehl , , , , Subject: Re: [irda-users] [PATCH] Make VLSI FIR depend on X86 In-Reply-To: <20031020211706.5be33474.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 967 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lists@mdiehl.de Precedence: bulk X-list: netdev Content-Length: 955 Lines: 27 On Mon, 20 Oct 2003, David S. Miller wrote: > On Mon, 20 Oct 2003 19:30:33 +0200 (CEST) > Martin Diehl wrote: > > > Well, it would work with any arch, _if_ there was a way to sync the > > streaming pci dma buffers before giving them back to hardware. > > If pci_dma_sync() doesn't perform the operation you want, please > describe what that operation is. > Last time I checked pci_dma_sync was meant to sync the mapping when ownership gets transferred from busmaster to cpu, i.e. after hardware used/modified the buffer. What about the other direction when the cpu filled a reused streaming map to device and wants to pass ownership to the busmaster - we need to flush cpu caches to make sure the busmaster sees the modified data. Did I miss something? Thanks, Martin From davem@pizda.ninka.net Tue Oct 21 00:17:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 00:18:30 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L7Hu25001358 for ; Tue, 21 Oct 2003 00:17:56 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA13435; Tue, 21 Oct 2003 00:12:41 -0700 Date: Tue, 21 Oct 2003 00:12:41 -0700 From: "David S. Miller" To: Martin Diehl Cc: lists@mdiehl.de, noah@caltech.edu, irda-users@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [irda-users] [PATCH] Make VLSI FIR depend on X86 Message-Id: <20031021001241.390a16df.davem@redhat.com> In-Reply-To: References: <20031020211706.5be33474.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 968 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: 1008 Lines: 24 On Tue, 21 Oct 2003 09:12:53 +0200 (CEST) Martin Diehl wrote: > Last time I checked pci_dma_sync was meant to sync the mapping when > ownership gets transferred from busmaster to cpu, i.e. after hardware > used/modified the buffer. What about the other direction when the cpu > filled a reused streaming map to device and wants to pass ownership to the > busmaster - we need to flush cpu caches to make sure the busmaster sees > the modified data. That's absolutely correct. Several times I've noted that this is a BUG in the API, that there is no way to sync the other way, someone just has to add the interface hooks then all the platform maintainers will implement it. Here, do this, add a new interface called pci_dma_sync_to_device() with the appropriate args. Add a NOP implementation to asm-i386/pci.h and suitable documentation changes to Documentation/DMA-mapping.txt When you send me that patch, I'll work with the platform maintainers to take care of the rest. Deal? From lists@mdiehl.de Tue Oct 21 00:36:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 00:36:40 -0700 (PDT) Received: from bart.webpack.hosteurope.de (bart.one-2-one.net [217.115.142.76]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L7a625004855 for ; Tue, 21 Oct 2003 00:36:06 -0700 Received: from notebook.home.mdiehl.de (pD9E94909.dip0.t-ipconnect.de [217.233.73.9]) (authenticated) by bart.webpack.hosteurope.de (8.11.6/8.11.6) with ESMTP id h9L7VKt24116; Tue, 21 Oct 2003 09:31:20 +0200 Received: from notebook.home.mdiehl.de (localhost.localdomain [127.0.0.1]) by notebook.home.mdiehl.de (8.12.1/8.12.1) with ESMTP id h9L7XP1m003596; Tue, 21 Oct 2003 09:33:25 +0200 Received: from localhost (martin@localhost) by notebook.home.mdiehl.de (8.12.1/8.12.1/Submit) with ESMTP id h9L7XOW9003593; Tue, 21 Oct 2003 09:33:24 +0200 X-Authentication-Warning: notebook.home.mdiehl.de: martin owned process doing -bs Date: Tue, 21 Oct 2003 09:33:24 +0200 (CEST) From: Martin Diehl X-X-Sender: martin@notebook.home.mdiehl.de To: "David S. Miller" cc: Martin Diehl , , , , Subject: Re: [irda-users] [PATCH] Make VLSI FIR depend on X86 In-Reply-To: <20031021001241.390a16df.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 969 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lists@mdiehl.de Precedence: bulk X-list: netdev Content-Length: 593 Lines: 19 On Tue, 21 Oct 2003, David S. Miller wrote: > Here, do this, add a new interface called pci_dma_sync_to_device() > with the appropriate args. Add a NOP implementation to asm-i386/pci.h > and suitable documentation changes to Documentation/DMA-mapping.txt > > When you send me that patch, I'll work with the platform maintainers > to take care of the rest. > > Deal? Ok, Thanks. Will do it. One more question: Shouldn't the i386 implementation instead of being NOP just call flush_write_buffers() - at least this is what the vlsi-private implementation is doing at the moment? Martin From rnp@paradise.net.nz Tue Oct 21 00:48:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 00:49:14 -0700 (PDT) Received: from linda-1.paradise.net.nz (bm-1a.paradise.net.nz [202.0.58.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L7mc25005295 for ; Tue, 21 Oct 2003 00:48:39 -0700 Received: from smtp-2.paradise.net.nz (smtp-2a.paradise.net.nz [202.0.32.195]) by linda-1.paradise.net.nz (Paradise.net.nz) with ESMTP id <0HN300EK7KD1FI@linda-1.paradise.net.nz> for netdev@oss.sgi.com; Tue, 21 Oct 2003 20:48:37 +1300 (NZDT) Received: from ps2.local (203-79-92-141.cable.paradise.net.nz [203.79.92.141]) by smtp-2.paradise.net.nz (Postfix) with SMTP id F0E9F9E26B for ; Tue, 21 Oct 2003 20:48:25 +1300 (NZDT) Received: (qmail 755 invoked by uid 501); Tue, 21 Oct 2003 07:48:25 +0000 Date: Tue, 21 Oct 2003 20:48:25 +1300 (NZDT) From: Richard Procter Subject: Re: [PATCH] SMP support on 3c527 net driver for 2.6 In-reply-to: <20031020214927.11cd9d62.akpm@osdl.org> X-Sender: rix@ps2.local. To: Andrew Morton Cc: jgarzik@pobox.com, felipewd@terra.com.br, netdev@oss.sgi.com, linux-net@vger.kernel.org Message-id: Content-id: MIME-version: 1.0 Content-type: MULTIPART/MIXED; BOUNDARY="-1463810815-146488508-1066722352=:588" X-archive-position: 970 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rnp@paradise.net.nz Precedence: bulk X-list: netdev Content-Length: 23964 Lines: 418 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463810815-146488508-1066722352=:588 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: On Mon, 20 Oct 2003, Andrew Morton wrote: > Richard Procter wrote: > > > > Patch attached. > > Not a very good one :( Gar. I think I see what's happened. Two patches were submitted to the list against the same base, my own and Felipe's. I think Jeff applied Felipe's patch, while you applied mine. I've attached two patches to sort this out. The first, "jeff-to-andrew", is against the results of Felipe's patch, and should bring the two of you into synch. The second, "race", is against what Andrew has, incorporates both my own and Felipe's updates, and should apply cleanly for the both of you after Jeff applies the above. Whew. Sorry for the extra trouble. thanks, Richard. ---1463810815-146488508-1066722352=:588 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="3c527.c.race.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME="3c527.c.race.patch" LS0tIGxpbnV4LTIuNi4wLXRlc3Q4L2RyaXZlcnMvbmV0LzNjNTI3LmFuZHJl dy5jCTIwMDMtMTAtMjEgMTg6Mjk6NTEuMDAwMDAwMDAwICsxMzAwDQorKys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CXsNCg== ---1463810815-146488508-1066722352=:588 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="3c527.c.jeff-to-andrew.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME="3c527.c.jeff-to-andrew.patch" LS0tIGxpbnV4LTIuNi4wLXRlc3Q4L2RyaXZlcnMvbmV0LzNjNTI3LmZlbGlw ZS5jCTIwMDMtMTAtMjAgMjA6Mjc6MjIuMDAwMDAwMDAwICsxMzAwDQorKysg bGludXgtMi42LjAtdGVzdDgvZHJpdmVycy9uZXQvM2M1MjcuYwkyMDAzLTEw LTIxIDE4OjI5OjUxLjAwMDAwMDAwMCArMTMwMA0KQEAgLTE5LDcgKzE5LDcg QEANCiANCiAjZGVmaW5lIERSVl9OQU1FCQkiM2M1MjciDQogI2RlZmluZSBE UlZfVkVSU0lPTgkJIjAuNy1TTVAiDQotI2RlZmluZSBEUlZfUkVMREFURQkJ IjIwMDMvMTAvMDYiDQorI2RlZmluZSBEUlZfUkVMREFURQkJIjIwMDMvMDkv MTciDQogDQogc3RhdGljIGNvbnN0IGNoYXIgKnZlcnNpb24gPQ0KIERSVl9O QU1FICIuYzp2IiBEUlZfVkVSU0lPTiAiICIgRFJWX1JFTERBVEUgIiBSaWNo YXJkIFByb2N0ZXIgPHJucEBwYXJhZGlzZS5uZXQubno+XG4iOw0KQEAgLTE0 NCwxOSArMTQ0LDE3IEBAIHN0YXRpYyB1bnNpZ25lZCBpbnQgbWMzMl9kZWJ1 ZyA9IE5FVF9ERUINCiBzdGF0aWMgY29uc3QgaW50IFdPUktBUk9VTkRfODI1 ODY9MTsNCiANCiAvKiBQb2ludGVycyB0byBidWZmZXJzIGFuZCB0aGVpciBv bi1jYXJkIHJlY29yZHMgKi8NCi0NCiBzdHJ1Y3QgbWMzMl9yaW5nX2Rlc2Mg DQogew0KIAl2b2xhdGlsZSBzdHJ1Y3Qgc2tiX2hlYWRlciAqcDsgICAgICAg ICAgICAg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tYW5kcyBiZXlv bmQgdGhpcyBwb2ludCAqLw0KKw0KIAlkb3duKCZscC0+Y21kX211dGV4KTsN CiAJDQogCS8qIE9rIHRoZSBjYXJkIGlzIG5vdyBzdG9wcGluZyAqLwkNCkBA IC0xNDg3LDEwICsxNDg5LDkgQEAgc3RhdGljIGludCBtYzMyX2Nsb3NlKHN0 cnVjdCBuZXRfZGV2aWNlIA0KIA0KIHN0YXRpYyBzdHJ1Y3QgbmV0X2Rldmlj ZV9zdGF0cyAqbWMzMl9nZXRfc3RhdHMoc3RydWN0IG5ldF9kZXZpY2UgKmRl dikNCiB7DQotCXN0cnVjdCBtYzMyX2xvY2FsICpscCA9IChzdHJ1Y3QgbWMz Ml9sb2NhbCAqKWRldi0+cHJpdjs7DQorCXN0cnVjdCBtYzMyX2xvY2FsICps cCA9IChzdHJ1Y3QgbWMzMl9sb2NhbCAqKWRldi0+cHJpdjsNCiAJDQogCW1j MzJfdXBkYXRlX3N0YXRzKGRldik7IA0KLQ0KIAlyZXR1cm4gJmxwLT5uZXRf c3RhdHM7DQogfQ0KIA0K ---1463810815-146488508-1066722352=:588-- From davem@pizda.ninka.net Tue Oct 21 01:18:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 01:19:10 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L8IZ25006528 for ; Tue, 21 Oct 2003 01:18:35 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA13592; Tue, 21 Oct 2003 01:13:20 -0700 Date: Tue, 21 Oct 2003 01:13:20 -0700 From: "David S. Miller" To: Martin Diehl Cc: lists@mdiehl.de, noah@caltech.edu, irda-users@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [irda-users] [PATCH] Make VLSI FIR depend on X86 Message-Id: <20031021011320.3fa6888f.davem@redhat.com> In-Reply-To: References: <20031021001241.390a16df.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 971 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: 299 Lines: 8 On Tue, 21 Oct 2003 09:33:24 +0200 (CEST) Martin Diehl wrote: > One more question: Shouldn't the i386 implementation instead of being NOP > just call flush_write_buffers() - at least this is what the vlsi-private > implementation is doing at the moment? That seems right, yes. From pupilla@hotmail.com Tue Oct 21 01:54:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 01:55:20 -0700 (PDT) Received: from hotmail.com (sea2-dav56.sea2.hotmail.com [207.68.164.191]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9L8sj25007454 for ; Tue, 21 Oct 2003 01:54:45 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 21 Oct 2003 01:54:36 -0700 Received: from 80.204.235.254 by sea2-dav56.sea2.hotmail.com with DAV; Tue, 21 Oct 2003 08:54:36 +0000 X-Originating-IP: [80.204.235.254] X-Originating-Email: [pupilla@hotmail.com] From: "Marco Berizzi" To: "Donald Becker" Cc: References: Subject: Re: 3C905 + options=0x8 Date: Tue, 21 Oct 2003 10:54:31 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1123 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1123 Message-ID: X-OriginalArrivalTime: 21 Oct 2003 08:54:36.0402 (UTC) FILETIME=[F43A8520:01C397B0] X-archive-position: 972 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pupilla@hotmail.com Precedence: bulk X-list: netdev Content-Length: 17345 Lines: 386 Donald Becker wrote: > Baseline: what do you expect this option setting to do when used with > the 3c905_ (no suffix)? As you wrote: "...just to make sure..." ;-)) > Note that the 3c905 has an external MII transceiver (trasceiver type 6), > while the 3c905B and 3c905C have on-chip transceivers (transceiver type 8). FYI: With a 3c905: modprobe 3c59x options=0x8 rmmod 3c59x modprobe 3c59x options=0x6 doesn't work anyway until I reboot the linux box. > You should not set driver options unless you have a non-standard > configuration. Setting driver options "just to make sure" is a common > source of problems. Ok. > I suspect that just removing the module options will restore correct > operation. Yes it work when I remove the module options. modprobe 3c59x options=0x6,0x6,0x8 (the linux box contains 3 NICs, two 3C905 and one 3C905B) sometimes I get this error when I switch the eth0 cable from a 10MBit/s HUB to a cross cable (to connect directly to another system 100MBit/s FD): Output from mii-diag: mii-diag.c:v2.09 9/06/2003 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Using the new SIOCGMIIPHY value on PHY 24 (BMCR 0x3100). The autonegotiated capability is 01e0. The autonegotiated media type is 100baseTx-FD. Basic mode control register 0x3100: Auto-negotiation enabled. Basic mode status register 0x786f ... 786f. Link status: established. This transceiver is capable of 100baseTx-FD 100baseTx 10baseT-FD 10baseT. Able to perform Auto-negotiation, negotiation complete. *** Link Jabber! *** Your link partner advertised 45e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT, w/ 802.3X flow control. End of basic transceiver information. MII PHY #24 transceiver registers: 3100 786f 2000 5c01 01e1 45e1 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 8060 8020 0cb8 0000 1800 a3b9 005e 1f05 001d Output from dmesg: 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a eth0: Resetting the Tx ring pointer. eth0: Transmit error, Tx status register 90. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 06f5b280 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a NETDEV WATCHDOG: eth0: transmit timed out eth0: transmit timed out, tx_status 00 status e000. diagnostics: net 0cc0 media 8802 dma 00000020. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 00000000 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a eth0: Resetting the Tx ring pointer. eth0: Transmit error, Tx status register 90. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 06f5b280 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a NETDEV WATCHDOG: eth0: transmit timed out eth0: transmit timed out, tx_status 00 status e000. diagnostics: net 0cc0 media 8802 dma 00000020. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 00000000 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a eth0: Resetting the Tx ring pointer. eth0: Transmit error, Tx status register 90. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 06f5b280 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a NETDEV WATCHDOG: eth0: transmit timed out eth0: transmit timed out, tx_status 00 status e000. diagnostics: net 0cc0 media 8802 dma 00000020. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 00000000 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a eth0: Resetting the Tx ring pointer. eth0: Transmit error, Tx status register 90. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 06f5b280 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a NETDEV WATCHDOG: eth0: transmit timed out eth0: transmit timed out, tx_status 00 status e000. diagnostics: net 0cc0 media 8802 dma 00000020. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 00000000 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a eth0: Resetting the Tx ring pointer. eth0: Transmit error, Tx status register 90. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 06f5b280 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a NETDEV WATCHDOG: eth0: transmit timed out eth0: transmit timed out, tx_status 00 status e000. diagnostics: net 0cc0 media 8802 dma 00000020. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 00000000 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a eth0: Resetting the Tx ring pointer. eth0: Transmit error, Tx status register 90. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 06f5b280 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a NETDEV WATCHDOG: eth0: transmit timed out eth0: transmit timed out, tx_status 00 status e000. diagnostics: net 0cc0 media 8802 dma 00000020. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 00000000 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a eth0: Resetting the Tx ring pointer. eth0: Transmit error, Tx status register 90. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 06f5b280 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a NETDEV WATCHDOG: eth0: transmit timed out eth0: transmit timed out, tx_status 00 status e000. diagnostics: net 0cc0 media 8802 dma 00000020. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 00000000 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a eth0: Resetting the Tx ring pointer. eth0: Transmit error, Tx status register 90. Flags; bus-master 1, dirty 1(1) current 17(1) Transmit list 06f5b280 vs. c6f5b240. 0: @c6f5b200 length 8000002a status 8000002a 1: @c6f5b240 length 8000002a status 0000002a 2: @c6f5b280 length 8000002a status 0000002a 3: @c6f5b2c0 length 8000002a status 0000002a 4: @c6f5b300 length 8000002a status 0000002a 5: @c6f5b340 length 8000002a status 0000002a 6: @c6f5b380 length 8000002a status 0000002a 7: @c6f5b3c0 length 8000002a status 0000002a 8: @c6f5b400 length 8000002a status 0000002a 9: @c6f5b440 length 8000002a status 0000002a 10: @c6f5b480 length 8000002a status 0000002a 11: @c6f5b4c0 length 8000002a status 0000002a 12: @c6f5b500 length 8000002a status 0000002a 13: @c6f5b540 length 8000002a status 0000002a 14: @c6f5b580 length 8000002a status 0000002a 15: @c6f5b5c0 length 8000002a status 8000002a eth0: Host error, FIFO diagnostic register 2000. eth0: PCI bus error, bus status 00a00021 eth0: Media override to transceiver 6 (MII). eth0: Host error, FIFO diagnostic register 2000. eth0: PCI bus error, bus status 00000000 eth0: Media override to transceiver 6 (MII). eth0: Host error, FIFO diagnostic register 2000. eth0: PCI bus error, bus status 00000000 eth0: Media override to transceiver 6 (MII). eth1: Host error, FIFO diagnostic register 2000. eth1: PCI bus error, bus status 00000020 eth1: Media override to transceiver 6 (MII). eth1: Host error, FIFO diagnostic register 2000. eth1: PCI bus error, bus status 00000000 eth1: Media override to transceiver 6 (MII). From noah@caltech.edu Tue Oct 21 04:13:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 04:13:53 -0700 (PDT) Received: from water-ox.its.caltech.edu (SteeleMR-loadb-NAT-49.caltech.edu [131.215.49.69]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9LBDC25012206 for ; Tue, 21 Oct 2003 04:13:13 -0700 Received: from water-dog (water-dog [192.168.1.26]) by water-ox-postvirus (Postfix) with ESMTP id 7541926AC0E; Tue, 21 Oct 2003 04:13:07 -0700 (PDT) Received: from water-ox ([192.168.1.10]) by water-dog (MailMonitor for SMTP v1.2.2 ) ; Tue, 21 Oct 2003 04:13:06 -0700 (PDT) Received: from clyde.its.caltech.edu (clyde.its.caltech.edu [131.215.48.174]) by water-ox.its.caltech.edu (Postfix) with ESMTP id 16DAA26AC0E; Tue, 21 Oct 2003 04:13:06 -0700 (PDT) Received: from localhost (noah@localhost) by clyde.its.caltech.edu (8.12.9/8.12.8) with ESMTP id h9LBD5Aq026831; Tue, 21 Oct 2003 04:13:05 -0700 (PDT) X-Authentication-Warning: clyde.its.caltech.edu: noah owned process doing -bs Date: Tue, 21 Oct 2003 04:13:05 -0700 (PDT) From: "Noah J. Misch" X-X-Sender: noah@clyde To: Stephen Hemminger , "David S. Miller" Cc: acme@conectiva.com.br, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] Make LLC2 compile with PROC_FS=n In-Reply-To: <20031020223237.31854ab5.davem@redhat.com> Message-ID: References: <20031020101607.76e02647.shemminger@osdl.org> <20031020223237.31854ab5.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 973 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: noah@caltech.edu Precedence: bulk X-list: netdev Content-Length: 386 Lines: 16 On Mon, 20 Oct 2003, David S. Miller wrote: > On Mon, 20 Oct 2003 10:16:07 -0700 > Stephen Hemminger wrote: > > > Why make up a whole separate llc_proc.h file for two prototypes? > > Put them on the end of llc.h > > I definitely prefer this version of the fix. I agree completely. Thanks, Stephen. > Since Arnaldo appears to be busy, I'll apply this. Great. From hirofumi@mail.parknet.co.jp Tue Oct 21 06:35:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 06:36:09 -0700 (PDT) Received: from mail.parknet.co.jp (mail.parknet.co.jp [210.171.160.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9LDZW25021905 for ; Tue, 21 Oct 2003 06:35:34 -0700 Received: from ibmpc.myhome.or.jp [210.171.161.166] by mail.parknet.co.jp with ESMTP (SMTPD32-4.10) id A6A918AD0130; Tue, 21 Oct 2003 22:33:29 +0900 Received: from devron.myhome.or.jp (root@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.12.9/8.12.9/Debian-5) with ESMTP id h9LDZJXB007036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 21 Oct 2003 22:35:21 +0900 Received: from devron.myhome.or.jp (hirofumi@localhost [127.0.0.1]) by devron.myhome.or.jp (8.12.9/8.12.9/Debian-5) with ESMTP id h9LDZJ8o002316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 21 Oct 2003 22:35:19 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.12.9/8.12.9/Debian-5) id h9LDZCj8002313; Tue, 21 Oct 2003 22:35:12 +0900 To: Stephen Hemminger Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [RFT] merged 8139too NAPI References: <3F9070B6.9090306@pobox.com> <873cdqbt6z.fsf@devron.myhome.or.jp> <20031020131106.6862e951.shemminger@osdl.org> From: OGAWA Hirofumi Date: Tue, 21 Oct 2003 22:35:11 +0900 In-Reply-To: <20031020131106.6862e951.shemminger@osdl.org> Message-ID: <877k2ysohc.fsf@devron.myhome.or.jp> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 974 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hirofumi@mail.parknet.co.jp Precedence: bulk X-list: netdev Content-Length: 924 Lines: 28 Stephen Hemminger writes: > + spin_lock_bh(&tp->rx_lock); > /* disable Tx ASAP, if not already */ > tmp8 = RTL_R8 (ChipCmd); > if (tmp8 & CmdTxEnb) > @@ -1679,6 +1682,7 @@ > > /* ...and finally, reset everything */ > rtl8139_hw_start (dev); > + spin_unlock_bh(&tp->rx_lock); ->tx_timeout is on timer softirq context. So softirq was disabled already. Or Is this for future changes? > + /* Check uncommon events with one test. */ > + if (unlikely(status & (PCIErr | PCSTimeout | RxUnderrun | RxOverflow))) > + rtl8139_weird_interrupt (dev, tp, ioaddr, > + status, link_changed); I couldn't find this on previous email, rtl8139_weird_interrupt was changing. if (unlikely(status & (PCIErr|PCSTimeout|RxUnderrun|RxErr|RxFIFOOver))) rtl8139_weird_interrupt(dev, tp, ioaddr, status, link_changed); It should check the above status. -- OGAWA Hirofumi From maxk@qualcomm.com Tue Oct 21 08:56:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 08:56:41 -0700 (PDT) Received: from numenor.qualcomm.com (numenor.qualcomm.com [129.46.51.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9LFu525027310 for ; Tue, 21 Oct 2003 08:56:06 -0700 Received: from magus.qualcomm.com (magus.qualcomm.com [129.46.61.148]) by numenor.qualcomm.com (8.12.10/8.12.5/1.0) with ESMTP id h9LFtvVY003928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 21 Oct 2003 08:55:58 -0700 (PDT) Received: from MAXK.qualcomm.com (maxk.qualcomm.com [129.46.88.152]) by magus.qualcomm.com (8.12.10/8.12.5/1.0) with ESMTP id h9LFttFB024527; Tue, 21 Oct 2003 08:55:55 -0700 (PDT) Message-Id: <5.1.0.14.2.20031021085410.05203418@unixmail.qualcomm.com> X-Sender: maxk@unixmail.qualcomm.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 21 Oct 2003 08:55:54 -0700 To: Stephen Hemminger From: Max Krasnyansky Subject: Re: [PATCH] tun driver use private linked list. Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20031009125929.6f2d99f9.shemminger@osdl.org> References: <5.1.0.14.2.20031009110604.05a541b0@unixmail.qualcomm.com> <5.1.0.14.2.20030812092213.08dc6ea0@unixmail.qualcomm.com> <20030808113404.0e9e1e6d.shemminger@osdl.org> <200308051630.28552.bellucda@tiscali.it> <20030805090647.691daa7e.shemminger@osdl.org> <200308051910.55823.bellucda@tiscali.it> <20030807154524.4794ad45.shemminger@osdl.org> <20030807155901.49f1a424.davem@redhat.com> <20030808113404.0e9e1e6d.shemminger@osdl.org> <5.1.0.14.2.20030812092213.08dc6ea0@unixmail.qualcomm.com> <5.1.0.14.2.20031009110604.05a541b0@unixmail.qualcomm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-archive-position: 975 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: maxk@qualcomm.com Precedence: bulk X-list: netdev Content-Length: 1104 Lines: 20 At 12:59 PM 10/9/2003, Stephen Hemminger wrote: >On Thu, 09 Oct 2003 11:45:31 -0700 >Max Krasnyansky wrote: > >> Actually in case of persistent devices we can not let the module go away. Because it has >> important info like user id of the owner and stuff which is not stored anywhere else. >> It also provides device name reservation, UML folks use it for example to reserve certain >> devices to a certain users. If module goes away admin will have to recreate those devices >> again. TUN/TAP devices are created in ioctl and since vfs layer already holds a reference, >> like you said, it's safe for us to just do __module_get()/module_put(). > >I think letting the admin do what he requests is the right thing. The philosophy of >module unload has changed: with 2.4 it was "don't let admin unload the network >element if anything is using it"; now it is "let the admin unload any module >and cleanup as necessary". Yeah, I don't necessarily agree with that :). But I guess you can argue that only admin can unload the module. And he probably knows what he's doing. Max From linux-netdev@gmane.org Tue Oct 21 09:38:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 09:38:44 -0700 (PDT) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9LGc625028161 for ; Tue, 21 Oct 2003 09:38:08 -0700 Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AB4k5-000194-00 for ; Sun, 19 Oct 2003 06:00:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: netdev@oss.sgi.com Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AB3Wx-0000f0-00 for ; Sun, 19 Oct 2003 04:42:55 +0200 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AB3Wx-0001BD-00 for ; Sun, 19 Oct 2003 04:42:55 +0200 From: Marcelo Abreu Subject: Re: [PATCH][2.6] fix compilation w/o CONFIG_XFRM Date: Sat, 18 Oct 2003 23:42:51 -0300 Message-ID: <3F91FA2B.5050701@terra.com.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org Cc: davem@redhat.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030915 X-Accept-Language: pt-br, en-us, en In-Reply-To: X-archive-position: 976 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: skewer@terra.com.br Precedence: bulk X-list: netdev Content-Length: 688 Lines: 23 In case it's not fixed yet... I'm just reusing the patch from Zwane Mwaikambo for sit.c, now to fix compilation of ip6_tunnel.c. Please verify. --- linux-2.6.0-test8-a/net/ipv6/ip6_tunnel.c 2003-10-18 23:16:42.000000000 -0300 +++ linux-2.6.0-test8-b/net/ipv6/ip6_tunnel.c 2003-10-18 23:17:03.000000000 -0300 @@ -515,8 +515,10 @@ read_unlock(&ip6ip6_lock); goto discard; } +#ifdef CONFIG_XFRM secpath_put(skb->sp); skb->sp = NULL; +#endif skb->mac.raw = skb->nh.raw; skb->nh.raw = skb->data; skb->protocol = htons(ETH_P_IPV6); From maxk@qualcomm.com Tue Oct 21 09:39:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 09:40:11 -0700 (PDT) Received: from ithilien.qualcomm.com (ithilien.qualcomm.com [129.46.51.59]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9LGdb25028351 for ; Tue, 21 Oct 2003 09:39:38 -0700 Received: from sabrina.qualcomm.com (sabrina.qualcomm.com [129.46.61.150]) by ithilien.qualcomm.com (8.12.10/8.12.5/1.0) with ESMTP id h9LGdZ4t007290; Tue, 21 Oct 2003 09:39:36 -0700 (PDT) Received: from MAXK.qualcomm.com (maxk.qualcomm.com [129.46.88.152]) by sabrina.qualcomm.com (8.12.10/8.12.5/1.0) with ESMTP id h9LGdX0O012123; Tue, 21 Oct 2003 09:39:34 -0700 (PDT) Message-Id: <5.1.0.14.2.20031021090148.05451c60@unixmail.qualcomm.com> X-Sender: maxk@unixmail.qualcomm.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 21 Oct 2003 09:39:32 -0700 To: davem@redhat.com From: Max Krasnyansky Subject: [BK] TUN driver updates and fixes for 2.6 Cc: netdev@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-archive-position: 977 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: maxk@qualcomm.com Precedence: bulk X-list: netdev Content-Length: 943 Lines: 38 Dave, Please pull from bk://linux-bt.bkbits.net/tun-2.5 This will update the following files: drivers/net/tun.c | 99 ++++++++++++++++++++++++------------------------- include/linux/if_tun.h | 8 +-- 2 files changed, 53 insertions(+), 54 deletions(-) through these ChangeSets: (03/10/21 1.1348) [TUN] TUN/TAP driver updates and fixes. - Cleanup debug macros. Replaced DBG() with TUN_DBG() to avoid conflicts. - Autodetect IP version and set protocol accordingly. - Use set_current_state() instead of accessing current->state directly. - Optimized net device registration. Do not call dev_get_by_name() unless name has '%' character in it. This avoids extra scan of the net device list. - Return error code returned by misc_register() (instead of EIO) in case of failure. Thanks Max http://bluez.sf.net http://vacum.sf.net http://vtun.sf.net From benjamin@uow.edu.au Tue Oct 21 20:55:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 21 Oct 2003 20:55:57 -0700 (PDT) Received: from beru.its.uow.edu.au (beru.its.uow.edu.au [130.130.68.31]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9M3sw25013924 for ; Tue, 21 Oct 2003 20:55:19 -0700 Received: from beru (localhost [127.0.0.1]) by beru.its.uow.edu.au (8.12.9/8.12.9) with ESMTP id h9M3ssWW000103 for ; Wed, 22 Oct 2003 13:54:54 +1000 (EST) Received: from chac.its.uow.edu.au ([130.130.37.3]) by beru.its.uow.edu.au (MailMonitor for SMTP v1.2.2 ) ; Wed, 22 Oct 2003 13:54:54 +1000 (EST) Received: (from sendmail@localhost) by chac.its.uow.edu.au (8.12.9/8.12.9) id h9M3sriL010572 for ; Wed, 22 Oct 2003 13:54:53 +1000 (EST) Received: from mirapoint.uow.edu.au (mirapoint.uow.edu.au[130.130.68.27]) by chac.its.uow.edu.au (UWSMTPD 1.5.0) with ESMTP id 1441675.10562; Wednesday, 22 October 2003 13:54:51 +1000 Received: from mirapoint.uow.edu.au (localhost.uow.edu.au [127.0.0.1]) by mirapoint.uow.edu.au (Mirapoint Messaging Server MOS 3.3.7-GR) with ESMTP id ADH25407; Wed, 22 Oct 2003 13:54:49 +1000 (EST) Received: from 150.101.126.196 by mirapoint.uow.edu.au (Mirapoint Messaging Server MOS 3.3.7-GR) with HTTPS/1.1; Wed, 22 Oct 2003 13:54:49 +1000 Date: Wed, 22 Oct 2003 13:54:49 +1000 From: Benjamin Low Subject: PROBLEM: kernel BUG at dev.c:998! - panic w/ uml/bridge and Intel 82562 (e100) To: netdev@oss.sgi.com X-Mailer: Webmail Mirapoint Direct 3.3.7-GR MIME-Version: 1.0 Message-Id: <8a2645d5.d697cfd3.857ad00@mirapoint.uow.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-MessageID: 1441675.10562 X-EnvelopeFrom: 1441675.10562 X-EnvelopeTo: 1441675.10562 X-archive-position: 978 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: benjamin@uow.edu.au Precedence: bulk X-list: netdev Content-Length: 4524 Lines: 54 [report as per http://www.kernel.org/pub/linux/docs/lkml/reporting- bugs.html] [1.] panic when starting uml host with bridged networking on an Intel 82562 (e100 driver) [2.] I'm running user-mode-linux on a Gigabyte GA-8IG1000MK motherboard (Intel 865G chipset with onboard 82562 ethernet), and experience repeatable kernel panics when starting a uml instance. I have three bridges to the host (br0, br1 and br2) with the hosts eth0, eth1 and eth2 as port 1 on each bridge, respectively. eth0 is a 3Com 3c595 (3c59x), eth1 is the onboard Intel 82562 (e100), eth2 is a Netgear Natsemi DP83815 (natsemi). The panic does not occur if I do not plug the physical LAN cable into the Intel 82562 ethernet port. 'Internal' networking works fine, the uml instance and the host can communicate via the bridge (w/ lots of traffic: ping -f), but when plugging in the cable the host kernel panics on the first packet. If I take the interface down within the uml (uml# ifconfig eth1 down) and then plug in the the physical LAN, all works well *for a while*, though the panic still occurs after some traffic has passed (about 60-100 pings). The eepro100 driver works as expected (no panics). [3.] [4.] scripts/ver_linux: Linux preston 2.4.22 #1 Wed Oct 22 10:41:11 EST 2003 i686 GNU/Linux Gnu make 3.80 binutils 2.14.90.0.6 util-linux 2.12 mount 2.12 modutils 2.4.21 e2fsprogs 1.35-WIP PPP 2.4.1 Linux C Library 2.3.2 Dynamic linker (ldd) 2.3.2 Procps 3.1.12 Net-tools 1.60 Kbd 70: Sh-utils 5.0 Modules Loaded ipt_TCPMSS ipt_limit ipt_LOG ipt_state ipt_REJECT iptable_filter ipt_MASQUERADE iptable_nat ip_conntrack ip_tables natsemi e100 3c59x bridge uhci ehci-hcd usbcore tun rtc [5.] Can provide Oops output if required [6.] n/a [7.] Debian testing, can provide any proc info as required. From dtucker@zip.com.au Wed Oct 22 01:45:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 22 Oct 2003 01:46:04 -0700 (PDT) Received: from mta07ps.bigpond.com (mta07ps.bigpond.com [144.135.25.132]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9M8jI25028327 for ; Wed, 22 Oct 2003 01:45:24 -0700 Received: from dodgynet.dyndns.org. ([144.135.25.81]) by mta07ps.email.bigpond.com (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with SMTP id <0HN500JYAHG7AR@mta07ps.email.bigpond.com> for netdev@oss.sgi.com; Wed, 22 Oct 2003 18:40:55 +1000 (EST) Received: from cpe-144-137-122-171.nsw.bigpond.net.au ([144.137.122.171]) by psmam05bpa.bigpond.com(MAM REL_3_3_2d 107/7144184); Wed, 22 Oct 2003 18:40:55 +0000 Received: from zip.com.au (gate.dodgy.net.au [192.168.32.1]) by dodgynet.dyndns.org. (8.12.8/8.12.8) with ESMTP id h9M8epBJ002523; Wed, 22 Oct 2003 18:40:52 +1000 Date: Wed, 22 Oct 2003 18:40:51 +1000 From: Darren Tucker Subject: Re: [Bugme-new] [Bug 1360] New: Can't access /proc/self/fd/0 from sshd when no pty allocated. To: "David S. Miller" Cc: Andrew Morton , netdev@oss.sgi.com Message-id: <3F964293.FA2C3A7A@zip.com.au> MIME-version: 1.0 X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Accept-Language: en References: <200310151142.h9FBgi5k029003@fire-1.osdl.org> <20031018172736.417bf89d.akpm@osdl.org> <20031018235735.52f5e15a.davem@redhat.com> X-archive-position: 979 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dtucker@zip.com.au Precedence: bulk X-list: netdev Content-Length: 1010 Lines: 32 "David S. Miller" wrote: > > On Sat, 18 Oct 2003 17:27:36 -0700 > Andrew Morton wrote: > > > This appears to be deliberate: [snip] > > > > I do not know why; the comment is fairly useless. > > For many socket types there are no sane open() semantics. > > If I open() a unconnected socket, what does that mean? > Should it connect, of do something like a dup()? > > This code has been this way for a long time, anyone who wants to > change this needs to deal with and address all the aforementioned > issues. Thanks for looking at this. I've done some digging on the OpenSSH side: originally sshd used pipes on Linux but they were found [0] to have problems that cause lockups in (at least) rsync. [0] http://marc.theaimsgroup.com/?l=openssh-unix-dev&m=94914935131492 -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement. From davem@pizda.ninka.net Wed Oct 22 02:37:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 22 Oct 2003 02:37:57 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9M9bH25030325 for ; Wed, 22 Oct 2003 02:37:18 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA29931; Wed, 22 Oct 2003 02:31:52 -0700 Date: Wed, 22 Oct 2003 02:31:52 -0700 From: "David S. Miller" To: Max Krasnyansky Cc: netdev@oss.sgi.com Subject: Re: [BK] TUN driver updates and fixes for 2.6 Message-Id: <20031022023152.397dcb99.davem@redhat.com> In-Reply-To: <5.1.0.14.2.20031021090148.05451c60@unixmail.qualcomm.com> References: <5.1.0.14.2.20031021090148.05451c60@unixmail.qualcomm.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 980 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: 342 Lines: 13 On Tue, 21 Oct 2003 09:39:32 -0700 Max Krasnyansky wrote: > Please pull from > bk://linux-bt.bkbits.net/tun-2.5 > > This will update the following files: Please extract out only the important bug fixes from this tree. Linus isn't taking cleanups and optimizations anymore and therefore neither can I. Thanks. From rask@sygehus.dk Wed Oct 22 05:16:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 22 Oct 2003 05:17:33 -0700 (PDT) Received: from 0x50a41c3d.albnxx15.adsl-dhcp.tele.dk (0x50a41c3d.albnxx15.adsl-dhcp.tele.dk [80.164.28.61]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9MCGk25006263 for ; Wed, 22 Oct 2003 05:16:48 -0700 Received: by 0x50a41c3d.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 2F1C42C634; Wed, 22 Oct 2003 14:06:39 +0200 (CEST) Date: Wed, 22 Oct 2003 14:06:25 +0200 From: Rask Ingemann Lambertsen To: netdev@oss.sgi.com Subject: Re: network interface cards native vlans support in linux kernel? Message-ID: <20031022140624.A9145@vip.cybercity.dk> References: <20030709152814.GC15293@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030709152814.GC15293@gtf.org>; from jgarzik@pobox.com on Wed, Jul 09, 2003 at 11:28:15AM -0400 X-archive-position: 981 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rask@sygehus.dk Precedence: bulk X-list: netdev Content-Length: 847 Lines: 20 On Wed, Jul 09, 2003 at 11:28:15AM -0400, Jeff Garzik wrote: > On Wed, Jul 09, 2003 at 06:19:51PM +0300, Andrius Kasparavicius wrote: > > hello, as far as i know, currently there is no native vlan support in > > network device drivers. I mean, always need patching MTU.. add 4 bytes.. > > > > is there any problems to include full vlans support? > > Native VLAN support has been in the kernel for a while. > > A few drivers still need patching, and unfortunately the VLAN driver > patches floating around all need cleaning up. What does a driver need to do to make sure it can handle vlan frames? Is it enought to be prepared to handle frames of size dev->mtu+4? How do I know 4 bytes will be enough tomorrow when someone introduces VLAN2 with a 64-bit tag? Checking for CONFIG_VLAN is of no use, right? -- Regards, Rask Ingemann Lambertsen From greearb@candelatech.com Wed Oct 22 10:02:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 22 Oct 2003 10:02:41 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9MH2525013922 for ; Wed, 22 Oct 2003 10:02:06 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h9MH1nx1031838; Wed, 22 Oct 2003 10:01:58 -0700 Message-ID: <3F96B7FD.7080607@candelatech.com> Date: Wed, 22 Oct 2003 10:01:49 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Rask Ingemann Lambertsen CC: netdev@oss.sgi.com Subject: Re: network interface cards native vlans support in linux kernel? References: <20030709152814.GC15293@gtf.org> <20031022140624.A9145@vip.cybercity.dk> In-Reply-To: <20031022140624.A9145@vip.cybercity.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 982 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 1347 Lines: 38 Rask Ingemann Lambertsen wrote: > On Wed, Jul 09, 2003 at 11:28:15AM -0400, Jeff Garzik wrote: > >>On Wed, Jul 09, 2003 at 06:19:51PM +0300, Andrius Kasparavicius wrote: >> >>>hello, as far as i know, currently there is no native vlan support in >>>network device drivers. I mean, always need patching MTU.. add 4 bytes.. >>> >>>is there any problems to include full vlans support? >> >>Native VLAN support has been in the kernel for a while. >> >>A few drivers still need patching, and unfortunately the VLAN driver >>patches floating around all need cleaning up. > > > What does a driver need to do to make sure it can handle vlan frames? Is it > enought to be prepared to handle frames of size dev->mtu+4? How do I know 4 > bytes will be enough tomorrow when someone introduces VLAN2 with a 64-bit tag? > Checking for CONFIG_VLAN is of no use, right? It needs to be able to handle 1518 bytes (+crc), send and receive. I'd suggest using the Intel e100 or e1000, as they both support VLANs just fine. Most other GigE nics work too. Apply the patches in the VLAN howto if you need another NIC that needs patching. There seems to be zero motivation by 100bt driver authors to add VLAN support to the drivers that still need it... Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From acme@conectiva.com.br Wed Oct 22 12:26:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 22 Oct 2003 12:26:42 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9MJQ625019942 for ; Wed, 22 Oct 2003 12:26:08 -0700 Received: from [200.138.48.170] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1ACOch-0006Z1-00; Wed, 22 Oct 2003 17:26:23 -0200 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id B8C5819676; Mon, 20 Oct 2003 07:44:28 +0000 (UTC) Date: Mon, 20 Oct 2003 04:44:28 -0300 From: Arnaldo Carvalho de Melo To: "Noah J. Misch" Cc: rddunlap@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] Make LLC2 compile with PROC_FS=n Message-ID: <20031020074428.GA26494@conectiva.com.br> Mail-Followup-To: Arnaldo Carvalho de Melo , "Noah J. Misch" , rddunlap@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 983 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: 753 Lines: 18 Em Sun, Oct 19, 2003 at 10:03:52PM -0700, Noah J. Misch escreveu: > Hello Arnaldo, > > This patch allows the LLC2 code to link properly when CONFIG_PROC_FS=n. The > problem was that the Makefile only built llc_proc.c when PROC_FS=y/m, but > af_llc.c called functions in that file in all cases. The log details how I > fixed this. > > I think this is the best fix, but of course there are a number of less intrusive > fixes, including (I think) one as simple as making llc_proc.c always compile. > This one does apply cleanly to linux-2.5 BK as of 0400 UTC 10/20/2003 and passes > allyesconfig and (allyesconfig - PROC_FS) compiles on i386. > > Please let me know if I should supply you with further information. I'm OK with this patch. - Arnaldo From xma@us.ibm.com Wed Oct 22 13:02:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 22 Oct 2003 13:02:58 -0700 (PDT) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9MK2I25024280 for ; Wed, 22 Oct 2003 13:02:25 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9MK1dZY289580; Wed, 22 Oct 2003 16:01:40 -0400 Received: from d03nm124.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9MK1cXU324642; Wed, 22 Oct 2003 14:01:39 -0600 Importance: Normal Sensitivity: Subject: [Issues] Implementation for IPv6 MIB:ipv6PrefixTable To: "David S. Miller" Cc: mashirle@us.ibm.com, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: Shirley Ma Date: Wed, 22 Oct 2003 13:01:33 -0700 X-MIMETrack: Serialize by Router on D03NM124/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 10/22/2003 14:01:38 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 984 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xma@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1434 Lines: 37 Hi, Dave, I have several implementation issues about ipv6PrefixTable for IPv6 MIBs. This table must include all prefixes' info, manually configured prefix, addrconf prefix, dhcp prefix ... In each ipv6PrefixTable, there are 9 objects, which are Ifindex, Type, Prefix, Length, Origin(addrconf, manually, dhcp, others), OnLinkFlag, AutonomoueFlag, AdvPreferredLiftTime and ValidLifeTime. There is no such a table or similar list saved in Linux kernel. Manually configured prefix router, and on-link addrconf prefix router are saved in routing table, but only Prefix and Lengh objects there. The off-link or on-link flag (set to 0) prefix router are not in routing table or anywhere else, which are using default router by RFC 2461. I would like to hear your opinion on the implementation. I read some email thread before about a implementation of prefix list in the kernel. At that time, the conclusion was not implementing prefix list in the kernel, and also the prefix list only refers to onlink prefix by RFC2461. First, do you think it's a good idea to save all prefix objects in routing table? Second, where is the best location for the off-link prefix, on-link flag 0 prefix to be saved? Third, do you think it's a good idea to implement a prefix table/per interface in the kernel? Thanks Shirley Ma IBM Linux Technology Center 15300 SW Koll Parkway Beaverton, OR 97006-6063 Phone: (503) 578-7638 FAX: (503) 578-3228 From b_wydrowski@yahoo.com.au Wed Oct 22 13:10:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 22 Oct 2003 13:11:09 -0700 (PDT) Received: from web13006.mail.yahoo.com (web13006.mail.yahoo.com [216.136.174.16]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9MKAZ25024768 for ; Wed, 22 Oct 2003 13:10:35 -0700 Message-ID: <20031022200152.17005.qmail@web13006.mail.yahoo.com> Received: from [131.215.45.222] by web13006.mail.yahoo.com via HTTP; Thu, 23 Oct 2003 06:01:52 EST Date: Thu, 23 Oct 2003 06:01:52 +1000 (EST) From: =?iso-8859-1?q?Bartek=20Wydrowski?= Subject: RFC1323. No timestamping if SYN timestamp = 0. Bug or Feature? To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-309782246-1066852912=:16989" Content-Transfer-Encoding: 8bit X-archive-position: 985 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: b_wydrowski@yahoo.com.au Precedence: bulk X-list: netdev Content-Length: 4937 Lines: 63 --0-309782246-1066852912=:16989 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Dear NetDev, I have noticed that when my Windows XP PC makes a TCP connection to my Linux PC, the Windows PC sends a timestamp option with timestamp value 0 in the starting SYN- and linux seems to ignore this timestamp and does not communicate with timestamp option for the rest of the connection. There appears to be code in the TCP_IPV4.C file which checks for this condition and ignores timestamps if rcv_tsval == 0. I have included this code, as well as the TCP dump of this behaviour at the bottom. a) Is there a reason why Linux should not do timestamps if timestamp value in SYN is zero? b) Does this not cause problems with Windows and Linux RFC1323 compatibility? (It seems like windows sends timestamp 0 in SYN packet perhaps as a rule). c) Can this test condition be removed without other consequences? Indeed I removed the condition and then a Windows initiated connection was able to talk timestamps with Linux with no problems. Why do we need this (timestamp=0 in SYN) exclusion in the first place? Thanks Bartek Wydrowski Kernel Code: in tcp_ipv4.c ---------------------------- if (tp.saw_tstamp && tp.rcv_tsval == 0) { /* Some OSes (unknown ones, but I see them on web server, which * contains information interesting only for windows' * users) do not send their stamp in SYN. It is easy case. * We simply do not advertise TS support. */ tp.saw_tstamp = 0; tp.tstamp_ok = 0; } TCPdump of this behaviour: ----------------------------- windows XP Box > Linux Box 1991982409:199198240 9(0) win 64240 (DF) Linux Box > windows XP Box S 2478701299:247870129 9(0) ack 1991982410 win 5840 (DF) --------------------------------- Yahoo! Personals - New people, new possibilities. FREE for a limited time! --0-309782246-1066852912=:16989 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit

Dear NetDev,

I have noticed that when my Windows XP PC makes a TCP connection to my Linux PC, the Windows PC sends a timestamp option with timestamp value 0 in the starting SYN- and linux seems to ignore this timestamp and does not communicate with timestamp option
for the rest of the connection. There appears to be code in the TCP_IPV4.C file which checks for this condition and ignores timestamps if rcv_tsval == 0.  I have included this code, as well as the TCP dump of this behaviour at the bottom.

a) Is there a reason why Linux should not do timestamps if timestamp value in SYN is zero?
b) Does this not cause problems with Windows and Linux RFC1323
compatibility? (It seems like windows sends timestamp 0 in SYN packet perhaps as a rule).
c) Can this test condition be removed without other consequences?

Indeed I removed the condition and then a Windows initiated connection was able to talk timestamps with Linux with no problems. Why do we need this (timestamp=0 in SYN) exclusion in the first place?

Thanks
Bartek Wydrowski


Kernel Code: in tcp_ipv4.c
----------------------------

if (tp.saw_tstamp && tp.rcv_tsval == 0) {
                /* Some OSes (unknown ones, but I see them on web server,
which
                 * contains information interesting only for windows'
                 * users) do not send their stamp in SYN. It is easy case.
                 * We simply do not advertise TS support.
                 */
                tp.saw_tstamp = 0;
                tp.tstamp_ok = 0;
}

TCPdump of this behaviour:
-----------------------------

windows XP Box > Linux Box 1991982409:199198240 9(0) win 64240 <mss
1460,nop,wscale 0,nop,nop,timestamp 0 0,nop,nop,sackOK> (DF)

Linux Box > windows XP Box S 2478701299:247870129 9(0) ack 1991982410 win
5840 <mss 1460,nop,nop,sackOK,nop,wscale 8> (DF)



Yahoo! Personals
- New people, new possibilities. FREE for a limited time! --0-309782246-1066852912=:16989-- From acme@conectiva.com.br Wed Oct 22 14:18:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 22 Oct 2003 14:19:08 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9MLIX25025807 for ; Wed, 22 Oct 2003 14:18:34 -0700 Received: from [200.96.10.152] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1ACQNc-0006qA-00; Wed, 22 Oct 2003 19:18:57 -0200 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id A9AB91966D; Wed, 22 Oct 2003 21:18:18 +0000 (UTC) Date: Wed, 22 Oct 2003 18:18:16 -0300 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: Stephen Hemminger , noah@caltech.edu, rddunlap@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] Make LLC2 compile with PROC_FS=n Message-ID: <20031022211815.GA10112@conectiva.com.br> Mail-Followup-To: Arnaldo Carvalho de Melo , "David S. Miller" , Stephen Hemminger , noah@caltech.edu, rddunlap@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20031020101607.76e02647.shemminger@osdl.org> <20031020223237.31854ab5.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031020223237.31854ab5.davem@redhat.com> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 986 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: 488 Lines: 18 Em Mon, Oct 20, 2003 at 10:32:37PM -0700, David S. Miller escreveu: > On Mon, 20 Oct 2003 10:16:07 -0700 > Stephen Hemminger wrote: > > > Why make up a whole separate llc_proc.h file for two prototypes? > > Put them on the end of llc.h > > I definitely prefer this version of the fix. > > Since Arnaldo appears to be busy, I'll apply this. > > Thanks Noah and Stephen. Thanks a lot, I'm back from Europe, hope to become more active again. Regards, - Arnaldo From Chitrapu_Kishore@emc.com Wed Oct 22 14:41:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 22 Oct 2003 14:42:16 -0700 (PDT) Received: from mxic2.corp.emc.com (mxic2.corp.emc.com [128.221.12.9]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9MLff25026328 for ; Wed, 22 Oct 2003 14:41:42 -0700 Received: by mxic2.corp.emc.com with Internet Mail Service (5.5.2653.19) id ; Wed, 22 Oct 2003 17:41:31 -0400 Message-ID: From: Chitrapu_Kishore@emc.com To: netdev@oss.sgi.com Cc: Chitrapu_Kishore@emc.com Subject: oops in tcp_ipv4.c Date: Wed, 22 Oct 2003 17:41:26 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C398E5.3EEBD0F8" X-archive-position: 987 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Chitrapu_Kishore@emc.com Precedence: bulk X-list: netdev Content-Length: 12022 Lines: 291 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C398E5.3EEBD0F8 Content-Type: text/plain I have a panic on machines which have very high rate of incoming TCP connections. This panic occurs with 2.4.19 with SuSE patches applied to it. Specs: Pentium III (Coppermine), 1GHz, with memory = 515356 kB cat /proc/modules gives the following: ppp_generic 20576 0 slhc 6724 0 [ppp_generic] af_packet 11432 0 (autoclean) eepro100 22136 3 (autoclean) ipt_state 1112 14 (autoclean) ip_conntrack 21176 1 (autoclean) [ipt_state] ipt_LOG 4280 8 (autoclean) iptable_filter 2444 1 (autoclean) ip_tables 14720 3 [ipt_state ipt_LOG iptable_filter] rtc 8684 0 (autoclean) Following is the output from ksymoops: ------------ Unable to handle kernel paging request at virtual address 0013c1da c01f8bcd *pde = 00000000 Oops: 0000 2.4.19-prod-sles-ded8470bc8d929ffca7ec0daf42b93d6 #1 Thu Oct 9 05:10:58 EDT 2003 CPU: 0 EIP: 0010:[] Tainted: P Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00010246 eax: 03049a34 ebx: 0013c192 ecx: 0013c192 edx: 00000000 esi: c3007e98 edi: 00000c00 ebp: 00000096 esp: c3007e64 ds: 0018 es: 0018 ss: 0018 Process netstat (pid: 11340, stackpage=c3007000) Stack: 0013c192 c3007e98 c01f8fa1 0013c192 c3007e98 0000000e 00000000 00000c00 c0128bf0 00000960 00003ca5 0000000e 0000012c 33312020 3030202a 42303430 303a3037 20303031 36303030 34324431 3630303a 44442035 30303020 30303030 Call Trace: [] [] [] [] [] [] Code: 8b 59 48 29 c3 0f b7 41 08 0f 48 da 86 c4 0f b7 51 22 86 d6 >>EIP; c01f8bcd <===== >>esi; c3007e98 <[ip_conntrack].bss.end+83306d/eaf235> >>esp; c3007e64 <[ip_conntrack].bss.end+833039/eaf235> Trace; c01f8fa1 Trace; c0128bf0 Trace; c01303c4 <__alloc_pages+74/2e0> Trace; c01561b4 Trace; c0136d46 Trace; c0108933 Code; c01f8bcd 00000000 <_EIP>: Code; c01f8bcd <===== 0: 8b 59 48 mov 0x48(%ecx),%ebx <===== Code; c01f8bd0 3: 29 c3 sub %eax,%ebx Code; c01f8bd2 5: 0f b7 41 08 movzwl 0x8(%ecx),%eax Code; c01f8bd6 9: 0f 48 da cmovs %edx,%ebx Code; c01f8bd9 c: 86 c4 xchg %al,%ah Code; c01f8bdb e: 0f b7 51 22 movzwl 0x22(%ecx),%edx Code; c01f8bdf 12: 86 d6 xchg %dl,%dh <0> Kernel panic: Aiee, killing interrupt handler! ---------------------- Looks tcp_ehash[i+tcp_ehash_size] which accomodates all the timewait socks has been corrupted by the time procfs read happens. Is this panic already reported if so is there patch available for this. Thanks, -KC PS: Please copy me as I am not the list. ------_=_NextPart_001_01C398E5.3EEBD0F8 Content-Type: text/html Content-Transfer-Encoding: quoted-printable oops in tcp_ipv4.c

I have a panic on machines which have = very high rate of incoming TCP connections.
This panic occurs with 2.4.19 with = SuSE patches applied to it. Specs: Pentium III (Coppermine), 1GHz, with = memory =3D 515356 kB

cat /proc/modules gives the = following:
ppp_generic       &nbs= p;    20576   0
slhc         = ;           = 6724   0 [ppp_generic]
af_packet        =       11432   0 (autoclean)
eepro100        &= nbsp;      22136   3 = (autoclean)
ipt_state        =        1112  14 (autoclean)
ip_conntrack       &nb= sp;   21176   1 (autoclean) [ipt_state]
ipt_LOG        &n= bsp;        4280   8 = (autoclean)
iptable_filter       &= nbsp;  2444   1 (autoclean)
ip_tables        =       14720   3 [ipt_state ipt_LOG = iptable_filter]
rtc         =             = 8684   0 (autoclean)

Following is the output from = ksymoops:
------------
Unable to handle kernel paging = request at virtual address 0013c1da
c01f8bcd
*pde =3D 00000000
Oops: 0000 = 2.4.19-prod-sles-ded8470bc8d929ffca7ec0daf42b93d6 #1 Thu Oct 9 05:10:58 = EDT 2003
CPU: 0
EIP: 0010:[<c01f8bcd>]  = Tainted: P
Using defaults from ksymoops -t = elf32-i386 -a i386
EFLAGS: 00010246
eax: 03049a34   = ebx:      0013c192     = ecx: 0013c192       edx:  = 00000000
esi: c3007e98   = edi:      00000c00     = ebp: 00000096       esp:  = c3007e64
ds:  = 0018       es: = 0018      ss: 0018
Process netstat (pid: 11340, = stackpage=3Dc3007000)
Stack: 0013c192 c3007e98 c01f8fa1 = 0013c192 c3007e98 0000000e 00000000 00000c00
       = c0128bf0 00000960 00003ca5 0000000e 0000012c 33312020 3030202a 42303430<= /FONT>
       = 303a3037 20303031 36303030 34324431 3630303a 44442035 30303020 = 30303030
Call Trace: [<c01f8fa1>] = [<c0128bf0>] [<c01303c4>] [<c01561b4>] = [<c0136d46>] [<c0108933>]
Code: 8b 59 48 29 c3 0f b7 41 08 0f = 48 da 86 c4 0f b7 51 22 86 d6


>>EIP; c01f8bcd = <get_timewait_sock+d/70>   <=3D=3D=3D=3D=3D

>>esi; c3007e98 = <[ip_conntrack].bss.end+83306d/eaf235>
>>esp; c3007e64 = <[ip_conntrack].bss.end+833039/eaf235>

Trace; c01f8fa1 = <tcp_get_info+371/440>
Trace; c0128bf0 = <filemap_nopage+0/210>
Trace; c01303c4 = <__alloc_pages+74/2e0>
Trace; c01561b4 = <proc_file_read+94/1c0>
Trace; c0136d46 = <sys_read+96/f0>
Trace; c0108933 = <system_call+33/38>

Code;  c01f8bcd = <get_timewait_sock+d/70>
00000000 <_EIP>:
Code;  c01f8bcd = <get_timewait_sock+d/70>   <=3D=3D=3D=3D=3D
   0:   8b 59 = 48           &nbs= p;      mov    = 0x48(%ecx),%ebx   <=3D=3D=3D=3D=3D
Code;  c01f8bd0 = <get_timewait_sock+10/70>
   3:   29 = c3           &nbs= p;         = sub    %eax,%ebx
Code;  c01f8bd2 = <get_timewait_sock+12/70>
   5:   0f b7 41 = 08           &nbs= p;   movzwl 0x8(%ecx),%eax
Code;  c01f8bd6 = <get_timewait_sock+16/70>
   9:   0f 48 = da           &nbs= p;      cmovs  %edx,%ebx
Code;  c01f8bd9 = <get_timewait_sock+19/70>
   c:   86 = c4           &nbs= p;         xchg   = %al,%ah
Code;  c01f8bdb = <get_timewait_sock+1b/70>
   e:   0f b7 51 = 22           &nbs= p;   movzwl 0x22(%ecx),%edx
Code;  c01f8bdf = <get_timewait_sock+1f/70>
  12:   86 = d6           &nbs= p;         xchg   = %dl,%dh

 <0> Kernel panic: Aiee, = killing interrupt handler!
----------------------

Looks tcp_ehash[i+tcp_ehash_size] = which accomodates all the timewait socks has been corrupted by the time = procfs read happens.

Is this panic already reported if so = is there patch available for this.

Thanks,
-KC

PS: Please copy me as I am not the = list.


------_=_NextPart_001_01C398E5.3EEBD0F8-- From davem@pizda.ninka.net Thu Oct 23 00:43:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 23 Oct 2003 00:44:12 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9N7hd25010043 for ; Thu, 23 Oct 2003 00:43:40 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA12788; Thu, 23 Oct 2003 00:38:05 -0700 Date: Thu, 23 Oct 2003 00:38:05 -0700 From: "David S. Miller" To: Chitrapu_Kishore@emc.com Cc: netdev@oss.sgi.com, Chitrapu_Kishore@emc.com Subject: Re: oops in tcp_ipv4.c Message-Id: <20031023003805.0f8fb56e.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 988 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: 120 Lines: 3 Try to reproduce with more recent kernels (2.4.22 would be fine) and in particular without the vendor patches applied. From davem@pizda.ninka.net Thu Oct 23 01:43:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 23 Oct 2003 01:44:34 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9N8ht25014584 for ; Thu, 23 Oct 2003 01:43:56 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA12939; Thu, 23 Oct 2003 01:37:48 -0700 Date: Thu, 23 Oct 2003 01:37:48 -0700 From: "David S. Miller" To: Bartek Wydrowski Cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: RFC1323. No timestamping if SYN timestamp = 0. Bug or Feature? Message-Id: <20031023013748.0dd168db.davem@redhat.com> In-Reply-To: <20031022200152.17005.qmail@web13006.mail.yahoo.com> References: <20031022200152.17005.qmail@web13006.mail.yahoo.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 989 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: 365 Lines: 11 It is impossible to comply to RFC1323 if we allow TSval in the initial SYN packet to be zero, from RFC1323: When TSecr is not valid, its value must be zero. It is therefore impossible to accept TSval as zero, because our TSecr echo of that timestamp would be also zero and thus invalid. That is why we reject zero timestamps in the initial SYN packet. From davem@redhat.com Thu Oct 23 03:31:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 23 Oct 2003 03:31:36 -0700 (PDT) Received: from rth.ninka.net (rth.ninka.net [216.101.162.244]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9NAV125018971 for ; Thu, 23 Oct 2003 03:31:01 -0700 Received: from rth.ninka.net (localhost.localdomain [127.0.0.1]) by rth.ninka.net (8.12.8/8.12.8) with SMTP id h9NAV0lx027969; Thu, 23 Oct 2003 03:31:00 -0700 Date: Thu, 23 Oct 2003 03:31:00 -0700 From: "David S. Miller" To: an7 Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Useless networking code in 2.4.x ? Message-Id: <20031023033100.1bc47d31.davem@redhat.com> In-Reply-To: <20031023085801.40580.qmail@web11105.mail.yahoo.com> References: <20031023085801.40580.qmail@web11105.mail.yahoo.com> X-Mailer: Sylpheed version 0.9.7 (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: 990 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: 837 Lines: 25 On Thu, 23 Oct 2003 10:58:01 +0200 (CEST) an7 wrote: > If we have a look at tcp_recv_skb, and > tcp_read_sock(), > > we notice that there is a SYN check, and if the flag > is on, we do offset-- (sequence number not > corresponding to real data byte). > > This Syn check is useless, as the function cannot be > called at the beginning of a connection (since we have > not copied_seq filled with the last sequence number of > the last packet passed to the upper layer) > > What do you think of that ? Please next time, take this kind of question to netdev@oss.sgi.com where the networking developers are, most of them are not subscribed to linux-kernel. As to your question, if we ever support accepting data in the initial final SYN-ACK packet, this code would be needed, so it's better to keep this code around. From an3h0ny@yahoo.fr Thu Oct 23 04:02:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 23 Oct 2003 04:03:20 -0700 (PDT) Received: from web11102.mail.yahoo.com (web11102.mail.yahoo.com [216.136.131.149]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9NB2l25020159 for ; Thu, 23 Oct 2003 04:02:47 -0700 Message-ID: <20031023110247.55464.qmail@web11102.mail.yahoo.com> Received: from [195.68.44.148] by web11102.mail.yahoo.com via HTTP; Thu, 23 Oct 2003 13:02:47 CEST Date: Thu, 23 Oct 2003 13:02:47 +0200 (CEST) From: =?iso-8859-1?q?an7?= Subject: tcp_recv_skb, tcp_read_sock and tcp_recvmsg useless check ? To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 991 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: an3h0ny@yahoo.fr Precedence: bulk X-list: netdev Content-Length: 600 Lines: 22 Hi, If we have a look at tcp_recv_skb, and tcp_read_sock(), we notice that there is a SYN check, and if the flag is on, we do offset-- (sequence number not corresponding to real data byte). This Syn check is useless, as the function cannot be called at the beginning of a connection (since we have not copied_seq filled with the last sequence number of the last packet passed to the upper layer) What do you think of that ? ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From pekkas@netcore.fi Thu Oct 23 05:22:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 23 Oct 2003 05:23:28 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9NCMs25024656 for ; Thu, 23 Oct 2003 05:22:55 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h9NCMmD04196 for ; Thu, 23 Oct 2003 15:22:48 +0300 Date: Thu, 23 Oct 2003 15:22:47 +0300 (EEST) From: Pekka Savola To: netdev@oss.sgi.com Subject: Disabling IPv6 accept_ra on just some interface Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 992 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 1821 Lines: 50 Hi, I've been struggling to be able to disable IPV6 autoconfiguration on just one interface, but retain it on others. This appears to be a bit problematic because there exists an obvious race condition here: when the autoconf was enabled by default on every interface, disabling it afterwards on one particular interface will retain the addresses and routes on that interface until their expire. AFAICS, you should first (before any interface is brought up) disable accept_ra for every interface, plus default and all values. Then, for every interface, after you've loaded the driver (that is, a sysctl toggle exists for the device), you either enable the autoconf or not. This is a bit complex, but maybe doable. Any other ways around this? The implication is that the kernel will ignore route advertisements, and does not send the route solicitation itself. However, the consequence of this is that when you enable an interface like this, you'll have to wait for the next unsolicited advertisement -- which could take a long while. So, my thought (comments welcome) is: 1) when accept_ra changes from 0 -> 1, initiate the route solicitation process, likewise as one would when the interface is brought up. Makes sense? 2) (probably not a good idea, but some food for thought..) when accept_ra changes from 1 -> 0, delete any autoconfigured routes or prefixes. (could be ugly / dangerous..) (similar toggle could be in place for "autoconf" which could be used to generate the link-local addresses or maybe even kill them if you didn't want them for the general case.) Thoughts? -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From amir.noam@intel.com Thu Oct 23 09:17:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 23 Oct 2003 09:18:00 -0700 (PDT) Received: from hermes.iil.intel.com (hermes.iil.intel.com [192.198.152.99]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9NGHP25032556 for ; Thu, 23 Oct 2003 09:17:26 -0700 Received: from petasus.iil.intel.com (petasus.iil.intel.com [143.185.77.3]) by hermes.iil.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h9NGHIHo022109 for ; Thu, 23 Oct 2003 16:17:18 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h9NGKWA22525 for ; Thu, 23 Oct 2003 16:20:32 GMT Received: from sun111.npdj.intel.com ([10.12.254.111]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003102318171718740 ; Thu, 23 Oct 2003 18:17:17 +0200 Received: from jrslxjul4.npdj.intel.com (jrslxjul4 [10.12.254.188]) by sun111.npdj.intel.com (8.12.9/8.12.9/MailSET/Hub) with ESMTP id h9NGFxBN003670; Thu, 23 Oct 2003 18:16:00 +0200 (IST) Content-Type: text/plain; charset="us-ascii" From: Amir Noam To: Jay Vosburgh , jgarzik@pobox.com Subject: [PATCH] [bonding 2.4] fix creating/destroying the /proc/net/bonding dir Date: Thu, 23 Oct 2003 17:39:42 +0200 User-Agent: KMail/1.4.3 Cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310231739.42556.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 993 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev Content-Length: 3751 Lines: 164 This patch makes bonding create the /proc/net/bonding directory only if it exists (and destroy it only if it's empty). Synchronization with the NETDEV_CHANGENAME event is achieved through the RTNL semaphore. The patch applies on 2.4.23-pre8, after applying the patch that restores backward compatibility sent by Shmulik on 2003/10/12. Amir diff -Narup a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Oct 23 14:47:31 2003 +++ b/drivers/net/bonding/bond_main.c Thu Oct 23 17:04:52 2003 @@ -3574,6 +3574,62 @@ static void bond_destroy_proc_info(struc bond->bond_proc_file = NULL; } } + +/* Create the bonding directory under /proc/net, if doesn't exist yet. + * Caller must hold rtnl_lock. + */ +static void bond_create_proc_dir(void) +{ + int len = strlen(DRV_NAME); + + for (bond_proc_dir = proc_net->subdir; bond_proc_dir; + bond_proc_dir = bond_proc_dir->next) { + if ((bond_proc_dir->namelen == len) && + !memcmp(bond_proc_dir->name, DRV_NAME, len)) { + break; + } + } + + if (!bond_proc_dir) { + bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); + if (bond_proc_dir) { + bond_proc_dir->owner = THIS_MODULE; + } else { + printk(KERN_WARNING DRV_NAME + ": Warning: cannot create /proc/net/%s\n", + DRV_NAME); + } + } +} + +/* Destroy the bonding directory under /proc/net, if empty. + * Caller must hold rtnl_lock. + */ +static void bond_destroy_proc_dir(void) +{ + struct proc_dir_entry *de; + + if (!bond_proc_dir) { + return; + } + + /* verify that the /proc dir is empty */ + for (de = bond_proc_dir->subdir; de; de = de->next) { + /* ignore . and .. */ + if (*(de->name) != '.') { + break; + } + } + + if (de) { + if (bond_proc_dir->owner == THIS_MODULE) { + bond_proc_dir->owner = NULL; + } + } else { + remove_proc_entry(DRV_NAME, proc_net); + bond_proc_dir = NULL; + } +} #endif /* CONFIG_PROC_FS */ /* @@ -3829,6 +3885,9 @@ static struct notifier_block bond_netdev .notifier_call = bond_netdev_event, }; +/* De-initialize device specific data. + * Caller must hold rtnl_lock. + */ static inline void bond_deinit(struct net_device *dev) { struct bonding *bond = dev->priv; @@ -3840,6 +3899,9 @@ static inline void bond_deinit(struct ne #endif } +/* Unregister and free all bond devices. + * Caller must hold rtnl_lock. + */ static void bond_free_all(void) { struct bonding *bond, *nxt; @@ -3847,16 +3909,13 @@ static void bond_free_all(void) list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) { struct net_device *dev = bond->device; - unregister_netdev(dev); + unregister_netdevice(dev); bond_deinit(dev); free_netdev(dev); } #ifdef CONFIG_PROC_FS - if (bond_proc_dir) { - remove_proc_entry(DRV_NAME, proc_net); - bond_proc_dir = NULL; - } + bond_destroy_proc_dir(); #endif } @@ -4234,18 +4293,12 @@ static int __init bonding_init(void) primary = NULL; } + rtnl_lock(); + #ifdef CONFIG_PROC_FS - bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); - if (bond_proc_dir == NULL) { - printk(KERN_WARNING - "bonding_init(): can not create /proc/net/" DRV_NAME); - } else { - bond_proc_dir->owner = THIS_MODULE; - } + bond_create_proc_dir(); #endif - rtnl_lock(); - err = 0; for (no = 0; no < max_bonds; no++) { struct net_device *dev; @@ -4288,18 +4341,21 @@ static int __init bonding_init(void) return 0; out_err: - rtnl_unlock(); - /* free and unregister all bonds that were successfully added */ bond_free_all(); + rtnl_unlock(); + return err; } static void __exit bonding_exit(void) { unregister_netdevice_notifier(&bond_netdev_notifier); + + rtnl_lock(); bond_free_all(); + rtnl_unlock(); } module_init(bonding_init); From yoshfuji@linux-ipv6.org Thu Oct 23 20:32:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 23 Oct 2003 20:33:05 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9O3WU25019447 for ; Thu, 23 Oct 2003 20:32:31 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9O3Y2ft024465; Fri, 24 Oct 2003 12:34:03 +0900 Date: Fri, 24 Oct 2003 12:34:01 +0900 (JST) Message-Id: <20031024.123401.08140647.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: iproute2 not compiling anymore From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031005071152.49c35297.davem@redhat.com> References: <20031005130044.GA8861@pcw.home.local> <20031005071152.49c35297.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 994 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 Content-Length: 4146 Lines: 112 In article <20031005071152.49c35297.davem@redhat.com> (at Sun, 5 Oct 2003 07:11:52 -0700), "David S. Miller" says: > On Sun, 5 Oct 2003 15:00:44 +0200 > Willy TARREAU wrote: > > > /usr/src/linux/include/linux/in.h:147: field `gsr_group' has incomplete type > > I'll happily fix this, thanks for reporting this. > > Can you please in the future report such things on the networking > development list netdev@oss.sgi.com? Thanks. I believe that 2.6 also needs this fix: D: [NET]: Fix userland iproute2 build problems introduced by mcast changes. ===== include/linux/in.h 1.7 vs edited ===== --- 1.7/include/linux/in.h Wed Apr 16 17:45:42 2003 +++ edited/include/linux/in.h Fri Oct 24 11:39:37 2003 @@ -140,29 +140,29 @@ struct group_req { - __u32 gr_interface; /* interface index */ - struct sockaddr_storage gr_group; /* group address */ + __u32 gr_interface; /* interface index */ + struct __kernel_sockaddr_storage gr_group; /* group address */ }; struct group_source_req { - __u32 gsr_interface; /* interface index */ - struct sockaddr_storage gsr_group; /* group address */ - struct sockaddr_storage gsr_source; /* source address */ + __u32 gsr_interface; /* interface index */ + struct __kernel_sockaddr_storage gsr_group; /* group address */ + struct __kernel_sockaddr_storage gsr_source; /* source address */ }; struct group_filter { - __u32 gf_interface; /* interface index */ - struct sockaddr_storage gf_group; /* multicast address */ - __u32 gf_fmode; /* filter mode */ - __u32 gf_numsrc; /* number of sources */ - struct sockaddr_storage gf_slist[1]; /* interface index */ + __u32 gf_interface; /* interface index */ + struct __kernel_sockaddr_storage gf_group; /* multicast address */ + __u32 gf_fmode; /* filter mode */ + __u32 gf_numsrc; /* number of sources */ + struct __kernel_sockaddr_storage gf_slist[1]; /* interface index */ }; #define GROUP_FILTER_SIZE(numsrc) \ - (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) \ - + (numsrc) * sizeof(struct sockaddr_storage)) + (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \ + + (numsrc) * sizeof(struct __kernel_sockaddr_storage)) struct in_pktinfo { ===== include/linux/socket.h 1.9 vs edited ===== --- 1.9/include/linux/socket.h Tue May 13 06:35:19 2003 +++ edited/include/linux/socket.h Fri Oct 24 11:42:52 2003 @@ -1,6 +1,21 @@ #ifndef _LINUX_SOCKET_H #define _LINUX_SOCKET_H +/* + * Desired design of maximum size and alignment (see RFC2553) + */ +#define _K_SS_MAXSIZE 128 /* Implementation specific max size */ +#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) + /* Implementation specific desired alignment */ + +struct __kernel_sockaddr_storage { + unsigned short ss_family; /* address family */ + /* Following field(s) are implementation specific */ + char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; + /* space to achieve desired size, */ + /* _SS_MAXSIZE value minus size of ss_family */ +} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ + #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) #include /* for CONFIG_COMPAT */ @@ -27,20 +42,7 @@ int l_linger; /* How long to linger for */ }; -/* - * Desired design of maximum size and alignment (see RFC2553) - */ -#define _SS_MAXSIZE 128 /* Implementation specific max size */ -#define _SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) - /* Implementation specific desired alignment */ - -struct sockaddr_storage { - sa_family_t ss_family; /* address family */ - /* Following field(s) are implementation specific */ - char __data[_SS_MAXSIZE - sizeof(sa_family_t)]; - /* space to achieve desired size, */ - /* _SS_MAXSIZE value minus size of ss_family */ -} __attribute__ ((aligned(_SS_ALIGNSIZE))); /* force desired alignment */ +#define sockaddr_storage __kernel_sockaddr_storage /* * As we do 4.4BSD message passing we use a 4.4BSD message passing -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From an3h0ny@yahoo.fr Fri Oct 24 04:07:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 04:08:13 -0700 (PDT) Received: from web11108.mail.yahoo.com (web11108.mail.yahoo.com [216.136.131.155]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9OB7Y25003525 for ; Fri, 24 Oct 2003 04:07:35 -0700 Message-ID: <20031024110734.66548.qmail@web11108.mail.yahoo.com> Received: from [195.68.44.148] by web11108.mail.yahoo.com via HTTP; Fri, 24 Oct 2003 13:07:34 CEST Date: Fri, 24 Oct 2003 13:07:34 +0200 (CEST) From: =?iso-8859-1?q?an7?= Subject: tcp_recvmsg() To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 995 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: an3h0ny@yahoo.fr Precedence: bulk X-list: netdev Content-Length: 1064 Lines: 34 Hi here, I need a confirmation, please : tcp_recvmsg() is called to retrieve messages from the socket receive queue, isn't it ? It is used when userland applications use the recv() call,from BSD socket API as i said in a post before, i didn't understand a syn check that was in this function. Dave Miller told me the check was just here if one day, the stack will allow data reception with a syn/ack segment, with data attached (it is technically possible). When the established state is reached, the syn/ack+data segment will be on the socket receive queue, and so, we have to account for the syn sequence number, as this sequence number doesn't correspond to any real data byte. So i need to effectively confirm that the tcp_recvmsg() retrieves messages from the socket receive queue, and which function is responsible for putting packets in queue (i think it is tcp_data_queue ?) Thanks ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From davem@pizda.ninka.net Fri Oct 24 04:39:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 04:39:34 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9OBd125006945 for ; Fri, 24 Oct 2003 04:39:01 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA07283; Fri, 24 Oct 2003 04:33:12 -0700 Date: Fri, 24 Oct 2003 04:33:12 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: iproute2 not compiling anymore Message-Id: <20031024043312.1da45974.davem@redhat.com> In-Reply-To: <20031024.123401.08140647.yoshfuji@linux-ipv6.org> References: <20031005130044.GA8861@pcw.home.local> <20031005071152.49c35297.davem@redhat.com> <20031024.123401.08140647.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 996 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: 172 Lines: 8 On Fri, 24 Oct 2003 12:34:01 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > I believe that 2.6 also needs this fix: Ok, applied. Thanks. From kazunori@miyazawa.org Fri Oct 24 05:30:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 05:30:56 -0700 (PDT) Received: from miyazawa.org (usen-221x116x13x66.ap-US01.usen.ad.jp [221.116.13.66]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9OCU125008169 for ; Fri, 24 Oct 2003 05:30:22 -0700 Received: from monza.miyazawa.org (net56-dhcp-532.sfc.keio.ac.jp [::ffff:133.27.59.20]) (IDENT: miyazawa, AUTH: LOGIN kazunori, ) by miyazawa.org with esmtp; Fri, 24 Oct 2003 21:15:15 +0900 Date: Fri, 24 Oct 2003 21:30:58 +0900 From: Kazunori Miyazawa To: davem@redhat.com, netdev@oss.sgi.com Cc: usagi@linux-ipv6.org Subject: [PATCH] [IPv6][IPsec] fix oops with using IPsec Message-Id: <20031024213058.47b4a824.kazunori@miyazawa.org> X-Mailer: Sylpheed version 0.9.6 (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 997 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kazunori@miyazawa.org Precedence: bulk X-list: netdev Content-Length: 826 Lines: 20 Hello, This patch fixes oops with using IPsec in IPv6. Original source removes RTF_NDISC at copying dst. It makes the kernel use the wrong stackable destination. --- net/ipv6/xfrm6_policy.c.org 2003-10-24 21:17:26.000000000 +0900 +++ net/ipv6/xfrm6_policy.c 2003-10-24 21:17:41.000000000 +0900 @@ -169,7 +169,7 @@ dst_prev->output = dst_prev->xfrm->type->output; /* Sheit... I remember I did this right. Apparently, * it was magically lost, so this code needs audit */ - x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL); + x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL|RTF_NDISC); x->u.rt6.rt6i_metric = rt0->rt6i_metric; x->u.rt6.rt6i_node = rt0->rt6i_node; x->u.rt6.rt6i_gateway = rt0->rt6i_gateway; --Kazunori Miyazawa From davem@pizda.ninka.net Fri Oct 24 05:42:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 05:43:32 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9OCgs25008577 for ; Fri, 24 Oct 2003 05:42:58 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id FAA21769; Fri, 24 Oct 2003 05:37:01 -0700 Date: Fri, 24 Oct 2003 05:37:01 -0700 From: "David S. Miller" To: Kazunori Miyazawa Cc: netdev@oss.sgi.com, usagi@linux-ipv6.org Subject: Re: [PATCH] [IPv6][IPsec] fix oops with using IPsec Message-Id: <20031024053701.4155945f.davem@redhat.com> In-Reply-To: <20031024213058.47b4a824.kazunori@miyazawa.org> References: <20031024213058.47b4a824.kazunori@miyazawa.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 998 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: 283 Lines: 8 On Fri, 24 Oct 2003 21:30:58 +0900 Kazunori Miyazawa wrote: > This patch fixes oops with using IPsec in IPv6. Original source removes > RTF_NDISC at copying dst. It makes the kernel use the wrong stackable > destination. Patch applied, thank you very much. From Casey@Carter.net Fri Oct 24 06:16:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 06:16:50 -0700 (PDT) Received: from c000.snv.cp.net (h008.c000.snv.cp.net [209.228.32.72]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ODGH25009781 for ; Fri, 24 Oct 2003 06:16:17 -0700 Received: (cpmta 9367 invoked from network); 24 Oct 2003 06:16:15 -0700 Received: from 12.221.64.39 (HELO Carter.net) by smtp.carter.net (209.228.32.72) with SMTP; 24 Oct 2003 06:16:15 -0700 X-Sent: 24 Oct 2003 13:16:15 GMT Message-ID: <3F99261D.5030008@Carter.net> Date: Fri, 24 Oct 2003 08:16:13 -0500 From: Casey Carter User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Bartek Wydrowski , netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: RFC1323. No timestamping if SYN timestamp = 0. Bug or Feature? References: <20031022200152.17005.qmail@web13006.mail.yahoo.com> <20031023013748.0dd168db.davem@redhat.com> In-Reply-To: <20031023013748.0dd168db.davem@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 999 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Casey@Carter.net Precedence: bulk X-list: netdev Content-Length: 814 Lines: 27 David S. Miller wrote: >It is impossible to comply to RFC1323 if we allow TSval in the >initial SYN packet to be zero, from RFC1323: > > When TSecr is not valid, its value must be zero. > >It is therefore impossible to accept TSval as zero, because >our TSecr echo of that timestamp would be also zero and thus >invalid. > >That is why we reject zero timestamps in the initial SYN packet. > > Note that the text does not say "When TSecr is zero, it is invalid." You are reversing the conditional statement "not valid implies zero" to "zero implies not valid." I don't think that the intent of this text in the RFC is to forbid the use of zero as a timestamp, but only to assert that the value should be set to zero by default. -- Casey Carter Casey@Carter.net ccarter@cs.uiuc.edu AIM: cartec69 From kala@pinerecords.com Fri Oct 24 09:30:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 09:31:00 -0700 (PDT) Received: from louise.pinerecords.com (louise.pinerecords.com [213.168.176.16]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9OGU225014730 for ; Fri, 24 Oct 2003 09:30:24 -0700 Received: from louise.pinerecords.com (localhost [127.0.0.1]) by louise.pinerecords.com with ESMTP id h9OGU0TD012797 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Oct 2003 18:30:00 +0200 Received: (from kala@localhost) by louise.pinerecords.com (submit) id h9OGU0si012796; Fri, 24 Oct 2003 18:30:00 +0200 Date: Fri, 24 Oct 2003 18:29:59 +0200 From: Tomas Szepe To: davem@redhat.com Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, grof@dragon.cz Subject: possible bug in tcp_input.c Message-ID: <20031024162959.GB11154@louise.pinerecords.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 1000 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: szepe@pinerecords.com Precedence: bulk X-list: netdev Content-Length: 2329 Lines: 63 Hi David, We came up with the attached patch during a hectic oops tracing session that got started by our sysadmin writing down an oops using the pen & paper method, no less. The crashing machine has been a firewall running a very unusual NAT + QoS configuration, however we believe that we might have discovered a real bug in 2.4's tcp_input.c. Since our insight into the internals of the tcp/ip stack is far from even basic, we are seeking your opinion on whether we are correct. The static inline function skb_peek() as defined in include/linux/skbuff.h returns a pointer to a sk_buff, or NULL when its argument is an empty list or a pointer to the head element. Since this is documented behavior, it is not surprising that all segments of code within tcp_input.c dealing with a return from skb_peek() take care not to dereference the returned pointer if it happens to be NULL. There is an exception, though: /* tcp_input.c, line 1138 */ static inline int tcp_head_timedout(struct sock *sk, struct tcp_opt *tp) { return tp->packets_out && tcp_skb_timedout(tp, skb_peek(&sk->write_queue)); } The passed NULL (and yes, this is where we are getting one) is dereferenced immediately in: /* tcp_input.c, line 1133 */ static inline int tcp_skb_timedout(struct tcp_opt *tp, struct sk_buff *skb) { return (tcp_time_stamp - TCP_SKB_CB(skb)->when > tp->rto); } with TCP_SKB_CB that is defined as /* tcp.h, line 1034 */ #define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0])) We are proposing to cure the problem by adding a simple check in tcp_head_timedout(), but are not sure whether this is the right thing to do, because as a friend put it, we seem to be fixing a leaking faucet in a god damn power plant. Thanks for any help, -- Tomas Szepe diff -urN a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c --- a/net/ipv4/tcp_input.c 2003-06-13 16:51:39 +0200 +++ b/net/ipv4/tcp_input.c 2003-10-24 17:41:19 +0200 @@ -1138,7 +1138,11 @@ static inline int tcp_head_timedout(struct sock *sk, struct tcp_opt *tp) { - return tp->packets_out && tcp_skb_timedout(tp, skb_peek(&sk->write_queue)); + struct sk_buff *skb = skb_peek(&sk->write_queue); + if (skb == NULL) + return 1; + + return tp->packets_out && tcp_skb_timedout(tp, skb); } /* Linux NewReno/SACK/FACK/ECN state machine. From kuznet@ms2.inr.ac.ru Fri Oct 24 11:00:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 11:01:26 -0700 (PDT) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9OI0i25015814 for ; Fri, 24 Oct 2003 11:00:47 -0700 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id VAA16832; Fri, 24 Oct 2003 21:59:27 +0400 From: kuznet@ms2.inr.ac.ru Message-Id: <200310241759.VAA16832@yakov.inr.ac.ru> Subject: Re: [Issues] Implementation for IPv6 MIB:ipv6PrefixTable To: mashirle@us.ibm.com, netdev@oss.sgi.com, davem@redhat.com Date: Fri, 24 Oct 2003 21:59:27 +0400 (MSD) In-Reply-To: <20031024044708.236f0d22.davem@redhat.com> from "David S. Miller" at Oct 24, 2003 04:47:08 AM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1001 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Content-Length: 734 Lines: 24 Hello! > First, do you think it's a good idea to save all prefix objects in routing > table? Those which are on-link, of course. > Second, where is the best location for the off-link prefix, on-link flag 0 > prefix to be saved? Do you really think off-link prefixes are to be saved? Prefix in use is onlink by defintion, so just return 1 in these bit and ignore off-link prefixes completely, they are meaningless, are not they? > Third, do you think it's a good idea to implement a prefix table/per > interface in the kernel? Well, if SNMP is going to be used as a tool to snoop ndisc promiscuously (which seems to be the case if it shows inforrmation about offlink prefixes), then it is definitely not a kernel task. Alexey From andi@averellmail.firstfloor.org Fri Oct 24 13:57:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 13:57:54 -0700 (PDT) Received: from zero.aec.at (Barney_Stims@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9OKvE25020934 for ; Fri, 24 Oct 2003 13:57:17 -0700 Received: from fred.muc.de (Jarn_Leffer@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id h9OKv2S25148; Fri, 24 Oct 2003 22:57:03 +0200 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 7B5885BBF5; Fri, 24 Oct 2003 22:57:07 +0200 (CEST) Date: Fri, 24 Oct 2003 22:57:07 +0200 From: Andi Kleen To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH] Limit SO_BSDCOMPAT warning Message-ID: <20031024205707.GA1072@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 1002 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Content-Length: 763 Lines: 25 Warning a few times for each process is enough. -Andi diff -u linux-2.6.0test7/net/core/sock.c-o linux-2.6.0test7mm1-averell/net/core/sock.c --- linux-2.6.0test7mm1/net/core/sock.c-o 2003-10-16 05:19:13.000000000 +0200 +++ linux-2.6.0test7mm1/net/core/sock.c 2003-10-24 22:30:46.000000000 +0200 @@ -154,8 +154,14 @@ static void sock_warn_obsolete_bsdism(const char *name) { - printk(KERN_WARNING "process `%s' is using obsolete " - "%s SO_BSDCOMPAT\n", current->comm, name); + static int warned; + static char warncomm[16]; + if (strcmp(warncomm, current->comm) && warned < 5) { + strcpy(warncomm, current->comm); + printk(KERN_WARNING "process `%s' is using obsolete " + "%s SO_BSDCOMPAT\n", warncomm, name); + warned++; + } } /* From khc@pm.waw.pl Fri Oct 24 14:35:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 14:36:05 -0700 (PDT) Received: from hq.pm.waw.pl (hq.pm.waw.pl [195.116.170.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9OLZU25021725 for ; Fri, 24 Oct 2003 14:35:31 -0700 Received: by hq.pm.waw.pl (Postfix, from userid 10) id A3D173236; Fri, 24 Oct 2003 23:35:21 +0200 (CEST) Received: by defiant.pm.waw.pl (Postfix, from userid 500) id CD903302FD; Fri, 24 Oct 2003 23:35:23 +0200 (CEST) To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] 2.6.0test8 Goramo PCI200SYN sync serial driver From: Krzysztof Halasa Date: 24 Oct 2003 23:35:23 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-archive-position: 1003 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: khc@pm.waw.pl Precedence: bulk X-list: netdev Content-Length: 19955 Lines: 24 --=-=-= Hi, This is a 2.6.0test driver for Goramo PCI200SYN sync serial card, a dual V.35 port PCI card. This patch adds some defines to drivers/net/wan/hd64572.h header file, which is then shared between Cyclades PC300 and this driver (both cards use the same Hitachi SCA chip). This change: -#ifndef _HD64572_H -#define _HD64572_H +#ifndef __HD64572_H +#define __HD64572_H is required for proper detection of SCA chip version handled by .../wan/hd6457x.c file (SCA HD64570 used by n2.c and c101.c vs SCA-II HD64572 used by, for example, PCI200SYN). Compiles, works. Please apply. Thanks. -- Krzysztof Halasa, B*FH --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=pci200-2.6.0test8.patch --- linux-2.6.orig/drivers/net/wan/Makefile 2003-10-03 15:38:12.000000000 +0200 +++ linux-2.6/drivers/net/wan/Makefile 2003-10-03 16:28:07.000000000 +0200 @@ -67,6 +67,7 @@ obj-$(CONFIG_N2) += n2.o obj-$(CONFIG_C101) += c101.o obj-$(CONFIG_WANXL) += wanxl.o +obj-$(CONFIG_PCI200SYN) += pci200syn.o ifeq ($(CONFIG_WANXL_BUILD_FIRMWARE),y) ifeq ($(ARCH),m68k) --- linux-2.6.orig/drivers/net/wan/hd64572.h 2003-08-09 06:38:50.000000000 +0200 +++ linux-2.6/drivers/net/wan/hd64572.h 2003-10-03 16:22:06.000000000 +0200 @@ -23,8 +25,8 @@ * */ -#ifndef _HD64572_H -#define _HD64572_H +#ifndef __HD64572_H +#define __HD64572_H /* Illegal Access Register */ #define ILAR 0x00 @@ -59,6 +61,9 @@ #define IR0_M(val, chan) ((val)<<(8*(chan))) /* Int MSCI */ /* MSCI Channel Registers */ +#define MSCI0_OFFSET 0x00 +#define MSCI1_OFFSET 0x80 + #define MD0 0x138 /* Mode reg 0 */ #define MD1 0x139 /* Mode reg 1 */ #define MD2 0x13a /* Mode reg 2 */ @@ -107,6 +113,11 @@ #define RCR 0x156 /* Rx DMA Critical Request Reg */ /* Timer Registers */ +#define TIMER0RX_OFFSET 0x00 +#define TIMER0TX_OFFSET 0x10 +#define TIMER1RX_OFFSET 0x20 +#define TIMER1TX_OFFSET 0x30 + #define TCNTL 0x200 /* Timer Upcounter L */ #define TCNTH 0x201 /* Timer Upcounter H */ #define TCONRL 0x204 /* Timer Constant Register L */ @@ -132,6 +144,11 @@ #define DCR_TX(chan) (0x59 + 2*chan) /* DMA Command Reg (Tx) */ /* DMA Channel Registers */ +#define DMAC0RX_OFFSET 0x00 +#define DMAC0TX_OFFSET 0x20 +#define DMAC1RX_OFFSET 0x40 +#define DMAC1TX_OFFSET 0x60 + #define DARL 0x80 /* Dest Addr Register L (single-block, RX only) */ #define DARH 0x81 /* Dest Addr Register H (single-block, RX only) */ #define DARB 0x82 /* Dest Addr Register B (single-block, RX only) */ @@ -166,7 +184,17 @@ unsigned char filler[5]; /* alignment filler (16 bytes) */ } pcsca_bd_t; -/* +/* Block Descriptor Structure */ +typedef struct { + u32 cp; /* pointer to next block descriptor */ + u32 bp; /* buffer pointer */ + u16 len; /* data length */ + u8 stat; /* status */ + u8 unused; /* pads to 4-byte boundary */ +}pkt_desc; + + +/* Descriptor Status definitions: Bit Transmission Reception @@ -190,6 +218,23 @@ #define DST_SHRT 0x40 /* Short Frame */ #define DST_EOM 0x80 /* End of Message */ +/* Packet Descriptor Status bits */ + +#define ST_TX_EOM 0x80 /* End of frame */ +#define ST_TX_UNDRRUN 0x08 +#define ST_TX_OWNRSHP 0x02 +#define ST_TX_EOT 0x01 /* End of transmition */ + +#define ST_RX_EOM 0x80 /* End of frame */ +#define ST_RX_SHORT 0x40 /* Short frame */ +#define ST_RX_ABORT 0x20 /* Abort */ +#define ST_RX_RESBIT 0x10 /* Residual bit */ +#define ST_RX_OVERRUN 0x08 /* Overrun */ +#define ST_RX_CRC 0x04 /* CRC */ +#define ST_RX_OWNRSHP 0x02 + +#define ST_ERROR_MASK 0x7C + /* Status Counter Registers */ #define CMCR 0x158 /* Counter Master Ctl Reg */ #define TECNTL 0x160 /* Tx EOM Counter L */ @@ -246,11 +291,25 @@ #define MD0_BIT_SYNC 0x80 #define MD0_TRANSP 0xc0 +#define MD0_HDLC 0x80 /* Bit-sync HDLC mode */ + +#define MD0_CRC_NONE 0x00 +#define MD0_CRC_16_0 0x04 +#define MD0_CRC_16 0x05 +#define MD0_CRC_ITU32 0x06 +#define MD0_CRC_ITU 0x07 + #define MD1_NOADDR 0x00 #define MD1_SADDR1 0x40 #define MD1_SADDR2 0x80 #define MD1_DADDR 0xc0 +#define MD2_NRZI_IEEE 0x40 +#define MD2_MANCHESTER 0x80 +#define MD2_FM_MARK 0xA0 +#define MD2_FM_SPACE 0xC0 +#define MD2_LOOPBACK 0x03 /* Local data Loopback */ + #define MD2_F_DUPLEX 0x00 #define MD2_AUTO_ECHO 0x01 #define MD2_LOOP_HI_Z 0x02 @@ -274,6 +333,10 @@ #define CTL_URSKP 0x40 #define CTL_URCT 0x80 +#define CTL_NORTS 0x01 +#define CTL_NODTR 0x02 +#define CTL_IDLE 0x10 + #define RXS_BR0 0x01 #define RXS_BR1 0x02 #define RXS_BR2 0x04 @@ -302,6 +365,12 @@ #define EXS_TES1 0x20 #define EXS_TES2 0x40 +#define CLK_BRG_MASK 0x0F +#define CLK_PIN_OUT 0x80 +#define CLK_LINE 0x00 /* clock line input */ +#define CLK_BRG 0x40 /* internal baud rate generator */ +#define CLK_TX_RXCLK 0x60 /* TX clock from RX clock */ + #define CMD_RX_RST 0x11 #define CMD_RX_ENA 0x12 #define CMD_RX_DIS 0x13 @@ -324,6 +393,10 @@ #define CMD_SRCH_MODE 0x31 #define CMD_NOP 0x00 +#define CMD_RESET 0x21 +#define CMD_TX_ENABLE 0x02 +#define CMD_RX_ENABLE 0x12 + #define ST0_RXRDY 0x01 #define ST0_TXRDY 0x02 #define ST0_RXINTB 0x20 @@ -373,7 +446,9 @@ #define IE0_TXRDY 0x02 #define IE0_RXINTB 0x20 #define IE0_RXINTA 0x40 #define IE0_TXINT 0x80 +#define IE0_UDRN 0x00008000 /* TX underrun MSCI interrupt enable */ +#define IE0_CDCD 0x00000400 /* CD level change interrupt enable */ #define IE1_IDLD 0x01 #define IE1_ABTD 0x02 @@ -424,14 +499,28 @@ #define DIR_EOM 0x40 #define DIR_EOT 0x80 +#define DIR_REFE 0x04 +#define DIR_UDRFE 0x04 +#define DIR_COAE 0x08 +#define DIR_COFE 0x10 +#define DIR_BOFE 0x20 +#define DIR_EOME 0x40 +#define DIR_EOTE 0x80 + #define DMR_CNTE 0x02 #define DMR_NF 0x04 #define DMR_SEOME 0x08 #define DMR_TMOD 0x10 +#define DMER_DME 0x80 /* DMA Master Enable */ + #define DCR_SW_ABT 0x01 #define DCR_FCT_CLR 0x02 +#define DCR_ABORT 0x01 +#define DCR_CLEAR_EOF 0x02 + +#define PCR_COTE 0x80 #define PCR_PR0 0x01 #define PCR_PR1 0x02 #define PCR_PR2 0x04 @@ -440,4 +529,4 @@ #define PCR_OSB 0x40 #define PCR_BURST 0x80 -#endif /* (_HD64572_H) */ +#endif /* (__HD64572_H) */ --- linux-2.6.orig/drivers/net/wan/pci200syn.c 2003-10-03 16:29:06.000000000 +0200 +++ linux-2.6/drivers/net/wan/pci200syn.c 2003-10-03 16:22:06.000000000 +0200 @@ -0,0 +1,458 @@ +/* + * Goramo PCI200SYN synchronous serial card driver for Linux + * + * Copyright (C) 2002-2003 Krzysztof Halasa + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * For information see http://hq.pm.waw.pl/hdlc/ + * + * Sources of information: + * Hitachi HD64572 SCA-II User's Manual + * PLX Technology Inc. PCI9052 Data Book + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hd64572.h" + +static const char* version = "Goramo PCI200SYN driver version: 1.15"; +static const char* devname = "PCI200SYN"; + +#undef DEBUG_PKT +#define DEBUG_RINGS + +#define PCI200SYN_PLX_SIZE 0x80 /* PLX control window size (128b) */ +#define PCI200SYN_SCA_SIZE 0x400 /* SCA window size (1Kb) */ +#define ALL_PAGES_ALWAYS_MAPPED +#define NEED_DETECT_RAM +#define NEED_SCA_MSCI_INTR +#define MAX_TX_BUFFERS 10 + +static int pci_clock_freq = 33000000; +#define CLOCK_BASE pci_clock_freq + +#define PCI_VENDOR_ID_GORAMO 0x10B5 /* uses PLX:9050 ID - this card */ +#define PCI_DEVICE_ID_PCI200SYN 0x9050 /* doesn't have its own ID */ + + +/* + * PLX PCI9052 local configuration and shared runtime registers. + * This structure can be used to access 9052 registers (memory mapped). + */ +typedef struct { + u32 loc_addr_range[4]; /* 00-0Ch : Local Address Ranges */ + u32 loc_rom_range; /* 10h : Local ROM Range */ + u32 loc_addr_base[4]; /* 14-20h : Local Address Base Addrs */ + u32 loc_rom_base; /* 24h : Local ROM Base */ + u32 loc_bus_descr[4]; /* 28-34h : Local Bus Descriptors */ + u32 rom_bus_descr; /* 38h : ROM Bus Descriptor */ + u32 cs_base[4]; /* 3C-48h : Chip Select Base Addrs */ + u32 intr_ctrl_stat; /* 4Ch : Interrupt Control/Status */ + u32 init_ctrl; /* 50h : EEPROM ctrl, Init Ctrl, etc */ +}plx9052; + + + +typedef struct port_s { + hdlc_device hdlc; /* HDLC device struct - must be first */ + struct card_s *card; + spinlock_t lock; /* TX lock */ + sync_serial_settings settings; + int rxpart; /* partial frame received, next frame invalid*/ + unsigned short encoding; + unsigned short parity; + u16 rxin; /* rx ring buffer 'in' pointer */ + u16 txin; /* tx ring buffer 'in' and 'last' pointers */ + u16 txlast; + u8 rxs, txs, tmc; /* SCA registers */ + u8 phy_node; /* physical port # - 0 or 1 */ +}port_t; + + + +typedef struct card_s { + u32 ramphys; /* buffer memory base (physical) */ + u8* rambase; /* buffer memory base (virtual) */ + u32 ramsize; /* buffer memory size */ + u32 scaphys; /* SCA memory base (physical) */ + u8* scabase; /* SCA memory base (virtual) */ + u32 plxphys; /* PLX registers memory base (physical) */ + plx9052* plxbase; /* PLX registers memory base (virtual) */ + u16 rx_ring_buffers; /* number of buffers in a ring */ + u16 tx_ring_buffers; + u16 buff_offset; /* offset of first buffer of first channel */ + u8 irq; /* interrupt request level */ + + port_t ports[2]; +}card_t; + + +#define sca_in(reg, card) readb(card->scabase + (reg)) +#define sca_out(value, reg, card) writeb(value, card->scabase + (reg)) +#define sca_inw(reg, card) readw(card->scabase + (reg)) +#define sca_outw(value, reg, card) writew(value, card->scabase + (reg)) +#define sca_inl(reg, card) readl(card->scabase + (reg)) +#define sca_outl(value, reg, card) writel(value, card->scabase + (reg)) + +#define port_to_card(port) (port->card) +#define log_node(port) (port->phy_node) +#define phy_node(port) (port->phy_node) +#define winbase(card) (card->rambase) +#define get_port(card, port) (&card->ports[port]) +#define sca_flush(card) (sca_in(IER0, card)); + +static inline void new_memcpy_toio(char *dest, char *src, int length) +{ + int len; + do { + len = length > 256 ? 256 : length; + memcpy_toio(dest, src, len); + dest += len; + src += len; + length -= len; + readb(dest); + } while (len); +} + +#undef memcpy_toio +#define memcpy_toio new_memcpy_toio + +#include "hd6457x.c" + + +static void pci200_set_iface(port_t *port) +{ + card_t *card = port->card; + u16 msci = get_msci(port); + u8 rxs = port->rxs & CLK_BRG_MASK; + u8 txs = port->txs & CLK_BRG_MASK; + + sca_out(EXS_TES1, (phy_node(port) ? MSCI1_OFFSET : MSCI0_OFFSET) + EXS, + port_to_card(port)); + switch(port->settings.clock_type) { + case CLOCK_INT: + rxs |= CLK_BRG; /* BRG output */ + txs |= CLK_PIN_OUT | CLK_TX_RXCLK; /* RX clock */ + break; + + case CLOCK_TXINT: + rxs |= CLK_LINE; /* RXC input */ + txs |= CLK_PIN_OUT | CLK_BRG; /* BRG output */ + break; + + case CLOCK_TXFROMRX: + rxs |= CLK_LINE; /* RXC input */ + txs |= CLK_PIN_OUT | CLK_TX_RXCLK; /* RX clock */ + break; + + default: /* EXTernal clock */ + rxs |= CLK_LINE; /* RXC input */ + txs |= CLK_PIN_OUT | CLK_LINE; /* TXC input */ + break; + } + + port->rxs = rxs; + port->txs = txs; + sca_out(rxs, msci + RXS, card); + sca_out(txs, msci + TXS, card); + sca_set_port(port); +} + + + +static int pci200_open(struct net_device *dev) +{ + hdlc_device *hdlc = dev_to_hdlc(dev); + port_t *port = hdlc_to_port(hdlc); + + int result = hdlc_open(hdlc); + if (result) + return result; + + sca_open(hdlc); + pci200_set_iface(port); + sca_flush(port_to_card(port)); + return 0; +} + + + +static int pci200_close(struct net_device *dev) +{ + hdlc_device *hdlc = dev_to_hdlc(dev); + sca_close(hdlc); + sca_flush(port_to_card(dev_to_port(dev))); + hdlc_close(hdlc); + return 0; +} + + + +static int pci200_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +{ + const size_t size = sizeof(sync_serial_settings); + sync_serial_settings new_line, *line = ifr->ifr_settings.ifs_ifsu.sync; + hdlc_device *hdlc = dev_to_hdlc(dev); + port_t *port = hdlc_to_port(hdlc); + +#ifdef DEBUG_RINGS + if (cmd == SIOCDEVPRIVATE) { + sca_dump_rings(hdlc); + return 0; + } +#endif + if (cmd != SIOCWANDEV) + return hdlc_ioctl(dev, ifr, cmd); + + switch(ifr->ifr_settings.type) { + case IF_GET_IFACE: + ifr->ifr_settings.type = IF_IFACE_V35; + if (ifr->ifr_settings.size < size) { + ifr->ifr_settings.size = size; /* data size wanted */ + return -ENOBUFS; + } + if (copy_to_user(line, &port->settings, size)) + return -EFAULT; + return 0; + + case IF_IFACE_V35: + case IF_IFACE_SYNC_SERIAL: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + + if (copy_from_user(&new_line, line, size)) + return -EFAULT; + + if (new_line.clock_type != CLOCK_EXT && + new_line.clock_type != CLOCK_TXFROMRX && + new_line.clock_type != CLOCK_INT && + new_line.clock_type != CLOCK_TXINT) + return -EINVAL; /* No such clock setting */ + + if (new_line.loopback != 0 && new_line.loopback != 1) + return -EINVAL; + + memcpy(&port->settings, &new_line, size); /* Update settings */ + pci200_set_iface(port); + sca_flush(port_to_card(port)); + return 0; + + default: + return hdlc_ioctl(dev, ifr, cmd); + } +} + + + +static void pci200_pci_remove_one(struct pci_dev *pdev) +{ + int i; + card_t *card = pci_get_drvdata(pdev); + + for(i = 0; i < 2; i++) + if (card->ports[i].card) + unregister_hdlc_device(&card->ports[i].hdlc); + + if (card->irq) + free_irq(card->irq, card); + iounmap(card->rambase); + iounmap(card->scabase); + iounmap(card->plxbase); + pci_release_regions(pdev); + kfree(card); +} + + + +static int __devinit pci200_pci_init_one(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + card_t *card; + u8 rev_id; + u32 *p; + int i; + +#ifndef MODULE + static int printed_version; + if (!printed_version++) + printk(KERN_INFO "%s\n", version); +#endif + + i = pci_enable_device(pdev); + if (i) + return i; + + i = pci_request_regions(pdev, "PCI200SYN"); + if (i) + return i; + + card = kmalloc(sizeof(card_t), GFP_KERNEL); + if (card == NULL) { + printk(KERN_ERR "pci200syn: unable to allocate memory\n"); + return -ENOBUFS; + } + memset(card, 0, sizeof(card_t)); + pci_set_drvdata(pdev, card); + + pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); + if (pci_resource_len(pdev, 0) != PCI200SYN_PLX_SIZE || + pci_resource_len(pdev, 2) != PCI200SYN_SCA_SIZE || + pci_resource_len(pdev, 3) < 16384) { + printk(KERN_ERR "pci200syn: invalid card EEPROM parameters\n"); + kfree(card); + return -EFAULT; + } + + card->plxphys = pci_resource_start(pdev,0) & PCI_BASE_ADDRESS_MEM_MASK; + card->plxbase = ioremap(card->plxphys, PCI200SYN_PLX_SIZE); + + card->scaphys = pci_resource_start(pdev,2) & PCI_BASE_ADDRESS_MEM_MASK; + card->scabase = ioremap(card->scaphys, PCI200SYN_SCA_SIZE); + + card->ramphys = pci_resource_start(pdev,3) & PCI_BASE_ADDRESS_MEM_MASK; + card->rambase = ioremap(card->ramphys, pci_resource_len(pdev,3)); + + /* Reset PLX */ + p = &card->plxbase->init_ctrl; + writel(readl(p) | 0x40000000, p); + readl(p); /* Flush the write - do not use sca_flush */ + udelay(1); + + writel(readl(p) & ~0x40000000, p); + readl(p); /* Flush the write - do not use sca_flush */ + udelay(1); + + card->ramsize = sca_detect_ram(card, card->rambase, + pci_resource_len(pdev,3)); + + /* number of TX + RX buffers for one port - this is dual port card */ + i = card->ramsize / (2 * (sizeof(pkt_desc) + HDLC_MAX_MRU)); + card->tx_ring_buffers = min(i / 2, MAX_TX_BUFFERS); + card->rx_ring_buffers = i - card->tx_ring_buffers; + + card->buff_offset = 2 * sizeof(pkt_desc) * (card->tx_ring_buffers + + card->rx_ring_buffers); + + printk(KERN_INFO "pci200syn: %u KB RAM at 0x%x, IRQ%u, using %u TX +" + " %u RX packets rings\n", card->ramsize / 1024, + card->ramphys, pdev->irq, + card->tx_ring_buffers, card->rx_ring_buffers); + + if (card->tx_ring_buffers < 1) { + printk(KERN_ERR "pci200syn: RAM test failed\n"); + pci200_pci_remove_one(pdev); + return -EFAULT; + } + + /* Enable interrupts on the PCI bridge */ + p = &card->plxbase->intr_ctrl_stat; + writew(readw(p) | 0x0040, p); + + /* Allocate IRQ */ + if(request_irq(pdev->irq, sca_intr, SA_SHIRQ, devname, card)) { + printk(KERN_WARNING "pci200syn: could not allocate IRQ%d.\n", + pdev->irq); + pci200_pci_remove_one(pdev); + return -EBUSY; + } + card->irq = pdev->irq; + + sca_init(card, 0); + + for(i = 0; i < 2; i++) { + port_t *port = &card->ports[i]; + struct net_device *dev = hdlc_to_dev(&port->hdlc); + port->phy_node = i; + + spin_lock_init(&port->lock); + SET_MODULE_OWNER(dev); + dev->irq = card->irq; + dev->mem_start = card->ramphys; + dev->mem_end = card->ramphys + card->ramsize - 1; + dev->tx_queue_len = 50; + dev->do_ioctl = pci200_ioctl; + dev->open = pci200_open; + dev->stop = pci200_close; + port->hdlc.attach = sca_attach; + port->hdlc.xmit = sca_xmit; + port->settings.clock_type = CLOCK_EXT; + if(register_hdlc_device(&port->hdlc)) { + printk(KERN_ERR "pci200syn: unable to register hdlc " + "device\n"); + pci200_pci_remove_one(pdev); + return -ENOBUFS; + } + port->card = card; + sca_init_sync_port(port); /* Set up SCA memory */ + + printk(KERN_INFO "%s: PCI200SYN node %d\n", + hdlc_to_name(&port->hdlc), port->phy_node); + } + + sca_flush(card); + return 0; +} + + + +static struct pci_device_id pci200_pci_tbl[] __devinitdata = { + { PCI_VENDOR_ID_GORAMO, PCI_DEVICE_ID_PCI200SYN, PCI_ANY_ID, + PCI_ANY_ID, 0, 0, 0 }, + { 0, } +}; + + +static struct pci_driver pci200_pci_driver = { + name: "PCI200SYN", + id_table: pci200_pci_tbl, + probe: pci200_pci_init_one, + remove: pci200_pci_remove_one, +}; + + +static int __init pci200_init_module(void) +{ +#ifdef MODULE + printk(KERN_INFO "%s\n", version); +#endif + if (pci_clock_freq < 1000000 || pci_clock_freq > 80000000) { + printk(KERN_ERR "pci200syn: Invalid PCI clock frequency\n"); + return -EINVAL; + } + return pci_module_init(&pci200_pci_driver); +} + + + +static void __exit pci200_cleanup_module(void) +{ + pci_unregister_driver(&pci200_pci_driver); +} + +MODULE_AUTHOR("Krzysztof Halasa "); +MODULE_DESCRIPTION("Goramo PCI200SYN serial port driver"); +MODULE_LICENSE("GPL v2"); +MODULE_DEVICE_TABLE(pci, pci200_pci_tbl); +module_param(pci_clock_freq, int, 0444); +MODULE_PARM_DESC(pci_clock_freq, "System PCI clock frequency in Hz"); +module_init(pci200_init_module); +module_exit(pci200_cleanup_module); --- linux-2.6.orig/drivers/net/wan/Kconfig 2003-10-03 15:38:12.000000000 +0200 +++ linux-2.6/drivers/net/wan/Kconfig 2003-10-03 16:27:08.000000000 +0200 @@ -325,6 +325,21 @@ comment "X.25/LAPB support is disabled" depends on WAN && HDLC && (LAPB!=m || HDLC!=m) && LAPB!=y +config PCI200SYN + tristate "Goramo PCI200SYN support" + depends on HDLC && PCI + help + This driver is for PCI200SYN cards made by Goramo sp. j. + If you have such a card, say Y here and see + + + If you want to compile the driver as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read . The module + will be called pci200syn. + + If unsure, say N here. + config WANXL tristate "SBE Inc. wanXL support" depends on HDLC && PCI --=-=-=-- From davem@pizda.ninka.net Fri Oct 24 19:36:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 19:37:13 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9P2ac25027733 for ; Fri, 24 Oct 2003 19:36:38 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA23696; Fri, 24 Oct 2003 19:30:35 -0700 Date: Fri, 24 Oct 2003 19:30:34 -0700 From: "David S. Miller" To: Tomas Szepe Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, grof@dragon.cz Subject: Re: possible bug in tcp_input.c Message-Id: <20031024193034.30f1caed.davem@redhat.com> In-Reply-To: <20031024162959.GB11154@louise.pinerecords.com> References: <20031024162959.GB11154@louise.pinerecords.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1004 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: 906 Lines: 25 On Fri, 24 Oct 2003 18:29:59 +0200 Tomas Szepe wrote: > /* tcp_input.c, line 1138 */ > static inline int tcp_head_timedout(struct sock *sk, struct tcp_opt *tp) > { > return tp->packets_out && tcp_skb_timedout(tp, skb_peek(&sk->write_queue)); > } > > The passed NULL (and yes, this is where we are getting one) is dereferenced > immediately in: > > /* tcp_input.c, line 1133 */ > static inline int tcp_skb_timedout(struct tcp_opt *tp, struct sk_buff *skb) > { > return (tcp_time_stamp - TCP_SKB_CB(skb)->when > tp->rto); > } If tp->packets_out is non-zero (which by definition it is in your case else the right hand side of the "&&" would not be evaluated) then we _MUST_ have some packets in sk->write_queue. Something is being fiercely corrupted. Probably some piece of netfilter is freeing up an SKB one too many times thus corrupting the TCP write queue list pointers. From davem@pizda.ninka.net Fri Oct 24 19:43:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 24 Oct 2003 19:44:00 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9P2hQ25028108 for ; Fri, 24 Oct 2003 19:43:26 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA23723; Fri, 24 Oct 2003 19:37:26 -0700 Date: Fri, 24 Oct 2003 19:37:26 -0700 From: "David S. Miller" To: Andi Kleen Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Limit SO_BSDCOMPAT warning Message-Id: <20031024193726.0c269b60.davem@redhat.com> In-Reply-To: <20031024205707.GA1072@averell> References: <20031024205707.GA1072@averell> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1005 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: 365 Lines: 11 On Fri, 24 Oct 2003 22:57:07 +0200 Andi Kleen wrote: > Warning a few times for each process is enough. Ok, I'll apply this. I like this version of a patch limiting this message, compared to the others that have been submitted, because it still ensures that every program that has the problem will show up at least one time in the logs. Thanks Andi. From kala@pinerecords.com Sat Oct 25 02:35:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 25 Oct 2003 02:36:16 -0700 (PDT) Received: from louise.pinerecords.com (louise.pinerecords.com [213.168.176.16]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9P9ZZ25004498 for ; Sat, 25 Oct 2003 02:35:36 -0700 Received: from louise.pinerecords.com (localhost [127.0.0.1]) by louise.pinerecords.com with ESMTP id h9P9CvTD019498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Oct 2003 11:12:57 +0200 Received: (from kala@localhost) by louise.pinerecords.com (submit) id h9P9Cu2m019497; Sat, 25 Oct 2003 11:12:56 +0200 Date: Sat, 25 Oct 2003 11:12:56 +0200 From: Tomas Szepe To: "David S. Miller" Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, grof@dragon.cz Subject: Re: possible bug in tcp_input.c Message-ID: <20031025091256.GB13378@louise.pinerecords.com> References: <20031024162959.GB11154@louise.pinerecords.com> <20031024193034.30f1caed.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031024193034.30f1caed.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 1006 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: szepe@pinerecords.com Precedence: bulk X-list: netdev Content-Length: 2978 Lines: 78 On Oct-24 2003, Fri, 19:30 -0700 David S. Miller wrote: > > /* tcp_input.c, line 1138 */ > > static inline int tcp_head_timedout(struct sock *sk, struct tcp_opt *tp) > > { > > return tp->packets_out && tcp_skb_timedout(tp, skb_peek(&sk->write_queue)); > > } > > > > The passed NULL (and yes, this is where we are getting one) is dereferenced > > immediately in: > > > > /* tcp_input.c, line 1133 */ > > static inline int tcp_skb_timedout(struct tcp_opt *tp, struct sk_buff *skb) > > { > > return (tcp_time_stamp - TCP_SKB_CB(skb)->when > tp->rto); > > } > > If tp->packets_out is non-zero (which by definition it is > in your case else the right hand side of the "&&" would not be > evaluated) then we _MUST_ have some packets in sk->write_queue. > > Something is being fiercely corrupted. Probably some piece of > netfilter is freeing up an SKB one too many times thus corrupting > the TCP write queue list pointers. Ok, thanks. Here's the backtrace in case you are able to extract some information out of it. >>EIP; c01fa86f <===== >>ebx; c606c19c <_end+5d94b7c/85faa40> >>esi; c606c0e0 <_end+5d94ac0/85faa40> >>ebp; c606c0e0 <_end+5d94ac0/85faa40> >>esp; c026bc24 Trace; c01ffbe5 Trace; c01fb46b Trace; c01fbc67 Trace; c01fc06c Trace; c01fe6f2 Trace; c88e3c34 <[ip_tables]__kstrtab_ipt_register_table+0/0> Trace; c01063a2 Trace; c0206835 Trace; c01ed38e Trace; c01e0a3b Trace; c01ed240 Trace; c01ed008 Trace; c01ed240 Trace; c01ed589 Trace; c8912ddc <.data.end+3ba5/????> Trace; c01e0ca4 Trace; c01ed3b0 Trace; c88fa12a <[ip_nat_ftp].data.end+184b/8781> Trace; c01e21cd Trace; c88fa1cf <[ip_nat_ftp].data.end+18f0/8781> Trace; c01e08c2 Trace; c88fa7c0 <[ip_nat_ftp].data.end+1ee1/8781> Trace; c01ed3b0 Trace; c01ed3b0 Trace; c01e0a97 Trace; c88fa7a0 <[ip_nat_ftp].data.end+1ec1/8781> Trace; c01ed3b0 Trace; c88fa7c0 <[ip_nat_ftp].data.end+1ee1/8781> Trace; c01ed1de Trace; c01ed3b0 Trace; c01da3ef Trace; c01da533 Trace; c01da644 Trace; c011b3b5 Trace; c0108b4a Trace; c0105390 Trace; c010b0a8 Trace; c0105390 Trace; c01053b3 Trace; c0105442 Trace; c0105000 <_stext+0/0> -- Tomas Szepe From pekkas@netcore.fi Sat Oct 25 12:27:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 25 Oct 2003 12:28:13 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9PJRZ25021104 for ; Sat, 25 Oct 2003 12:27:36 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h9PJRR212166; Sat, 25 Oct 2003 22:27:28 +0300 Date: Sat, 25 Oct 2003 22:27:27 +0300 (EEST) From: Pekka Savola To: netdev@oss.sgi.com cc: Ed Rupp Subject: bugs in net/ipv6/mcast.c (fwd) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1007 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 635 Lines: 20 Probably fixed already, but just in case... ---------- Forwarded message ---------- Date: Sat, 25 Oct 2003 07:23:53 -0500 From: Ed Rupp To: pekkas@netcore.fi Subject: bugs in net/ipv6/mcast.c Hi. In the latest linux-2.6.0-test8 source there are 2 bugs in net/ipv6/mcast.c In function inet6_mc_check() the if statements on lines 607 and 609 have extra semicolons that will cause the code to fail. if (mc->sfmode == MCAST_INCLUDE && i >= psl->sl_count); rv = 0; if (mc->sfmode == MCAST_EXCLUDE && i < psl->sl_count); rv = 0; From aeb@cwi.nl Sat Oct 25 14:44:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 25 Oct 2003 14:45:03 -0700 (PDT) Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9PLiT25022361 for ; Sat, 25 Oct 2003 14:44:30 -0700 Received: from apps.cwi.nl (apps.cwi.nl [192.16.191.34]) by hera.cwi.nl with ESMTP id h9PLiJYB008946 for ; Sat, 25 Oct 2003 23:44:19 +0200 (MEST) From: Andries.Brouwer@cwi.nl Received: by apps.cwi.nl id h9PLiJ502790; Sat, 25 Oct 2003 23:44:19 +0200 (MEST) Date: Sat, 25 Oct 2003 23:44:19 +0200 (MEST) Message-Id: To: davem@redhat.com Subject: [patch] posix compliance for send(to) Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com X-archive-position: 1008 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Andries.Brouwer@cwi.nl Precedence: bulk X-list: netdev Content-Length: 1294 Lines: 39 POSIX 1003.1-2001, 2003 edition (see http://www.opengroup.org/onlinepubs/007904975/toc.htm) says about send(): The send() function shall send a message only when the socket is connected and gives the error returns [ENOTCONN] The socket is not connected or otherwise has not had the peer pre-specified. [EPIPE] The socket is shut down for writing, or the socket is connection-mode and is no longer connected. In the latter case, and if the socket is of type SOCK_STREAM, the SIGPIPE signal is generated to the calling thread. However, currently (2.6.0-test6) I see EPIPE and SIGPIPE for a send() on a fresh, non-connected socket. I suppose the below patch fixes this, but have not checked details of the state machine. Andries diff -u --recursive --new-file -X /linux/dontdiff a/net/ipv4/tcp.c b/net/ipv4/tcp.c --- a/net/ipv4/tcp.c Mon Jun 23 04:44:14 2003 +++ b/net/ipv4/tcp.c Sat Oct 25 22:46:44 2003 @@ -1044,6 +1044,10 @@ flags = msg->msg_flags; timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT); + err = -ENOTCONN; + if (sk->sk_state == TCP_CLOSE && !sock_flag(sk, SOCK_DONE)) + goto out_err; + /* Wait for a connection to finish. */ if ((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) if ((err = wait_for_tcp_connect(sk, flags, &timeo)) != 0) From phillim2@comcast.net Sat Oct 25 15:15:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 25 Oct 2003 15:16:06 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9PMFC25022912 for ; Sat, 25 Oct 2003 15:15:32 -0700 Received: from siasl.dyndns.org ([68.45.111.32]) by comcast.net (rwcrmhc12) with ESMTP id <2003102522150501400e9o1re>; Sat, 25 Oct 2003 22:15:05 +0000 Received: from phillim2 by siasl.dyndns.org with local (Exim 3.35 #1 (Debian)) id 1ADWg7-0004tv-00; Sat, 25 Oct 2003 18:14:35 -0400 Date: Sat, 25 Oct 2003 18:14:35 -0400 To: linux-kernel@vger.kernel.org Cc: torvalds@osdl.org, jgarzik@pobox.com, shemminger@osdl.org, netdev@oss.sgi.com Subject: [PATCH] ibmtr_cs/ibmtr on 2.6.0-test9 - get working again Message-ID: <20031025221435.GA18782@siasl.dyndns.org> Mail-Followup-To: phillim2, linux-kernel@vger.kernel.org, torvalds@osdl.org, jgarzik@pobox.com, shemminger@osdl.org, netdev@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i From: Mike Phillips X-archive-position: 1009 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: phillim2@comcast.net Precedence: bulk X-list: netdev Content-Length: 2807 Lines: 83 Patch to get ibmtr_cs / ibmtr working again in 2.6.0-test9. A change went in a while back I missed that killed it. Also fixed the timer to elimitate the uninitialized timer error on close. Please apply so we have a working driver for 2.6. I'll start right on updates to the new net-2.5 probes interface. Thanks Mike Phillips diff -urN -X dontdiff linux-2.6.0-test9.vanilla/drivers/net/pcmcia/ibmtr_cs.c linux-2.6.0-test9/drivers/net/pcmcia/ibmtr_cs.c --- linux-2.6.0-test9.vanilla/drivers/net/pcmcia/ibmtr_cs.c 2003-10-25 14:43:42.000000000 -0400 +++ linux-2.6.0-test9/drivers/net/pcmcia/ibmtr_cs.c 2003-10-25 17:23:35.000000000 -0400 @@ -136,7 +136,7 @@ struct net_device *dev; dev_node_t node; window_handle_t sram_win_handle; - struct tok_info ti; + struct tok_info *ti; } ibmtr_dev_t; static void netdev_get_drvinfo(struct net_device *dev, @@ -168,14 +168,17 @@ DEBUG(0, "ibmtr_attach()\n"); /* Create new token-ring device */ - dev = alloc_trdev(sizeof(*info)); + info = kmalloc(sizeof(*info), GFP_KERNEL); + if (!info) return NULL; + memset(info,0,sizeof(*info)); + dev = alloc_trdev(sizeof(struct tok_info)); if (!dev) return NULL; - info = dev->priv; link = &info->link; link->priv = info; - + info->ti = dev->priv; + link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts1 = 4; link->io.IOAddrLines = 16; @@ -265,6 +268,7 @@ *linkp = link->next; unregister_netdev(dev); free_netdev(dev); + kfree(info); } /* ibmtr_detach */ /*====================================================================== diff -urN -X dontdiff linux-2.6.0-test9.vanilla/drivers/net/tokenring/ibmtr.c linux-2.6.0-test9/drivers/net/tokenring/ibmtr.c --- linux-2.6.0-test9.vanilla/drivers/net/tokenring/ibmtr.c 2003-10-25 14:43:58.000000000 -0400 +++ linux-2.6.0-test9/drivers/net/tokenring/ibmtr.c 2003-10-25 17:26:38.000000000 -0400 @@ -152,7 +152,7 @@ /* this allows displaying full adapter information */ -char *channel_def[] __initdata = { "ISA", "MCA", "ISA P&P" }; +char *channel_def[] __devinitdata = { "ISA", "MCA", "ISA P&P" }; static char pcchannelid[] __devinitdata = { 0x05, 0x00, 0x04, 0x09, @@ -864,7 +864,8 @@ ti->sram_virt &= ~1; /* to reverse what we do in tok_close */ /* init the spinlock */ ti->lock = (spinlock_t) SPIN_LOCK_UNLOCKED; - + init_timer(&ti->tr_timer); + i = tok_init_card(dev); if (i) return i; @@ -1033,7 +1034,7 @@ /* Important for PCMCIA hot unplug, otherwise, we'll pull the card, */ /* unloading the module from memory, and then if a timer pops, ouch */ - del_timer(&ti->tr_timer); + del_timer_sync(&ti->tr_timer); outb(0, dev->base_addr + ADAPTRESET); ti->sram_virt |= 1; ti->open_status = CLOSED; From akpm@osdl.org Sat Oct 25 15:56:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 25 Oct 2003 15:56:35 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9PMu125023462 for ; Sat, 25 Oct 2003 15:56:02 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9PMtlo12569; Sat, 25 Oct 2003 15:55:47 -0700 Date: Sat, 25 Oct 2003 15:56:49 -0700 From: Andrew Morton To: Mike Phillips Cc: linux-kernel@vger.kernel.org, torvalds@osdl.org, jgarzik@pobox.com, shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] ibmtr_cs/ibmtr on 2.6.0-test9 - get working again Message-Id: <20031025155649.148bad99.akpm@osdl.org> In-Reply-To: <20031025221435.GA18782@siasl.dyndns.org> References: <20031025221435.GA18782@siasl.dyndns.org> X-Mailer: Sylpheed version 0.9.4 (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: 1010 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 342 Lines: 11 Mike Phillips wrote: > > - dev = alloc_trdev(sizeof(*info)); > + info = kmalloc(sizeof(*info), GFP_KERNEL); > + if (!info) return NULL; > + memset(info,0,sizeof(*info)); > + dev = alloc_trdev(sizeof(struct tok_info)); > if (!dev) > return NULL; This return leaks the memory at `info'. From phillim2@comcast.net Sat Oct 25 18:23:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 25 Oct 2003 18:23:58 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9Q1NM25027676 for ; Sat, 25 Oct 2003 18:23:22 -0700 Received: from siasl.dyndns.org ([68.45.111.32]) by comcast.net (rwcrmhc12) with ESMTP id <2003102523181901400lg61pe>; Sat, 25 Oct 2003 23:18:19 +0000 Received: from phillim2 by siasl.dyndns.org with local (Exim 3.35 #1 (Debian)) id 1ADXfC-00055C-00; Sat, 25 Oct 2003 19:17:42 -0400 Date: Sat, 25 Oct 2003 19:17:41 -0400 To: Andrew Morton Cc: linux-kernel@vger.kernel.org, torvalds@osdl.org, jgarzik@pobox.com, shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] ibmtr_cs/ibmtr on 2.6.0-test9 - get working again Message-ID: <20031025231741.GA18982@siasl.dyndns.org> Mail-Followup-To: phillim2, Andrew Morton , linux-kernel@vger.kernel.org, torvalds@osdl.org, jgarzik@pobox.com, shemminger@osdl.org, netdev@oss.sgi.com References: <20031025221435.GA18782@siasl.dyndns.org> <20031025155649.148bad99.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031025155649.148bad99.akpm@osdl.org> User-Agent: Mutt/1.3.28i From: Mike Phillips X-archive-position: 1011 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: phillim2@comcast.net Precedence: bulk X-list: netdev Content-Length: 2718 Lines: 85 Andrew Morton may (or may not) have said: > > if (!dev) > > return NULL; > > This return leaks the memory at `info'. Ooops, so it does, bad me. Corrected patch below: diff -urN -X dontdiff linux-2.6.0-test9.vanilla/drivers/net/pcmcia/ibmtr_cs.c linux-2.6.0-test9/drivers/net/pcmcia/ibmtr_cs.c --- linux-2.6.0-test9.vanilla/drivers/net/pcmcia/ibmtr_cs.c 2003-10-25 14:43:42.000000000 -0400 +++ linux-2.6.0-test9/drivers/net/pcmcia/ibmtr_cs.c 2003-10-25 19:01:02.000000000 -0400 @@ -136,7 +136,7 @@ struct net_device *dev; dev_node_t node; window_handle_t sram_win_handle; - struct tok_info ti; + struct tok_info *ti; } ibmtr_dev_t; static void netdev_get_drvinfo(struct net_device *dev, @@ -168,14 +168,19 @@ DEBUG(0, "ibmtr_attach()\n"); /* Create new token-ring device */ - dev = alloc_trdev(sizeof(*info)); - if (!dev) - return NULL; - info = dev->priv; + info = kmalloc(sizeof(*info), GFP_KERNEL); + if (!info) return NULL; + memset(info,0,sizeof(*info)); + dev = alloc_trdev(sizeof(struct tok_info)); + if (!dev) { + kfree(info); + return NULL; + } link = &info->link; link->priv = info; - + info->ti = dev->priv; + link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts1 = 4; link->io.IOAddrLines = 16; @@ -265,6 +270,7 @@ *linkp = link->next; unregister_netdev(dev); free_netdev(dev); + kfree(info); } /* ibmtr_detach */ /*====================================================================== diff -urN -X dontdiff linux-2.6.0-test9.vanilla/drivers/net/tokenring/ibmtr.c linux-2.6.0-test9/drivers/net/tokenring/ibmtr.c --- linux-2.6.0-test9.vanilla/drivers/net/tokenring/ibmtr.c 2003-10-25 14:43:58.000000000 -0400 +++ linux-2.6.0-test9/drivers/net/tokenring/ibmtr.c 2003-10-25 17:26:38.000000000 -0400 @@ -152,7 +152,7 @@ /* this allows displaying full adapter information */ -char *channel_def[] __initdata = { "ISA", "MCA", "ISA P&P" }; +char *channel_def[] __devinitdata = { "ISA", "MCA", "ISA P&P" }; static char pcchannelid[] __devinitdata = { 0x05, 0x00, 0x04, 0x09, @@ -864,7 +864,8 @@ ti->sram_virt &= ~1; /* to reverse what we do in tok_close */ /* init the spinlock */ ti->lock = (spinlock_t) SPIN_LOCK_UNLOCKED; - + init_timer(&ti->tr_timer); + i = tok_init_card(dev); if (i) return i; @@ -1033,7 +1034,7 @@ /* Important for PCMCIA hot unplug, otherwise, we'll pull the card, */ /* unloading the module from memory, and then if a timer pops, ouch */ - del_timer(&ti->tr_timer); + del_timer_sync(&ti->tr_timer); outb(0, dev->base_addr + ADAPTRESET); ti->sram_virt |= 1; ti->open_status = CLOSED; From kala@pinerecords.com Sat Oct 25 23:55:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 25 Oct 2003 23:55:57 -0700 (PDT) Received: from louise.pinerecords.com (louise.pinerecords.com [213.168.176.16]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9Q6tL25001603 for ; Sat, 25 Oct 2003 23:55:22 -0700 Received: from louise.pinerecords.com (localhost [127.0.0.1]) by louise.pinerecords.com with ESMTP id h9Q6tKTD028405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 26 Oct 2003 07:55:20 +0100 Received: (from kala@localhost) by louise.pinerecords.com (submit) id h9Q6tJK2028404; Sun, 26 Oct 2003 07:55:19 +0100 Date: Sun, 26 Oct 2003 07:55:19 +0100 From: Tomas Szepe To: "David S. Miller" Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, grof@dragon.cz, volf@dragon.cz Subject: Re: possible bug in tcp_input.c Message-ID: <20031026065519.GC28035@louise.pinerecords.com> References: <20031024162959.GB11154@louise.pinerecords.com> <20031024193034.30f1caed.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031024193034.30f1caed.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 1012 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: szepe@pinerecords.com Precedence: bulk X-list: netdev Content-Length: 2171 Lines: 61 On Oct-24 2003, Fri, 19:30 -0700 David S. Miller wrote: > > The passed NULL (and yes, this is where we are getting one) is dereferenced > > immediately in: > > > > /* tcp_input.c, line 1133 */ > > static inline int tcp_skb_timedout(struct tcp_opt *tp, struct sk_buff *skb) > > { > > return (tcp_time_stamp - TCP_SKB_CB(skb)->when > tp->rto); > > } > > If tp->packets_out is non-zero (which by definition it is > in your case else the right hand side of the "&&" would not be > evaluated) then we _MUST_ have some packets in sk->write_queue. > > Something is being fiercely corrupted. Probably some piece of > netfilter is freeing up an SKB one too many times thus corrupting > the TCP write queue list pointers. Dave, we've been thinking about this some more and have concluded that since the problem is a relatively non-fatal one, the kernel should just print out an "assertion failed" error similar to the one in tcp_input.c, line 1323 [BUG_TRAP(cnt <= tp->packets_out);] and maybe fix things up a little rather than oops on a NULL pointer dereference; The state in question, although invalid, is possible and should IMHO be checked for as in all the other "if (skb != NULL) ..." places). What do you think? We keep on trying to locate which code is causing the corruption, meanwhile the affected system has been running crash-lessly with the attached patch. Thanks, -- Tomas Szepe diff -urN a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c --- a/net/ipv4/tcp_input.c 2003-06-13 16:51:39 +0200 +++ b/net/ipv4/tcp_input.c 2003-10-26 07:29:11 +0100 @@ -1138,7 +1138,19 @@ static inline int tcp_head_timedout(struct sock *sk, struct tcp_opt *tp) { - return tp->packets_out && tcp_skb_timedout(tp, skb_peek(&sk->write_queue)); + struct sk_buff *skb = skb_peek(&sk->write_queue); + + if (skb == NULL) { + if (tp->packets_out) { + printk("KERNEL: assertion (%s) failed at %s(%d)\n", + "skb == NULL && tp->packets_out", + __FILE__, __LINE__); + tp->packets_out = 0; + } + return 0; + } else { + return tp->packets_out && tcp_skb_timedout(tp, skb); + } } /* Linux NewReno/SACK/FACK/ECN state machine. From yoshfuji@linux-ipv6.org Sun Oct 26 01:50:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 01:51:28 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9Q9or25006171 for ; Sun, 26 Oct 2003 01:50:54 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9Q9oNlg007287; Sun, 26 Oct 2003 18:50:23 +0900 Date: Sun, 26 Oct 2003 18:50:23 +0900 (JST) Message-Id: <20031026.185023.108406592.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org, miyazawa@linux-ipv6.org Subject: Re: ipv6 UDP MSG_MORE oops fix From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20030808.170839.90822982.yoshfuji@linux-ipv6.org> References: <20030807223421.70497d61.davem@redhat.com> <20030808.170839.90822982.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1013 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 Content-Length: 975 Lines: 25 Hello. This thread would be too old but anyway... In article <20030808.170839.90822982.yoshfuji@linux-ipv6.org> (at Fri, 08 Aug 2003 17:08:39 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > In article <20030807223421.70497d61.davem@redhat.com> (at Thu, 7 Aug 2003 22:34:21 -0700), "David S. Miller" says: > > > Yoshfuji-san, I found the MSG_MORE udp bug. > > Yes, thanks. This is what I told you before. > I'm going to test if problems go away with this patch. This fixes oops, but there remains several issues. I'm about to send 3 patches to fix them. [1/3] IPv6: Odd IPv6 header in UDPv6 packets when sending MSG_MORE flag [2/3] NET: store cork'ing flow information in common storage in inet_opt [3/3] IPv6: breakage of sendmsg to IPv4-mapped address via UDPv6 socket Thanks in advance. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Oct 26 01:54:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 01:54:45 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9Q9s825006522 for ; Sun, 26 Oct 2003 01:54:09 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9Q9s9lg007333; Sun, 26 Oct 2003 18:54:09 +0900 Date: Sun, 26 Oct 2003 18:54:09 +0900 (JST) Message-Id: <20031026.185409.41408145.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com, miyazawa@linux-ipv6.org, yoshfuji@linux-ipv6.org Subject: [PATCH 2/3] NET: store cork'ing flow information in common storage From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031026.185023.108406592.yoshfuji@linux-ipv6.org> References: <20030807223421.70497d61.davem@redhat.com> <20030808.170839.90822982.yoshfuji@linux-ipv6.org> <20031026.185023.108406592.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1014 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 Content-Length: 6793 Lines: 229 Hello. > I'm about to send 3 patches to fix them. > > [1/3] IPv6: Odd IPv6 header in UDPv6 packets when sending MSG_MORE flag > [2/3] NET: store cork'ing flow information in common storage in inet_opt > [3/3] IPv6: breakage of sendmsg to IPv4-mapped address via UDPv6 socket [2/3] NET: store cork'ing flow information in common storage in inet_opt. --- linux-2.5-net/include/linux/ip.h Sun Oct 19 01:10:46 2003 +++ linux-2.5-udp6_append_data/include/linux/ip.h Sun Oct 26 16:19:58 2003 @@ -83,6 +83,7 @@ #include #include #include +#include struct ip_options { __u32 faddr; /* Saved first hop address */ @@ -141,6 +142,7 @@ struct rtable *rt; int length; /* Total length of all frames */ u32 addr; + struct flowi fl; } cork; }; --- linux-2.5-net/include/linux/ipv6.h Sun Oct 26 16:19:19 2003 +++ linux-2.5-udp6_append_data/include/linux/ipv6.h Sun Oct 26 16:19:58 2003 @@ -174,7 +174,6 @@ #include /* struct ipv6_mc_socklist */ #include #include -#include /* This structure contains results of exthdrs parsing @@ -235,7 +234,6 @@ struct { struct ipv6_txoptions *opt; struct rt6_info *rt; - struct flowi fl; int hop_limit; } cork; }; --- linux-2.5-net/include/linux/udp.h Sun Oct 19 01:10:47 2003 +++ linux-2.5-udp6_append_data/include/linux/udp.h Sun Oct 26 16:20:00 2003 @@ -44,13 +44,9 @@ unsigned int corkflag; /* Cork is required */ __u16 encap_type; /* Is this an Encapsulation socket? */ /* - * Following members retains the infomation to create a UDP header + * Following member retains the infomation to create a UDP header * when the socket is uncorked. */ - u32 saddr; /* source address */ - u32 daddr; /* destination address */ - __u16 sport; /* source port */ - __u16 dport; /* destination port */ __u16 len; /* total length of pending frames */ }; --- linux-2.5-net/net/ipv4/udp.c Sun Oct 19 01:10:53 2003 +++ linux-2.5-udp6_append_data/net/ipv4/udp.c Sun Oct 26 16:20:04 2003 @@ -398,6 +398,8 @@ */ static int udp_push_pending_frames(struct sock *sk, struct udp_opt *up) { + struct inet_opt *inet = inet_sk(sk); + struct flowi *fl = &inet->cork.fl; struct sk_buff *skb; struct udphdr *uh; int err = 0; @@ -410,8 +412,8 @@ * Create a UDP header */ uh = skb->h.uh; - uh->source = up->sport; - uh->dest = up->dport; + uh->source = fl->fl_ip_sport; + uh->dest = fl->fl_ip_dport; uh->len = htons(up->len); uh->check = 0; @@ -426,12 +428,12 @@ */ if (skb->ip_summed == CHECKSUM_HW) { skb->csum = offsetof(struct udphdr, check); - uh->check = ~csum_tcpudp_magic(up->saddr, up->daddr, + uh->check = ~csum_tcpudp_magic(fl->fl4_src, fl->fl4_dst, up->len, IPPROTO_UDP, 0); } else { skb->csum = csum_partial((char *)uh, sizeof(struct udphdr), skb->csum); - uh->check = csum_tcpudp_magic(up->saddr, up->daddr, + uh->check = csum_tcpudp_magic(fl->fl4_src, fl->fl4_dst, up->len, IPPROTO_UDP, skb->csum); if (uh->check == 0) uh->check = -1; @@ -456,7 +458,7 @@ skb_queue_walk(&sk->sk_write_queue, skb) { csum = csum_add(csum, skb->csum); } - uh->check = csum_tcpudp_magic(up->saddr, up->daddr, + uh->check = csum_tcpudp_magic(fl->fl4_src, fl->fl4_dst, up->len, IPPROTO_UDP, csum); if (uh->check == 0) uh->check = -1; @@ -636,10 +638,10 @@ /* * Now cork the socket to pend data. */ - up->daddr = daddr; - up->dport = dport; - up->saddr = saddr; - up->sport = inet->sport; + inet->cork.fl.fl4_dst = daddr; + inet->cork.fl.fl_ip_dport = dport; + inet->cork.fl.fl4_src = saddr; + inet->cork.fl.fl_ip_sport = inet->sport; up->pending = 1; do_append_data: --- linux-2.5-net/net/ipv6/udp.c Sun Oct 26 16:19:19 2003 +++ linux-2.5-udp6_append_data/net/ipv6/udp.c Sun Oct 26 16:20:00 2003 @@ -720,8 +720,8 @@ { struct sk_buff *skb; struct udphdr *uh; - struct ipv6_pinfo *np = inet6_sk(sk); - struct flowi *fl = &np->cork.fl; + struct inet_opt *inet = inet_sk(sk); + struct flowi *fl = &inet->cork.fl; int err = 0; /* Grab the skbuff where UDP header space exists. */ @@ -783,7 +783,7 @@ struct in6_addr *daddr; struct ipv6_txoptions *opt = NULL; struct ip6_flowlabel *flowlabel = NULL; - struct flowi *fl = &np->cork.fl; + struct flowi *fl = &inet->cork.fl; struct dst_entry *dst; int addr_len = msg->msg_namelen; int ulen = len; @@ -830,7 +830,7 @@ if (sin6->sin6_port == 0) return -EINVAL; - up->dport = sin6->sin6_port; + fl->fl_ip_dport = sin6->sin6_port; daddr = &sin6->sin6_addr; if (np->sndflow) { @@ -859,7 +859,7 @@ if (sk->sk_state != TCP_ESTABLISHED) return -EDESTADDRREQ; - up->dport = inet->dport; + fl->fl_ip_dport = inet->dport; daddr = &np->daddr; fl->fl6_flowlabel = np->flow_label; } @@ -874,7 +874,7 @@ sin.sin_family = AF_INET; sin.sin_addr.s_addr = daddr->s6_addr32[3]; - sin.sin_port = up->dport; + sin.sin_port = inet->cork.fl.fl_ip_dport; msg->msg_name = (struct sockaddr *)(&sin); msg->msg_namelen = sizeof(sin); fl6_sock_release(flowlabel); @@ -911,7 +911,6 @@ ipv6_addr_copy(&fl->fl6_dst, daddr); if (ipv6_addr_any(&fl->fl6_src) && !ipv6_addr_any(&np->saddr)) ipv6_addr_copy(&fl->fl6_src, &np->saddr); - fl->fl_ip_dport = up->dport; fl->fl_ip_sport = inet->sport; /* merge ip6_build_xmit from ip6_output */ --- linux-2.5-net/net/ipv6/ip6_output.c Sun Oct 26 16:19:19 2003 +++ linux-2.5-udp6_append_data/net/ipv6/ip6_output.c Sun Oct 26 16:20:00 2003 @@ -1239,7 +1239,7 @@ } dst_hold(&rt->u.dst); np->cork.rt = rt; - np->cork.fl = *fl; + inet->cork.fl = *fl; np->cork.hop_limit = hlimit; inet->cork.fragsize = mtu = dst_pmtu(&rt->u.dst); inet->cork.length = 0; @@ -1250,6 +1250,7 @@ transhdrlen += exthdrlen; } else { rt = np->cork.rt; + fl = &inet->cork.fl; if (inet->cork.flags & IPCORK_OPT) opt = np->cork.opt; transhdrlen = 0; @@ -1423,7 +1424,7 @@ struct ipv6hdr *hdr; struct ipv6_txoptions *opt = np->cork.opt; struct rt6_info *rt = np->cork.rt; - struct flowi *fl = &np->cork.fl; + struct flowi *fl = &inet->cork.fl; unsigned char proto = fl->proto; int err = 0; @@ -1487,7 +1488,7 @@ dst_release(&np->cork.rt->u.dst); np->cork.rt = NULL; } - memset(&np->cork.fl, 0, sizeof(np->cork.fl)); + memset(&inet->cork.fl, 0, sizeof(inet->cork.fl)); return err; error: goto out; @@ -1512,5 +1513,5 @@ dst_release(&np->cork.rt->u.dst); np->cork.rt = NULL; } - memset(&np->cork.fl, 0, sizeof(np->cork.fl)); + memset(&inet->cork.fl, 0, sizeof(inet->cork.fl)); } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Oct 26 01:54:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 01:54:47 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9Q9sC25006527 for ; Sun, 26 Oct 2003 01:54:12 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9Q9sDlg007339; Sun, 26 Oct 2003 18:54:13 +0900 Date: Sun, 26 Oct 2003 18:54:12 +0900 (JST) Message-Id: <20031026.185412.22276663.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com, miyazawa@linux-ipv6.org, yoshfuji@linux-ipv6.org Subject: [PATCH 3/3] IPv6: breakage of sendmsg to IPv4-mapped address via UDPv6 socket From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031026.185023.108406592.yoshfuji@linux-ipv6.org> References: <20030807223421.70497d61.davem@redhat.com> <20030808.170839.90822982.yoshfuji@linux-ipv6.org> <20031026.185023.108406592.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1015 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 Content-Length: 4163 Lines: 169 Hello. > I'm about to send 3 patches to fix them. > > [1/3] IPv6: Odd IPv6 header in UDPv6 packets when sending MSG_MORE flag > [2/3] NET: store cork'ing flow information in common storage in inet_opt > [3/3] IPv6: breakage of sendmsg to IPv4-mapped address via UDPv6 socket [3/3] IPv6: breakage of sendmsg to IPv4-mapped address via UDPv6 socket D: Fixing breakage of sendmsg to IPv4-mapped address via UDPv6 socket; D: check destination address before checking cork flag to process D: appropriately. --- linux-2.5-net/net/ipv4/udp.c Sun Oct 26 16:23:36 2003 +++ linux-2.5-udp6_append_data/net/ipv4/udp.c Sun Oct 26 16:23:55 2003 @@ -522,8 +522,13 @@ * The socket lock must be held while it's corked. */ lock_sock(sk); - if (likely(up->pending)) + if (likely(up->pending)) { + if (unlikely(up->pending != AF_INET)) { + release_sock(sk); + return -EINVAL; + } goto do_append_data; + } release_sock(sk); } ulen += sizeof(struct udphdr); @@ -642,7 +647,7 @@ inet->cork.fl.fl_ip_dport = dport; inet->cork.fl.fl4_src = saddr; inet->cork.fl.fl_ip_sport = inet->sport; - up->pending = 1; + up->pending = AF_INET; do_append_data: up->len += ulen; --- linux-2.5-net/net/ipv6/udp.c Sun Oct 26 16:23:36 2003 +++ linux-2.5-udp6_append_data/net/ipv6/udp.c Sun Oct 26 16:23:55 2003 @@ -787,11 +787,56 @@ struct dst_entry *dst; int addr_len = msg->msg_namelen; int ulen = len; - int addr_type; int hlimit = -1; int corkreq = up->corkflag || msg->msg_flags&MSG_MORE; int err; - + + /* destination address check */ + if (sin6) { + if (addr_len < offsetof(struct sockaddr, sa_data)) + return -EINVAL; + + switch (sin6->sin6_family) { + case AF_INET6: + if (addr_len < SIN6_LEN_RFC2133) + return -EINVAL; + daddr = &sin6->sin6_addr; + break; + case AF_INET: + goto do_udp_sendmsg; + case AF_UNSPEC: + msg->msg_name = sin6 = NULL; + msg->msg_namelen = addr_len = 0; + daddr = NULL; + break; + default: + return -EINVAL; + } + } else if (!up->pending) { + if (sk->sk_state != TCP_ESTABLISHED) + return -EDESTADDRREQ; + daddr = &np->daddr; + } else + daddr = NULL; + + if (daddr) { + if (ipv6_addr_type(daddr) == IPV6_ADDR_MAPPED) { + struct sockaddr_in sin; + sin.sin_family = AF_INET; + sin.sin_port = sin6 ? sin6->sin6_port : inet->dport; + sin.sin_addr.s_addr = daddr->s6_addr[3]; + msg->msg_name = &sin; + msg->msg_namelen = sizeof(sin); +do_udp_sendmsg: + if (__ipv6_only_sock(sk)) + return -ENETUNREACH; + return udp_sendmsg(iocb, sk, msg, len); + } + } + + if (up->pending == AF_INET) + return udp_sendmsg(iocb, sk, msg, len); + /* Rough check on arithmetic overflow, better check is made in ip6_build_xmit */ @@ -805,6 +850,10 @@ */ lock_sock(sk); if (likely(up->pending)) { + if (unlikely(up->pending != AF_INET6)) { + release_sock(sk); + return -EINVAL; + } dst = NULL; goto do_append_data; } @@ -815,18 +864,6 @@ memset(fl, 0, sizeof(*fl)); if (sin6) { - if (sin6->sin6_family == AF_INET) { - if (__ipv6_only_sock(sk)) - return -ENETUNREACH; - return udp_sendmsg(iocb, sk, msg, len); - } - - if (addr_len < SIN6_LEN_RFC2133) - return -EINVAL; - - if (sin6->sin6_family && sin6->sin6_family != AF_INET6) - return -EINVAL; - if (sin6->sin6_port == 0) return -EINVAL; @@ -864,24 +901,6 @@ fl->fl6_flowlabel = np->flow_label; } - addr_type = ipv6_addr_type(daddr); - - if (addr_type == IPV6_ADDR_MAPPED) { - struct sockaddr_in sin; - - if (__ipv6_only_sock(sk)) - return -ENETUNREACH; - - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = daddr->s6_addr32[3]; - sin.sin_port = inet->cork.fl.fl_ip_dport; - msg->msg_name = (struct sockaddr *)(&sin); - msg->msg_namelen = sizeof(sin); - fl6_sock_release(flowlabel); - - return udp_sendmsg(iocb, sk, msg, len); - } - if (!fl->oif) fl->oif = sk->sk_bound_dev_if; @@ -950,7 +969,7 @@ goto out; } - up->pending = 1; + up->pending = AF_INET6; do_append_data: up->len += ulen; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Oct 26 02:49:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 02:50:06 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9QAnQ25009109 for ; Sun, 26 Oct 2003 02:49:26 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9Q9s5lg007327; Sun, 26 Oct 2003 18:54:05 +0900 Date: Sun, 26 Oct 2003 18:54:05 +0900 (JST) Message-Id: <20031026.185405.129894332.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com, miyazawa@linux-ipv6.org, yoshfuji@linux-ipv6.org Subject: [PATCH 1/3] IPv6: Fix odd IPv6 header in UDPv6 packets when sending MSG_MORE flag From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031026.185023.108406592.yoshfuji@linux-ipv6.org> References: <20030807223421.70497d61.davem@redhat.com> <20030808.170839.90822982.yoshfuji@linux-ipv6.org> <20031026.185023.108406592.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1016 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 Content-Length: 6541 Lines: 222 Hello. > I'm about to send 3 patches to fix them. > > [1/3] IPv6: Odd IPv6 header in UDPv6 packets when sending MSG_MORE flag > [2/3] NET: store cork'ing flow information in common storage in inet_opt > [3/3] IPv6: breakage of sendmsg to IPv4-mapped address via UDPv6 socket [1/3] IPv6: Odd IPv6 header in UDPv6 packets when sending MSG_MORE flag D: Broken IPv6 header for UDPv6 was generated with MSG_MORE flag. D: Remember cork'ed flow information in real storage. ===== include/linux/ipv6.h 1.12 vs edited ===== --- 1.12/include/linux/ipv6.h Sat Sep 13 09:25:13 2003 +++ edited/include/linux/ipv6.h Sun Oct 26 14:56:16 2003 @@ -174,6 +174,7 @@ #include /* struct ipv6_mc_socklist */ #include #include +#include /* This structure contains results of exthdrs parsing @@ -234,7 +235,7 @@ struct { struct ipv6_txoptions *opt; struct rt6_info *rt; - struct flowi *fl; + struct flowi fl; int hop_limit; } cork; }; ===== net/ipv6/ip6_output.c 1.44 vs edited ===== --- 1.44/net/ipv6/ip6_output.c Mon Sep 1 17:44:26 2003 +++ edited/net/ipv6/ip6_output.c Sun Oct 26 14:56:16 2003 @@ -1239,7 +1239,7 @@ } dst_hold(&rt->u.dst); np->cork.rt = rt; - np->cork.fl = fl; + np->cork.fl = *fl; np->cork.hop_limit = hlimit; inet->cork.fragsize = mtu = dst_pmtu(&rt->u.dst); inet->cork.length = 0; @@ -1423,7 +1423,7 @@ struct ipv6hdr *hdr; struct ipv6_txoptions *opt = np->cork.opt; struct rt6_info *rt = np->cork.rt; - struct flowi *fl = np->cork.fl; + struct flowi *fl = &np->cork.fl; unsigned char proto = fl->proto; int err = 0; @@ -1487,9 +1487,7 @@ dst_release(&np->cork.rt->u.dst); np->cork.rt = NULL; } - if (np->cork.fl) { - np->cork.fl = NULL; - } + memset(&np->cork.fl, 0, sizeof(np->cork.fl)); return err; error: goto out; @@ -1514,7 +1512,5 @@ dst_release(&np->cork.rt->u.dst); np->cork.rt = NULL; } - if (np->cork.fl) { - np->cork.fl = NULL; - } + memset(&np->cork.fl, 0, sizeof(np->cork.fl)); } ===== net/ipv6/udp.c 1.50 vs edited ===== --- 1.50/net/ipv6/udp.c Thu Oct 9 00:27:40 2003 +++ edited/net/ipv6/udp.c Sun Oct 26 14:56:16 2003 @@ -721,7 +721,7 @@ struct sk_buff *skb; struct udphdr *uh; struct ipv6_pinfo *np = inet6_sk(sk); - struct flowi *fl = np->cork.fl; + struct flowi *fl = &np->cork.fl; int err = 0; /* Grab the skbuff where UDP header space exists. */ @@ -783,7 +783,7 @@ struct in6_addr *daddr; struct ipv6_txoptions *opt = NULL; struct ip6_flowlabel *flowlabel = NULL; - struct flowi fl; + struct flowi *fl = &np->cork.fl; struct dst_entry *dst; int addr_len = msg->msg_namelen; int ulen = len; @@ -812,7 +812,7 @@ } ulen += sizeof(struct udphdr); - memset(&fl, 0, sizeof(fl)); + memset(fl, 0, sizeof(*fl)); if (sin6) { if (sin6->sin6_family == AF_INET) { @@ -834,9 +834,9 @@ daddr = &sin6->sin6_addr; if (np->sndflow) { - fl.fl6_flowlabel = sin6->sin6_flowinfo&IPV6_FLOWINFO_MASK; - if (fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) { - flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel); + fl->fl6_flowlabel = sin6->sin6_flowinfo&IPV6_FLOWINFO_MASK; + if (fl->fl6_flowlabel&IPV6_FLOWLABEL_MASK) { + flowlabel = fl6_sock_lookup(sk, fl->fl6_flowlabel); if (flowlabel == NULL) return -EINVAL; daddr = &flowlabel->dst; @@ -854,14 +854,14 @@ if (addr_len >= sizeof(struct sockaddr_in6) && sin6->sin6_scope_id && ipv6_addr_type(daddr)&IPV6_ADDR_LINKLOCAL) - fl.oif = sin6->sin6_scope_id; + fl->oif = sin6->sin6_scope_id; } else { if (sk->sk_state != TCP_ESTABLISHED) return -EDESTADDRREQ; up->dport = inet->dport; daddr = &np->daddr; - fl.fl6_flowlabel = np->flow_label; + fl->fl6_flowlabel = np->flow_label; } addr_type = ipv6_addr_type(daddr); @@ -882,20 +882,20 @@ return udp_sendmsg(iocb, sk, msg, len); } - if (!fl.oif) - fl.oif = sk->sk_bound_dev_if; + if (!fl->oif) + fl->oif = sk->sk_bound_dev_if; if (msg->msg_controllen) { opt = &opt_space; memset(opt, 0, sizeof(struct ipv6_txoptions)); - err = datagram_send_ctl(msg, &fl, opt, &hlimit); + err = datagram_send_ctl(msg, fl, opt, &hlimit); if (err < 0) { fl6_sock_release(flowlabel); return err; } - if ((fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) && !flowlabel) { - flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel); + if ((fl->fl6_flowlabel&IPV6_FLOWLABEL_MASK) && !flowlabel) { + flowlabel = fl6_sock_lookup(sk, fl->fl6_flowlabel); if (flowlabel == NULL) return -EINVAL; } @@ -907,28 +907,28 @@ if (flowlabel) opt = fl6_merge_options(&opt_space, flowlabel, opt); - fl.proto = IPPROTO_UDP; - ipv6_addr_copy(&fl.fl6_dst, daddr); - if (ipv6_addr_any(&fl.fl6_src) && !ipv6_addr_any(&np->saddr)) - ipv6_addr_copy(&fl.fl6_src, &np->saddr); - fl.fl_ip_dport = up->dport; - fl.fl_ip_sport = inet->sport; + fl->proto = IPPROTO_UDP; + ipv6_addr_copy(&fl->fl6_dst, daddr); + if (ipv6_addr_any(&fl->fl6_src) && !ipv6_addr_any(&np->saddr)) + ipv6_addr_copy(&fl->fl6_src, &np->saddr); + fl->fl_ip_dport = up->dport; + fl->fl_ip_sport = inet->sport; /* merge ip6_build_xmit from ip6_output */ if (opt && opt->srcrt) { struct rt0_hdr *rt0 = (struct rt0_hdr *) opt->srcrt; - ipv6_addr_copy(&fl.fl6_dst, rt0->addr); + ipv6_addr_copy(&fl->fl6_dst, rt0->addr); } - if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) - fl.oif = np->mcast_oif; + if (!fl->oif && ipv6_addr_is_multicast(&fl->fl6_dst)) + fl->oif = np->mcast_oif; - err = ip6_dst_lookup(sk, &dst, &fl); + err = ip6_dst_lookup(sk, &dst, fl); if (err) goto out; if (hlimit < 0) { - if (ipv6_addr_is_multicast(&fl.fl6_dst)) + if (ipv6_addr_is_multicast(&fl->fl6_dst)) hlimit = np->mcast_hops; else hlimit = np->hop_limit; @@ -956,7 +956,7 @@ do_append_data: up->len += ulen; err = ip6_append_data(sk, ip_generic_getfrag, msg->msg_iov, ulen, sizeof(struct udphdr), - hlimit, opt, &fl, (struct rt6_info*)dst, + hlimit, opt, fl, (struct rt6_info*)dst, corkreq ? msg->msg_flags|MSG_MORE : msg->msg_flags); if (err) udp_v6_flush_pending_frames(sk); @@ -965,7 +965,7 @@ if (dst) ip6_dst_store(sk, dst, - !ipv6_addr_cmp(&fl.fl6_dst, &np->daddr) ? + !ipv6_addr_cmp(&fl->fl6_dst, &np->daddr) ? &np->daddr : NULL); if (err > 0) err = np->recverr ? net_xmit_errno(err) : 0; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From mikpe@user.it.uu.se Sun Oct 26 07:43:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 07:43:52 -0800 (PST) Received: from meryl.it.uu.se (root@meryl.it.uu.se [130.238.12.42]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9QFhI25031820 for ; Sun, 26 Oct 2003 07:43:19 -0800 Received: from harpo.it.uu.se (1@harpo.it.uu.se [130.238.12.34]) by meryl.it.uu.se (8.8.5/8.8.5) with ESMTP id QAA27201; Sun, 26 Oct 2003 16:43:13 +0100 (MET) Received: (from mikpe@localhost) by harpo.it.uu.se (8.12.8+Sun/8.12.9) id h9QFhDWW029273; Sun, 26 Oct 2003 16:43:13 +0100 (MET) Date: Sun, 26 Oct 2003 16:43:13 +0100 (MET) Message-Id: <200310261543.h9QFhDWW029273@harpo.it.uu.se> From: Mikael Pettersson To: netdev@oss.sgi.com Subject: 2.6.0-test8-bk3 net/ipv4/tcp.c change broken? Cc: linux-kernel@vger.kernel.org X-archive-position: 1017 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mikpe@csd.uu.se Precedence: bulk X-list: netdev Content-Length: 2070 Lines: 64 The 2.6.0-test8-bk3 change to delay pending signals checking in net/ipv4/tcp.c appears to be broken. On machine A I run X and an xterm. Within that xterm I rlogin to machine B. On machine B I start emacs in text mode (emacs -nw). When machine A runs 2.6.0-test8-bk2 or older, emacs works as usual: it uses the xterm's entire size, and responds correctly and instantly to control characters like ^S (I-search, not xoff) and ^G (Quit). When machine A runs 2.6.0-test8-bk3 or later, emacs starts in a tiny 24 rows by 80 columns mode, ^S incorrectly sends xoff, ^G isn't seen by emacs until after a one second delay, and similarly there is a one second delay between exiting emacs and getting the next shell prompt. While running emacs, if I beat on it with ^G and ^L it eventually (after about 5-10 seconds) goes into the xterm's full rows/columns mode. Reverting 2.6.0-test8-bk3's net/ipv4/tcp.c patch (included below) fixes these problems. /Mikael diff -ruN linux-2.6.0-test8-bk2/net/ipv4/tcp.c linux-2.6.0-test8-bk3/net/ipv4/tcp.c --- linux-2.6.0-test8-bk2/net/ipv4/tcp.c 2003-10-26 15:52:26.000000000 +0100 +++ linux-2.6.0-test8-bk3/net/ipv4/tcp.c 2003-10-26 15:51:58.000000000 +0100 @@ -1540,17 +1540,6 @@ if (copied && tp->urg_data && tp->urg_seq == *seq) break; - /* We need to check signals first, to get correct SIGURG - * handling. FIXME: Need to check this doesn't impact 1003.1g - * and move it down to the bottom of the loop - */ - if (signal_pending(current)) { - if (copied) - break; - copied = timeo ? sock_intr_errno(timeo) : -EAGAIN; - break; - } - /* Next get a buffer. */ skb = skb_peek(&sk->sk_receive_queue); @@ -1587,6 +1576,7 @@ sk->sk_state == TCP_CLOSE || (sk->sk_shutdown & RCV_SHUTDOWN) || !timeo || + signal_pending(current) || (flags & MSG_PEEK)) break; } else { @@ -1616,6 +1606,11 @@ copied = -EAGAIN; break; } + + if (signal_pending(current)) { + copied = sock_intr_errno(timeo); + break; + } } cleanup_rbuf(sk, copied); From yoshfuji@linux-ipv6.org Sun Oct 26 08:45:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 08:46:01 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9QGj325003223 for ; Sun, 26 Oct 2003 08:45:24 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9QGj2lg009323; Mon, 27 Oct 2003 01:45:02 +0900 Date: Mon, 27 Oct 2003 01:45:02 +0900 (JST) Message-Id: <20031027.014502.98736584.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] IPV6: Typo in address comparison From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1018 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 Content-Length: 621 Lines: 20 Hello. Typo found in the local address comparison among sockets. ===== net/ipv6/addrconf.c 1.71 vs edited ===== --- 1.71/net/ipv6/addrconf.c Tue Oct 21 14:59:11 2003 +++ edited/net/ipv6/addrconf.c Mon Oct 27 01:35:11 2003 @@ -992,7 +992,7 @@ !ipv6_addr_cmp(&np->rcv_saddr, (sk2->sk_state != TCP_TIME_WAIT ? &inet6_sk(sk2)->rcv_saddr : - &tcptw_sk(sk)->tw_v6_rcv_saddr))) + &tcptw_sk(sk2)->tw_v6_rcv_saddr))) return 1; if (addr_type == IPV6_ADDR_MAPPED && -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From aeb@cwi.nl Sun Oct 26 11:40:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 11:41:20 -0800 (PST) Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9QJei25004585 for ; Sun, 26 Oct 2003 11:40:45 -0800 Received: from apps.cwi.nl (apps.cwi.nl [192.16.191.34]) by hera.cwi.nl with ESMTP id h9QJeW9o002721 for ; Sun, 26 Oct 2003 20:40:32 +0100 (MET) From: Andries.Brouwer@cwi.nl Received: by apps.cwi.nl id h9QJeWa04880; Sun, 26 Oct 2003 20:40:32 +0100 (MET) Date: Sun, 26 Oct 2003 20:40:32 +0100 (MET) Message-Id: To: Andries.Brouwer@cwi.nl, torvalds@osdl.org Subject: Re: Linux 2.6.0-test9 Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com X-archive-position: 1019 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Andries.Brouwer@cwi.nl Precedence: bulk X-list: netdev Content-Length: 471 Lines: 16 From: Linus Torvalds > I have run 2.6.0-test6 without any problems. Switched > to 2.6.0-test9 today. Something involving job control > or so is broken. Several of my remote xterms hang. Btw, this one sounds like a known bug in bash. No - it is a recent kernel bug. Mikael Pettersson noticed precisely the same thing, and says "Reverting 2.6.0-test8-bk3's net/ipv4/tcp.c patch fixes these problems." And so it does. Andries From spi@gmxpro.de Sun Oct 26 14:08:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 14:09:13 -0800 (PST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9QM8d25008521 for ; Sun, 26 Oct 2003 14:08:40 -0800 Received: (qmail 32509 invoked by uid 65534); 26 Oct 2003 22:08:31 -0000 Received: from pD9E60142.dip.t-dialin.net (EHLO d800) (217.230.1.66) by mail.gmx.net (mp021) with SMTP; 26 Oct 2003 23:08:31 +0100 X-Authenticated: #555711 From: "Sebastian Piecha" To: James Morris , LK-net , Date: Sun, 26 Oct 2003 23:08:50 +0100 MIME-Version: 1.0 Subject: Re: oops in skbuff.c Message-ID: <3F9C5402.9225.291F78E8@localhost> Priority: normal X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-archive-position: 1020 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: spi@gmxpro.de Precedence: bulk X-list: netdev Content-Length: 3580 Lines: 103 > > > On Thu, 16 Oct 2003, Sebastian Piecha wrote: > > > > > > > panics. Copying more than 4 GB to the samba share also lets the > > > > kernel panic with an OOPS. > > > > > > Does the above cause a panic for the 2.6-test kernels? > > > Do you have netfilter enabled, and if so, any iptables modules loaded? > > > > > > > > I did a mistake. iptables is installed but no rules added. I'll > > remove iptables and rerun the check. > > For being sure I removed iptables but again the oops happened. I also > tried kernel 2.4.18 without success. > > Does anybody have a clue how to go on? I reinstalled my system from scratch. Debian testing, kernel 2.4.22, samba 2.2.8a. Again the oops is occuring in skbuff. With kernel 2.6.0-test7 I didn't get any oops. But I'd prefer using a stable 2.4.x kernel. There are modifications in skbuff.c in kernel 2.6.0-test7. For what reason skbuff.c has changed? Due to bug fixes or general changes in the kernel? Could skbuff.c easily be backported to 2.4.20 or 2.4.22? And here's a copy of the last oops: Oops: 0000 CPU: 0 EIP: 0010:[] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00010282 eax: c44ca6e0 ebx: 00200000 ecx: c44ca6e0 edx: 00200000 esi: cf80ae20 edi: fffffffd ebp: 00000046 esp: c029bf10 ds: 0018 es: 0018 ss: 0018 Process swapper (pid: 0, stackpage=c029b000) Stack: 00000030 cf80ae20 c01c14c9 cf80ae20 cf80ae20 00000030 c01c1513 cf80ae20 cf80ae20 cf80ae20 c01c1697 cf80ae20 00000000 00000030 cf8105c0 cf80ae20 c01c65e3 cf80ae20 0000000e 00000001 c02ba568 c0121b95 c02ba568 00000002 Call Trace: [] [] [] [] [] [] [] [] [] [] [] [] Code: 8b 42 78 8b 1b 48 74 0a ff 4a 78 0f 94 c0 84 c0 74 08 89 14 >>EIP; c01c1402 <===== >>eax; c44ca6e0 <_end+41d3b18/14516498> >>ecx; c44ca6e0 <_end+41d3b18/14516498> >>esi; cf80ae20 <_end+f514258/14516498> >>esp; c029bf10 Trace; c01c14c9 Trace; c01c1513 Trace; c01c1697 <__kfree_skb+127/1c0> Trace; c01c65e3 Trace; c0121b95 Trace; c010a88b Trace; c0107080 Trace; c010cde8 Trace; c0107080 Trace; c01070a3 Trace; c0107132 Trace; c0105000 <_stext+0/0> Code; c01c1402 00000000 <_EIP>: Code; c01c1402 <===== 0: 8b 42 78 mov 0x78(%edx),%eax <===== Code; c01c1405 3: 8b 1b mov (%ebx),%ebx Code; c01c1407 5: 48 dec %eax Code; c01c1408 6: 74 0a je 12 <_EIP+0x12> Code; c01c140a 8: ff 4a 78 decl 0x78(%edx) Code; c01c140d b: 0f 94 c0 sete %al Code; c01c1410 e: 84 c0 test %al,%al Code; c01c1412 10: 74 08 je 1a <_EIP+0x1a> Code; c01c1414 12: 89 14 00 mov %edx,(%eax,%eax,1) <0>Kernel panic: Aiee, killing interrupt handler! -- Mit freundlichen Gruessen/Best regards, Sebastian Piecha EMail: spi@gmxpro.de From ak@muc.de Sun Oct 26 14:46:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 14:46:38 -0800 (PST) Received: from zero.aec.at (Lavatar_Shunk@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9QMk325009027 for ; Sun, 26 Oct 2003 14:46:04 -0800 Received: from fred.muc.de (Jex_Wopley@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id h9QMjoS07949; Sun, 26 Oct 2003 23:45:51 +0100 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 92F605BBF5; Sun, 26 Oct 2003 23:45:54 +0100 (CET) To: Simon Roscic Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [2.6.0-test8/9] ethertap oops From: Andi Kleen Date: Sun, 26 Oct 2003 23:45:52 +0100 In-Reply-To: (Simon Roscic's message of "Sun, 26 Oct 2003 23:10:14 +0100") Message-ID: User-Agent: Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.2 (i586-suse-linux) References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 1021 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Content-Length: 1338 Lines: 38 Simon Roscic writes: > EIP is at ethertap_rx+0x131/0x2a0 [ethertap] Does this patch fix it? -Andi diff -u linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o linux-2.6.0test7mm1-averell/drivers/net/ethertap.c --- linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o 2003-09-11 04:12:33.000000000 +0200 +++ linux-2.6.0test7mm1-averell/drivers/net/ethertap.c 2003-10-26 23:41:17.000000000 +0100 @@ -302,11 +302,12 @@ static void ethertap_rx(struct sock *sk, int len) { - struct net_device *dev = tap_map[sk->sk_protocol]; + unsigned unit = sk->sk_protocol - NETLINK_TAPBASE; + struct net_device *dev; struct sk_buff *skb; - if (dev==NULL) { - printk(KERN_CRIT "ethertap: bad unit!\n"); + if (unit >= max_taps || (dev = tap_map[unit]) == NULL) { + printk(KERN_CRIT "ethertap: bad unit %u!\n", unit); skb_queue_purge(&sk->sk_receive_queue); return; } diff -u linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c-o linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c --- linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c-o 2003-10-09 00:29:02.000000000 +0200 +++ linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c 2003-10-26 23:42:44.000000000 +0100 @@ -777,6 +777,7 @@ if (input) nlk_sk(sk)->data_ready = input; + sk->sk_protocol = unit; netlink_insert(sk, 0); return sk; } From akpm@osdl.org Sun Oct 26 16:01:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 16:01:40 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R00x25010248 for ; Sun, 26 Oct 2003 16:01:02 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9R00io19370; Sun, 26 Oct 2003 16:00:45 -0800 Date: Sun, 26 Oct 2003 16:01:58 -0800 From: Andrew Morton To: Andries.Brouwer@cwi.nl Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Linux 2.6.0-test9 Message-Id: <20031026160158.74bd09c8.akpm@osdl.org> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.4 (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: 1022 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 563 Lines: 19 Andries.Brouwer@cwi.nl wrote: > > From: Linus Torvalds > > > I have run 2.6.0-test6 without any problems. Switched > > to 2.6.0-test9 today. Something involving job control > > or so is broken. Several of my remote xterms hang. > > Btw, this one sounds like a known bug in bash. > > No - it is a recent kernel bug. > Mikael Pettersson noticed precisely the same thing, and says > "Reverting 2.6.0-test8-bk3's net/ipv4/tcp.c patch fixes > these problems." > And so it does. > Can someone show us the diff for this? From akpm@osdl.org Sun Oct 26 16:02:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 16:02:38 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R02R25010383 for ; Sun, 26 Oct 2003 16:02:27 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9R02Lo19600; Sun, 26 Oct 2003 16:02:21 -0800 Date: Sun, 26 Oct 2003 16:03:34 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: Simon Roscic Subject: Fw: [2.6.0-test8/9] ethertap oops Message-Id: <20031026160334.3999761f.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) 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 h9R02R25010383 X-archive-position: 1023 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 4322 Lines: 110 Begin forwarded message: Date: Sun, 26 Oct 2003 23:02:57 +0100 From: Simon Roscic To: linux-kernel@vger.kernel.org Subject: [2.6.0-test8/9] ethertap oops (please cc me, as i´m not subscribed to lkml - thanks) hi, last week i started playing around with -test8, wich was working very well on my machine, except ethertap, wich oopsed ... i tried again with -test9, and as i expected (changelog doesnt mention ethertap changes) i got the same oops. i need ethertap for the vpn software (phion vpn) we use at the office, the phion vpn client uses the ethertap device and works well with kernel 2.4 series, but on 2.6 it doesn't work. (tried with -test8 & 9) the initial connect seems to work, i see the vpn motd (the vpn client is an ncurses program), but as soon as i try to do something eg. ping, or as soon as network traffic is going to / coming from the vpn, i get the following oops: Unable to handle kernel paging request at virtual address 0000885e printing eip: e18792d1 *pde = 00000000 Oops: 0002 [#1] CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010246 EIP is at ethertap_rx+0x131/0x2a0 [ethertap] eax: 00000000 ebx: df344840 ecx: 00000000 edx: 00000800 esi: 0000885a edi: df3448a4 ebp: 00000048 esp: de421d84 ds: 007b es: 007b ss: 0068 Process phionvpn (pid: 553, threadinfo=de420000 task=df746080) Stack: df344840 de579ecc 00000011 dffcdc04 de420000 de579ecc dffcdbc0 de420000 dffcdbc0 df633c80 c030d979 dffcdbc0 00000048 df344840 c030d050 dffcdbc0 00000048 7fffffff 00000010 00000048 00000000 df746080 c0117370 00000000 Call Trace: [] netlink_data_ready+0x59/0x70 [] netlink_unicast+0x290/0x340 [] default_wake_function+0x0/0x30 [] default_wake_function+0x0/0x30 [] alloc_skb+0x47/0xe0 [] netlink_sendmsg+0x202/0x2f0 [] schedule+0x2f9/0x580 [] sock_sendmsg+0x9e/0xd0 [] netlink_write+0x0/0x80 [] netlink_write+0x70/0x80 [] vfs_write+0xb8/0x130 [] sys_write+0x42/0x70 [] syscall_call+0x7/0xb Code: ff 46 04 01 6e 0c 89 1c 24 e8 51 85 a8 de 8b 54 24 14 a1 80 i´ve put up further information here: kernel 2.6.0-test9 (vanilla+con`s swappiness autoregulation patch): kernel .config: http://segfault.info/simon/ethertap-oops/2.6.0-test9/kernel-2.6.0-test9.config dmesg output: http://segfault.info/simon/ethertap-oops/2.6.0-test9/dmesg-2.6.0-test9 ksymoops (useless on 2.6? - i remember there was some discussion on lkml a while back): http://segfault.info/simon/ethertap-oops/2.6.0-test9/ksymoops-2.6.0-test9 the oops: http://segfault.info/simon/ethertap-oops/2.6.0-test9/oops-2.6.0-test9 strace of the phion vpn client, one on kernel 2.4.22, and one on kernel 2.6.0-test9: http://segfault.info/simon/ethertap-oops/2.6.0-test9/phion-strace-2.4.22 http://segfault.info/simon/ethertap-oops/2.6.0-test9/phion-strace-2.6.0-test9 ver_linux output: http://segfault.info/simon/ethertap-oops/2.6.0-test9/ver_linux kernel 2.6.0-test8 (vanilla, without any other patches): kernel .config: http://segfault.info/simon/ethertap-oops/2.6.0-test8/kernel-2.6.0-test8.config ksymoops (useless on 2.6? - i remember there was some discussion on lkml a while back): http://segfault.info/simon/ethertap-oops/2.6.0-test8/ksymoops-2.6.0-test8 the oops: http://segfault.info/simon/ethertap-oops/2.6.0-test8/oops-2.6.0-test8 strace of the phion vpn client, one on kernel 2.4.22, and one on kernel 2.6.0-test8: http://segfault.info/simon/ethertap-oops/2.6.0-test8/phion-strace-2.4.22 http://segfault.info/simon/ethertap-oops/2.6.0-test8/phion-strace-2.6.0-test8 ver_linux output: http://segfault.info/simon/ethertap-oops/2.6.0-test8/ver_linux i dont know, how "clean" the phion vpn client software is, as it is a closed source :( program, but i think even if a program does something ugly with ethertap it should not oops. (and it works on 2.4) i hope the provided information is useable, if you need more information, logs, etc. just mail me. bye, simon. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ From torvalds@osdl.org Sun Oct 26 16:22:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 16:22:51 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R0MH25014165 for ; Sun, 26 Oct 2003 16:22:17 -0800 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9R0Lxo23644; Sun, 26 Oct 2003 16:21:59 -0800 Date: Sun, 26 Oct 2003 16:21:59 -0800 (PST) From: Linus Torvalds To: Andrew Morton cc: Andries.Brouwer@cwi.nl, Kernel Mailing List , , "David S. Miller" , Subject: Re: Linux 2.6.0-test9 In-Reply-To: <20031026160158.74bd09c8.akpm@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1024 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev Content-Length: 1452 Lines: 40 On Sun, 26 Oct 2003, Andrew Morton wrote: > > Can someone show us the diff for this? There's only one change to tcp.c after -test8: it's kuznet@ms2.inr.ac.ru: TCP: do not return -EINTR, when data are available for read() and I think it should just be reverted: the changeset even removes the comment that clearly says: /* We need to check signals first, to get correct SIGURG * handling. FIXME: Need to check this doesn't impact 1003.1g * and move it down to the bottom of the loop */ And Alexey apparently tried to do the "FIXME" part, but without thinking about the SIGURG part. We _need_ to stop at urgent data and we _should_ return -EINTR, and let the SIGURG handler do the URG read. Otherwise we'll lose urgent data (or we'll just read it inline without realizing that it was urgent data). I don't know anybody sane who uses urgent data (telnet and rlogin do, I don't know if they count as sane any more), but it does look like that patch totally broke it. I'd revert it myself, but since the networking code is fairly well maintained, I'll just wait for David and Alexey to weigh in, and tell me that I'm a total moron and I overlooked something. But I don't think I missed anything. Andries, what was the situation that led to a TCP lockup? I don't see anything but URG being broken by that patch, so it would be good to verify that your breakage really was URG, to see that it's totally understood.. Linus From torvalds@osdl.org Sun Oct 26 16:28:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 16:28:59 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R0SP25014905 for ; Sun, 26 Oct 2003 16:28:25 -0800 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9R0SBo24453; Sun, 26 Oct 2003 16:28:11 -0800 Date: Sun, 26 Oct 2003 16:28:11 -0800 (PST) From: Linus Torvalds To: Andrew Morton cc: Andries.Brouwer@cwi.nl, Kernel Mailing List , , "David S. Miller" , Subject: Re: Linux 2.6.0-test9 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1025 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev Content-Length: 1234 Lines: 38 On Sun, 26 Oct 2003, Linus Torvalds wrote: > > Andries, what was the situation that led to a TCP lockup? I don't see > anything but URG being broken by that patch, so it would be good to verify > that your breakage really was URG, to see that it's totally understood.. Btw, final comment: if it really is URG-only breakage, then instead of reverting the patch (if it had some other reasons going for it), we could change the URG test at the top of the loop from if (copied && tp->urg_data && tp->urg_seq == *seq) break to if (tp->urg_data && tp->urg_seq == *seq) { if (copied) break; if (signal_pending(current)) { copied = timeo ? sock_intr_errno(timeo) : -EAGAIN; break; } } which gives the right break semantics for URG data. After that, the only other place where we should check for signal pending is probably at the tcp_data_wait() call. All the other signal pending checks seem bogus (ie right now a pending signal will mean that we avoid doing even TCP-level cleanups, which looks just wrong). But reverting the change is clearly the "safer" thing to do, I just worry that Alexey might have had a real reason for tryign to avoid the EINTR in the first place (for non-URG data). Linus From aeb@cwi.nl Sun Oct 26 17:49:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 17:49:44 -0800 (PST) Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R1n525016132 for ; Sun, 26 Oct 2003 17:49:06 -0800 Received: from apps.cwi.nl (apps.cwi.nl [192.16.191.34]) by hera.cwi.nl with ESMTP id h9R1mrZB006692 for ; Mon, 27 Oct 2003 02:48:53 +0100 (MET) From: Andries.Brouwer@cwi.nl Received: by apps.cwi.nl id h9R1mqO06057; Mon, 27 Oct 2003 02:48:52 +0100 (MET) Date: Mon, 27 Oct 2003 02:48:52 +0100 (MET) Message-Id: To: akpm@osdl.org, torvalds@osdl.org Subject: Re: Linux 2.6.0-test9 Cc: Andries.Brouwer@cwi.nl, davem@redhat.com, kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org, netdev@oss.sgi.com X-archive-position: 1026 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Andries.Brouwer@cwi.nl Precedence: bulk X-list: netdev Content-Length: 283 Lines: 11 > Andries, what was the situation that led to a TCP lockup? rlogin followed by "emacs -nw". rlogin uses SIGURG for communication. It is not the TCP protocol that is locked up. Keystrokes are transmitted and the results are sent back. But the reader half of rlogin hangs. Andries From yoshfuji@linux-ipv6.org Sun Oct 26 18:07:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 18:08:12 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R27X25016649 for ; Sun, 26 Oct 2003 18:07:34 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9R27Alg011684; Mon, 27 Oct 2003 11:07:10 +0900 Date: Mon, 27 Oct 2003 11:07:10 +0900 (JST) Message-Id: <20031027.110710.54972254.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, niteowl@austin.rr.com, pekkas@netcore.fi, yoshfuji@linux-ipv6.org Subject: Re: bugs in net/ipv6/mcast.c (fwd) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1027 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 Content-Length: 1339 Lines: 38 In article (at Sat, 25 Oct 2003 22:27:27 +0300 (EEST)), Pekka Savola says: > Probably fixed already, but just in case... Not yet in the bk tree. > Hi. In the latest linux-2.6.0-test8 source there are 2 bugs in > net/ipv6/mcast.c > In function inet6_mc_check() the if statements on lines 607 and 609 have > extra semicolons that will cause the code to fail. > > if (mc->sfmode == MCAST_INCLUDE && i >= psl->sl_count); > rv = 0; > if (mc->sfmode == MCAST_EXCLUDE && i < psl->sl_count); > rv = 0; Exactly. Patch follows. ===== net/ipv6/mcast.c 1.39 vs edited ===== --- 1.39/net/ipv6/mcast.c Fri Oct 17 17:05:20 2003 +++ edited/net/ipv6/mcast.c Mon Oct 27 11:01:27 2003 @@ -604,9 +604,9 @@ if (ipv6_addr_cmp(&psl->sl_addr[i], src_addr) == 0) break; } - if (mc->sfmode == MCAST_INCLUDE && i >= psl->sl_count); + if (mc->sfmode == MCAST_INCLUDE && i >= psl->sl_count) rv = 0; - if (mc->sfmode == MCAST_EXCLUDE && i < psl->sl_count); + if (mc->sfmode == MCAST_EXCLUDE && i < psl->sl_count) rv = 0; } read_unlock(&ipv6_sk_mc_lock); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From torvalds@osdl.org Sun Oct 26 18:10:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 18:11:00 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R2AQ25016995 for ; Sun, 26 Oct 2003 18:10:26 -0800 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9R2A3o07350; Sun, 26 Oct 2003 18:10:03 -0800 Date: Sun, 26 Oct 2003 18:10:03 -0800 (PST) From: Linus Torvalds To: Andries.Brouwer@cwi.nl cc: akpm@osdl.org, , , , Subject: Re: Linux 2.6.0-test9 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1028 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev Content-Length: 1986 Lines: 55 On Mon, 27 Oct 2003 Andries.Brouwer@cwi.nl wrote: > > rlogin followed by "emacs -nw". Ok. I bet I've never seen it partly because I only use ssh (I don't even allow rlogin to any of my machines). But you're right, rlogin certainly not only uses OOB data, but uses SIGURG itself. I would actually expect that if we delay the SIGURG until after we've read the URG data, the child process that wants to actually read the URG data will trivially hang, waiting for it. If this is easily repeatable for you, can you test just applying this patch on top of plain -test9? It's not the patch I'd actually do in real life, but it's the minimal patch to verify that it's really SIGURG and urgent data that is the thing you see. Sounds very likely, but it would be good to really verify. I think that this is, btw, the _right_ place for checking that SIGURG anyway. The case of being at urgent data really is a special case, and I think it was a mistake to try to have the signal_pending() check in a common code sequence - it's really two totally differenct cases when we check for "should we stop here due to SIGURG handling", or "should we return because we would have to wait for more data and we have a signal pending". Yes, both cases test for "signal_pending(current)", but the SIGURG case really could test for just "do we have SIGURG pending", not just "any signal". Linus --- 1.49/net/ipv4/tcp.c Mon Oct 20 22:27:42 2003 +++ edited/net/ipv4/tcp.c Sun Oct 26 17:59:14 2003 @@ -1536,9 +1536,15 @@ struct sk_buff *skb; u32 offset; - /* Are we at urgent data? Stop if we have read anything. */ - if (copied && tp->urg_data && tp->urg_seq == *seq) - break; + /* Are we at urgent data? Stop if we have read anything or have SIGURG pending. */ + if (tp->urg_data && tp->urg_seq == *seq) { + if (copied) + break; + if (signal_pending(current)) { + copied = timeo ? sock_intr_errno(timeo) : -EAGAIN; + break; + } + } /* Next get a buffer. */ From davem@pizda.ninka.net Sun Oct 26 22:39:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 22:40:18 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R6di25023619 for ; Sun, 26 Oct 2003 22:39:44 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA29343; Sun, 26 Oct 2003 22:33:19 -0800 Date: Sun, 26 Oct 2003 22:33:18 -0800 From: "David S. Miller" To: Tomas Szepe Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, grof@dragon.cz, volf@dragon.cz Subject: Re: possible bug in tcp_input.c Message-Id: <20031026223318.41917bb0.davem@redhat.com> In-Reply-To: <20031026065519.GC28035@louise.pinerecords.com> References: <20031024162959.GB11154@louise.pinerecords.com> <20031024193034.30f1caed.davem@redhat.com> <20031026065519.GC28035@louise.pinerecords.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1029 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: 927 Lines: 20 On Sun, 26 Oct 2003 07:55:19 +0100 Tomas Szepe wrote: > Dave, we've been thinking about this some more and have concluded > that since the problem is a relatively non-fatal one, the kernel > should just print out an "assertion failed" error similar to the > one in tcp_input.c, line 1323 [BUG_TRAP(cnt <= tp->packets_out);] > and maybe fix things up a little rather than oops on a NULL pointer > dereference; The state in question, although invalid, is possible > and should IMHO be checked for as in all the other "if (skb != NULL) > ..." places). If this condition triggers, the lists are corrupt and the kernel should not try to access this socket in any way whatsoever past this point. Therefore it should OOPS, which is exactly what it does now. A BUG_ON() is an equivalent response as far as I am concerned, it has the same exact result, and the backtrace shows where the problem is occuring. From davem@pizda.ninka.net Sun Oct 26 22:50:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 22:51:24 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R6om25024055 for ; Sun, 26 Oct 2003 22:50:48 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA29405; Sun, 26 Oct 2003 22:43:58 -0800 Date: Sun, 26 Oct 2003 22:43:58 -0800 From: "David S. Miller" To: Linus Torvalds Cc: akpm@osdl.org, Andries.Brouwer@cwi.nl, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Linux 2.6.0-test9 Message-Id: <20031026224358.233e6d1a.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1030 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: 1280 Lines: 31 On Sun, 26 Oct 2003 16:28:11 -0800 (PST) Linus Torvalds wrote: > But reverting the change is clearly the "safer" thing to do, I just worry > that Alexey might have had a real reason for tryign to avoid the EINTR in > the first place (for non-URG data). I'd like to hear something from Alexey first. The problem we were trying to deal with was that when data is available to read a lot of people were complaining that we return -EINTR and no other system does this. This is heavily inconsistent with how we handle every other type of socket error. In all other cases, a read() when data is available will succeed until the very last byte is sucked out of the socket, then any subsequent read() call after the queue is emptied will return the error. But I am starting to see that URG is different. It is not like other socket errors that halt the socket and make no new data arrive after it happens. Rather, URG can happen just about anywhere and more data can continue to flow into the socket buffers. In fact, this means that our change can result in an application can never see the error if data continues to arrive faster than the application can pull it out, see? Alexey, I think we did not understand this case fully when making this change. From davem@pizda.ninka.net Sun Oct 26 23:54:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 23:55:20 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R7sk25024918 for ; Sun, 26 Oct 2003 23:54:46 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA29588; Sun, 26 Oct 2003 23:48:28 -0800 Date: Sun, 26 Oct 2003 23:48:28 -0800 From: "David S. Miller" To: Andi Kleen Cc: simon.roscic@chello.at, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [2.6.0-test8/9] ethertap oops Message-Id: <20031026234828.2cb1f746.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1031 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: 942 Lines: 24 On Sun, 26 Oct 2003 23:45:52 +0100 Andi Kleen wrote: > diff -u linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o linux-2.6.0test7mm1-averell/drivers/net/ethertap.c > --- linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o 2003-09-11 04:12:33.000000000 +0200 > +++ linux-2.6.0test7mm1-averell/drivers/net/ethertap.c 2003-10-26 23:41:17.000000000 +0100 This part looks good, applied. > diff -u linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c-o linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c > --- linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c-o 2003-10-09 00:29:02.000000000 +0200 > +++ linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c 2003-10-26 23:42:44.000000000 +0100 > @@ -777,6 +777,7 @@ > if (input) > nlk_sk(sk)->data_ready = input; > > + sk->sk_protocol = unit; > netlink_insert(sk, 0); > return sk; > } This part is not needed, netlink_create() does this for us :-) Thanks Andi. From davem@pizda.ninka.net Sun Oct 26 23:56:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 26 Oct 2003 23:56:49 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R7uH25025065 for ; Sun, 26 Oct 2003 23:56:17 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA29630; Sun, 26 Oct 2003 23:50:00 -0800 Date: Sun, 26 Oct 2003 23:50:00 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPV6: Typo in address comparison Message-Id: <20031026235000.7f8df6bb.davem@redhat.com> In-Reply-To: <20031027.014502.98736584.yoshfuji@linux-ipv6.org> References: <20031027.014502.98736584.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1032 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: 301 Lines: 11 On Mon, 27 Oct 2003 01:45:02 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > Hello. > > Typo found in the local address comparison among sockets. Oops, Arnaldo and I saw this the other week too, but the fix for it got lost. I applied your patch, thank you Yoshfuji. From davem@pizda.ninka.net Mon Oct 27 00:03:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 00:03:48 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R83E25025738 for ; Mon, 27 Oct 2003 00:03:14 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA29700; Sun, 26 Oct 2003 23:56:58 -0800 Date: Sun, 26 Oct 2003 23:56:57 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org, miyazawa@linux-ipv6.org Subject: Re: ipv6 UDP MSG_MORE oops fix Message-Id: <20031026235657.7c3927d5.davem@redhat.com> In-Reply-To: <20031026.185023.108406592.yoshfuji@linux-ipv6.org> References: <20030807223421.70497d61.davem@redhat.com> <20030808.170839.90822982.yoshfuji@linux-ipv6.org> <20031026.185023.108406592.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1033 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: 375 Lines: 8 On Sun, 26 Oct 2003 18:50:23 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > [1/3] IPv6: Odd IPv6 header in UDPv6 packets when sending MSG_MORE flag > [2/3] NET: store cork'ing flow information in common storage in inet_opt > [3/3] IPv6: breakage of sendmsg to IPv4-mapped address via UDPv6 socket All three patches applied, thanks Yoshfuji. From davem@pizda.ninka.net Mon Oct 27 00:08:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 00:09:18 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R88g25026168 for ; Mon, 27 Oct 2003 00:08:43 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA29773; Mon, 27 Oct 2003 00:02:11 -0800 Date: Mon, 27 Oct 2003 00:02:11 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, niteowl@austin.rr.com, pekkas@netcore.fi, yoshfuji@linux-ipv6.org Subject: Re: bugs in net/ipv6/mcast.c (fwd) Message-Id: <20031027000211.3dcaa385.davem@redhat.com> In-Reply-To: <20031027.110710.54972254.yoshfuji@linux-ipv6.org> References: <20031027.110710.54972254.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1034 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: 160 Lines: 6 On Mon, 27 Oct 2003 11:07:10 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > Exactly. Patch follows. Applied, thanks everyone. From davem@pizda.ninka.net Mon Oct 27 01:47:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 01:47:39 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R9kn25030026 for ; Mon, 27 Oct 2003 01:47:02 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA30036; Mon, 27 Oct 2003 01:40:32 -0800 Date: Mon, 27 Oct 2003 01:40:32 -0800 From: "David S. Miller" To: Linus Torvalds Cc: Andries.Brouwer@cwi.nl, akpm@osdl.org, kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Linux 2.6.0-test9 Message-Id: <20031027014032.4908019f.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1035 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: 210 Lines: 7 I'm going to just revert the changeset in the networking fixes I send to Linus today. If we resolve this some other way, that's fine and the original change is in the revision history for people to refer to. From mikpe@user.it.uu.se Mon Oct 27 01:48:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 01:48:40 -0800 (PST) Received: from meryl.it.uu.se (root@meryl.it.uu.se [130.238.12.42]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9R9m425030092 for ; Mon, 27 Oct 2003 01:48:05 -0800 Received: from harpo.it.uu.se (1@harpo.it.uu.se [130.238.12.34]) by meryl.it.uu.se (8.8.5/8.8.5) with ESMTP id KAA22226; Mon, 27 Oct 2003 10:47:54 +0100 (MET) Received: (from mikpe@localhost) by harpo.it.uu.se (8.12.8+Sun/8.12.9) id h9R9lr8M003468; Mon, 27 Oct 2003 10:47:53 +0100 (MET) Date: Mon, 27 Oct 2003 10:47:53 +0100 (MET) Message-Id: <200310270947.h9R9lr8M003468@harpo.it.uu.se> From: Mikael Pettersson To: Andries.Brouwer@cwi.nl, torvalds@osdl.org Subject: Re: Linux 2.6.0-test9 Cc: akpm@osdl.org, davem@redhat.com, kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org, netdev@oss.sgi.com X-archive-position: 1036 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mikpe@csd.uu.se Precedence: bulk X-list: netdev Content-Length: 1548 Lines: 43 On Sun, 26 Oct 2003 18:10:03 -0800 (PST), Linus Torvalds wrote: >On Mon, 27 Oct 2003 Andries.Brouwer@cwi.nl wrote: >> >> rlogin followed by "emacs -nw". > >Ok. I bet I've never seen it partly because I only use ssh (I don't even >allow rlogin to any of my machines). But you're right, rlogin certainly >not only uses OOB data, but uses SIGURG itself. I would actually expect >that if we delay the SIGURG until after we've read the URG data, the child >process that wants to actually read the URG data will trivially hang, >waiting for it. > >If this is easily repeatable for you, can you test just applying this >patch on top of plain -test9? It's not the patch I'd actually do in real >life, but it's the minimal patch to verify that it's really SIGURG and >urgent data that is the thing you see. Sounds very likely, but it would be >good to really verify. This patch does fix the rlogin + emacs -nw problems. /Mikael >--- 1.49/net/ipv4/tcp.c Mon Oct 20 22:27:42 2003 >+++ edited/net/ipv4/tcp.c Sun Oct 26 17:59:14 2003 >@@ -1536,9 +1536,15 @@ > struct sk_buff *skb; > u32 offset; > >- /* Are we at urgent data? Stop if we have read anything. */ >- if (copied && tp->urg_data && tp->urg_seq == *seq) >- break; >+ /* Are we at urgent data? Stop if we have read anything or have SIGURG pending. */ >+ if (tp->urg_data && tp->urg_seq == *seq) { >+ if (copied) >+ break; >+ if (signal_pending(current)) { >+ copied = timeo ? sock_intr_errno(timeo) : -EAGAIN; >+ break; >+ } >+ } > > /* Next get a buffer. */ > From aeb@cwi.nl Mon Oct 27 02:58:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 02:59:19 -0800 (PST) Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RAwf25001068 for ; Mon, 27 Oct 2003 02:58:42 -0800 Received: from apps.cwi.nl (apps.cwi.nl [192.16.191.34]) by hera.cwi.nl with ESMTP id h9RAwTpw015097 for ; Mon, 27 Oct 2003 11:58:29 +0100 (MET) From: Andries.Brouwer@cwi.nl Received: by apps.cwi.nl id h9RAwTB04591; Mon, 27 Oct 2003 11:58:29 +0100 (MET) Date: Mon, 27 Oct 2003 11:58:29 +0100 (MET) Message-Id: To: Andries.Brouwer@cwi.nl, torvalds@osdl.org Subject: Re: Linux 2.6.0-test9 Cc: akpm@osdl.org, davem@redhat.com, kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org, netdev@oss.sgi.com X-archive-position: 1037 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Andries.Brouwer@cwi.nl Precedence: bulk X-list: netdev Content-Length: 123 Lines: 5 > If this is easily repeatable for you, can you test just applying this > patch on top of plain -test9? Yes, that works. From arekm@beep.pl Mon Oct 27 03:45:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 03:46:06 -0800 (PST) Received: from maja.beep.pl (exim@smtp.sys.beep.pl [195.245.198.13]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RBjV25001817 for ; Mon, 27 Oct 2003 03:45:32 -0800 Received: from gucio-bb.sys.beep.pl ([195.245.198.12] helo=gucio.beep.pl) by maja.beep.pl with esmtp (TLSv1:EDH-RSA-DES-CBC3-SHA:168) (Exim 4.24) id 1AE5ju-0006Ry-PQ for netdev@oss.sgi.com; Mon, 27 Oct 2003 12:40:50 +0100 Received: from arm.t19.ds.pwr.wroc.pl ([156.17.236.105] helo=192.168.2.2) by gucio.beep.pl with asmtp (TLSv1:RC4-MD5:128) (Exim 4.24) id 1AE5mu-0007KM-0Q for netdev@oss.sgi.com; Mon, 27 Oct 2003 12:43:56 +0100 From: Arkadiusz Miskiewicz Reply-To: admin@beep.pl Organization: BeeProvider To: netdev@oss.sgi.com Subject: iproute2 and 2.6.0-test9 Date: Mon, 27 Oct 2003 12:42:36 +0100 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200310271236.58440.arekm@beep.pl> Content-Type: text/plain; charset="iso-8859-2" Reply-to: admin@beep.pl X-Authenticated-Id: arekm Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h9RBjV25001817 X-archive-position: 1038 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: arekm@beep.pl Precedence: bulk X-list: netdev Content-Length: 7392 Lines: 158 Hi, I have problem with 2.6.0-test9. iproute hangs when flushing ie: [root@mobarm arekm]# ip a 1: lo: mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever inet6 ff02::1/128 scope global valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:a0:cc:da:d9:3c brd ff:ff:ff:ff:ff:ff inet 192.168.2.2/24 brd 192.168.2.255 scope global eth0 inet6 fe80::2a0:ccff:feda:d93c/64 scope link valid_lft forever preferred_lft forever inet6 ff02::1:ffda:d93c/128 scope global valid_lft forever preferred_lft forever inet6 ff02::1/128 scope global valid_lft forever preferred_lft forever 3: irda0: mtu 2048 qdisc pfifo_fast qlen 8 link/irda 4: sit0: mtu 1480 qdisc noop link/sit 0.0.0.0 brd 0.0.0.0 [root@mobarm arekm]# ip link set eth0 down [root@mobarm arekm]# ip a flush dev eth0 (hangs here but I can interrupt it with ctrl+c) [arekm@mobarm arekm]$ ps aux | grep "ip a" root 12479 93.9 0.1 1560 328 pts/3 R 12:33 0:18 ip a flush dev eth0 arekm 12513 0.0 0.2 2100 620 pts/5 S 12:33 0:00 grep ip a [arekm@mobarm arekm]$ ps arx -O wchan | grep "ip a" 12479 - R pts/3 00:00:57 ip a flush dev eth0 eats 93.9% cpu, When doing the other way - first flush, then down everything is ok: [root@mobarm arekm]# ip a flush dev eth0 [root@mobarm arekm]# ip link set eth0 down [root@mobarm arekm]# iproute2-2.4.7.ss020116 strace shows: 5525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"@\0\0\0\24\0\2\ 0\177\35\255?\245<\0\0\n\200\200\376\1\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 192 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"\24\0\0\0\3\0\2 \0\177\35\255?\245<\0\0\0\0\0\0\1\0\0\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 20 15525 sendto(3, "@\0\0\0\25\0\1\0\200\35\255?\245<\0\0\n\200\200\0\2\0\0"..., 64, 0, {sa_family=AF_NETLINK, sa_data="\0\0\0\ 0\0\0\0\0\0\0\20\306\377\277"}, 12) = 64 15525 sendto(3, "\24\0\0\0\26\0\1\3\201\35\255?\0\0\0\0\0\365\377\277", 20, 0, {sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\ 0\0\0\0\20\306\377\277"}, 12) = 20 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"$\0\0\0\2\0\0\0 \200\35\255?\245<\0\0\235\377\377\377@\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 36 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"<\0\0\0\24\0\2\ 0\201\35\255?\245<\0\0\2\10\200\376\1\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 60 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"@\0\0\0\24\0\2\ 0\201\35\255?\245<\0\0\n\200\200\376\1\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 192 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"\24\0\0\0\3\0\2 \0\201\35\255?\245<\0\0\0\0\0\0\1\0\0\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 20 15525 sendto(3, "@\0\0\0\25\0\1\0\202\35\255?\245<\0\0\n\200\200\0\2\0\0"..., 64, 0, {sa_family=AF_NETLINK, sa_data="\0\0\0\ 0\0\0\0\0\0\0\20\306\377\277"}, 12) = 64 15525 sendto(3, "\24\0\0\0\26\0\1\3\203\35\255?\0\0\0\0\0\365\377\277", 20, 0, {sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\ 0\0\0\0\20\306\377\277"}, 12) = 20 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"$\0\0\0\2\0\0\0 \202\35\255?\245<\0\0\235\377\377\377@\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 36 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"<\0\0\0\24\0\2\ 0\203\35\255?\245<\0\0\2\10\200\376\1\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 60 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"@\0\0\0\24\0\2\ 0\203\35\255?\245<\0\0\n\200\200\376\1\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 192 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"\24\0\0\0\3\0\2 \0\203\35\255?\245<\0\0\0\0\0\0\1\0\0\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 20 15525 sendto(3, "@\0\0\0\25\0\1\0\204\35\255?\245<\0\0\n\200\200\0\2\0\0"..., 64, 0, {sa_family=AF_NETLINK, sa_data="\0\0\0\ 0\0\0\0\0\0\0\20\306\377\277"}, 12) = 64 15525 sendto(3, "\24\0\0\0\26\0\1\3\205\35\255?\0\0\0\0\0\365\377\277", 20, 0, {sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\ 0\0\0\0\20\306\377\277"}, 12) = 20 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"$\0\0\0\2\0\0\0 \204\35\255?\245<\0\0\235\377\377\377@\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 36 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"<\0\0\0\24\0\2\ 0\205\35\255?\245<\0\0\2\10\200\376\1\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 60 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"@\0\0\0\24\0\2\ 0\205\35\255?\245<\0\0\n\200\200\376\1\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 192 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"\24\0\0\0\3\0\2 \0\205\35\255?\245<\0\0\0\0\0\0\1\0\0\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 20 15525 sendto(3, "@\0\0\0\25\0\1\0\206\35\255?\245<\0\0\n\200\200\0\2\0\0"..., 64, 0, {sa_family=AF_NETLINK, sa_data="\0\0\0\ 0\0\0\0\0\0\0\20\306\377\277"}, 12) = 64 15525 sendto(3, "\24\0\0\0\26\0\1\3\207\35\255?\0\0\0\0\0\365\377\277", 20, 0, {sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\ 0\0\0\0\20\306\377\277"}, 12) = 20 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"$\0\0\0\2\0\0\0 \206\35\255?\245<\0\0\235\377\377\377@\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 36 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"<\0\0\0\24\0\2\ 0\207\35\255?\245<\0\0\2\10\200\376\1\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 60 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"@\0\0\0\24\0\2\ 0\207\35\255?\245<\0\0\n\200\200\376\1\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 192 15525 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, msg_iov(1)=[{"\24\0\0\0\3\0\2 \0\207\35\255?\245<\0\0\0\0\0\0\1\0\0\0"..., 8192}], msg_controllen=0, msg_flags=0}, 0) = 20 15525 sendto(3, "@\0\0\0\25\0\1\0\210\35\255?\245<\0\0\n\200\200\0\2\0\0"..., 64, 0, {sa_family=AF_NETLINK, sa_data="\0\0\0\ 0\0\0\0\0\0\0\20\306\377\277"}, 12) = 64 15525 sendto(3, "\24\0\0\0\26\0\1\3\211\35\255?\0\0\0\0\0\365\377\277", 20, 0, {sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\ 0\0\0\0\20\306\377\277"}, 12) = 20 ps. please cc me as I'm not subscribed -- Arkadiusz Mi¶kiewicz, Grupa BeeProvider - http://www.beep.pl/ From davem@pizda.ninka.net Mon Oct 27 04:29:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 04:29:52 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RCTH25006166 for ; Mon, 27 Oct 2003 04:29:18 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA30908; Mon, 27 Oct 2003 04:22:58 -0800 Date: Mon, 27 Oct 2003 04:22:58 -0800 From: "David S. Miller" To: Andi Kleen Cc: ak@muc.de, simon.roscic@chello.at, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [2.6.0-test8/9] ethertap oops Message-Id: <20031027042258.21446129.davem@redhat.com> In-Reply-To: <20031027122635.GB16013@wotan.suse.de> References: <20031026234828.2cb1f746.davem@redhat.com> <20031027122635.GB16013@wotan.suse.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1039 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: 316 Lines: 9 On Mon, 27 Oct 2003 13:26:35 +0100 Andi Kleen wrote: > I don't know if it actually fixed the bug, I did not test it > (sorry, should have stated that in the original mail) > But at least it should printk now instead of crashing. Ok, it's still an improvement over the blind dereferencing it does not. From ak@suse.de Mon Oct 27 04:54:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 04:55:22 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RCsb25006680 for ; Mon, 27 Oct 2003 04:54:38 -0800 Received: from Hermes.suse.de (Hermes.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 3A1191757521; Mon, 27 Oct 2003 13:26:37 +0100 (CET) Received: by wotan.suse.de (Postfix, from userid 14000) id 2E6E01402B; Mon, 27 Oct 2003 13:26:35 +0100 (CET) Date: Mon, 27 Oct 2003 13:26:35 +0100 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , simon.roscic@chello.at, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [2.6.0-test8/9] ethertap oops Message-ID: <20031027122635.GB16013@wotan.suse.de> References: <20031026234828.2cb1f746.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031026234828.2cb1f746.davem@redhat.com> X-archive-position: 1040 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 Content-Length: 659 Lines: 15 On Sun, Oct 26, 2003 at 11:48:28PM -0800, David S. Miller wrote: > On Sun, 26 Oct 2003 23:45:52 +0100 > Andi Kleen wrote: > > > diff -u linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o linux-2.6.0test7mm1-averell/drivers/net/ethertap.c > > --- linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o 2003-09-11 04:12:33.000000000 +0200 > > +++ linux-2.6.0test7mm1-averell/drivers/net/ethertap.c 2003-10-26 23:41:17.000000000 +0100 > > This part looks good, applied. I don't know if it actually fixed the bug, I did not test it (sorry, should have stated that in the original mail) But at least it should printk now instead of crashing. -Andi From yoshfuji@linux-ipv6.org Mon Oct 27 04:59:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 04:59:35 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RCx125007034 for ; Mon, 27 Oct 2003 04:59:01 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9RCwrlg014999; Mon, 27 Oct 2003 21:58:53 +0900 Date: Mon, 27 Oct 2003 21:58:53 +0900 (JST) Message-Id: <20031027.215853.103522470.yoshfuji@linux-ipv6.org> To: pekkas@netcore.fi Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org, sekiya@wide.ad.jp Subject: Re: Disabling IPv6 accept_ra on just some interface From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1041 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 Content-Length: 1492 Lines: 40 In article (at Thu, 23 Oct 2003 15:22:47 +0300 (EEST)), Pekka Savola says: > So, my thought (comments welcome) is: > > 1) when accept_ra changes from 0 -> 1, initiate the route > solicitation process, likewise as one would when the interface is > brought up. > > Makes sense? > > 2) (probably not a good idea, but some food for thought..) when accept_ra > changes from 1 -> 0, delete any autoconfigured routes or > prefixes. (could be ugly / dangerous..) Well, we'd propose to have another config "send_rs" or something like that because accept_ra is also effective against unsolicited RAs. It, "send_rs," tells kernel to start sending RS when the variable is changed 0 to 1 and/or when interface is going up. Assume the node has eth0 and eth1. Operation will be something like the following. If you want to listen RA and to send RS on some interfaces, sysctl -w net.ipv6.conf.default.accept_ra=0 sysctl -w net.ipv6.conf.default.send_rs=0 ifup -a sysctl -w net.ipv6.conf.eth0.accept_ra=1 sysctl -w net.ipv6.conf.eth0.send_rs=1 If you want to listen RA on all interfaces, but do not want to send RS on some of them, sysctl -w net.ipv6.conf.default.accept_ra=1 sysctl -w net.ipv6.conf.default.send_rs=0 ifup -a sysctl -w net.ipv6.cont.eth0.send_rs=1 -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From pekkas@netcore.fi Mon Oct 27 05:05:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 05:06:36 -0800 (PST) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RD5u25007504 for ; Mon, 27 Oct 2003 05:05:58 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h9RD5gW09850; Mon, 27 Oct 2003 15:05:42 +0200 Date: Mon, 27 Oct 2003 15:05:42 +0200 (EET) From: Pekka Savola To: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= cc: netdev@oss.sgi.com, Subject: Re: Disabling IPv6 accept_ra on just some interface In-Reply-To: <20031027.215853.103522470.yoshfuji@linux-ipv6.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-archive-position: 1042 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 2117 Lines: 53 On Mon, 27 Oct 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote: > In article (at Thu, 23 Oct 2003 15:22:47 +0300 (EEST)), Pekka Savola says: > > So, my thought (comments welcome) is: > > > > 1) when accept_ra changes from 0 -> 1, initiate the route > > solicitation process, likewise as one would when the interface is > > brought up. > > > > Makes sense? > > > > 2) (probably not a good idea, but some food for thought..) when accept_ra > > changes from 1 -> 0, delete any autoconfigured routes or > > prefixes. (could be ugly / dangerous..) > > Well, we'd propose to have another config "send_rs" or something like that > because accept_ra is also effective against unsolicited RAs. > It, "send_rs," tells kernel to start sending RS > when the variable is changed 0 to 1 and/or > when interface is going up. I don't have any major objections to this model, I'm just worried that it might make the configuration more complex (we already have accept_ra and "autoconf" toggles which are confusing enough without documentation :-) with little gain. That is, is there any case when you'd want to accept an RA but *not* send RS? I fail to see clear applicability for this, hence my proposal to overload accept_ra :-) > Assume the node has eth0 and eth1. > Operation will be something like the following. > > If you want to listen RA and to send RS on some interfaces, > sysctl -w net.ipv6.conf.default.accept_ra=0 > sysctl -w net.ipv6.conf.default.send_rs=0 > ifup -a > sysctl -w net.ipv6.conf.eth0.accept_ra=1 > sysctl -w net.ipv6.conf.eth0.send_rs=1 > > If you want to listen RA on all interfaces, but do not want to send RS on > some of them, > sysctl -w net.ipv6.conf.default.accept_ra=1 > sysctl -w net.ipv6.conf.default.send_rs=0 > ifup -a > sysctl -w net.ipv6.cont.eth0.send_rs=1 > > -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From mehul.patel@in.ibm.com Mon Oct 27 06:24:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 06:25:04 -0800 (PST) Received: from ausmtp02.au.ibm.com (ausmtp02.au.ibm.com [202.81.18.187]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9REOP25008561 for ; Mon, 27 Oct 2003 06:24:26 -0800 Received: from sd0112e0.au.ibm.com (d23rh903.au.ibm.com [202.81.18.201]) by ausmtp02.au.ibm.com (8.12.10/8.12.9) with ESMTP id h9RENTTv083160; Tue, 28 Oct 2003 01:23:29 +1100 Received: from d23m0178.in.ibm.com (d23av02.au.ibm.com [9.190.250.243]) by sd0112e0.au.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9REO4ws066936; Tue, 28 Oct 2003 01:24:19 +1100 To: netdev@oss.sgi.com Cc: Matthias Fruehauf , olaf@suse.de, Anil K Prasad , Daljeet Maini MIME-Version: 1.0 Subject: Re: Linux kernel updates and ip_crossover patch X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mehulkumar J Patel Date: Mon, 27 Oct 2003 19:54:37 +0530 X-MIMETrack: Serialize by Router on d23m0178/23/M/IBM(Release 6.0.1 [IBM]|May 16, 2003) at 10/27/2003 19:54:43, Serialize complete at 10/27/2003 19:54:43 Content-Type: multipart/alternative; boundary="=_alternative 004F8B0565256DCC_=" X-archive-position: 1043 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mehul.patel@in.ibm.com Precedence: bulk X-list: netdev Content-Length: 12189 Lines: 343 This is a multipart message in MIME format. --=_alternative 004F8B0565256DCC_= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, We at IBM need IP CROSSOVER module as part of kernel source. I sent the request to SuSe for the same and they got back to me and their=20 response is in this mail thread below. Can you please let me know what do you think about IP CROSSOVER feature ? best regards, Mehul. ----- Forwarded by Mehulkumar J Patel/India/IBM on 27/10/2003 17:42 ----- Olaf Hering 29/09/2003 16:40 =20 To: Kaena Freitas , Mehulkumar J Patel/India/= IBM@IBMIN cc: Mehulkumar J Patel/India/IBM@IBMIN, Matthias Fruehauf ,=20 olaf@suse.de, Anil K Prasad/India/IBM@IBMIN, Daljeet Maini/India/IBM@IBMIN Subject: Re: Linux kernel updates and ip=5Fcrossover patch =20 On Wed, Sep 24, Kaena Freitas wrote: >=20 >=20 >=20 >=20 > Hello Mehul - >=20 > Sorry it has taken me a while to respond. We do not keep any code in=20 CMVC. > All code we get from SuSE is on the ftp3 site along with all the source > RPMs. We do have internel CVS trees, but there is no guarantee that=20 those > trees are current with the code we get from SuSE which is what your team > should be testing. >=20 > As for the htx patch you've provided, I have copied SuSE on this email=20 to > get their comments if it can be part of their distribution. Good morning, did you sent the patch to netdev@oss.sgi.com? What opinion have the network and iptables maintainers about this feature? > (See attached file: hxecom=5Fpatch)forgot to attach the patch. >=20 >=20 > e-mail: mehul.patel@in.ibm.com > IBM Global Services > Bangalore, India. > Tel: 091-80-5094160 >=20 >=20 >=20 > =20 > Mehulkumar J =20 > Patel To: Kaena=20 Freitas/Austin/IBM=20 > cc: Anil K=20 Prasad/India/IBM@IBMIN, Daljeet=20 > 23/09/2003 18:38 Maini/India/IBM@IBMIN = =20 > Please respond to From: Mehulkumar J=20 Patel/India/IBM@IBMIN=20 > Subject: Linux kernel=20 updates and ip=5Fcrossover patch=20 > =20 > =20 > =20 >=20 >=20 >=20 > Hi, >=20 > We are HTX Team. > We get affected by changes in Linux kernel in a way where we have to=20 update > our build environment > continuously. As of now we are doing so manually. But considering the > effort we are thinking of making > it automated. >=20 > Can you please tell us if there is a fixed place from where we can sync > Linux kernel sources through > scripts. Or do you put Linux kernel sources in cmvc or any other version > control system. >=20 > Also, we have an exerciser named "hxecom" which requires an external=20 patch, > ip=5Fcrossover for hxecom > to work in single system test. > This patch helps us in sending packets destined to IP address on the=20 same > machine without looping > back at IP layer. Packet actually goes out to hardware and thus we are=20 able > to stress network cards. > For this patch to work, kernel should have been compiled with netfilter. > If netfilter is not enabled and ip=5Fcrossover patch is not applied, we=20 end > up recompiling the whole > stuff and need to copy kernel and /lib/modules on all the test machines, > which is bit ugly. > Can you please include these two request from us in all p-series kernels = ? >=20 > I am attaching the patch here. >=20 > best regards, > Mehul. > e-mail: mehul.patel@in.ibm.com > IBM Global Services > Bangalore, India. > Tel: 091-80-5094160 >=20 >=20 >=20 --=20 USB is for mice, FireWire is for men! sUse lINUX ag, n=DCRNBERG --=_alternative 004F8B0565256DCC_= Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,

We at IBM need IP CROSSOVER module a= s part of kernel source.

I sent the request to SuSe for the s= ame and they got back to me and their response is in this mail thread below= .

Can you please let me know what do y= ou think about IP CROSSOVER feature ?

best regards,
Mehul.
----- Forwarded by M= ehulkumar J Patel/India/IBM on 27/10/2003 17:42 -----
Olaf Hering <olh@suse.de>

29/09/2003 16:40

       
        To: &nbs= p;      Kaena Freitas <kaena@us.ibm.com>, Mehulkumar J= Patel/India/IBM@IBMIN
        cc: &nbs= p;      Mehulkumar J Patel/India/IBM@IBMIN, Matthias Fruehau= f <mfrueh@suse.de>, olaf@suse.de, Anil K Prasad/India/IBM@IBMIN, Dalj= eet Maini/India/IBM@IBMIN
        Subject:=        Re: Linux kernel updates and ip=5Fcrossover pat= ch

       


 On Wed, Sep 24, Kaena Freitas= wrote:

>
>
>
>
> Hello Mehul -
>
> Sorry it has taken me a while to respond. We do not keep any code in C= MVC.
> All code we get from SuSE is on the ftp3 site along with all the sourc= e
> RPMs. We do have internel CVS trees, but there is no guarantee that th= ose
> trees are current with the code we get from SuSE which is what your te= am
> should be testing.
>
> As for the htx patch you've provided, I have copied SuSE on this email= to
> get their comments if it can be part of their distribution.

Good morning,

did you sent the patch to netdev@oss.sgi.com?
What opinion have the network and iptables maintainers about this feature?<= br>

> (See attached file: hxecom=5Fpatch)forgot to attach the patch.
>
>
> e-mail: mehul.patel@in.ibm.com
> IBM Global Services
> Bangalore, India.
> Tel: 091-80-5094160
>
>
>
>                     =                      = ;                     &nb= sp;                     &= nbsp;                    =          
>                     =   Mehulkumar J                =                     &nbs= p;                     &n= bsp;                     =
>                     =   Patel                  =  To:       Kaena Freitas/Austin/IBM     &nbs= p;                     &n= bsp;      
>                     =                      = ;      cc:       Anil K Prasad/India/IBM@IBMI= N, Daljeet                   &= nbsp;
>                     =   23/09/2003 18:38          Maini/India/IBM@I= BMIN                     =                      = ;    
>                     =   Please respond to        From:     Meh= ulkumar J Patel/India/IBM@IBMIN             &= nbsp;          
>                     =                      = ;      Subject:  Linux kernel updates and ip=5Fcrossove= r patch              
>                     =                      = ;                     &nb= sp;                     &= nbsp;                    =          
>                     =                      = ;                     &nb= sp;                     &= nbsp;                    =          
>                     =                      = ;                     &nb= sp;                     &= nbsp;                    =          
>
>
>
> Hi,
>
> We are HTX Team.
> We get affected by changes in Linux kernel in a way where we have to u= pdate
> our build environment
> continuously. As of now we are doing so manually. But considering the<= br> > effort we are thinking of making
> it automated.
>
> Can you please tell us if there is a fixed place from where we can syn= c
> Linux kernel sources through
> scripts. Or do you put Linux kernel sources in cmvc or any other versi= on
> control system.
>
> Also, we have an exerciser named "hxecom" which requires an = external patch,
> ip=5Fcrossover for hxecom
>  to work in single system test.
> This patch helps us in sending packets destined to IP address on the s= ame
> machine without looping
> back at IP layer. Packet actually goes out to hardware and thus we are= able
> to stress network cards.
> For this patch to work, kernel should have been compiled with netfilte= r.
> If netfilter is not enabled and ip=5Fcrossover patch is not applied, w= e end
> up recompiling the whole
> stuff and need to copy kernel and /lib/modules on all the test machine= s,
> which is bit ugly.
> Can you please include these two request from us in all p-series kerne= ls ?
>
> I am attaching the patch here.
>
> best regards,
> Mehul.
> e-mail: mehul.patel@in.ibm.com
> IBM Global Services
> Bangalore, India.
> Tel: 091-80-5094160
>
>
>



--
USB is for mice, FireWire is for men!

sUse lINUX ag, n=DCRNBERG


--=_alternative 004F8B0565256DCC_=-- From yoshfuji@linux-ipv6.org Mon Oct 27 06:27:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 06:27:36 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RER025008790 for ; Mon, 27 Oct 2003 06:27:02 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9RER0lg015764; Mon, 27 Oct 2003 23:27:01 +0900 Date: Mon, 27 Oct 2003 23:27:00 +0900 (JST) Message-Id: <20031027.232700.97608602.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] IPV6: inappropriate usage of inet{,6}_sk() From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1044 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 Content-Length: 4784 Lines: 149 Hi, I found other inappropriate usages of inet{,6}_sk() for tcp_tw_bucket: - inet6_sk(sk)->ipv6only - inet6_sk(sk)->rcv_saddr - inet_sk(sk)->rcv_saddr Patch is against my previous patch. Thanks. ===== include/net/tcp.h 1.51 vs edited ===== --- 1.51/include/net/tcp.h Thu Jul 10 11:18:02 2003 +++ edited/include/net/tcp.h Mon Oct 27 22:17:19 2003 @@ -219,6 +219,7 @@ #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) struct in6_addr tw_v6_daddr; struct in6_addr tw_v6_rcv_saddr; + int tw_v6_ipv6only; #endif }; @@ -266,6 +267,35 @@ hlist_for_each_entry_safe(tw, node, safe, jail, tw_death_node) #define tcptw_sk(__sk) ((struct tcp_tw_bucket *)(__sk)) + +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +# define tcptw_sk_ipv6only(__sk) (tcptw_sk(__sk)->tw_v6_ipv6only) +#else +# define tcptw_sk_ipv6only(__sk) 0 +#endif + +static inline const u32 tcp_v4_rcv_saddr(const struct sock *sk) +{ + return likely(sk->sk_state != TCP_TIME_WAIT) ? + inet_sk(sk)->rcv_saddr : tcptw_sk(sk)->tw_rcv_saddr; +} + +static inline const struct in6_addr *__tcp_v6_rcv_saddr(const struct sock *sk) +{ + return likely(sk->sk_state != TCP_TIME_WAIT) ? + &inet6_sk(sk)->rcv_saddr : &tcptw_sk(sk)->tw_v6_rcv_saddr; +} + +static inline const struct in6_addr *tcp_v6_rcv_saddr(const struct sock *sk) +{ + return sk->sk_family == AF_INET6 ? __tcp_v6_rcv_saddr(sk) : NULL; +} + +static inline int tcp_v6_ipv6only(const struct sock *sk) +{ + return likely(sk->sk_state != TCP_TIME_WAIT) ? + ipv6_only_sock(sk) : tcptw_sk_ipv6only(sk); +} extern kmem_cache_t *tcp_timewait_cachep; ===== net/ipv4/tcp_ipv4.c 1.72 vs edited ===== --- 1.72/net/ipv4/tcp_ipv4.c Thu Oct 16 14:11:23 2003 +++ edited/net/ipv4/tcp_ipv4.c Mon Oct 27 22:17:21 2003 @@ -178,12 +178,6 @@ tcp_sk(sk)->bind_hash = tb; } -static inline const u32 tcp_v4_rcv_saddr(const struct sock *sk) -{ - return likely(sk->sk_state != TCP_TIME_WAIT) ? - inet_sk(sk)->rcv_saddr : tcptw_sk(sk)->tw_rcv_saddr; -} - static inline int tcp_bind_conflict(struct sock *sk, struct tcp_bind_bucket *tb) { const u32 sk_rcv_saddr = tcp_v4_rcv_saddr(sk); ===== net/ipv4/tcp_minisocks.c 1.42 vs edited ===== --- 1.42/net/ipv4/tcp_minisocks.c Mon Sep 29 06:37:15 2003 +++ edited/net/ipv4/tcp_minisocks.c Mon Oct 27 22:17:21 2003 @@ -368,6 +368,11 @@ ipv6_addr_copy(&tw->tw_v6_daddr, &np->daddr); ipv6_addr_copy(&tw->tw_v6_rcv_saddr, &np->rcv_saddr); + tw->tw_v6_ipv6only = np->ipv6only; + } else { + memset(&tw->tw_v6_daddr, 0, sizeof(tw->tw_v6_daddr)); + memset(&tw->tw_v6_rcv_saddr, 0, sizeof(tw->tw_v6_rcv_saddr)); + tw->tw_v6_ipv6only = 0; } #endif /* Linkage updates. */ --- linux-2.5/net/ipv6/addrconf.c Mon Oct 27 22:59:39 2003 +++ linux-2.5-net/net/ipv6/addrconf.c Mon Oct 27 22:23:05 2003 @@ -970,36 +970,33 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) { - struct ipv6_pinfo *np = inet6_sk(sk); - int addr_type = ipv6_addr_type(&np->rcv_saddr); + const struct in6_addr *sk_rcv_saddr6 = &inet6_sk(sk)->rcv_saddr; + const struct in6_addr *sk2_rcv_saddr6 = tcp_v6_rcv_saddr(sk2); + u32 sk_rcv_saddr = inet_sk(sk)->rcv_saddr; + u32 sk2_rcv_saddr = tcp_v4_rcv_saddr(sk2); + int sk_ipv6only = ipv6_only_sock(sk); + int sk2_ipv6only = tcp_v6_ipv6only(sk2); + int addr_type = ipv6_addr_type(sk_rcv_saddr6); + int addr_type2 = sk2_rcv_saddr6 ? ipv6_addr_type(sk2_rcv_saddr6) : IPV6_ADDR_MAPPED; - if (!inet_sk(sk2)->rcv_saddr && !ipv6_only_sock(sk)) + if (!sk2_rcv_saddr && !sk_ipv6only) return 1; - if (sk2->sk_family == AF_INET6 && - ipv6_addr_any(&inet6_sk(sk2)->rcv_saddr) && - !(ipv6_only_sock(sk2) && addr_type == IPV6_ADDR_MAPPED)) + if (addr_type2 == IPV6_ADDR_ANY && + !(sk2_ipv6only && addr_type == IPV6_ADDR_MAPPED)) return 1; if (addr_type == IPV6_ADDR_ANY && - (!ipv6_only_sock(sk) || - !(sk2->sk_family == AF_INET6 ? - (ipv6_addr_type(&inet6_sk(sk2)->rcv_saddr) == IPV6_ADDR_MAPPED) : - 1))) + !(sk_ipv6only && addr_type2 == IPV6_ADDR_MAPPED)) return 1; - if (sk2->sk_family == AF_INET6 && - !ipv6_addr_cmp(&np->rcv_saddr, - (sk2->sk_state != TCP_TIME_WAIT ? - &inet6_sk(sk2)->rcv_saddr : - &tcptw_sk(sk2)->tw_v6_rcv_saddr))) + if (sk2_rcv_saddr6 && + !ipv6_addr_cmp(sk_rcv_saddr6, sk2_rcv_saddr6)) return 1; if (addr_type == IPV6_ADDR_MAPPED && - !ipv6_only_sock(sk2) && - (!inet_sk(sk2)->rcv_saddr || - !inet_sk(sk)->rcv_saddr || - inet_sk(sk)->rcv_saddr == inet_sk(sk2)->rcv_saddr)) + !sk2_ipv6only && + (!sk2_rcv_saddr || !sk_rcv_saddr || sk_rcv_saddr == sk2_rcv_saddr)) return 1; return 0; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From acme@conectiva.com.br Mon Oct 27 06:32:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 06:33:18 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9REWh25009281 for ; Mon, 27 Oct 2003 06:32:44 -0800 Received: from [200.181.139.25] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AE8Qx-0003oG-00; Mon, 27 Oct 2003 12:33:27 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 7DE1B1966D; Mon, 27 Oct 2003 14:32:57 +0000 (UTC) Date: Mon, 27 Oct 2003 12:32:56 -0200 From: Arnaldo Carvalho de Melo To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: inappropriate usage of inet{,6}_sk() Message-ID: <20031027143256.GE10490@conectiva.com.br> References: <20031027.232700.97608602.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031027.232700.97608602.yoshfuji@linux-ipv6.org> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1045 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: 469 Lines: 16 Em Mon, Oct 27, 2003 at 11:27:00PM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ escreveu: > Hi, > > I found other inappropriate usages of inet{,6}_sk() for > tcp_tw_bucket: > - inet6_sk(sk)->ipv6only > - inet6_sk(sk)->rcv_saddr > - inet_sk(sk)->rcv_saddr > > Patch is against my previous patch. Great, part of this was in the first patch I send fixing the addrconf stuff, I should have submitted those before, but went to Europe, etc, thanks Yoshifuji-san! - Arnaldo From an3h0ny@yahoo.fr Mon Oct 27 07:06:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 07:07:23 -0800 (PST) Received: from web11106.mail.yahoo.com (web11106.mail.yahoo.com [216.136.131.153]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RF6k25011003 for ; Mon, 27 Oct 2003 07:06:46 -0800 Message-ID: <20031027150646.80244.qmail@web11106.mail.yahoo.com> Received: from [195.68.44.148] by web11106.mail.yahoo.com via HTTP; Mon, 27 Oct 2003 16:06:46 CET Date: Mon, 27 Oct 2003 16:06:46 +0100 (CET) From: =?iso-8859-1?q?an7?= Subject: use of Prequeue To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1046 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: an3h0ny@yahoo.fr Precedence: bulk X-list: netdev Content-Length: 350 Lines: 14 Hi all, the use of prequeue seems particular to linux. Can you tell me what is aimed for, and what is its position relatively to the backlog and the socket receive queue ? Thanks ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From greearb@candelatech.com Mon Oct 27 08:16:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 08:17:16 -0800 (PST) Received: from grok.yi.org (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RGGd25012241 for ; Mon, 27 Oct 2003 08:16:40 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h9RGGEtT018121; Mon, 27 Oct 2003 08:16:14 -0800 Message-ID: <3F9D44CD.2000609@candelatech.com> Date: Mon, 27 Oct 2003 08:16:13 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mehulkumar J Patel CC: netdev@oss.sgi.com, Matthias Fruehauf , olaf@suse.de, Anil K Prasad , Daljeet Maini Subject: Re: Linux kernel updates and ip_crossover patch References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1047 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 353 Lines: 17 Mehulkumar J Patel wrote: > > Hi, > > We at IBM need IP CROSSOVER module as part of kernel source. Please send the ip-crossover patch to netdev. I have written a patch to do the same thing, and am interested to see how this patch differs. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From aprasad@in.ibm.com Mon Oct 27 08:29:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 08:30:23 -0800 (PST) Received: from ausmtp02.au.ibm.com (ausmtp02.au.ibm.com [202.81.18.187]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RGTm25015434 for ; Mon, 27 Oct 2003 08:29:49 -0800 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp02.au.ibm.com (8.12.10/8.12.9) with ESMTP id h9RGSrTv181402; Tue, 28 Oct 2003 03:28:53 +1100 Received: from d23m0060.in.ibm.com (d23av02.au.ibm.com [9.190.250.243]) by sd0208e0.au.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9RGTgFQ047478; Tue, 28 Oct 2003 03:29:43 +1100 In-Reply-To: <3F9D44CD.2000609@candelatech.com> Subject: Re: Linux kernel updates and ip_crossover patch To: Ben Greear Cc: Daljeet Maini , Mehulkumar J Patel , Matthias Fruehauf , netdev@oss.sgi.com, olaf@suse.de X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: Anil K Prasad Date: Mon, 27 Oct 2003 10:34:13 -0600 X-MIMETrack: Serialize by Router on d23m0060/23/M/IBM(Release 6.0.1 [IBM]|May 6, 2003) at 27/10/2003 22:04:32 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 1048 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aprasad@in.ibm.com Precedence: bulk X-list: netdev Content-Length: 12715 Lines: 450 >> >> We at IBM need IP CROSSOVER module as part of kernel source. >Please send the ip-crossover patch to netdev. I have written a patch >to do the same thing, and am interested to see how this patch differs. Here is the patch for IP-Cross over module. Thanks, Anil. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.4.21/Documentation/Configure.help working-2.4.21-crossover/Documentation/Configure.help --- linux-2.4.21/Documentation/Configure.help 2003-06-14 13:59:23.000000000 +1000 +++ working-2.4.21-crossover/Documentation/Configure.help 2003-07-10 18:16:04.000000000 +1000 @@ -2954,6 +2954,18 @@ CONFIG_IP_NF_COMPAT_IPFWADM If you want to compile it as a module, say M here and read . If unsure, say `N'. +IP forced crossover support (EXPERIMENTAL) +CONFIG_IP_NF_CROSSOVER + This option allows you to connect two local network cards + with a crossover cable, and then force packets to pass over + that cable (Linux will normally short-circuit such packets). + + If you want to compile it as a module, say M here and read + : the module will be called + ip_crossover. + + Say `N'. + EUI64 address check (EXPERIMENTAL) CONFIG_IP6_NF_MATCH_EUI64 This module performs checking on the IPv6 source address diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.4.21/net/ipv4/netfilter/Config.in working-2.4.21-crossover/net/ipv4/netfilter/Config.in --- linux-2.4.21/net/ipv4/netfilter/Config.in 2003-06-14 14:00:02.000000000 +1000 +++ working-2.4.21-crossover/net/ipv4/netfilter/Config.in 2003-07-10 18:14:41.000000000 +1000 @@ -129,4 +129,7 @@ if [ "$CONFIG_IP_NF_CONNTRACK" != "y" ]; fi fi fi + +dep_tristate ' IP forced crossover support (EXPERIMENTAL)' CONFIG_IP_NF_CROSSOVER $CONFIG_EXPERIMENTAL + endmenu diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.4.21/net/ipv4/netfilter/Makefile working-2.4.21-crossover/net/ipv4/netfilter/Makefile --- linux-2.4.21/net/ipv4/netfilter/Makefile 2003-06-14 14:00:02.000000000 +1000 +++ working-2.4.21-crossover/net/ipv4/netfilter/Makefile 2003-07-10 18:13:23.000000000 +1000 @@ -110,6 +110,8 @@ obj-$(CONFIG_IP_NF_COMPAT_IPFWADM) += ip obj-$(CONFIG_IP_NF_QUEUE) += ip_queue.o +obj-$(CONFIG_IP_NF_CROSSOVER) += ip_crossover.o + include $(TOPDIR)/Rules.make ip_conntrack.o: $(ip_conntrack-objs) diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.4.21/net/ipv4/netfilter/ip_crossover.c working-2.4.21-crossover/net/ipv4/netfilter/ip_crossover.c --- linux-2.4.21/net/ipv4/netfilter/ip_crossover.c 1970-01-01 10:00:00.000000000 +1000 +++ working-2.4.21-crossover/net/ipv4/netfilter/ip_crossover.c 2003-07-10 18:36:47.000000000 +1000 @@ -0,0 +1,262 @@ +/* Copyright 2003 Rusty Russell, IBM Corporation. + * + * Simple packet mangling. The idea is to use a crossover between two + * local NICs for testing, then this module creates "phantom" boxes on + * each network at the interface address + 1. + * + * Packets sent to one phantom will come in like they came from the other. + * + * Usage: + * ifconfig eth0 192.168.1.1 + * ifconfig eth1 192.168.2.1 + * arp -s 192.168.1.2 + * arp -s 192.168.2.2 + * modprobe ip_crossover dev1=eth0 dev2=eth1 + * + * Then doing ping 192.168.1.2, ICMP ping goes out eth0 and comes + * back in eth1. Reply goes out eth1 and comes back in eth0. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct ifinfo +{ + /* Keep track of name so we can drop reference. */ + char name[IFNAMSIZ]; + + /* Cached interface addr. */ + u32 ifaddr; + + /* "Phantom" box which gets mapped. */ + u32 phantom; +}; + +static struct ifinfo devinfo1, devinfo2; + +/* Stolen from Alexey's ip_nat_dumb. */ +static int nat_header(struct sk_buff *skb, u32 saddr, u32 daddr) +{ + struct iphdr *iph = skb->nh.iph; + + u32 odaddr = iph->daddr; + u32 osaddr = iph->saddr; + u16 check; + + /* Rewrite IP header */ + iph->saddr = saddr; + iph->daddr = daddr; + iph->check = 0; + iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); + + /* If it is the first fragment, rewrite protocol headers */ + if (!(iph->frag_off & htons(IP_OFFSET))) { + u16 *cksum; + + switch(iph->protocol) { + case IPPROTO_TCP: + cksum = (u16*)&((struct tcphdr*) + (((char*)iph)+(iph->ihl<<2)))->check; + if ((u8*)(cksum+1) > skb->tail) + return 0; + check = *cksum; + if (skb->ip_summed != CHECKSUM_HW) + check = ~check; + check = csum_tcpudp_magic(iph->saddr, iph->daddr, + 0, 0, check); + check = csum_tcpudp_magic(~osaddr, ~odaddr, 0, 0, + ~check); + if (skb->ip_summed == CHECKSUM_HW) + check = ~check; + *cksum = check; + break; + case IPPROTO_UDP: + cksum = (u16*)&((struct udphdr*) + (((char*)iph)+(iph->ihl<<2)))->check; + if ((u8*)(cksum+1) > skb->tail) + return 0; + if ((check = *cksum) != 0) { + check = csum_tcpudp_magic(iph->saddr, + iph->daddr, 0, 0, + ~check); + check = csum_tcpudp_magic(~osaddr, ~odaddr, + 0, 0, ~check); + *cksum = check ? : 0xFFFF; + } + break; + case IPPROTO_ICMP: + { + struct icmphdr *icmph + = (struct icmphdr*)((char*)iph+(iph->ihl<<2)); + struct iphdr *ciph; + u32 idaddr, isaddr; + + if ((icmph->type != ICMP_DEST_UNREACH) && + (icmph->type != ICMP_TIME_EXCEEDED) && + (icmph->type != ICMP_PARAMETERPROB)) + break; + + ciph = (struct iphdr *) (icmph + 1); + + if ((u8*)(ciph+1) > skb->tail) + return 0; + + isaddr = ciph->saddr; + idaddr = ciph->daddr; + + /* Change addresses inside ICMP packet. */ + ciph->daddr = iph->saddr; + ciph->saddr = iph->daddr; + cksum = &icmph->checksum; + /* Using tcpudp primitive. Why not? */ + check = csum_tcpudp_magic(ciph->saddr, ciph->daddr, + 0, 0, ~(*cksum)); + *cksum = csum_tcpudp_magic(~isaddr, ~idaddr, 0, 0, + ~check); + break; + } + default: + break; + } + } + return 1; +} + +static unsigned int xover_hook(unsigned int hook, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)) +{ + /* Going out to phantom box 1: change it to coming from + phantom box 2, and vice versa. */ + if ((*pskb)->nh.iph->daddr == devinfo1.phantom) { + /* printk(KERN_DEBUG "dev1: %u.%u.%u.%u->%u.%u.%u.%u" + " becomes %u.%u.%u.%u->%u.%u.%u.%u\n", + NIPQUAD((*pskb)->nh.iph->saddr), + NIPQUAD((*pskb)->nh.iph->daddr), + NIPQUAD(devinfo2.phantom), + NIPQUAD(devinfo2.ifaddr));*/ + if (!nat_header(*pskb, devinfo2.phantom, devinfo2.ifaddr)) + return NF_DROP; + } else if ((*pskb)->nh.iph->daddr == devinfo2.phantom) { + /* printk(KERN_DEBUG "dev1: %u.%u.%u.%u->%u.%u.%u.%u" + " becomes %u.%u.%u.%u->%u.%u.%u.%u\n", + NIPQUAD((*pskb)->nh.iph->saddr), + NIPQUAD((*pskb)->nh.iph->daddr), + NIPQUAD(devinfo1.phantom), + NIPQUAD(devinfo1.ifaddr));*/ + if (!nat_header(*pskb, devinfo1.phantom, devinfo1.ifaddr)) + return NF_DROP; + } + + return NF_ACCEPT; +} + +static int __set_dev(const char *name, struct ifinfo *ifi) +{ + struct net_device *dev; + struct in_device *indev; + + dev = dev_get_by_name(name); + if (!dev) + goto fail; + indev = __in_dev_get(dev); + if (!indev || !indev->ifa_list) + goto put_fail; + + ifi->ifaddr = indev->ifa_list->ifa_address; + ifi->phantom = htonl(ntohl(indev->ifa_list->ifa_address) + 1); + if (ifi->phantom == indev->ifa_list->ifa_broadcast) + goto put_fail; + + strncpy(ifi->name, name, sizeof(ifi->name)-1); + printk(KERN_INFO "ip_crossover: phantom for %s: %u.%u.%u.%u\n", + ifi->name, NIPQUAD(ifi->phantom)); + return 0; + +put_fail: + dev_put(dev); +fail: + printk(KERN_WARNING "ip_crossover: device %s is not usable.\n", name); + return -ENOENT; +} + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,50) +#include +static int set_dev(const char *val, struct kernel_param *kp) +{ + return __set_dev(val, kp->arg); +} +module_param_call(dev1, set_dev, NULL, &devinfo1, 0); +module_param_call(dev2, set_dev, NULL, &devinfo2, 0); + +#define compat_parse_params() +#define NF_HOOK_OWNER .owner = THIS_MODULE, +#else +static char *dev1, *dev2; + +MODULE_PARM(dev1, "s"); +MODULE_PARM(dev2, "s"); + +static void compat_parse_params(void) +{ + if (dev1) + __set_dev(dev1, &devinfo1); + if (dev2) + __set_dev(dev2, &devinfo2); +} + +#define NF_HOOK_OWNER +#endif /* KERNEL_VERSION */ + +static struct nf_hook_ops xover_ops += { .hook = xover_hook, + .pf = PF_INET, + .hooknum = NF_IP_POST_ROUTING, + .priority = NF_IP_PRI_MANGLE, + NF_HOOK_OWNER +}; + +static int __init init(void) +{ + compat_parse_params(); + + if (!devinfo1.name[0] || !devinfo2.name[0]) { + printk(KERN_ERR "ip_crossover: need dev1 and dev2 args\n"); + return -EINVAL; + } + + return nf_register_hook(&xover_ops); +} + +static void __exit fini(void) +{ + struct net_device *dev; + + nf_unregister_hook(&xover_ops); + + /* Release devices. */ + dev = dev_get_by_name(devinfo1.name); + dev_put(dev); + dev_put(dev); + + dev = dev_get_by_name(devinfo2.name); + dev_put(dev); + dev_put(dev); +} + +module_init(init); +module_exit(fini); +MODULE_LICENSE("GPL"); +MODULE_PARM_DESC(dev1, "First device for crossover (required)"); +MODULE_PARM_DESC(dev2, "Second device for crossover (required)"); From simon.roscic@chello.at Mon Oct 27 09:41:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 09:41:43 -0800 (PST) Received: from viefep13-int.chello.at (viefep13-int.chello.at [213.46.255.15]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RHf125017583 for ; Mon, 27 Oct 2003 09:41:06 -0800 Received: from gatekeeper.local.net ([213.47.247.120]) by viefep13-int.chello.at (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with ESMTP id <20031027174054.RQJ4020.viefep13-int.chello.at@gatekeeper.local.net>; Mon, 27 Oct 2003 18:40:54 +0100 Received: from localhost ([127.0.0.1] helo=localhost) by localhost with esmtp (Exim 3.35 #1 (Debian)) id <1AEBMM-0004S6-00@localhost>; Mon, 27 Oct 2003 18:40:54 +0100 From: Simon Roscic To: Andi Kleen , "David S. Miller" Subject: Re: [2.6.0-test8/9] ethertap oops Date: Mon, 27 Oct 2003 18:40:53 +0100 User-Agent: KMail/1.5.4 References: <20031026234828.2cb1f746.davem@redhat.com> <20031027122635.GB16013@wotan.suse.de> In-Reply-To: <20031027122635.GB16013@wotan.suse.de> Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310271840.53980.simon.roscic@chello.at> X-archive-position: 1049 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: simon.roscic@chello.at Precedence: bulk X-list: netdev On Monday, 27. Oct 2003 13:26, Andi Kleen wrote: > On Sun, Oct 26, 2003 at 11:48:28PM -0800, David S. Miller wrote: > > On Sun, 26 Oct 2003 23:45:52 +0100 > > > > Andi Kleen wrote: > > > diff -u linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o > > > linux-2.6.0test7mm1-averell/drivers/net/ethertap.c --- > > > linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o 2003-09-11 > > > 04:12:33.000000000 +0200 +++ > > > linux-2.6.0test7mm1-averell/drivers/net/ethertap.c 2003-10-26 > > > 23:41:17.000000000 +0100 > > > > This part looks good, applied. > > I don't know if it actually fixed the bug, I did not test it > (sorry, should have stated that in the original mail) > But at least it should printk now instead of crashing. > > -Andi Hi Andi, Your patch fixed the bug! Thanks a lot! I applyed the first hunk as David wrote above. bye, simon. From kuznet@ms2.inr.ac.ru Mon Oct 27 11:37:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 11:37:46 -0800 (PST) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RJb525023436 for ; Mon, 27 Oct 2003 11:37:09 -0800 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id WAA07348; Mon, 27 Oct 2003 22:36:21 +0300 From: kuznet@ms2.inr.ac.ru Message-Id: <200310271936.WAA07348@yakov.inr.ac.ru> Subject: Re: Linux 2.6.0-test9 To: torvalds@osdl.org (Linus Torvalds) Date: Mon, 27 Oct 2003 22:36:21 +0300 (MSK) Cc: akpm@osdl.org, Andries.Brouwer@cwi.nl, linux-kernel@vger.kernel.org (Kernel Mailing List), netdev@oss.sgi.com, davem@redhat.com (David S. Miller), kuznet@ms2.inr.ac.ru In-Reply-To: from "Linus Torvalds" at Oct 26, 2003 04:21:59 PM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1050 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Hello! > And Alexey apparently tried to do the "FIXME" part, but without thinking > about the SIGURG part. Actually, it was thought a lot for several linux-2.x. :-) > We _need_ to stop at urgent data and we _should_ return -EINTR, and let > the SIGURG handler do the URG read. Otherwise we'll lose urgent data (or > we'll just read it inline without realizing that it was urgent data). The patch was expected not to break this property. Alas, something is overlooked yet. I still do not understand what exactly is broken, I feel I have to find some rlogin to experiment in vivo. Alexey From kuznet@ms2.inr.ac.ru Mon Oct 27 11:55:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 11:55:33 -0800 (PST) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9RJsx25023894 for ; Mon, 27 Oct 2003 11:55:00 -0800 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id WAA07541; Mon, 27 Oct 2003 22:54:41 +0300 From: kuznet@ms2.inr.ac.ru Message-Id: <200310271954.WAA07541@yakov.inr.ac.ru> Subject: Re: Linux 2.6.0-test9 To: davem@redhat.com (David S. Miller) Date: Mon, 27 Oct 2003 22:54:41 +0300 (MSK) Cc: torvalds@osdl.org (Linus Torvalds), akpm@osdl.org, Andries.Brouwer@cwi.nl, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru In-Reply-To: <20031026224358.233e6d1a.davem@redhat.com> from "David S. Miller" at Oct 26, 2003 10:43:58 PM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1051 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Hello! > But I am starting to see that URG is different. It is not like > other socket errors that halt the socket and make no new data > arrive after it happens. Rather, URG can happen just about anywhere > and more data can continue to flow into the socket buffers. > > In fact, this means that our change can result in an application > can never see the error if data continues to arrive faster than > the application can pull it out, see? > > Alexey, I think we did not understand this case fully when making this > change. No doubts taking into account that the things are so badly broken. :-) But I was aware about this problem and even "proved" to you that the patch will not change anything. :-) Remember this? > I found only one more or less essential difference: when we have one oob > octet in the stream with data following it, read() can return -EINTR/RESTART > due to pending SIGURG and normal data will be read at the second read(), > or, alternatively, it can return data following oob octet immediately. > > In practice there is no real difference: SIGURG is processed before read() > returns in any case and even more, with restartable signals it is just > exactly no difference. Actually, I considered the same thing: >--- 1.49/net/ipv4/tcp.c Mon Oct 20 22:27:42 2003 >+++ edited/net/ipv4/tcp.c Sun Oct 26 17:59:14 2003 >@@ -1536,9 +1536,15 @@ > struct sk_buff *skb; > u32 offset; > >- /* Are we at urgent data? Stop if we have read anything. */ >- if (copied && tp->urg_data && tp->urg_seq == *seq) >- break; >+ /* Are we at urgent data? Stop if we have read anything or have SIGURG pending. */ >+ if (tp->urg_data && tp->urg_seq == *seq) { >+ if (copied) >+ break; >+ if (signal_pending(current)) { >+ copied = timeo ? sock_intr_errno(timeo) : -EAGAIN; >+ break; >+ } >+ } > > /* Next get a buffer. */ > as a reliable workaround for SIGURG situation, but then "figured out" that this is not necessary (which was mistake). Though at the moment I still do not understand what exactly is so wrong with that my argument, the signal should be processed before read() returns, should not it? Maybe, rlogin longjmp()s or something like this... Alexey From tommy.christensen@tpack.net Mon Oct 27 16:42:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 27 Oct 2003 16:43:23 -0800 (PST) Received: from mail.tpack.net ([213.173.228.18]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9S0gn25007157 for ; Mon, 27 Oct 2003 16:42:50 -0800 Received: (qmail 32094 invoked from network); 28 Oct 2003 00:42:43 -0000 Received: from dhcp-219.cph.tpack.net (HELO tpack.net) (192.168.0.219) by 0 with SMTP; 28 Oct 2003 00:42:43 -0000 Message-ID: <3F9DBB7F.7030309@tpack.net> Date: Tue, 28 Oct 2003 01:42:39 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: en-us, en MIME-Version: 1.0 To: kuznet@ms2.inr.ac.ru CC: Linus Torvalds , akpm@osdl.org, Andries.Brouwer@cwi.nl, Kernel Mailing List , netdev@oss.sgi.com, "David S. Miller" Subject: Re: Linux 2.6.0-test9 References: <200310271936.WAA07348@yakov.inr.ac.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1052 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev kuznet@ms2.inr.ac.ru wrote: > Hello! > > >>And Alexey apparently tried to do the "FIXME" part, but without thinking >>about the SIGURG part. > > > Actually, it was thought a lot for several linux-2.x. :-) > > > >>We _need_ to stop at urgent data and we _should_ return -EINTR, and let >>the SIGURG handler do the URG read. Otherwise we'll lose urgent data (or >>we'll just read it inline without realizing that it was urgent data). > > > The patch was expected not to break this property. Alas, something > is overlooked yet. I still do not understand what exactly is broken, > I feel I have to find some rlogin to experiment in vivo. Hi Alexey I think the patch breaks things because it consumes (or rather skips) the urgent data ( in the code after the label found_ok_skb: ). Since this happens before the SIGURG handler is run, it won't find any urgent data. What do you think? The patch by Linus seems to be fine though. -Tommy From davem@pizda.ninka.net Tue Oct 28 01:05:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 01:06:06 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9S95925020350 for ; Tue, 28 Oct 2003 01:05:29 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA31006; Tue, 28 Oct 2003 00:58:42 -0800 Date: Tue, 28 Oct 2003 00:58:42 -0800 From: "David S. Miller" To: netdev@oss.sgi.com Cc: kuznet@ms2.inr.ac.ru, b_wydrowski@yahoo.com.au, casey@carter.net, ccarter@cs.uiuc.edu Subject: Windows XP zero initial timestamps Message-Id: <20031028005842.091c93a9.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1053 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 This is for the people who brought up the zero timestamp issue with Windows XP. It may be allowed by RFC1323, but always using a zero initial timestamp breaks PAWS. PAWS depends upon each end-host using a single host-wide timestamp source for all connections. I can't even imagine what XP is trying to accomplish by using a zero-based timestamp for all connections. But there is no doubt that it breaks PAWS. The best we could ever do is to allow zero initial timestamps but to disable PAWS when using timestamps with such systems. Someone should contact the windows networking coders, I doubt they broke PAWS intentionally. From davem@pizda.ninka.net Tue Oct 28 01:10:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 01:11:25 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9S9Am25020922 for ; Tue, 28 Oct 2003 01:10:49 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA31059; Tue, 28 Oct 2003 01:04:18 -0800 Date: Tue, 28 Oct 2003 01:04:18 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPV6: inappropriate usage of inet{,6}_sk() Message-Id: <20031028010418.6e8960a8.davem@redhat.com> In-Reply-To: <20031027.232700.97608602.yoshfuji@linux-ipv6.org> References: <20031027.232700.97608602.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1054 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 On Mon, 27 Oct 2003 23:27:00 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > Hi, > > I found other inappropriate usages of inet{,6}_sk() for > tcp_tw_bucket: > - inet6_sk(sk)->ipv6only > - inet6_sk(sk)->rcv_saddr > - inet_sk(sk)->rcv_saddr > > Patch is against my previous patch. Thank you for working on a fix for this. Patch need some small fixes before I can apply it. > +static inline const struct in6_addr *__tcp_v6_rcv_saddr(const struct sock *sk) > +{ > + return likely(sk->sk_state != TCP_TIME_WAIT) ? > + &inet6_sk(sk)->rcv_saddr : &tcptw_sk(sk)->tw_v6_rcv_saddr; > +} Cannot reference inet6_sk() or tw->tw_v6_rcv_saddr outside of CONFIG_IPV6 || CONFIG_IPV6_MODULE since these things do not exist when those configs are both disabled. Please verify the build of your new patch with IPV6 fully disabled. Thank you. From davem@redhat.com Tue Oct 28 01:43:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 01:44:01 -0800 (PST) Received: from rth.ninka.net (rth.ninka.net [216.101.162.244]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9S9hQ25021530 for ; Tue, 28 Oct 2003 01:43:26 -0800 Received: from rth.ninka.net (localhost.localdomain [127.0.0.1]) by rth.ninka.net (8.12.8/8.12.8) with SMTP id h9S9gNlx021849; Tue, 28 Oct 2003 01:42:23 -0800 Date: Tue, 28 Oct 2003 01:42:23 -0800 From: "David S. Miller" To: Emmanuel Fleury Cc: netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, hadi@cyberus.ca Subject: Re: Announce: NetKeeper Firewall For Linux Message-Id: <20031028014223.129933be.davem@redhat.com> In-Reply-To: <1067285612.552.9.camel@aphrodite.olympus.net> References: <1067285612.552.9.camel@aphrodite.olympus.net> X-Mailer: Sylpheed version 0.9.7 (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: 1055 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 On Mon, 27 Oct 2003 21:13:32 +0100 Emmanuel Fleury wrote: > For more details check out the netkeeper web-site: > http://www.cs.auc.dk/~fleury/netkeeper/ You may want to have a look at: http://www.cyberus.ca/~hadi/patches/action/README which I believe is the way to implement these kinds of things. From davem@redhat.com Tue Oct 28 01:54:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 01:55:12 -0800 (PST) Received: from rth.ninka.net (rth.ninka.net [216.101.162.244]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9S9sZ25021909 for ; Tue, 28 Oct 2003 01:54:37 -0800 Received: from rth.ninka.net (localhost.localdomain [127.0.0.1]) by rth.ninka.net (8.12.8/8.12.8) with SMTP id h9S9oWlx021873; Tue, 28 Oct 2003 01:50:32 -0800 Date: Tue, 28 Oct 2003 01:50:32 -0800 From: "David S. Miller" To: davidm@hpl.hp.com Cc: davidm@napali.hpl.hp.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.or.sgi.com Subject: Re: status of ipchains in 2.6? Message-Id: <20031028015032.734caf21.davem@redhat.com> In-Reply-To: <200310280127.h9S1RM5d002140@napali.hpl.hp.com> References: <200310280127.h9S1RM5d002140@napali.hpl.hp.com> X-Mailer: Sylpheed version 0.9.7 (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: 1056 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 On Mon, 27 Oct 2003 17:27:22 -0800 David Mosberger wrote: > I recently discovered that ipchains is rather broken. I noticed the > problem on ia64, but suspect that it's likely to affect all 64-bit > platforms (if not 32-bit platforms). A more detailed description of > the problem I'm seeing is here: > > http://tinyurl.com/sm9d > > Unlike ipchains, iptables works perfectly fine, so perhaps we just > need to update Kconfig to discourage ipchains on ia64 (and/or other > 64-bit platforms)? Might want to post this to the netfilter lists or netdev.... Nah, that might actually get the bug fixed. linux-kernel is always the wrong place to report networking problems, most networking developers do not read linux-kernel. They do read netdev@oss.sgi.com so please post things there. From fleury@cs.auc.dk Tue Oct 28 02:09:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 02:10:01 -0800 (PST) Received: from mailhost.cs.auc.dk (root@mailhost.cs.auc.dk [130.225.194.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SA9P25023108 for ; Tue, 28 Oct 2003 02:09:26 -0800 Received: from rade7.s.cs.auc.dk (fleury@rade7.s.cs.auc.dk [192.168.194.153]) by mailhost.cs.auc.dk (8.12.10/8.12.10) with ESMTP id h9SA8GBt022480; Tue, 28 Oct 2003 11:08:16 +0100 (MET) Subject: Re: Announce: NetKeeper Firewall For Linux From: Emmanuel Fleury To: "David S. Miller" Cc: netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, hadi@cyberus.ca, Mikkel Christiansen In-Reply-To: <20031028014223.129933be.davem@redhat.com> References: <1067285612.552.9.camel@aphrodite.olympus.net> <20031028014223.129933be.davem@redhat.com> Content-Type: text/plain Organization: Aalborg University -- Computer Science Dept. Message-Id: <1067335655.10628.7.camel@rade7.s.cs.auc.dk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 28 Oct 2003 11:07:35 +0100 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.14 X-archive-position: 1057 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fleury@cs.auc.dk Precedence: bulk X-list: netdev Hi, On Tue, 2003-10-28 at 10:42, David S. Miller wrote: > On Mon, 27 Oct 2003 21:13:32 +0100 > Emmanuel Fleury wrote: > > > For more details check out the netkeeper web-site: > > http://www.cs.auc.dk/~fleury/netkeeper/ > > You may want to have a look at: > > http://www.cyberus.ca/~hadi/patches/action/README > > which I believe is the way to implement these kinds > of things. Actually, that is exactly the direction which we have been aiming at. Thanks for this valuable input. Regards -- Mikkel & Emmanuel From yoshfuji@linux-ipv6.org Tue Oct 28 03:08:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 03:09:35 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SB8w25028019 for ; Tue, 28 Oct 2003 03:08:59 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9SB8xlg023998; Tue, 28 Oct 2003 20:08:59 +0900 Date: Tue, 28 Oct 2003 20:08:55 +0900 (JST) Message-Id: <20031028.200855.55272006.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPV6: inappropriate usage of inet{,6}_sk() From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031028010418.6e8960a8.davem@redhat.com> References: <20031027.232700.97608602.yoshfuji@linux-ipv6.org> <20031028010418.6e8960a8.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1058 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 <20031028010418.6e8960a8.davem@redhat.com> (at Tue, 28 Oct 2003 01:04:18 -0800), "David S. Miller" says: > Cannot reference inet6_sk() or tw->tw_v6_rcv_saddr outside of > CONFIG_IPV6 || CONFIG_IPV6_MODULE since these things do not exist when > those configs are both disabled. Oh... Here's revised patch. ===== include/net/tcp.h 1.51 vs edited ===== --- 1.51/include/net/tcp.h Thu Jul 10 11:18:02 2003 +++ edited/include/net/tcp.h Tue Oct 28 20:05:11 2003 @@ -219,6 +219,7 @@ #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) struct in6_addr tw_v6_daddr; struct in6_addr tw_v6_rcv_saddr; + int tw_v6_ipv6only; #endif }; @@ -266,6 +267,38 @@ hlist_for_each_entry_safe(tw, node, safe, jail, tw_death_node) #define tcptw_sk(__sk) ((struct tcp_tw_bucket *)(__sk)) + +static inline const u32 tcp_v4_rcv_saddr(const struct sock *sk) +{ + return likely(sk->sk_state != TCP_TIME_WAIT) ? + inet_sk(sk)->rcv_saddr : tcptw_sk(sk)->tw_rcv_saddr; +} + +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +static inline const struct in6_addr *__tcp_v6_rcv_saddr(const struct sock *sk) +{ + return likely(sk->sk_state != TCP_TIME_WAIT) ? + &inet6_sk(sk)->rcv_saddr : &tcptw_sk(sk)->tw_v6_rcv_saddr; +} + +static inline const struct in6_addr *tcp_v6_rcv_saddr(const struct sock *sk) +{ + return sk->sk_family == AF_INET6 ? __tcp_v6_rcv_saddr(sk) : NULL; +} + +#define tcptw_sk_ipv6only(__sk) (tcptw_sk(__sk)->tw_v6_ipv6only) + +static inline int tcp_v6_ipv6only(const struct sock *sk) +{ + return likely(sk->sk_state != TCP_TIME_WAIT) ? + ipv6_only_sock(sk) : tcptw_sk_ipv6only(sk); +} +#else +# define __tcp_v6_rcv_saddr(__sk) NULL +# define tcp_v6_rcv_saddr(__sk) NULL +# define tcptw_sk_ipv6only(__sk) 0 +# define tcp_v6_ipv6only(__sk) 0 +#endif extern kmem_cache_t *tcp_timewait_cachep; ===== net/ipv4/tcp_ipv4.c 1.74 vs edited ===== --- 1.74/net/ipv4/tcp_ipv4.c Mon Oct 27 17:29:00 2003 +++ edited/net/ipv4/tcp_ipv4.c Tue Oct 28 20:05:12 2003 @@ -178,12 +178,6 @@ tcp_sk(sk)->bind_hash = tb; } -static inline const u32 tcp_v4_rcv_saddr(const struct sock *sk) -{ - return likely(sk->sk_state != TCP_TIME_WAIT) ? - inet_sk(sk)->rcv_saddr : tcptw_sk(sk)->tw_rcv_saddr; -} - static inline int tcp_bind_conflict(struct sock *sk, struct tcp_bind_bucket *tb) { const u32 sk_rcv_saddr = tcp_v4_rcv_saddr(sk); ===== net/ipv4/tcp_minisocks.c 1.42 vs edited ===== --- 1.42/net/ipv4/tcp_minisocks.c Mon Sep 29 06:37:15 2003 +++ edited/net/ipv4/tcp_minisocks.c Tue Oct 28 20:05:12 2003 @@ -368,6 +368,11 @@ ipv6_addr_copy(&tw->tw_v6_daddr, &np->daddr); ipv6_addr_copy(&tw->tw_v6_rcv_saddr, &np->rcv_saddr); + tw->tw_v6_ipv6only = np->ipv6only; + } else { + memset(&tw->tw_v6_daddr, 0, sizeof(tw->tw_v6_daddr)); + memset(&tw->tw_v6_rcv_saddr, 0, sizeof(tw->tw_v6_rcv_saddr)); + tw->tw_v6_ipv6only = 0; } #endif /* Linkage updates. */ ===== net/ipv6/addrconf.c 1.73 vs edited ===== --- 1.73/net/ipv6/addrconf.c Mon Oct 27 17:56:14 2003 +++ edited/net/ipv6/addrconf.c Tue Oct 28 20:05:13 2003 @@ -970,36 +970,33 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) { - struct ipv6_pinfo *np = inet6_sk(sk); - int addr_type = ipv6_addr_type(&np->rcv_saddr); + const struct in6_addr *sk_rcv_saddr6 = &inet6_sk(sk)->rcv_saddr; + const struct in6_addr *sk2_rcv_saddr6 = tcp_v6_rcv_saddr(sk2); + u32 sk_rcv_saddr = inet_sk(sk)->rcv_saddr; + u32 sk2_rcv_saddr = tcp_v4_rcv_saddr(sk2); + int sk_ipv6only = ipv6_only_sock(sk); + int sk2_ipv6only = tcp_v6_ipv6only(sk2); + int addr_type = ipv6_addr_type(sk_rcv_saddr6); + int addr_type2 = sk2_rcv_saddr6 ? ipv6_addr_type(sk2_rcv_saddr6) : IPV6_ADDR_MAPPED; - if (!inet_sk(sk2)->rcv_saddr && !ipv6_only_sock(sk)) + if (!sk2_rcv_saddr && !sk_ipv6only) return 1; - if (sk2->sk_family == AF_INET6 && - ipv6_addr_any(&inet6_sk(sk2)->rcv_saddr) && - !(ipv6_only_sock(sk2) && addr_type == IPV6_ADDR_MAPPED)) + if (addr_type2 == IPV6_ADDR_ANY && + !(sk2_ipv6only && addr_type == IPV6_ADDR_MAPPED)) return 1; if (addr_type == IPV6_ADDR_ANY && - (!ipv6_only_sock(sk) || - !(sk2->sk_family == AF_INET6 ? - (ipv6_addr_type(&inet6_sk(sk2)->rcv_saddr) == IPV6_ADDR_MAPPED) : - 1))) + !(sk_ipv6only && addr_type2 == IPV6_ADDR_MAPPED)) return 1; - if (sk2->sk_family == AF_INET6 && - !ipv6_addr_cmp(&np->rcv_saddr, - (sk2->sk_state != TCP_TIME_WAIT ? - &inet6_sk(sk2)->rcv_saddr : - &tcptw_sk(sk2)->tw_v6_rcv_saddr))) + if (sk2_rcv_saddr6 && + !ipv6_addr_cmp(sk_rcv_saddr6, sk2_rcv_saddr6)) return 1; if (addr_type == IPV6_ADDR_MAPPED && - !ipv6_only_sock(sk2) && - (!inet_sk(sk2)->rcv_saddr || - !inet_sk(sk)->rcv_saddr || - inet_sk(sk)->rcv_saddr == inet_sk(sk2)->rcv_saddr)) + !sk2_ipv6only && + (!sk2_rcv_saddr || !sk_rcv_saddr || sk_rcv_saddr == sk2_rcv_saddr)) return 1; return 0; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From davem@pizda.ninka.net Tue Oct 28 03:14:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 03:15:29 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SBEs25028413 for ; Tue, 28 Oct 2003 03:14:56 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA31473; Tue, 28 Oct 2003 03:08:25 -0800 Date: Tue, 28 Oct 2003 03:08:25 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPV6: inappropriate usage of inet{,6}_sk() Message-Id: <20031028030825.70843a6a.davem@redhat.com> In-Reply-To: <20031028.200855.55272006.yoshfuji@linux-ipv6.org> References: <20031027.232700.97608602.yoshfuji@linux-ipv6.org> <20031028010418.6e8960a8.davem@redhat.com> <20031028.200855.55272006.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1059 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 On Tue, 28 Oct 2003 20:08:55 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > In article <20031028010418.6e8960a8.davem@redhat.com> (at Tue, 28 Oct 2003 01:04:18 -0800), "David S. Miller" says: > > > Cannot reference inet6_sk() or tw->tw_v6_rcv_saddr outside of > > CONFIG_IPV6 || CONFIG_IPV6_MODULE since these things do not exist when > > those configs are both disabled. > > Oh... Here's revised patch. Applied, thank you Yoshfuji. From an3h0ny@yahoo.fr Tue Oct 28 04:32:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 04:33:32 -0800 (PST) Received: from web11108.mail.yahoo.com (web11108.mail.yahoo.com [216.136.131.155]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SCWv25003007 for ; Tue, 28 Oct 2003 04:32:57 -0800 Message-ID: <20031028123257.51307.qmail@web11108.mail.yahoo.com> Received: from [195.68.44.148] by web11108.mail.yahoo.com via HTTP; Tue, 28 Oct 2003 13:32:57 CET Date: Tue, 28 Oct 2003 13:32:57 +0100 (CET) From: =?iso-8859-1?q?an7?= Subject: Use of prequeue To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1060 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: an3h0ny@yahoo.fr Precedence: bulk X-list: netdev Hi all, the use of prequeue seems particular to linux. Can you tell me what is aimed for, and what is its position relatively to the backlog and the socket receive queue ? Thanks ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From ebrunet@lps.ens.fr Tue Oct 28 04:45:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 04:46:17 -0800 (PST) Received: from platane.lps.ens.fr (platane.lps.ens.fr [129.199.121.28]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SCjd25003808 for ; Tue, 28 Oct 2003 04:45:42 -0800 Received: from platane.lps.ens.fr (platane.lps.ens.fr [127.0.0.1]) by platane.lps.ens.fr (8.12.8/8.12.8) with ESMTP id h9SCeZbP019727; Tue, 28 Oct 2003 13:40:35 +0100 Received: (from ebrunet@localhost) by platane.lps.ens.fr (8.12.8/8.12.8/Submit) id h9SCeWE8019725; Tue, 28 Oct 2003 13:40:32 +0100 Date: Tue, 28 Oct 2003 13:40:31 +0100 From: =?iso-8859-1?Q?=C9ric?= Brunet To: netfilter@lists.netfilter.org, netdev@oss.sgi.com Cc: davidm@napali.hpl.hp.com Subject: Re: test9, complete lockup, ipchains related Message-ID: <20031028124031.GA19567@lps.ens.fr> References: <20031027205235.GA18206@lps.ens.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20031027205235.GA18206@lps.ens.fr> User-Agent: Mutt/1.4.1i X-MIME-Autoconverted: from 8bit to quoted-printable by platane.lps.ens.fr id h9SCeZbP019727 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h9SCjd25003808 X-archive-position: 1061 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Eric.Brunet@lps.ens.fr Precedence: bulk X-list: netdev Hello all, This is a repost of a message I sent yesterday to linux-kernel. I understand I should have sent it there right away. Please note, that another instance of (probably) the same problem on an ia64 platform has also been reported by David Mosberger on linux-kernel, and he has a better trace than I do. Please see and for his report. Please, Cc me any answer. Thanks, Éric Brunet On Mon, Oct 27, 2003 at 09:52:35PM +0100, Éric Brunet wrote: > I have the following setup on my PIV computer, shuttle motherboard, > 2.6.0-test9 kernel: > > eth1 is a RTL-8029 and connects me to the outside world > eth0 is a RT8139 and is where I plug my laptop. > > Using ipchains, I masqerade the laptop, so that it can also access the > outside world. > > The problem is that my computer locks up when I try to do a big backup > with rsync over ssh from the laptop to a computer in the outside world. > No mouse, no keyboard, nothing in the logs. > > I couldn't reproduce it with some scp from the laptop to a computer over > the outside world. I don't know what is so special with rsync. > > I couldn't reproduce it with a rsync from the laptop to my computer. That > is why I think it is ipchains related. > > Everything is working fine with kernels -test1 and -test4. The lockup is > already present in -test8 and, I think, -test7 (need to check that). > > Once I constated the problem with a complete boot (X11, kde, many > services), I have reproduced them in booting in single user mode, with no > more operations than ifup'ing eth0, eth1, loading ipchains and setting > the one single rule (masqerading) I need. > > ONCE, I got some kernel trace spit out on the console before the computer > locked. Unfortunately, I only got the 24 last lines. I tried to obtain > another trace in a 80x60 vga mode, but failed. Here is the trace, hand > copied: > > ip_rcv_finish +0x1c5/0x22c > ip_rcv_finish +0x0/0x22c > nf_hook_slow +0xd4/0x122 > ip_rcv_finish +0x0/0x22c > ip_rcv +0x3c5/0x480 > ip_rcv_finish +0x0/0x22c > netif_receive_skb +0x12b/0x164 > process_backlog +0x6e/0xfd > net_rx_action +0x6a/0xe4 > do_softirq +0x95/0x97 > do_IRQ +0xca/0xe5 > default_idle +0x0/0x27 > rest_init +0x0/0x27 > common_interrupt +0x18/0x20 > default_idle +0x0/0x27 > rest_init +0x0/0x27 > default_idle +0x24/0x27 > cpu_idle +0x2e/0x37 > start_kernel +0x163/0x191 > unknown_bootoption +0x0/0xff > Code 8b 53 08 0f b7 47 0e 31 f6 66 39 42 1e 74 1f 85 f6 75 07 a1 > Kernel panic: Fatal exception in interrupt > In interrupt handler - not syncing > > .config, dmesg, lspci, etc. available on > http://perso.nerim.net/~tudia/bug-reports > > > Regards, > > Éric Brunet From news@gatekeeper.tmr.com Tue Oct 28 05:40:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 05:41:13 -0800 (PST) Received: from gatekeeper.tmr.com (tmr-02.dsl.thebiz.net [216.238.38.204]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SDeC25006385 for ; Tue, 28 Oct 2003 05:40:34 -0800 Received: (from news@localhost) by gatekeeper.tmr.com (8.9.0/8.9.0) id IAA26484 for netdev@oss.sgi.com; Tue, 28 Oct 2003 08:29:54 -0500 To: netdev@oss.sgi.com Path: gatekeeper.tmr.com!davidsen From: davidsen@tmr.com (bill davidsen) Newsgroups: mail.netdev Subject: Re: patricia tries vs. hash for routing? Date: 28 Oct 2003 13:29:54 GMT Organization: TMR Associates, Schenectady NY Lines: 20 Message-ID: References: <20030919214837.GA3012@sirius.cs.pdx.edu> <20030919233730.75969de6.davem@redhat.com> X-Trace: gatekeeper.tmr.com 1067347794 26483 192.168.12.62 (28 Oct 2003 13:29:54 GMT) X-Complaints-To: abuse@tmr.com Originator: davidsen@gatekeeper.tmr.com X-archive-position: 1062 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davidsen@tmr.com Precedence: bulk X-list: netdev In article <20030919233730.75969de6.davem@redhat.com>, David S. Miller wrote: | On Fri, 19 Sep 2003 14:48:37 -0700 | Kristen Carlson wrote: | | > I was looking through some very old mail list discussions (1996!) on this | > topic, and the feeling then was that the code was optimal for < 60,000 routes. | > Given that much has happened since then, is it still a fair assumption to say | > that the linux routing algorithm is optimized for < 60,000 routes, but a | > more BSD-like algorithm works better for > 60,000 routes? | | That's not true at all, the current code can handle many more than | 60,000 routes. I don't think "optimized for" meant it wouldn't handle more, just that performance would degrade. -- bill davidsen CTO, TMR Associates, Inc Doing interesting things with little computers since 1979. From yoshfuji@linux-ipv6.org Tue Oct 28 06:34:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 06:35:29 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SEYk25007544 for ; Tue, 28 Oct 2003 06:34:49 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9SEYklg024906; Tue, 28 Oct 2003 23:34:47 +0900 Date: Tue, 28 Oct 2003 23:34:43 +0900 (JST) Message-Id: <20031028.233443.26373361.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] IPV4: CONFIG_INET description From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1063 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 Hi, Description of CONFIG_INET seems out-of-date. ===== net/Kconfig 1.26 vs edited ===== --- 1.26/net/Kconfig Sun Oct 5 15:50:47 2003 +++ edited/net/Kconfig Tue Oct 28 23:24:10 2003 @@ -96,14 +96,8 @@ allows you to ping yourself (great fun, that!). For an excellent introduction to Linux networking, please read the - NET-3-HOWTO, available from + Linux Networking HOWTO, available from . - - This option is also necessary if you want to use the full power of - term (term is a program which gives you almost full Internet - connectivity if you have a regular dial up shell account on some - Internet connected Unix computer; for more information, read - ). If you say Y here and also to "/proc file system support" and "Sysctl support" below, you can change various aspects of the -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From davem@pizda.ninka.net Tue Oct 28 06:50:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 06:51:08 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SEoZ25008138 for ; Tue, 28 Oct 2003 06:50:36 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id GAA13438; Tue, 28 Oct 2003 06:44:05 -0800 Date: Tue, 28 Oct 2003 06:44:05 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPV4: CONFIG_INET description Message-Id: <20031028064405.2a3303c8.davem@redhat.com> In-Reply-To: <20031028.233443.26373361.yoshfuji@linux-ipv6.org> References: <20031028.233443.26373361.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1064 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 On Tue, 28 Oct 2003 23:34:43 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > Description of CONFIG_INET seems out-of-date. Applied, thank you. I remember using 'term' a long time ago, it was the first internet conectivity I had from home. :-) From yoshfuji@linux-ipv6.org Tue Oct 28 07:35:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 07:36:09 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SFZY25009967 for ; Tue, 28 Oct 2003 07:35:35 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9SFZalg025196; Wed, 29 Oct 2003 00:35:36 +0900 Date: Wed, 29 Oct 2003 00:35:36 +0900 (JST) Message-Id: <20031029.003536.91692593.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH] IPV6: CONFIG_IPV6 Documentation update From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1065 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. CONFIG_IPV6 Documentation update. Specifically, there are no descriptions on net-tools in Documentation/Changes. Thanks. ===== net/Kconfig 1.26 vs edited ===== --- 1.26/net/Kconfig Sun Oct 5 15:50:47 2003 +++ edited/net/Kconfig Wed Oct 29 00:31:40 2003 @@ -120,8 +120,10 @@ tristate "The IPv6 protocol (EXPERIMENTAL)" depends on INET && EXPERIMENTAL ---help--- - This is experimental support for the next version of the Internet - Protocol: IP version 6 (also called IPng "IP next generation"). + This is experimental support for the IP version 6 (formerly called + IPng "IP next generation"). You will still be able to do + regular IPv4 networking as well. + Features of this new protocol include: expanded address space, authentication and privacy, and seamless interoperability with the current version of IP (IP version 4). For general information about @@ -130,12 +132,10 @@ and the file net/ipv6/README in the kernel source. - If you want to use IPv6, please upgrade to the newest net-tools as - given in . You will still be able to do - regular IPv4 networking as well. - - To compile this protocol support as a module, choose M here: the - module will be called ipv6. + To compile this protocol support as a module, choose M here: the + module will be called ipv6. If you try building this as a module + and you have said Y to "Kernel module loader support" above, + be sure to add 'alias net-pf-10 ipv6' to your /etc/modules.conf file. It is safe to say N here for now. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Tue Oct 28 07:46:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 07:47:32 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SFkw25010399 for ; Tue, 28 Oct 2003 07:46:58 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9SFkxlg025274; Wed, 29 Oct 2003 00:46:59 +0900 Date: Wed, 29 Oct 2003 00:46:59 +0900 (JST) Message-Id: <20031029.004659.91579816.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH] DECNET: Compaq => HP From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1066 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 Hi, More document update: Compaq was bought by HP... ===== net/Kconfig 1.26 vs edited ===== --- 1.26/net/Kconfig Sun Oct 5 15:50:47 2003 +++ edited/net/Kconfig Wed Oct 29 00:39:36 2003 @@ -145,7 +145,7 @@ tristate "DECnet Support" ---help--- The DECnet networking protocol was used in many products made by - Digital (now Compaq). It provides reliable stream and sequenced + Digital (now HP). It provides reliable stream and sequenced packet communications over which run a variety of services similar to those which run over TCP/IP. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From davem@pizda.ninka.net Tue Oct 28 07:47:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 07:48:14 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SFlf25010418 for ; Tue, 28 Oct 2003 07:47:41 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA13669; Tue, 28 Oct 2003 07:41:11 -0800 Date: Tue, 28 Oct 2003 07:41:11 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: CONFIG_IPV6 Documentation update Message-Id: <20031028074111.6423a8a9.davem@redhat.com> In-Reply-To: <20031029.003536.91692593.yoshfuji@linux-ipv6.org> References: <20031029.003536.91692593.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1067 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 On Wed, 29 Oct 2003 00:35:36 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > CONFIG_IPV6 Documentation update. > > Specifically, there are no descriptions on net-tools in > Documentation/Changes. Applied, thank you. From davem@pizda.ninka.net Tue Oct 28 08:04:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 08:04:53 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SG4I25014204 for ; Tue, 28 Oct 2003 08:04:20 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA13730; Tue, 28 Oct 2003 07:57:47 -0800 Date: Tue, 28 Oct 2003 07:57:47 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] DECNET: Compaq => HP Message-Id: <20031028075747.23ea54b8.davem@redhat.com> In-Reply-To: <20031029.004659.91579816.yoshfuji@linux-ipv6.org> References: <20031029.004659.91579816.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1068 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 On Wed, 29 Oct 2003 00:46:59 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > More document update: Compaq was bought by HP... I think it's more appropriate to mention both Compaq and HP, right? From yoshfuji@linux-ipv6.org Tue Oct 28 08:09:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 08:10:09 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SG9W25014621 for ; Tue, 28 Oct 2003 08:09:33 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9SG9Ylg025405; Wed, 29 Oct 2003 01:09:34 +0900 Date: Wed, 29 Oct 2003 01:09:33 +0900 (JST) Message-Id: <20031029.010933.21400721.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: Re: [PATCH] DECNET: Compaq => HP From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031028075747.23ea54b8.davem@redhat.com> References: <20031029.004659.91579816.yoshfuji@linux-ipv6.org> <20031028075747.23ea54b8.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1069 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 <20031028075747.23ea54b8.davem@redhat.com> (at Tue, 28 Oct 2003 07:57:47 -0800), "David S. Miller" says: > On Wed, 29 Oct 2003 00:46:59 +0900 (JST) > YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > > > More document update: Compaq was bought by HP... > > I think it's more appropriate to mention both Compaq and > HP, right? How about this? ===== net/Kconfig 1.26 vs edited ===== --- 1.26/net/Kconfig Sun Oct 5 15:50:47 2003 +++ edited/net/Kconfig Wed Oct 29 01:07:54 2003 @@ -145,9 +145,9 @@ tristate "DECnet Support" ---help--- The DECnet networking protocol was used in many products made by - Digital (now Compaq). It provides reliable stream and sequenced - packet communications over which run a variety of services similar - to those which run over TCP/IP. + Digital (bought by Compaq, and now HP). It provides reliable + stream and sequenced packet communications over which run a + variety of services similar to those which run over TCP/IP. To find some tools to use with the kernel layer support, please look at Patrick Caulfield's web site: -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From Qing.Li@windriver.com Tue Oct 28 08:21:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 08:22:03 -0800 (PST) Received: from mail.wrs.com (unknown-1-11.wrs.com [147.11.1.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SGLT25017768 for ; Tue, 28 Oct 2003 08:21:29 -0800 Received: from heavygear ([147.11.233.8]) by mail.wrs.com (8.9.3/8.9.1) with SMTP id IAA09745 for ; Tue, 28 Oct 2003 08:21:19 -0800 (PST) From: "Qing Li" To: Subject: routing apps Date: Tue, 28 Oct 2003 08:21:27 -0800 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.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-archive-position: 1070 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Qing.Li@windriver.com Precedence: bulk X-list: netdev What is the most widely used GNU routing applications on Linux? Is it zebra ? Thanks, -- Qing From yoshfuji@linux-ipv6.org Tue Oct 28 08:22:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 08:22:38 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SGM125017784 for ; Tue, 28 Oct 2003 08:22:05 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9SGM2lg025509; Wed, 29 Oct 2003 01:22:02 +0900 Date: Wed, 29 Oct 2003 01:22:02 +0900 (JST) Message-Id: <20031029.012202.105420248.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH] remove historic entries in Documentation/Changes From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1071 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 Hi, It seems that these entries are out-of-date; "bk annotate" tells these lines are very old. Please ensure if it is correct. ===== Documentation/Changes 1.44 vs edited ===== --- 1.44/Documentation/Changes Sun Oct 5 15:50:47 2003 +++ edited/Documentation/Changes Wed Oct 29 01:00:17 2003 @@ -59,8 +59,6 @@ o xfsprogs 2.1.0 # xfs_db -V o pcmcia-cs 3.1.21 # cardmgr -V o quota-tools 3.09 # quota -V -o PPP 2.4.0 # pppd --version -o isdn4k-utils 3.1pre1 # isdnctrl 2>&1|grep version o nfs-utils 1.0.5 # showmount --version o procps 3.1.13 # ps --version o oprofile 0.5.3 # oprofiled --version @@ -234,52 +232,6 @@ Networking ========== -General changes ---------------- - -The IP firewalling and NAT code has been replaced again. The new -netfilter software (including ipfwadm and ipchains backwards- -compatible modules) is currently distributed separately. - -If you have advanced network configuration needs, you should probably -consider using the network tools from ip-route2. - -PPP ---- - -The PPP driver has been restructured to support multilink and to -enable it to operate over diverse media layers. If you use PPP, -upgrade pppd to at least 2.4.0. - -If you are not using devfs, you must have the device file /dev/ppp -which can be made by: - -mknod /dev/ppp c 108 0 - -as root. - -If you build ppp support as modules, you will need the following in -your /etc/modules.conf file: - -alias char-major-108 ppp_generic -alias /dev/ppp ppp_generic -alias tty-ldisc-3 ppp_async -alias tty-ldisc-14 ppp_synctty -alias ppp-compress-21 bsd_comp -alias ppp-compress-24 ppp_deflate -alias ppp-compress-26 ppp_deflate - -If you use devfsd and build ppp support as modules, you will need -the following in your /etc/devfsd.conf file: - -LOOKUP PPP MODLOAD - -Isdn4k-utils ------------- - -Due to changes in the length of the phone number field, isdn4k-utils -needs to be recompiled or (preferably) upgraded. - NFS-utils --------- @@ -385,34 +337,12 @@ ---------- o -Networking -********** - -PPP ---- -o - -Isdn4k-utils ------------- -o - -NFS-utils ---------- -o - -Netfilter ---------- -o -o -o - -Ip-route2 ---------- -o - OProfile -------- o + +Networking +********** NFS-Utils --------- -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From davem@pizda.ninka.net Tue Oct 28 08:24:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 08:25:20 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SGOl25018485 for ; Tue, 28 Oct 2003 08:24:47 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA13824; Tue, 28 Oct 2003 08:18:17 -0800 Date: Tue, 28 Oct 2003 08:18:16 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] remove historic entries in Documentation/Changes Message-Id: <20031028081816.10d1ebce.davem@redhat.com> In-Reply-To: <20031029.012202.105420248.yoshfuji@linux-ipv6.org> References: <20031029.012202.105420248.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1072 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 On Wed, 29 Oct 2003 01:22:02 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > It seems that these entries are out-of-date; > "bk annotate" tells these lines are very old. > > Please ensure if it is correct. Well, just removing all references to iproute2 would not be correct, we should mention the current location one can obtain the latest iproute2 sources from. Actually, all of these random changes are beginning to become cleanup in nature and therefore not the kind of changes Linus wants going into the tree right now. Can you make these Kconfig and documentation fixes at some later time? Thank you. From kml@patheticgeek.net Tue Oct 28 08:25:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 08:25:49 -0800 (PST) Received: from patheticgeek.net (adsl-216-101-184-46.dsl.snfc21.pacbell.net [216.101.184.46]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SGP325018494 for ; Tue, 28 Oct 2003 08:25:16 -0800 Received: (qmail 14239 invoked by uid 153); 28 Oct 2003 16:17:59 -0000 Message-ID: <20031028161759.14346.qmail@patheticgeek.net> From: "Kevin Lahey" To: netdev@oss.sgi.com Subject: [PATCH] tcp_ack_update_window window scaling bug Date: Tue, 28 Oct 2003 08:17:59 -0800 X-archive-position: 1073 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kml@patheticgeek.net Precedence: bulk X-list: netdev Using ttcp to test TSO on 2.5.75, I noticed an odd problem with receiver windows larger than 64KB. The initial data packet after the three-way handshake was delayed by around 200 milliseconds. Further investigation revealed that TSO support for the connection was being turned off at the same time by the SWS avoidance code. The same ttcp transfer without the large receiver window showed no delay, and didn't turn off TSO. It appears that tcp_ack_update_window is window scaling the offered TCP receiver window even on the SYN packet. As noted in no less than two other places in the networking code, RFC 1323 insists that initial window advertisements are unscaled. This meant that tp->max_window was too large initially, resulting in an inappropriately large TSO segment size. The initial TSO segment was delayed by the SWS code, causing the 200ms pause. I'm not sure whether this bug could ever be tickled by anything *but* TSO, but I suppose in some contrived situations with non-Linux remote hosts, it could wind up being significant. Here's a patch that solves my performance problem: --- linux-2.5.75/net/ipv4/tcp_input.c.orig Mon Oct 27 19:02:55 2003 +++ linux-2.5.75/net/ipv4/tcp_input.c Mon Oct 27 19:04:34 2003 @@ -1966,7 +1966,8 @@ struct sk_buff *skb, u32 ack, u32 ack_seq) { int flag = 0; - u32 nwin = ntohs(skb->h.th->window) << tp->snd_wscale; + u32 nwin = (skb->h.th->syn ? ntohs(skb->h.th->window) : + ntohs(skb->h.th->window) << tp->snd_wscale); if (tcp_may_update_window(tp, ack, ack_seq, nwin)) { flag |= FLAG_WIN_UPDATE; Thanks, Kevin kml@patheticgeek.net From yoshfuji@linux-ipv6.org Tue Oct 28 08:32:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 08:33:23 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SGWm25019296 for ; Tue, 28 Oct 2003 08:32:51 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9SGWnlg025580; Wed, 29 Oct 2003 01:32:50 +0900 Date: Wed, 29 Oct 2003 01:32:49 +0900 (JST) Message-Id: <20031029.013249.103429560.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] remove historic entries in Documentation/Changes From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031028081816.10d1ebce.davem@redhat.com> References: <20031029.012202.105420248.yoshfuji@linux-ipv6.org> <20031028081816.10d1ebce.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1074 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 <20031028081816.10d1ebce.davem@redhat.com> (at Tue, 28 Oct 2003 08:18:16 -0800), "David S. Miller" says: > Can you make these Kconfig and documentation fixes at some later time? > Thank you. Well, will we have a chance for doing this before 2.6.0? I believe document errors should be corrected before 2.6.0 because it makes people "oops" :-) --yoshfuji From davem@pizda.ninka.net Tue Oct 28 08:38:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 08:38:35 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SGc225019683 for ; Tue, 28 Oct 2003 08:38:02 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA13878; Tue, 28 Oct 2003 08:31:32 -0800 Date: Tue, 28 Oct 2003 08:31:32 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] remove historic entries in Documentation/Changes Message-Id: <20031028083132.6b30dbf8.davem@redhat.com> In-Reply-To: <20031029.013249.103429560.yoshfuji@linux-ipv6.org> References: <20031029.012202.105420248.yoshfuji@linux-ipv6.org> <20031028081816.10d1ebce.davem@redhat.com> <20031029.013249.103429560.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1075 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 On Wed, 29 Oct 2003 01:32:49 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > Well, will we have a chance for doing this before 2.6.0? > I believe document errors should be corrected before 2.6.0 > because it makes people "oops" :-) I also think these kinds of changes should go in, but Linus disagrees and he is the boss :-) Please just collect them and resubmit after 2.6.0-final. Thank you. From davem@pizda.ninka.net Tue Oct 28 08:41:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 08:42:26 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SGfq25020066 for ; Tue, 28 Oct 2003 08:41:53 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA13908; Tue, 28 Oct 2003 08:35:23 -0800 Date: Tue, 28 Oct 2003 08:35:23 -0800 From: "David S. Miller" To: "Kevin Lahey" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] tcp_ack_update_window window scaling bug Message-Id: <20031028083523.383f4b85.davem@redhat.com> In-Reply-To: <20031028161759.14346.qmail@patheticgeek.net> References: <20031028161759.14346.qmail@patheticgeek.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1076 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 On Tue, 28 Oct 2003 08:17:59 -0800 "Kevin Lahey" wrote: > It appears that tcp_ack_update_window is window scaling the offered > TCP receiver window even on the SYN packet. As noted in no less > than two other places in the networking code, RFC 1323 insists that > initial window advertisements are unscaled. Good spotting Kevin, thanks a lot. I changed your patch slightly so that there is only one expansion of ntohs(). Longer term we should make all the include/linux/byteorder/swab.h routines inline functions instead of macros and then mark them with __attribute__((pure)). Thanks again Kevin. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1377 -> 1.1378 # net/ipv4/tcp_input.c 1.46 -> 1.47 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/28 kml@patheticgeek.net 1.1378 # [TCP]: When SYN is set, the window is not scaled. # -------------------------------------------- # diff -Nru a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c --- a/net/ipv4/tcp_input.c Tue Oct 28 08:38:22 2003 +++ b/net/ipv4/tcp_input.c Tue Oct 28 08:38:22 2003 @@ -1967,7 +1967,10 @@ struct sk_buff *skb, u32 ack, u32 ack_seq) { int flag = 0; - u32 nwin = ntohs(skb->h.th->window) << tp->snd_wscale; + u32 nwin = ntohs(skb->h.th->window); + + if (likely(!skb->h.th->syn)) + nwin <<= tp->snd_wscale; if (tcp_may_update_window(tp, ack, ack_seq, nwin)) { flag |= FLAG_WIN_UPDATE; From yoshfuji@linux-ipv6.org Tue Oct 28 08:45:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 08:46:19 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SGjQ25020447 for ; Tue, 28 Oct 2003 08:45:46 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9SGjRlg025672; Wed, 29 Oct 2003 01:45:28 +0900 Date: Wed, 29 Oct 2003 01:45:27 +0900 (JST) Message-Id: <20031029.014527.102655902.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: Re: [PATCH] remove historic entries in Documentation/Changes From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031028083132.6b30dbf8.davem@redhat.com> References: <20031028081816.10d1ebce.davem@redhat.com> <20031029.013249.103429560.yoshfuji@linux-ipv6.org> <20031028083132.6b30dbf8.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1077 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 <20031028083132.6b30dbf8.davem@redhat.com> (at Tue, 28 Oct 2003 08:31:32 -0800), "David S. Miller" says: > and he is the boss :-) :-) > Please just collect them and resubmit after 2.6.0-final. Yup. --yoshfuji From davidm@napali.hpl.hp.com Tue Oct 28 09:57:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 09:57:33 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SHv025021612 for ; Tue, 28 Oct 2003 09:57:01 -0800 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by palrel10.hp.com (Postfix) with ESMTP id A5E501C035AF; Tue, 28 Oct 2003 09:57:00 -0800 (PST) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.12.10/8.12.10/HPL-PA Hub) with ESMTP id h9SHuxUd026308; Tue, 28 Oct 2003 09:56:59 -0800 (PST) Received: from napali.hpl.hp.com (napali [127.0.0.1]) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9SHuxFO009223; Tue, 28 Oct 2003 09:56:59 -0800 Received: (from davidm@localhost) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) id h9SHuwZF009219; Tue, 28 Oct 2003 09:56:58 -0800 From: David Mosberger MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16286.44522.275791.73904@napali.hpl.hp.com> Date: Tue, 28 Oct 2003 09:56:58 -0800 To: "David S. Miller" Cc: davidm@hpl.hp.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.or.sgi.com Subject: Re: status of ipchains in 2.6? In-Reply-To: <20031028015032.734caf21.davem@redhat.com> References: <200310280127.h9S1RM5d002140@napali.hpl.hp.com> <20031028015032.734caf21.davem@redhat.com> X-Mailer: VM 7.07 under Emacs 21.2.1 Reply-To: davidm@hpl.hp.com X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ X-archive-position: 1078 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davidm@napali.hpl.hp.com Precedence: bulk X-list: netdev >>>>> On Tue, 28 Oct 2003 01:50:32 -0800, "David S. Miller" said: DaveM> On Mon, 27 Oct 2003 17:27:22 -0800 David Mosberger DaveM> wrote: >> I recently discovered that ipchains is rather broken. I noticed >> the problem on ia64, but suspect that it's likely to affect all >> 64-bit platforms (if not 32-bit platforms). A more detailed >> description of the problem I'm seeing is here: >> http://tinyurl.com/sm9d >> Unlike ipchains, iptables works perfectly fine, so perhaps we >> just need to update Kconfig to discourage ipchains on ia64 >> (and/or other 64-bit platforms)? DaveM> Might want to post this to the netfilter lists or netdev.... DaveM> Nah, that might actually get the bug fixed. $ fgrep -i ipchain MAINTAINERS $ Might want to consider updating the MAINTAINERS file? --david From davem@pizda.ninka.net Tue Oct 28 10:06:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 10:06:51 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SI6I25022040 for ; Tue, 28 Oct 2003 10:06:18 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA14135; Tue, 28 Oct 2003 09:57:47 -0800 Date: Tue, 28 Oct 2003 09:57:47 -0800 From: "David S. Miller" To: davidm@hpl.hp.com Cc: davidm@napali.hpl.hp.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.or.sgi.com Subject: Re: status of ipchains in 2.6? Message-Id: <20031028095747.2cdb57e7.davem@redhat.com> In-Reply-To: <16286.44522.275791.73904@napali.hpl.hp.com> References: <200310280127.h9S1RM5d002140@napali.hpl.hp.com> <20031028015032.734caf21.davem@redhat.com> <16286.44522.275791.73904@napali.hpl.hp.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1079 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 On Tue, 28 Oct 2003 09:56:58 -0800 David Mosberger wrote: > >>>>> On Tue, 28 Oct 2003 01:50:32 -0800, "David S. Miller" said: > > $ fgrep -i ipchain MAINTAINERS Try netfilter, ipchains is a part of netfilter. From gandalf@wlug.westbo.se Tue Oct 28 10:23:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 10:24:16 -0800 (PST) Received: from null.rsn.bth.se (postfix@null.rsn.bth.se [194.47.142.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SINf25022480 for ; Tue, 28 Oct 2003 10:23:42 -0800 Received: by null.rsn.bth.se (Postfix, from userid 65534) id 085EA2C0007; Tue, 28 Oct 2003 19:23:39 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by null.rsn.bth.se (Postfix) with ESMTP id 9B7F12C000B; Tue, 28 Oct 2003 19:23:38 +0100 (CET) Received: from null.rsn.bth.se ([127.0.0.1]) by localhost (null [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 07087-10; Tue, 28 Oct 2003 19:23:38 +0100 (CET) Received: from tux.rsn.bth.se (tux.rsn.bth.se [194.47.143.135]) by null.rsn.bth.se (Postfix) with ESMTP id 098D32C0007; Tue, 28 Oct 2003 19:23:38 +0100 (CET) Received: by tux.rsn.bth.se (Postfix, from userid 501) id 1C9C73FED; Tue, 28 Oct 2003 19:23:38 +0100 (CET) Subject: Re: status of ipchains in 2.6? From: Martin Josefsson To: davidm@hpl.hp.com Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, davem@redhat.com In-Reply-To: <200310280127.h9S1RM5d002140@napali.hpl.hp.com> References: <200310280127.h9S1RM5d002140@napali.hpl.hp.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-l/3S+QrtpWkiPJDm/Ryr" Message-Id: <1067365417.14002.18.camel@tux.rsn.bth.se> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 28 Oct 2003 19:23:37 +0100 X-Virus-Scanned: by amavisd-new-20030616-p5 X-archive-position: 1080 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@wlug.westbo.se Precedence: bulk X-list: netdev --=-l/3S+QrtpWkiPJDm/Ryr Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2003-10-28 at 02:27, David Mosberger wrote: > I recently discovered that ipchains is rather broken. I noticed the > problem on ia64, but suspect that it's likely to affect all 64-bit > platforms (if not 32-bit platforms). A more detailed description of > the problem I'm seeing is here: >=20 > http://tinyurl.com/sm9d >=20 > Unlike ipchains, iptables works perfectly fine, so perhaps we just > need to update Kconfig to discourage ipchains on ia64 (and/or other > 64-bit platforms)? Please try this patch that just got included in linus tree. ChangeSet 1.1360, 2003/10/27 00:01:25-08:00, rusty@rustcorp.com.au [NETFILTER]: Fix ipchains oops in NAT =09 We updated ip_nat_setup_info to set the initialized flag and call place_in_hashes, but *didn't* change the call in ip_fw_compat_masq.c which also calls place_in_hashes() itself (again!). Result: corrupt list, and next thing which lands in the same hash bucket goes boom. =09 Thanks to Andy Polyakov for chasing this down. # This patch includes the following deltas: # ChangeSet 1.1359 -> 1.1360=20 # net/ipv4/netfilter/ip_fw_compat_masq.c 1.11 -> 1.12 =20 # ip_fw_compat_masq.c | 3 --- 1 files changed, 3 deletions(-) diff -Nru a/net/ipv4/netfilter/ip_fw_compat_masq.c b/net/ipv4/netfilter/ip_= fw_compat_masq.c --- a/net/ipv4/netfilter/ip_fw_compat_masq.c Mon Oct 27 12:07:33 2003 +++ b/net/ipv4/netfilter/ip_fw_compat_masq.c Mon Oct 27 12:07:33 2003 @@ -91,9 +91,6 @@ WRITE_UNLOCK(&ip_nat_lock); return ret; } - - place_in_hashes(ct, info); - info->initialized =3D 1; } else DEBUGP("Masquerading already done on this conn.\n"); WRITE_UNLOCK(&ip_nat_lock); --=20 /Martin --=-l/3S+QrtpWkiPJDm/Ryr Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQA/nrQoWm2vlfa207ERArQ7AKCyccc4ksQ8ZDdHAc0ly9G9LUig/wCeLW4Z +GAedAotQlQ3y4CImhNPiq0= =1EDW -----END PGP SIGNATURE----- --=-l/3S+QrtpWkiPJDm/Ryr-- From kuznet@ms2.inr.ac.ru Tue Oct 28 10:26:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 10:26:40 -0800 (PST) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SIPs25022830 for ; Tue, 28 Oct 2003 10:26:07 -0800 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id VAA23218; Tue, 28 Oct 2003 21:25:15 +0300 From: kuznet@ms2.inr.ac.ru Message-Id: <200310281825.VAA23218@yakov.inr.ac.ru> Subject: Re: Linux 2.6.0-test9 To: tommy.christensen@tpack.net (Tommy Christensen) Date: Tue, 28 Oct 2003 21:25:15 +0300 (MSK) Cc: torvalds@osdl.org (Linus Torvalds), akpm@osdl.org, Andries.Brouwer@cwi.nl, linux-kernel@vger.kernel.org (Kernel Mailing List), netdev@oss.sgi.com, davem@redhat.com (David S. Miller) In-Reply-To: <3F9DBB7F.7030309@tpack.net> from "Tommy Christensen" at Oct 28, 2003 01:42:39 AM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1081 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Hello! > I think the patch breaks things because it consumes (or rather skips) > the urgent data ( in the code after the label found_ok_skb: ). > > Since this happens before the SIGURG handler is run, it won't find > any urgent data. > > What do you think? Yes, you are absolutely right. I missed exactly this thing. > The patch by Linus seems to be fine though. I think the patch suggested by Linus is 100% correct and in fact it is the only solution. Alexey From manfred@colorfullife.com Tue Oct 28 10:27:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 10:28:03 -0800 (PST) Received: from dbl.q-ag.de (dbl.q-ag.de [80.146.160.66]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SIR225022982 for ; Tue, 28 Oct 2003 10:27:08 -0800 Received: from colorfullife.com (dbl [127.0.0.1]) by dbl.q-ag.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9SIQHN9002299; Tue, 28 Oct 2003 19:26:58 +0100 Message-ID: <3F9EB4CE.2080308@colorfullife.com> Date: Tue, 28 Oct 2003 19:26:22 +0100 From: Manfred Spraul User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Liontooth CC: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [2.6.0-test-9] natsemi oops References: <20031028040421.98826.qmail@mail.com> In-Reply-To: <20031028040421.98826.qmail@mail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1082 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 [netdev added to cc list: it looks like a module refcount bug with ipx] David Liontooth wrote: >The natsemi oops is triggered in 2.6.0-test9 too. > >kernel BUG at include/linux/module.h:296 > > That's BUG_ON(module_refcount(module) == 0) in __module_get. I doubt that the natsemi driver has anything to do with the bug, it looks like a bug in the ipx core. >Everything freezes. > >Am I the only one to get this? > >I don't know when it started, but 2.5.69 has no problems. > > My guess: 2.5.69 has no bug check. It will oops with the right timing of rmmod and a packet arrival. >Cheers, >David > > >----- Original Message ----- >From: "David Liontooth" >Date: Mon, 20 Oct 2003 21:05:13 -0500 >To: linux-kernel@vger.kernel.org >Subject: Re: [2.6.0-test-7] natsemi oops > > > >>Correction: I get the oops also when natsemi is compiled as a module. >>It is triggered not when the module is loaded, but when it is used >>the first time. Oops (some fragments below) followed by a total freeze; >>nothing gets logged. >> >>Is this a known problem? >> >>Is there a workaround? >> >>Cheers, >>David >> >> >>----- Original Message ----- >>From: David Liontooth >>Date: Mon, 20 Oct 2003 05:24:52 -0500 >>To: linux-kernel@vger.kernel.org >>Subject: [2.6.0-test-7] natsemi oops >> >> >> >>>The 2.6.0-test-7 boots fine and works great -- until I plug >>>in the ethernet cable. Within a second I get an oops and >>>everything freezes. Booting with "acpi=off" makes no difference. >>>If I boot with the ethernet cable plugged in, I get to the >>>login prompt, and it oopses within a second. If I time it right, >>>I can log into the machine remotely for one second before it >>>oopses (so the natsemi driver is working). Very reproducible! >>>/proc/kmsg is empty. >>> >>>If I compile natsemi as a module, I don't get the oops. >>>However, now the driver is not working -- I can't ping out. >>>Everything works fine in 2.5.69, which I've been running >>>since early July. >>> >>>Here's some of the oops, taken by hand: >>> >>>Process swapper (pid: 0, threadinfo=c042a000 task c03a47a0) >>> >>>Stack >>> >>>Call trace: >>> >>>ipxitf_auto_create >>>ipx_rcv >>>netif_receive_skb >>>process_backlog >>>net_rx_action >>>do_softirq >>>do_IRQ >>>_stext >>>common_interrupt >>>acpi_processor_idle >>>cpu_idle >>>start_kernel >>>unknown_bootoption >>> >>>Kernel panic: Fatal exception in interrupt >>>In interrupt handler -- not syncing >>> >>>Configuration, lspci, and dmesg attached. >>> >>>Cheers, >>>David >>> >>> >>> >>> >>> >><< config-2.6.0-test7-3 >> >><< dmesg-2.6.0-test7-7 >> >><< lspci-2.6.0-test7 >> >> >>-- >>__________________________________________________________ >>Sign-up for your own personalized E-mail at Mail.com >>http://www.mail.com/?sr=signup >> >>CareerBuilder.com has over 400,000 jobs. Be smarter about your job search >>http://corp.mail.com/careers >> >> >> > > > -- Manfred From davidm@napali.hpl.hp.com Tue Oct 28 11:25:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 11:26:07 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SJPC25023972 for ; Tue, 28 Oct 2003 11:25:32 -0800 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by palrel13.hp.com (Postfix) with ESMTP id 3CDCD1C02DFD; Tue, 28 Oct 2003 11:25:12 -0800 (PST) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.12.10/8.12.10/HPL-PA Hub) with ESMTP id h9SJPAUd006493; Tue, 28 Oct 2003 11:25:11 -0800 (PST) Received: from napali.hpl.hp.com (napali [127.0.0.1]) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9SJPAFO009909; Tue, 28 Oct 2003 11:25:10 -0800 Received: (from davidm@localhost) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) id h9SJPAWK009905; Tue, 28 Oct 2003 11:25:10 -0800 From: David Mosberger MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16286.49814.27138.219567@napali.hpl.hp.com> Date: Tue, 28 Oct 2003 11:25:10 -0800 To: "David S. Miller" Cc: davidm@hpl.hp.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org Subject: Re: status of ipchains in 2.6? In-Reply-To: <20031028095747.2cdb57e7.davem@redhat.com> References: <200310280127.h9S1RM5d002140@napali.hpl.hp.com> <20031028015032.734caf21.davem@redhat.com> <16286.44522.275791.73904@napali.hpl.hp.com> <20031028095747.2cdb57e7.davem@redhat.com> X-Mailer: VM 7.07 under Emacs 21.2.1 Reply-To: davidm@hpl.hp.com X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ X-archive-position: 1083 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davidm@napali.hpl.hp.com Precedence: bulk X-list: netdev >>>>> On Tue, 28 Oct 2003 09:57:47 -0800, "David S. Miller" said: David> On Tue, 28 Oct 2003 09:56:58 -0800 David Mosberger David> wrote: >> >>>>> On Tue, 28 Oct 2003 01:50:32 -0800, "David S. Miller" >> said: >> $ fgrep -i ipchain MAINTAINERS David> Try netfilter, ipchains is a part of netfilter. I took ipchains not being mentioned in MAINTAINERS as a sign that nobody wanted to hear bug reports about it, hence my choice of lkml. Perhaps you prefer to flame people rather than making it easier for them to find the right mailing-list? --david From shemminger@osdl.org Tue Oct 28 11:47:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 11:47:36 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SJl325024433 for ; Tue, 28 Oct 2003 11:47:03 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9SJkro22726; Tue, 28 Oct 2003 11:46:53 -0800 Date: Tue, 28 Oct 2003 11:47:07 -0800 From: Stephen Hemminger To: OGAWA Hirofumi Cc: Jeff Garzik , netdev@oss.sgi.com Subject: [PATCH] Updated 8139too with NAPI Message-Id: <20031028114707.1d234da6.shemminger@osdl.org> In-Reply-To: <877k2ysohc.fsf@devron.myhome.or.jp> References: <3F9070B6.9090306@pobox.com> <873cdqbt6z.fsf@devron.myhome.or.jp> <20031020131106.6862e951.shemminger@osdl.org> <877k2ysohc.fsf@devron.myhome.or.jp> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1084 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 Jeff, please review this for *after* 2.6.0 goes final. This version of the 8139too driver uses NAPI for receive and a 64k window. Some changes since the previous version are to handle suspend/resume of polling receive, and to add a version netif_poll_disable that spins for use during the transmit timeout processing. --- 2.6.0-test9/drivers/net/8139too.c 2003-10-27 12:09:03.000000000 -0800 +++ linux-2.5/drivers/net/8139too.c 2003-10-28 10:34:51.000000000 -0800 @@ -92,7 +92,7 @@ */ #define DRV_NAME "8139too" -#define DRV_VERSION "0.9.26" +#define DRV_VERSION "0.9.27" #include @@ -123,12 +123,12 @@ #define USE_IO_OPS 1 #endif -/* use a 16K rx ring buffer instead of the default 32K */ -#ifdef CONFIG_SH_DREAMCAST +/* use a 16K rx ring buffer instead of the default 64K */ +#if defined(CONFIG_SH_DREAMCAST) || defined(CONFIG_EMBEDDED) #define USE_BUF16K 1 #endif -/* define to 1 to enable copious debugging info */ +/* define to 1 to some debug, 2 lots */ #undef RTL8139_DEBUG /* define to 1 to disable lightweight runtime debugging checks */ @@ -145,11 +145,7 @@ #ifdef RTL8139_NDEBUG # define assert(expr) do {} while (0) #else -# define assert(expr) \ - if(!(expr)) { \ - printk( "Assertion failed! %s,%s,%s,line=%d\n", \ - #expr,__FILE__,__FUNCTION__,__LINE__); \ - } +# define assert(expr) BUG_ON((expr) == 0) #endif @@ -159,9 +155,6 @@ static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; -/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ -static int max_interrupt_work = 20; - /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). The RTL chips use a 64 element hash table based on the Ethernet CRC. */ static int multicast_filter_limit = 32; @@ -170,11 +163,15 @@ static int multicast_filter_limit = 32; static int debug = -1; /* Size of the in-memory receive ring. */ +/* 0==8K, 1==16K, 2==32K, 3==64K */ #ifdef USE_BUF16K -#define RX_BUF_LEN_IDX 1 /* 0==8K, 1==16K, 2==32K, 3==64K */ +#define RX_BUF_LEN_IDX 1 +#elif defined(USE_BUF32K) +#define RX_BUF_LEN_IDX 2 #else -#define RX_BUF_LEN_IDX 2 /* 0==8K, 1==16K, 2==32K, 3==64K */ +#define RX_BUF_LEN_IDX 3 #endif + #define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX) #define RX_BUF_PAD 16 #define RX_BUF_WRAP_PAD 2048 /* spare padding to handle lack of packet wrap */ @@ -589,13 +586,11 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fa MODULE_LICENSE("GPL"); MODULE_PARM (multicast_filter_limit, "i"); -MODULE_PARM (max_interrupt_work, "i"); MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM (full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM (debug, "i"); MODULE_PARM_DESC (debug, "8139too bitmapped message enable number"); MODULE_PARM_DESC (multicast_filter_limit, "8139too maximum number of filtered multicast addresses"); -MODULE_PARM_DESC (max_interrupt_work, "8139too maximum events handled per interrupt"); MODULE_PARM_DESC (media, "8139too: Bits 4+9: force full duplex, bit 5: 100Mbps"); MODULE_PARM_DESC (full_duplex, "8139too: Force full duplex for board(s) (1)"); @@ -609,6 +604,7 @@ static void rtl8139_tx_timeout (struct n static void rtl8139_init_ring (struct net_device *dev); static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev); +static int rtl8139_poll(struct net_device *dev, int *budget); static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance, struct pt_regs *regs); static int rtl8139_close (struct net_device *dev); @@ -681,16 +677,25 @@ static const u16 rtl8139_intr_mask = PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK; +static const u16 rtl8139_norx_intr_mask = + PCIErr | PCSTimeout | RxUnderrun | + TxErr | TxOK | RxErr ; + #ifdef USE_BUF16K static const unsigned int rtl8139_rx_config = RxCfgRcv16K | RxNoWrap | (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); -#else +#elif defined(USE_BUF32K) static const unsigned int rtl8139_rx_config = RxCfgRcv32K | RxNoWrap | (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); +#else +static const unsigned int rtl8139_rx_config = + RxCfgRcv64K | RxNoWrap | + (RX_FIFO_THRESH << RxCfgFIFOShift) | + (RX_DMA_BURST << RxCfgDMAShift); #endif static const unsigned int rtl8139_tx_config = @@ -867,9 +872,7 @@ static int __devinit rtl8139_init_board match: DPRINTK ("chipset id (%d) == index %d, '%s'\n", - tmp, - tp->chipset, - rtl_chip_info[tp->chipset].name); + version, i, rtl_chip_info[i].name); if (tp->chipset >= CH_8139B) { u8 new_tmp8 = tmp8 = RTL_R8 (Config1); @@ -963,6 +966,8 @@ static int __devinit rtl8139_init_one (s /* The Rtl8139-specific entries in the device structure. */ dev->open = rtl8139_open; dev->hard_start_xmit = rtl8139_start_xmit; + dev->poll = rtl8139_poll; + dev->weight = 64; dev->stop = rtl8139_close; dev->get_stats = rtl8139_get_stats; dev->set_multicast_list = rtl8139_set_rx_mode; @@ -1630,7 +1635,7 @@ static inline void rtl8139_start_thread( } } -static void rtl8139_tx_clear (struct rtl8139_private *tp) +static inline void rtl8139_tx_clear (struct rtl8139_private *tp) { tp->cur_tx = 0; tp->dirty_tx = 0; @@ -1639,6 +1644,15 @@ static void rtl8139_tx_clear (struct rtl } +/* spin while poll is running + * could use netif_poll_disable but that sleeps. + */ +static inline void __netif_poll_disable(struct net_device *dev) +{ + while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) + cpu_relax(); +} + static void rtl8139_tx_timeout (struct net_device *dev) { struct rtl8139_private *tp = dev->priv; @@ -1663,6 +1677,8 @@ static void rtl8139_tx_timeout (struct n /* Disable interrupts by clearing the interrupt mask. */ RTL_W16 (IntrMask, 0x0000); + __netif_poll_disable(dev); + /* Emit info to figure out what went wrong. */ printk (KERN_DEBUG "%s: Tx queue start entry %ld dirty entry %ld.\n", dev->name, tp->cur_tx, tp->dirty_tx); @@ -1678,7 +1694,10 @@ static void rtl8139_tx_timeout (struct n spin_unlock_irqrestore (&tp->lock, flags); /* ...and finally, reset everything */ - rtl8139_hw_start (dev); + if (netif_running(dev)) + rtl8139_hw_start (dev); + + netif_poll_enable (dev); netif_wake_queue (dev); } @@ -1694,6 +1713,7 @@ static int rtl8139_start_xmit (struct sk /* Calculate the next Tx descriptor entry. */ entry = tp->cur_tx % NUM_TX_DESC; + /* Note: the chip doesn't have auto-pad! */ if (likely(len < TX_BUF_SIZE)) { if (len < ETH_ZLEN) memset(tp->tx_buf[entry], 0, ETH_ZLEN); @@ -1705,7 +1725,6 @@ static int rtl8139_start_xmit (struct sk return 0; } - /* Note: the chip doesn't have auto-pad! */ spin_lock_irq(&tp->lock); RTL_W32_F (TxStatus0 + (entry * sizeof (u32)), tp->tx_flag | max(len, (unsigned int)ETH_ZLEN)); @@ -1719,8 +1738,10 @@ static int rtl8139_start_xmit (struct sk netif_stop_queue (dev); spin_unlock_irq(&tp->lock); +#if RTL8139_DEBUG > 2 DPRINTK ("%s: Queued Tx packet size %u to slot %d.\n", dev->name, len, entry); +#endif return 0; } @@ -1791,8 +1812,7 @@ static void rtl8139_tx_interrupt (struct if (tp->dirty_tx != dirty_tx) { tp->dirty_tx = dirty_tx; mb(); - if (netif_queue_stopped (dev)) - netif_wake_queue (dev); + netif_wake_queue (dev); } } @@ -1879,59 +1899,50 @@ static void rtl8139_rx_err (u32 rx_statu #endif } -static void rtl8139_rx_interrupt (struct net_device *dev, - struct rtl8139_private *tp, void *ioaddr) +static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, + int budget) { - unsigned char *rx_ring; - u16 cur_rx; - - assert (dev != NULL); - assert (tp != NULL); - assert (ioaddr != NULL); - - rx_ring = tp->rx_ring; - cur_rx = tp->cur_rx; + void *ioaddr = tp->mmio_addr; + int received = 0; + const unsigned char *rx_ring = tp->rx_ring; + unsigned int cur_rx = tp->cur_rx; + unsigned int last = tp->cur_rx; +#if RTL8139_DEBUG > 1 DPRINTK ("%s: In rtl8139_rx(), current %4.4x BufAddr %4.4x," " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, RTL_R16 (RxBufAddr), RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); +#endif - while ((RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { - int ring_offset = cur_rx % RX_BUF_LEN; + while (netif_running(dev) && received < budget + && (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { u32 rx_status; unsigned int rx_size; unsigned int pkt_size; struct sk_buff *skb; + u16 status; rmb(); /* read size+status of next frame from DMA ring buffer */ - rx_status = le32_to_cpu (*(u32 *) (rx_ring + ring_offset)); + rx_status = le32_to_cpu (*(u32 *) (rx_ring + cur_rx)); rx_size = rx_status >> 16; pkt_size = rx_size - 4; +#if RTL8139_DEBUG > 2 DPRINTK ("%s: rtl8139_rx() status %4.4x, size %4.4x," " cur %4.4x.\n", dev->name, rx_status, rx_size, cur_rx); -#if RTL8139_DEBUG > 2 - { - int i; - DPRINTK ("%s: Frame contents ", dev->name); - for (i = 0; i < 70; i++) - printk (" %2.2x", - rx_ring[ring_offset + i]); - printk (".\n"); - } #endif /* Packet copy from FIFO still in progress. * Theoretically, this should never happen * since EarlyRx is disabled. */ - if (rx_size == 0xfff0) { + if (unlikely(rx_size == 0xfff0)) { tp->xstats.early_rx++; - break; + goto done; } /* If Rx err or invalid rx_size/rx_status received @@ -1939,55 +1950,69 @@ static void rtl8139_rx_interrupt (struct * Rx process gets reset, so we abort any further * Rx processing. */ - if ((rx_size > (MAX_ETH_FRAME_SIZE+4)) || - (rx_size < 8) || - (!(rx_status & RxStatusOK))) { + if (unlikely((rx_size > (MAX_ETH_FRAME_SIZE+4)) || + (rx_size < 8) || + (!(rx_status & RxStatusOK)))) { rtl8139_rx_err (rx_status, dev, tp, ioaddr); - return; + return -1; } /* Malloc up new buffer, compatible with net-2e. */ /* Omit the four octet CRC from the length. */ - /* TODO: consider allocating skb's outside of - * interrupt context, both to speed interrupt processing, - * and also to reduce the chances of having to - * drop packets here under memory pressure. - */ - skb = dev_alloc_skb (pkt_size + 2); - if (skb) { + if (likely(skb)) { skb->dev = dev; skb_reserve (skb, 2); /* 16 byte align the IP fields. */ - - eth_copy_and_sum (skb, &rx_ring[ring_offset + 4], pkt_size, 0); + memcpy(skb->data, &rx_ring[cur_rx + 4], pkt_size); skb_put (skb, pkt_size); skb->protocol = eth_type_trans (skb, dev); - netif_rx (skb); + dev->last_rx = jiffies; tp->stats.rx_bytes += pkt_size; tp->stats.rx_packets++; + + netif_receive_skb (skb); } else { - printk (KERN_WARNING - "%s: Memory squeeze, dropping packet.\n", - dev->name); + if (net_ratelimit()) + printk (KERN_WARNING + "%s: Memory squeeze, dropping packet.\n", + dev->name); tp->stats.rx_dropped++; } + received++; - cur_rx = (cur_rx + rx_size + 4 + 3) & ~3; - RTL_W16 (RxBufPtr, cur_rx - 16); + cur_rx = ((cur_rx + rx_size + 4 + 3) & ~3) % RX_BUF_LEN; + RTL_W16 (RxBufPtr, (u16) (cur_rx - 16)); - if (RTL_R16 (IntrStatus) & RxAckBits) + if (last > cur_rx) + printk(" crossing %x -> %x\n", last, cur_rx); + last = cur_rx; + + /* Clear out errors and receive interrupts */ + status = RTL_R16 (IntrStatus) & RxAckBits; + if (likely(status != 0)) { + if (unlikely(status & (RxFIFOOver | RxOverflow))) { + tp->stats.rx_errors++; + if (status & RxFIFOOver) + tp->stats.rx_fifo_errors++; + } RTL_W16_F (IntrStatus, RxAckBits); + } } + done: + +#if RTL8139_DEBUG > 1 DPRINTK ("%s: Done rtl8139_rx(), current %4.4x BufAddr %4.4x," " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, RTL_R16 (RxBufAddr), RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); +#endif tp->cur_rx = cur_rx; + return received; } @@ -2013,14 +2038,11 @@ static void rtl8139_weird_interrupt (str status &= ~RxUnderrun; } - /* XXX along with rtl8139_rx_err, are we double-counting errors? */ - if (status & - (RxUnderrun | RxOverflow | RxErr | RxFIFOOver)) + if (status & (RxUnderrun | RxErr)) tp->stats.rx_errors++; - if (status & PCSTimeout) - tp->stats.rx_length_errors++; - if (status & (RxUnderrun | RxFIFOOver)) + tp->stats.rx_length_errors++; /* race with rtl8139_rx_err */ + if (status & RxUnderrun) tp->stats.rx_fifo_errors++; if (status & PCIErr) { u16 pci_cmd_status; @@ -2032,6 +2054,35 @@ static void rtl8139_weird_interrupt (str } } +static int rtl8139_poll(struct net_device *dev, int *budget) +{ + struct rtl8139_private *tp = dev->priv; + void *ioaddr = tp->mmio_addr; + int orig_budget = min(*budget, dev->quota); + int done = 1; + + if (likely(RTL_R16(IntrStatus) & RxAckBits)) { + int work_done; + + work_done = rtl8139_rx(dev, tp, orig_budget); + if (likely(work_done > 0)) { + *budget -= work_done; + dev->quota -= work_done; + done = (work_done < orig_budget); + } + } + + if (done) { + /* + * This order is important + * (see Documentation/networking/NAPI_HOWTO.txt) + */ + netif_rx_complete(dev); + RTL_W16_F(IntrMask, rtl8139_intr_mask); + } + + return !done; +} /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ @@ -2040,68 +2091,53 @@ static irqreturn_t rtl8139_interrupt (in { struct net_device *dev = (struct net_device *) dev_instance; struct rtl8139_private *tp = dev->priv; - int boguscnt = max_interrupt_work; void *ioaddr = tp->mmio_addr; - int ackstat, status; + u16 status, ackstat; int link_changed = 0; /* avoid bogus "uninit" warning */ int handled = 0; spin_lock (&tp->lock); + status = RTL_R16 (IntrStatus); - do { - status = RTL_R16 (IntrStatus); - - /* h/w no longer present (hotplug?) or major error, bail */ - if (status == 0xFFFF) - break; + /* shared irq? */ + if (unlikely((status & rtl8139_intr_mask) == 0)) + goto out; - if ((status & - (PCIErr | PCSTimeout | RxUnderrun | RxOverflow | - RxFIFOOver | TxErr | TxOK | RxErr | RxOK)) == 0) - break; + handled = 1; - handled = 1; + /* h/w no longer present (hotplug?) or major error, bail */ + if (unlikely(status == 0xFFFF)) + goto out; - /* Acknowledge all of the current interrupt sources ASAP, but - an first get an additional status bit from CSCR. */ - if (status & RxUnderrun) - link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; + /* Acknowledge all of the current interrupt sources ASAP, but + an first get an additional status bit from CSCR. */ + if (unlikely(status & RxUnderrun)) + link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; - /* The chip takes special action when we clear RxAckBits, - * so we clear them later in rtl8139_rx_interrupt - */ - ackstat = status & ~(RxAckBits | TxErr); + ackstat = status & ~(RxAckBits | TxErr); + if (ackstat) RTL_W16 (IntrStatus, ackstat); - DPRINTK ("%s: interrupt status=%#4.4x ackstat=%#4.4x new intstat=%#4.4x.\n", - dev->name, status, ackstat, RTL_R16 (IntrStatus)); - - if (netif_running (dev) && (status & RxAckBits)) - rtl8139_rx_interrupt (dev, tp, ioaddr); - - /* Check uncommon events with one test. */ - if (status & (PCIErr | PCSTimeout | RxUnderrun | RxOverflow | - RxFIFOOver | RxErr)) - rtl8139_weird_interrupt (dev, tp, ioaddr, - status, link_changed); - - if (netif_running (dev) && (status & (TxOK | TxErr))) { - rtl8139_tx_interrupt (dev, tp, ioaddr); - if (status & TxErr) - RTL_W16 (IntrStatus, TxErr); + /* Receive packets are processed by poll routine. + If not running start it now. */ + if (status & RxAckBits){ + if (netif_rx_schedule_prep(dev)) { + RTL_W16_F (IntrMask, rtl8139_norx_intr_mask); + __netif_rx_schedule (dev); } - - boguscnt--; - } while (boguscnt > 0); - - if (boguscnt <= 0) { - printk (KERN_WARNING "%s: Too much work at interrupt, " - "IntrStatus=0x%4.4x.\n", dev->name, status); - - /* Clear all interrupt sources. */ - RTL_W16 (IntrStatus, 0xffff); } + /* Check uncommon events with one test. */ + if (unlikely(status & (PCIErr | PCSTimeout | RxUnderrun | RxErr))) + rtl8139_weird_interrupt (dev, tp, ioaddr, + status, link_changed); + + if (netif_running (dev) && (status & (TxOK | TxErr))) { + rtl8139_tx_interrupt (dev, tp, ioaddr); + if (status & TxErr) + RTL_W16 (IntrStatus, TxErr); + } + out: spin_unlock (&tp->lock); DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n", @@ -2445,9 +2481,11 @@ static void rtl8139_set_rx_mode (struct unsigned long flags; struct rtl8139_private *tp = dev->priv; + netif_poll_disable (dev); spin_lock_irqsave (&tp->lock, flags); __set_rx_mode(dev); spin_unlock_irqrestore (&tp->lock, flags); + netif_poll_enable (dev); } #ifdef CONFIG_PM @@ -2463,6 +2501,7 @@ static int rtl8139_suspend (struct pci_d return 0; netif_device_detach (dev); + netif_poll_disable(dev); spin_lock_irqsave (&tp->lock, flags); @@ -2494,6 +2533,7 @@ static int rtl8139_resume (struct pci_de rtl8139_init_ring (dev); rtl8139_hw_start (dev); netif_device_attach (dev); + netif_poll_enable (dev); return 0; } From themel@iwoars.net Tue Oct 28 13:56:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 13:56:35 -0800 (PST) Received: from iwoars.net (iwoars.net [217.160.110.113]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9SLu125030199 for ; Tue, 28 Oct 2003 13:56:02 -0800 Received: (qmail 30455 invoked by uid 1002); 28 Oct 2003 21:56:00 -0000 Date: Tue, 28 Oct 2003 22:56:00 +0100 From: Thomas Themel To: netdev@oss.sgi.com Subject: Source addresses of rerouted packets Message-ID: <20031028215600.GE15501@iwoars.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Jabber-ID: themel0r@jabber.at X-ICQ-UIN: 8774749 X-Postal: Hauptplatz 8/4, 9500 Villach, Austria X-Phone: +43 676 846623 13 X-archive-position: 1085 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: themel@iwoars.net Precedence: bulk X-list: netdev Hi, I've recently tried to do policy routing of locally generated traffic based on a netfilter fwmark. This works, in a way, but doesn't achieve the result I want. I want to route locally originating connections differently based on their fwmark, but the packets always end up with the wrong source address (that of the interface they would go out on if they hadn't been marked). After seeing this both with 2.4.20 and 2.6.0-test9, I've had a quick look at the routing code, and what I believe is happening is - the new socket doesn't yet have a source address - the SYN packet is queued and routed, thus the socket gets a source address - the SYN packet is caught by the netfilter rule and marked - the SYN packet is rerouted, but at that point, it/its socket already has the source address of the original route and doesn't get the address of the different route it is now sent on. Is this behaviour intended? Following the principle of least surprise, I would expect a locally generated packet to get the source address of the last route it traverses. ciao, -- [*Thomas Themel*] 'To a hardcore geek, "Open" and "Source" are like [extended contact] the nipples on the breasts of Jennifer Love Hewitt.' [info provided in] - Mr. Cranky reviewing "Antitrust" [*message header*] From davidm@napali.hpl.hp.com Tue Oct 28 16:16:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 16:16:46 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9T0GD25032762 for ; Tue, 28 Oct 2003 16:16:14 -0800 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by palrel10.hp.com (Postfix) with ESMTP id 894841C0146B; Tue, 28 Oct 2003 16:16:13 -0800 (PST) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.12.10/8.12.10/HPL-PA Hub) with ESMTP id h9T0GCUd011452; Tue, 28 Oct 2003 16:16:12 -0800 (PST) Received: from napali.hpl.hp.com (napali [127.0.0.1]) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9T0GCFO012137; Tue, 28 Oct 2003 16:16:12 -0800 Received: (from davidm@localhost) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) id h9T0G4q9012133; Tue, 28 Oct 2003 16:16:04 -0800 From: David Mosberger MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16287.1732.427119.22477@napali.hpl.hp.com> Date: Tue, 28 Oct 2003 16:16:04 -0800 To: Martin Josefsson Cc: davidm@hpl.hp.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, davem@redhat.com Subject: Re: status of ipchains in 2.6? In-Reply-To: <1067365417.14002.18.camel@tux.rsn.bth.se> References: <200310280127.h9S1RM5d002140@napali.hpl.hp.com> <1067365417.14002.18.camel@tux.rsn.bth.se> X-Mailer: VM 7.07 under Emacs 21.2.1 Reply-To: davidm@hpl.hp.com X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ X-archive-position: 1086 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davidm@napali.hpl.hp.com Precedence: bulk X-list: netdev Yes, Rusty mentioned the same patch yesterday. I tried it now and ipchain masquerading seems to be working fine again. --david >>>>> On Tue, 28 Oct 2003 19:23:37 +0100, Martin Josefsson said: Martin> Please try this patch that just got included in linus tree. Martin> ChangeSet 1.1360, 2003/10/27 00:01:25-08:00, rusty@rustcorp.com.au Martin> [NETFILTER]: Fix ipchains oops in NAT Martin> We updated ip_nat_setup_info to set the initialized flag and call Martin> place_in_hashes, but *didn't* change the call in ip_fw_compat_masq.c Martin> which also calls place_in_hashes() itself (again!). Result: corrupt Martin> list, and next thing which lands in the same hash bucket goes boom. Martin> Thanks to Andy Polyakov for chasing this down. Martin> # This patch includes the following deltas: Martin> # ChangeSet 1.1359 -> 1.1360 Martin> # net/ipv4/netfilter/ip_fw_compat_masq.c 1.11 -> 1.12 Martin> # Martin> ip_fw_compat_masq.c | 3 --- Martin> 1 files changed, 3 deletions(-) Martin> diff -Nru a/net/ipv4/netfilter/ip_fw_compat_masq.c b/net/ipv4/netfilter/ip_fw_compat_masq.c Martin> --- a/net/ipv4/netfilter/ip_fw_compat_masq.c Mon Oct 27 12:07:33 2003 Martin> +++ b/net/ipv4/netfilter/ip_fw_compat_masq.c Mon Oct 27 12:07:33 2003 Martin> @@ -91,9 +91,6 @@ Martin> WRITE_UNLOCK(&ip_nat_lock); Martin> return ret; Martin> } Martin> - Martin> - place_in_hashes(ct, info); Martin> - info->initialized = 1; Martin> } else Martin> DEBUGP("Masquerading already done on this conn.\n"); Martin> WRITE_UNLOCK(&ip_nat_lock); Martin> -- Martin> /Martin From davidm@napali.hpl.hp.com Tue Oct 28 22:58:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 28 Oct 2003 22:58:39 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9T6w225011328 for ; Tue, 28 Oct 2003 22:58:02 -0800 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by palrel11.hp.com (Postfix) with ESMTP id B73391C014F7 for ; Tue, 28 Oct 2003 22:58:01 -0800 (PST) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.12.10/8.12.10/HPL-PA Hub) with ESMTP id h9T6w1Nq025396 for ; Tue, 28 Oct 2003 22:58:01 -0800 (PST) Received: from napali.hpl.hp.com (napali [127.0.0.1]) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9T6w0FO015306 for ; Tue, 28 Oct 2003 22:58:00 -0800 Received: (from davidm@localhost) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) id h9T6w04k015302; Tue, 28 Oct 2003 22:58:00 -0800 Date: Tue, 28 Oct 2003 22:58:00 -0800 From: David Mosberger Message-Id: <200310290658.h9T6w04k015302@napali.hpl.hp.com> To: netdev@oss.sgi.com Subject: SOMAXCONN too low X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ Reply-To: davidm@hpl.hp.com X-archive-position: 1087 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davidm@napali.hpl.hp.com Precedence: bulk X-list: netdev I was a bit surprised to find that listen() is still capping at the hard limit of SOMAXCONN (which is still 128). This is ridiculously low for high-performance servers. Today's severs can do easily in excess of 10,000 TCP connections/second so a queue length of 128 corresponds to just about 10ms, so it doesn't take much of bad scheduling etc. to overflow the queue. You obviously want some control over how big the listen queue can grow, but it seems to me that a sysctl would be in place. I found this patch to do that, but no reaction to it: http://www.ussg.iu.edu/hypermail/linux/kernel/0205.0/1287.html I also found this message: http://marc.theaimsgroup.com/?l=linux-net&m=98745977620384&w=2 but the argument makes little sense, because TUX bypasses sys_listen() alltogether and therefore can set the listen queue length to anything it wants. In fact, tux2 defaults to a listen-queue size of 2048, so if anything it is an argument _for_ increasing the max. listen-queue size. Also, it appears that current SuSE kernels do indeed have a net.core.somaxconn sysctl to let a sysadmin choose a larger SOMAXCONN value. --david From ak@suse.de Wed Oct 29 04:54:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 04:54:58 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TCsD25028804 for ; Wed, 29 Oct 2003 04:54:13 -0800 Received: from Hermes.suse.de (Hermes.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 15F5C1768A2A; Wed, 29 Oct 2003 13:33:17 +0100 (CET) Date: Wed, 29 Oct 2003 13:33:15 +0100 From: Andi Kleen To: davidm@hpl.hp.com Cc: davidm@napali.hpl.hp.com, netdev@oss.sgi.com Subject: Re: SOMAXCONN too low Message-Id: <20031029133315.5638f842.ak@suse.de> In-Reply-To: <200310290658.h9T6w04k015302@napali.hpl.hp.com> References: <200310290658.h9T6w04k015302@napali.hpl.hp.com> X-Mailer: Sylpheed version 0.8.9 (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: 1088 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 Tue, 28 Oct 2003 22:58:00 -0800 David Mosberger wrote: > Also, it appears that current SuSE kernels do indeed have a > net.core.somaxconn sysctl to let a sysadmin choose a larger SOMAXCONN > value. Yes I did that patch some time ago for some server who needed it. If there is interest I can submit it for 2.6. But I'm not sure it fits the "important bug fixes only" rule. Another alternative would be to make it a fraction of the listen() argument per socket (e.g. min(tcp_max_syn_backlog,min(128,10%*listenarg))) to allow the application to easily change it. -Andi From spi@gmxpro.de Wed Oct 29 09:00:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 09:01:09 -0800 (PST) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TH0F25006996 for ; Wed, 29 Oct 2003 09:00:36 -0800 Received: (qmail 13376 invoked by uid 65534); 29 Oct 2003 17:00:06 -0000 Received: from pD9518ED1.dip.t-dialin.net (EHLO d800) (217.81.142.209) by mail.gmx.net (mp023) with SMTP; 29 Oct 2003 18:00:06 +0100 X-Authenticated: #555711 From: "Sebastian Piecha" To: netdev@oss.sgi.com Date: Wed, 29 Oct 2003 18:00:26 +0100 MIME-Version: 1.0 Subject: Re: oops in skbuff.c Message-ID: <3FA0003A.25544.4BACBCA@localhost> Priority: normal X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-archive-position: 1089 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: spi@gmxpro.de Precedence: bulk X-list: netdev Everything works now. skbuff.c seems to be ok. At the end it seems to be an issue between one of my three memory modules and the installed Promise ide controller. Without the Promise controller everythink works and with a changed memory stick also everything works. I did a lot of memtests but no error was shown. I think one of the memory modules has some electrical specialties when used together with the Promise controller. Thanks a lot to everybody who tried to shed some light on this. -- Mit freundlichen Gruessen/Best regards, Sebastian Piecha EMail: spi@gmxpro.de From davidm@napali.hpl.hp.com Wed Oct 29 09:13:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 09:14:31 -0800 (PST) Received: from palrel12.hp.com (palrel12.hp.com [156.153.255.237]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9THDo25007495 for ; Wed, 29 Oct 2003 09:13:50 -0800 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by palrel12.hp.com (Postfix) with ESMTP id 4E5321C03186; Wed, 29 Oct 2003 09:13:50 -0800 (PST) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.12.10/8.12.10/HPL-PA Hub) with ESMTP id h9THDli9001586; Wed, 29 Oct 2003 09:13:48 -0800 (PST) Received: from napali.hpl.hp.com (napali [127.0.0.1]) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9THDiFO019392; Wed, 29 Oct 2003 09:13:44 -0800 Received: (from davidm@localhost) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) id h9THDi73019388; Wed, 29 Oct 2003 09:13:44 -0800 From: David Mosberger MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16287.62792.721035.910762@napali.hpl.hp.com> Date: Wed, 29 Oct 2003 09:13:44 -0800 To: Andi Kleen Cc: davidm@hpl.hp.com, netdev@oss.sgi.com Subject: Re: SOMAXCONN too low In-Reply-To: <20031029133315.5638f842.ak@suse.de> References: <200310290658.h9T6w04k015302@napali.hpl.hp.com> <20031029133315.5638f842.ak@suse.de> X-Mailer: VM 7.07 under Emacs 21.2.1 Reply-To: davidm@hpl.hp.com X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ X-archive-position: 1090 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davidm@napali.hpl.hp.com Precedence: bulk X-list: netdev >>>>> On Wed, 29 Oct 2003 13:33:15 +0100, Andi Kleen said: Andi> On Tue, 28 Oct 2003 22:58:00 -0800 Andi> David Mosberger wrote: >> Also, it appears that current SuSE kernels do indeed have a >> net.core.somaxconn sysctl to let a sysadmin choose a larger SOMAXCONN >> value. Andi> Yes I did that patch some time ago for some server who needed Andi> it. If there is interest I can submit it for 2.6. But I'm not Andi> sure it fits the "important bug fixes only" rule. Yes, I think the patch should be (re-)submitted. It certainly fixes a performance bug. At the moment, in-kernel servers are at an unfair advantage over user-space servers for this reason. In my opinion, SOMAXCONN should also be bumped, but that's less critical if there is a sysctl to override the default value (plus I only have a hand-wavy argument as to what SOMAXCONN should be...). Another argument _for_ including the patch in 2.6.0 is so that we don't have to add a user-visible change in the middle of 2.6 (e.g., simplifies documentation etc). Plus the patch is trivial. Andi> Another alternative would be to make it a fraction of the Andi> listen() argument per socket Andi> (e.g. min(tcp_max_syn_backlog,min(128,10%*listenarg))) to Andi> allow the application to easily change it. I don't understand what purpose this would serve. Seems to me it would make life only more complicated for apps that know what they're doing. --david From davem@pizda.ninka.net Wed Oct 29 09:31:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 09:31:39 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9THV225008020 for ; Wed, 29 Oct 2003 09:31:03 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA30265; Wed, 29 Oct 2003 09:22:20 -0800 Date: Wed, 29 Oct 2003 09:22:20 -0800 From: "David S. Miller" To: davidm@hpl.hp.com Cc: davidm@napali.hpl.hp.com, ak@suse.de, netdev@oss.sgi.com Subject: Re: SOMAXCONN too low Message-Id: <20031029092220.12518b68.davem@redhat.com> In-Reply-To: <16287.62792.721035.910762@napali.hpl.hp.com> References: <200310290658.h9T6w04k015302@napali.hpl.hp.com> <20031029133315.5638f842.ak@suse.de> <16287.62792.721035.910762@napali.hpl.hp.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1091 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 On Wed, 29 Oct 2003 09:13:44 -0800 David Mosberger wrote: > >>>>> On Wed, 29 Oct 2003 13:33:15 +0100, Andi Kleen said: > > Andi> Another alternative would be to make it a fraction of the > Andi> listen() argument per socket > Andi> (e.g. min(tcp_max_syn_backlog,min(128,10%*listenarg))) to > Andi> allow the application to easily change it. > > I don't understand what purpose this would serve. Seems to me it > would make life only more complicated for apps that know what they're > doing. Andi's saying the the max backlog should be a function of the queue length the user asks for when he makes the listen() system call. Also note that we'll need to tweak the TCP listening socket SYNQ hash table size if we modify these kinds of things. > At the moment, in-kernel servers are at an unfair advantage over > user-space servers for this reason. I totally disagree, the only reason things like TuX perform better than their userland counterparts and don't run into SOMAXCONN issues is because it is threaded properly. This is where all of the "jitter" stuff you keep talking about really comes from. When I've asked in the past to see code for userland servers that have a problem wrt. SOMAXCONN, it's always the case that the userland server only lets one of it's threads take new connections via accept(). It's no wonder they have problems.... This is why I'm usually big time against changing this value, if we change it we may be less likely to discover userland server stupidity like that I mentioned above. From davidm@napali.hpl.hp.com Wed Oct 29 10:08:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 10:09:03 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TI8S25009071 for ; Wed, 29 Oct 2003 10:08:29 -0800 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by palrel13.hp.com (Postfix) with ESMTP id 5495F1C030C7; Wed, 29 Oct 2003 10:08:28 -0800 (PST) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.12.10/8.12.10/HPL-PA Hub) with ESMTP id h9TI8Qi9008514; Wed, 29 Oct 2003 10:08:27 -0800 (PST) Received: from napali.hpl.hp.com (napali [127.0.0.1]) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9TI8QFO019741; Wed, 29 Oct 2003 10:08:26 -0800 Received: (from davidm@localhost) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) id h9TI8PCJ019737; Wed, 29 Oct 2003 10:08:25 -0800 From: David Mosberger MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16288.537.258222.601897@napali.hpl.hp.com> Date: Wed, 29 Oct 2003 10:08:25 -0800 To: "David S. Miller" Cc: davidm@hpl.hp.com, ak@suse.de, netdev@oss.sgi.com Subject: Re: SOMAXCONN too low In-Reply-To: <20031029092220.12518b68.davem@redhat.com> References: <200310290658.h9T6w04k015302@napali.hpl.hp.com> <20031029133315.5638f842.ak@suse.de> <16287.62792.721035.910762@napali.hpl.hp.com> <20031029092220.12518b68.davem@redhat.com> X-Mailer: VM 7.07 under Emacs 21.2.1 Reply-To: davidm@hpl.hp.com X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ X-archive-position: 1092 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davidm@napali.hpl.hp.com Precedence: bulk X-list: netdev >>>>> On Wed, 29 Oct 2003 09:22:20 -0800, "David S. Miller" said: DaveM> On Wed, 29 Oct 2003 09:13:44 -0800 David Mosberger DaveM> wrote: >> >>>>> On Wed, 29 Oct 2003 13:33:15 +0100, Andi Kleen >> said: Andi> Another alternative would be to make it a fraction of the Andi> listen() argument per socket Andi> (e.g. min(tcp_max_syn_backlog,min(128,10%*listenarg))) to Andi> allow the application to easily change it. >> I don't understand what purpose this would serve. Seems to me >> it would make life only more complicated for apps that know what >> they're doing. DaveM> Andi's saying the the max backlog should be a function of the DaveM> queue length the user asks for when he makes the listen() DaveM> system call. Sure, but I just don't see the point of doing that. DaveM> Also note that we'll need to tweak the TCP listening socket DaveM> SYNQ hash table size if we modify these kinds of things. Perhaps, but is this really a first-order effect? Since it won't affect user-level, perhaps that could be done a bit later? (In the interest of minimizing 2.6.0 patch, I mean.) >> At the moment, in-kernel servers are at an unfair advantage over >> user-space servers for this reason. DaveM> I totally disagree, the only reason things like TuX perform DaveM> better than their userland counterparts and don't run into DaveM> SOMAXCONN issues is because it is threaded properly. This is DaveM> where all of the "jitter" stuff you keep talking about really DaveM> comes from. We noticed this problem with a server that uses one thread per CPU (pinned). Why don't you run tux with the "backlog" parameter set to 128 and see what happens under heavy load? --david From fubar@us.ibm.com Wed Oct 29 10:39:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 10:40:02 -0800 (PST) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TIdK25010066 for ; Wed, 29 Oct 2003 10:39:28 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e31.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9TIdCjt464522; Wed, 29 Oct 2003 13:39:13 -0500 Received: from death.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9TId8Fa127730; Wed, 29 Oct 2003 11:39:09 -0700 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h9TIct7I013610; Wed, 29 Oct 2003 10:38:56 -0800 Message-Id: <200310291838.h9TIct7I013610@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: "David S. Miller" Cc: Jeff Garzik , netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net Subject: [PATCH] 2.4 bonding backwards compat resend Date: Wed, 29 Oct 2003 10:38:55 -0800 From: Jay Vosburgh X-archive-position: 1093 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev Dave, the appended patch has been waiting for Jeff to apply it for quite a while, but he seems to be really busy lately. Can you apply this? This needs to go in before 2.4.23 is released. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From: Shmulik Hen Subject: [PATCH}[bonding] Restore compatibilty with old ifenslave To: "Jeff Garzik" , "Jay Vosburgh" Cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Date: Mon, 29 Sep 2003 18:20:28 +0300 Hi, The patch below restores compatibility that was removed during the propagation set. That set added the ability to set the bond's hardware address in the conventional way using SIOCSIFHWADDR but also removed support for the very old way using BOND_SETHWADDR, which, although has been removed from the ifenslave code for years, turns out to still be in use in the ifenslave binary of recent distributions. The patch applies on 2.4.23-pre5 and should also cleanly apply on 2.6.0-test6 after fully applying the propagation set (patch 2 wasn't applied yet). Jeff, please apply this patch soon so that 2.4.23 won't be released with a bug that breaks compatibility. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Naurp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Mon Sep 29 15:15:57 2003 +++ b/drivers/net/bonding/bond_main.c Mon Sep 29 18:15:00 2003 @@ -3048,6 +3048,10 @@ static int bond_ioctl(struct net_device case SIOCBONDRELEASE: ret = bond_release(master_dev, slave_dev); break; + case BOND_SETHWADDR_OLD: + case SIOCBONDSETHWADDR: + ret = bond_sethwaddr(master_dev, slave_dev); + break; case BOND_CHANGE_ACTIVE_OLD: case SIOCBONDCHANGEACTIVE: if (USES_PRIMARY(bond_mode)) { From davem@pizda.ninka.net Wed Oct 29 10:43:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 10:43:47 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TIhE25010541 for ; Wed, 29 Oct 2003 10:43:14 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id KAA30567; Wed, 29 Oct 2003 10:36:32 -0800 Date: Wed, 29 Oct 2003 10:36:32 -0800 From: "David S. Miller" To: Jay Vosburgh Cc: jgarzik@pobox.com, netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net Subject: Re: [PATCH] 2.4 bonding backwards compat resend Message-Id: <20031029103632.72f4b904.davem@redhat.com> In-Reply-To: <200310291838.h9TIct7I013610@death.ibm.com> References: <200310291838.h9TIct7I013610@death.ibm.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1094 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 On Wed, 29 Oct 2003 10:38:55 -0800 Jay Vosburgh wrote: > Dave, the appended patch has been waiting for Jeff to apply it > for quite a while, but he seems to be really busy lately. Can you > apply this? This needs to go in before 2.4.23 is released. > No problem, I'll do this for you right now. From fubar@us.ibm.com Wed Oct 29 10:43:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 10:44:13 -0800 (PST) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.105]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TIhe25010548 for ; Wed, 29 Oct 2003 10:43:40 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e5.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9TIhYn9760860; Wed, 29 Oct 2003 13:43:34 -0500 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9TIhUUM061768; Wed, 29 Oct 2003 13:43:31 -0500 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h9TIhLAV013620; Wed, 29 Oct 2003 10:43:22 -0800 Message-Id: <200310291843.h9TIhLAV013620@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: "David S. Miller" Cc: Jeff Garzik , netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net Subject: [PATCH] 2.6 bonding missing patch Date: Wed, 29 Oct 2003 10:43:21 -0800 From: Jay Vosburgh X-archive-position: 1095 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev Dave, this patch has also been waiting for a while. This is part of a multipart patch set that was incorporated into 2.6 in mid September, but this one got lost in the mail. This fixes bugs in the link monitoring functionality within the bonding driver, so it should be acceptable for 2.6. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From: Amir Noam Subject: [PATCH 2/10] [bonding 2.6] fix monitoring functions To: jgarzik@pobox.com, davem@redhat.com Cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Date: Sun, 12 Oct 2003 16:42:26 +0200 Hi, This is a resend of the second patch of the propagations patch set sent on 2003/11/09. The rest of the set is already in 2.6 and this patch was left out only because it failed to reach Jeff the first time. (This patch is also in 2.4 since 2.4.23-pre3). Patch cleanly applies on 2.6.0-test7. Amir diff -Naurp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Sun Oct 12 15:19:27 2003 +++ b/drivers/net/bonding/bond_main.c Sun Oct 12 15:24:07 2003 @@ -2238,8 +2238,9 @@ out: static void bond_mii_monitor(struct net_device *master) { bonding_t *bond = (struct bonding *) master->priv; - slave_t *slave, *bestslave, *oldcurrent; + slave_t *slave, *oldcurrent; int slave_died = 0; + int do_failover = 0; read_lock(&bond->lock); @@ -2249,7 +2250,6 @@ static void bond_mii_monitor(struct net_ * program could monitor the link itself if needed. */ - bestslave = NULL; slave = (slave_t *)bond; read_lock(&bond->ptrlock); @@ -2257,8 +2257,6 @@ static void bond_mii_monitor(struct net_ read_unlock(&bond->ptrlock); while ((slave = slave->prev) != (slave_t *)bond) { - /* use updelay+1 to match an UP slave even when updelay is 0 */ - int mindelay = updelay + 1; struct net_device *dev = slave->dev; int link_state; u16 old_speed = slave->speed; @@ -2269,14 +2267,7 @@ static void bond_mii_monitor(struct net_ switch (slave->link) { case BOND_LINK_UP: /* the link was up */ if (link_state == BMSR_LSTATUS) { - /* link stays up, tell that this one - is immediately available */ - if (IS_UP(dev) && (mindelay > -2)) { - /* -2 is the best case : - this slave was already up */ - mindelay = -2; - bestslave = slave; - } + /* link stays up, nothing more to do */ break; } else { /* link going down */ @@ -2316,6 +2307,7 @@ static void bond_mii_monitor(struct net_ (bond_mode == BOND_MODE_8023AD)) { bond_set_slave_inactive_flags(slave); } + printk(KERN_INFO "%s: link status definitely down " "for interface %s, disabling it", @@ -2332,12 +2324,10 @@ static void bond_mii_monitor(struct net_ bond_alb_handle_link_change(bond, slave, BOND_LINK_DOWN); } - write_lock(&bond->ptrlock); - if (slave == bond->current_slave) { - /* find a new interface and be verbose */ - reselect_active_interface(bond); + if (slave == oldcurrent) { + do_failover = 1; } - write_unlock(&bond->ptrlock); + slave_died = 1; } else { slave->delay--; @@ -2352,13 +2342,6 @@ static void bond_mii_monitor(struct net_ master->name, (downdelay - slave->delay) * miimon, dev->name); - - if (IS_UP(dev) && (mindelay > -1)) { - /* -1 is a good case : this slave went - down only for a short time */ - mindelay = -1; - bestslave = slave; - } } break; case BOND_LINK_DOWN: /* the link was down */ @@ -2428,26 +2411,12 @@ static void bond_mii_monitor(struct net_ bond_alb_handle_link_change(bond, slave, BOND_LINK_UP); } - write_lock(&bond->ptrlock); - if ( (bond->primary_slave != NULL) - && (slave == bond->primary_slave) ) - reselect_active_interface(bond); - write_unlock(&bond->ptrlock); - } - else + if ((oldcurrent == NULL) || + (slave == bond->primary_slave)) { + do_failover = 1; + } + } else { slave->delay--; - - /* we'll also look for the mostly eligible slave */ - if (bond->primary_slave == NULL) { - if (IS_UP(dev) && (slave->delay < mindelay)) { - mindelay = slave->delay; - bestslave = slave; - } - } else if ( (IS_UP(bond->primary_slave->dev)) || - ( (!IS_UP(bond->primary_slave->dev)) && - (IS_UP(dev) && (slave->delay < mindelay)) ) ) { - mindelay = slave->delay; - bestslave = slave; } } break; @@ -2466,26 +2435,17 @@ static void bond_mii_monitor(struct net_ } /* end of while */ - /* - * if there's no active interface and we discovered that one - * of the slaves could be activated earlier, so we do it. - */ - read_lock(&bond->ptrlock); - oldcurrent = bond->current_slave; - read_unlock(&bond->ptrlock); + if (do_failover) { + write_lock(&bond->ptrlock); - /* no active interface at the moment or need to bring up the primary */ - if (oldcurrent == NULL) { /* no active interface at the moment */ - if (bestslave != NULL) { /* last chance to find one ? */ - write_lock(&bond->ptrlock); - change_active_interface(bond, bestslave); - write_unlock(&bond->ptrlock); - } else if (slave_died) { - /* print this message only once a slave has just died */ + reselect_active_interface(bond); + if (oldcurrent && !bond->current_slave) { printk(KERN_INFO "%s: now running without any active interface !\n", master->name); } + + write_unlock(&bond->ptrlock); } read_unlock(&bond->lock); @@ -2503,9 +2463,10 @@ static void bond_mii_monitor(struct net_ static void loadbalance_arp_monitor(struct net_device *master) { bonding_t *bond; - slave_t *slave; + slave_t *slave, *oldcurrent; int the_delta_in_ticks = arp_interval * HZ / 1000; int next_timer = jiffies + (arp_interval * HZ / 1000); + int do_failover = 0; bond = (struct bonding *) master->priv; if (master->priv == NULL) { @@ -2529,6 +2490,10 @@ static void loadbalance_arp_monitor(stru read_lock(&bond->lock); + read_lock(&bond->ptrlock); + oldcurrent = bond->current_slave; + read_unlock(&bond->ptrlock); + /* see if any of the previous devices are up now (i.e. they have * xmt and rcv traffic). the current_slave does not come into * the picture unless it is null. also, slave->jiffies is not needed @@ -2555,21 +2520,19 @@ static void loadbalance_arp_monitor(stru * current_slave being null after enslaving * is closed. */ - write_lock(&bond->ptrlock); - if (bond->current_slave == NULL) { + if (oldcurrent == NULL) { printk(KERN_INFO "%s: link status definitely up " "for interface %s, ", master->name, slave->dev->name); - reselect_active_interface(bond); + do_failover = 1; } else { printk(KERN_INFO "%s: interface %s is now up\n", master->name, slave->dev->name); } - write_unlock(&bond->ptrlock); } } else { /* slave->link == BOND_LINK_UP */ @@ -2592,11 +2555,9 @@ static void loadbalance_arp_monitor(stru master->name, slave->dev->name); - write_lock(&bond->ptrlock); - if (slave == bond->current_slave) { - reselect_active_interface(bond); + if (slave == oldcurrent) { + do_failover = 1; } - write_unlock(&bond->ptrlock); } } @@ -2610,6 +2571,19 @@ static void loadbalance_arp_monitor(stru if (IS_UP(slave->dev)) { arp_send_all(slave); } + } + + if (do_failover) { + write_lock(&bond->ptrlock); + + reselect_active_interface(bond); + if (oldcurrent && !bond->current_slave) { + printk(KERN_INFO + "%s: now running without any active interface !\n", + master->name); + } + + write_unlock(&bond->ptrlock); } read_unlock(&bond->lock); From davem@pizda.ninka.net Wed Oct 29 10:52:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 10:53:08 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TIqX25011301 for ; Wed, 29 Oct 2003 10:52:35 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id KAA30620; Wed, 29 Oct 2003 10:43:50 -0800 Date: Wed, 29 Oct 2003 10:43:50 -0800 From: "David S. Miller" To: davidm@hpl.hp.com Cc: davidm@napali.hpl.hp.com, ak@suse.de, netdev@oss.sgi.com Subject: Re: SOMAXCONN too low Message-Id: <20031029104350.1db8c94d.davem@redhat.com> In-Reply-To: <16288.537.258222.601897@napali.hpl.hp.com> References: <200310290658.h9T6w04k015302@napali.hpl.hp.com> <20031029133315.5638f842.ak@suse.de> <16287.62792.721035.910762@napali.hpl.hp.com> <20031029092220.12518b68.davem@redhat.com> <16288.537.258222.601897@napali.hpl.hp.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1096 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 On Wed, 29 Oct 2003 10:08:25 -0800 David Mosberger wrote: > We noticed this problem with a server that uses one thread per CPU > (pinned). Why don't you run tux with the "backlog" parameter set to > 128 and see what happens under heavy load? Then TuX could be improved too, what can I say? If the thread taking in new connections does anything more involved than: while (1) { fd = accept(listen_fd); thr = pick_service_thread(); spin_lock(new_conn_queue[thr]); append(fd, new_conn_queue[thr]); spin_unlock(new_conn_queue[thr]); wake(thr); } it's broken. I severly doubt that anyone can show that, when using the above scheme, their multi-GHZ cpu cannot handle whatever connection load you put on the system. The fact that people have written web servers that outperform TuX and handle the load better is something else to think about. They existing within the SOMAXCONN limits. From davem@pizda.ninka.net Wed Oct 29 11:06:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 11:07:28 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TJ6r25011775 for ; Wed, 29 Oct 2003 11:06:53 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id KAA30671; Wed, 29 Oct 2003 10:58:09 -0800 Date: Wed, 29 Oct 2003 10:58:09 -0800 From: "David S. Miller" To: davidm@hpl.hp.com Cc: davidm@napali.hpl.hp.com, netdev@oss.sgi.com Subject: Re: SOMAXCONN too low Message-Id: <20031029105809.0a1f27a1.davem@redhat.com> In-Reply-To: <200310290658.h9T6w04k015302@napali.hpl.hp.com> References: <200310290658.h9T6w04k015302@napali.hpl.hp.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1097 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 On Tue, 28 Oct 2003 22:58:00 -0800 David Mosberger wrote: > You obviously want some control over how big the listen queue can > grow, but it seems to me that a sysctl would be in place. I found > this patch to do that, but no reaction to it: > > http://www.ussg.iu.edu/hypermail/linux/kernel/0205.0/1287.html I think I'm going to apply this patch. People can then set the limit to what they want, the default stays at 128, and the SOMAXCONN define itself does not change. Ok David? From davidm@napali.hpl.hp.com Wed Oct 29 11:15:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 11:16:24 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TJFp25012561 for ; Wed, 29 Oct 2003 11:15:51 -0800 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by palrel13.hp.com (Postfix) with ESMTP id 0098A1C03269; Wed, 29 Oct 2003 11:15:51 -0800 (PST) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.12.10/8.12.10/HPL-PA Hub) with ESMTP id h9TJFni9016809; Wed, 29 Oct 2003 11:15:49 -0800 (PST) Received: from napali.hpl.hp.com (napali [127.0.0.1]) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9TJFnFO020230; Wed, 29 Oct 2003 11:15:49 -0800 Received: (from davidm@localhost) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-6.6) id h9TJFntv020226; Wed, 29 Oct 2003 11:15:49 -0800 From: David Mosberger MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16288.4581.143121.899848@napali.hpl.hp.com> Date: Wed, 29 Oct 2003 11:15:49 -0800 To: "David S. Miller" Cc: davidm@hpl.hp.com, netdev@oss.sgi.com Subject: Re: SOMAXCONN too low In-Reply-To: <20031029105809.0a1f27a1.davem@redhat.com> References: <200310290658.h9T6w04k015302@napali.hpl.hp.com> <20031029105809.0a1f27a1.davem@redhat.com> X-Mailer: VM 7.07 under Emacs 21.2.1 Reply-To: davidm@hpl.hp.com X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ X-archive-position: 1098 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davidm@napali.hpl.hp.com Precedence: bulk X-list: netdev >>>>> On Wed, 29 Oct 2003 10:58:09 -0800, "David S. Miller" said: DaveM> On Tue, 28 Oct 2003 22:58:00 -0800 David Mosberger DaveM> wrote: >> You obviously want some control over how big the listen queue can >> grow, but it seems to me that a sysctl would be in place. I >> found this patch to do that, but no reaction to it: >> http://www.ussg.iu.edu/hypermail/linux/kernel/0205.0/1287.html DaveM> I think I'm going to apply this patch. DaveM> People can then set the limit to what they want, the default DaveM> stays at 128, and the SOMAXCONN define itself does not DaveM> change. DaveM> Ok David? Yup. Thanks! --david From jgarzik@pobox.com Wed Oct 29 11:34:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 11:34:51 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TJYG25013803 for ; Wed, 29 Oct 2003 11:34:17 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:38221 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AEw57-00044l-3X; Wed, 29 Oct 2003 19:34:13 +0000 Message-ID: <3FA01629.2080202@pobox.com> Date: Wed, 29 Oct 2003 14:34:01 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: OGAWA Hirofumi , netdev@oss.sgi.com Subject: Re: [PATCH] Updated 8139too with NAPI References: <3F9070B6.9090306@pobox.com> <873cdqbt6z.fsf@devron.myhome.or.jp> <20031020131106.6862e951.shemminger@osdl.org> <877k2ysohc.fsf@devron.myhome.or.jp> <20031028114707.1d234da6.shemminger@osdl.org> In-Reply-To: <20031028114707.1d234da6.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1099 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 I'd like to apply this to net-drivers-2.[45]-exp, but it doesn't apply cleanly. Can you wait a bit, for my posting of those queues, and then resend? From jgarzik@pobox.com Wed Oct 29 11:45:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 11:46:13 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TJjb25014252 for ; Wed, 29 Oct 2003 11:45:38 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:38226 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AEwG8-0004C5-CW; Wed, 29 Oct 2003 19:45:36 +0000 Message-ID: <3FA018D4.30006@pobox.com> Date: Wed, 29 Oct 2003 14:45:24 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Richard Procter CC: Andrew Morton , felipewd@terra.com.br, netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: [PATCH] SMP support on 3c527 net driver for 2.6 References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1100 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 applied both patches to my net-drivers-2.5-exp queue. From davem@pizda.ninka.net Wed Oct 29 11:52:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 11:52:40 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TJq325014622 for ; Wed, 29 Oct 2003 11:52:04 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA31004; Wed, 29 Oct 2003 11:45:20 -0800 Date: Wed, 29 Oct 2003 11:45:20 -0800 From: "David S. Miller" To: Andi Kleen Cc: davidm@hpl.hp.com, davidm@napali.hpl.hp.com, netdev@oss.sgi.com Subject: Re: SOMAXCONN too low Message-Id: <20031029114520.644dc146.davem@redhat.com> In-Reply-To: <20031029204707.67f9a2e1.ak@suse.de> References: <200310290658.h9T6w04k015302@napali.hpl.hp.com> <20031029105809.0a1f27a1.davem@redhat.com> <20031029204707.67f9a2e1.ak@suse.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1101 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 On Wed, 29 Oct 2003 20:47:07 +0100 Andi Kleen wrote: > Can I respectfully ask to name the sysctl net/core/somaxconn ? Sure, no problem. From jgarzik@pobox.com Wed Oct 29 11:54:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 11:55:05 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TJsV25014990 for ; Wed, 29 Oct 2003 11:54:32 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:38236 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AEwOk-0004Jp-NK; Wed, 29 Oct 2003 19:54:30 +0000 Message-ID: <3FA01AEB.4030308@pobox.com> Date: Wed, 29 Oct 2003 14:54:19 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] (2/6) smctr -- probe2 References: <200310152048.h9FKm0911880@mail.osdl.org> In-Reply-To: <200310152048.h9FKm0911880@mail.osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1102 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 applied 1-4 of this series to net-drivers-2.5-exp From jgarzik@pobox.com Wed Oct 29 11:54:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 11:55:16 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TJsg25015000 for ; Wed, 29 Oct 2003 11:54:42 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:38237 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AEwOv-0004Ju-9B; Wed, 29 Oct 2003 19:54:41 +0000 Message-ID: <3FA01AF5.1090609@pobox.com> Date: Wed, 29 Oct 2003 14:54:29 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] trivial -- skfp_probe should be static References: <20031015122348.6453c0f0.shemminger@osdl.org> In-Reply-To: <20031015122348.6453c0f0.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1103 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 applied to net-drivers-2.5-exp From akpm@osdl.org Wed Oct 29 11:59:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 12:00:24 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TJxo25015705 for ; Wed, 29 Oct 2003 11:59:51 -0800 Received: from akpm.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9TJxSC28321; Wed, 29 Oct 2003 11:59:29 -0800 Date: Wed, 29 Oct 2003 11:59:51 -0800 From: Andrew Morton To: Jeff Garzik Cc: rnp@paradise.net.nz, felipewd@terra.com.br, netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: [PATCH] SMP support on 3c527 net driver for 2.6 Message-Id: <20031029115951.7d7e6c12.akpm@osdl.org> In-Reply-To: <3FA018D4.30006@pobox.com> References: <3FA018D4.30006@pobox.com> X-Mailer: Sylpheed version 0.9.6 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Wed__29_Oct_2003_11_59_51_-0800_=QFIBBK4SI818vCp" X-archive-position: 1104 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --Multipart=_Wed__29_Oct_2003_11_59_51_-0800_=QFIBBK4SI818vCp Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Jeff Garzik wrote: > > applied both patches to my net-drivers-2.5-exp queue. > Which patches? I have three. Attached. --Multipart=_Wed__29_Oct_2003_11_59_51_-0800_=QFIBBK4SI818vCp Content-Type: application/octet-stream; name="3c527-smp-update.patch" Content-Disposition: attachment; filename="3c527-smp-update.patch" Content-Transfer-Encoding: base64 CkZyb206IFJpY2hhcmQgUHJvY3RlciA8cm5wQHBhcmFkaXNlLm5ldC5uej4KClRoaXMgcGF0Y2gg dXBkYXRlcyB0aGUgM2M1MjcgbmV0IGRyaXZlciBmb3IgMi42LiAKCkl0IGlzIHRlc3RlZCwgYnV0 IG9ubHkgYXMgYSBiYWNrLXBvcnQgdG8gMi40LCBhcyBJIHdhcyB1bmFibGUgdG8gCmdldCBteSBz Y3NpIGRyaXZlciBib290aW5nIG9uIDIuNi4gCgpJdCBhbHNvIGluY2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OjM4OjQ3IDIwMDMKKysrIDI1LWFrcG0vZHJpdmVy cy9uZXQvS2NvbmZpZwlXZWQgT2N0IDIyIDEyOjM4OjQ3IDIwMDMKQEAgLTY1Nyw3ICs2NTcsNyBA QCBjb25maWcgRUxNQwogCiBjb25maWcgRUxNQ19JSQogCXRyaXN0YXRlICIzYzUyNyBcIkV0aGVy TGluay9NQyAzMlwiIHN1cHBvcnQgKEVYUEVSSU1FTlRBTCkiCi0JZGVwZW5kcyBvbiBORVRfVkVO RE9SXzNDT00gJiYgTUNBICYmIEVYUEVSSU1FTlRBTCAmJiBCUk9LRU5fT05fU01QCisJZGVwZW5k cyBvbiBORVRfVkVORE9SXzNDT00gJiYgTUNBICYmIE1DQV9MRUdBQ1kKIAloZWxwCiAJICBJZiB5 b3UgaGF2ZSBhIG5ldHdvcmsgKEV0aGVybmV0KSBjYXJkIG9mIHRoaXMgdHlwZSwgc2F5IFkgYW5k IHJlYWQKIAkgIHRoZSBFdGhlcm5ldC1IT1dUTywgYXZhaWxhYmxlIGZyb20KCl8K --Multipart=_Wed__29_Oct_2003_11_59_51_-0800_=QFIBBK4SI818vCp Content-Type: application/octet-stream; name="3c527-race-fix.patch" Content-Disposition: attachment; filename="3c527-race-fix.patch" Content-Transfer-Encoding: base64 IGRyaXZlcnMvbmV0LzNjNTI3LmMgfCAgIDQ0ICsrKysrKysrKysrKysrKysrKysrKystLS0tLS0t LS0tLS0tLS0tLS0tLS0tCiAxIGZpbGVzIGNoYW5nZWQsIDIyIGluc2VydGlvbnMoKyksIDIyIGRl bGV0aW9ucygtKQoKZGlmZiAtcHVOIGRyaXZlcnMvbmV0LzNjNTI3LmN+M2M1MjctcmFjZS1maXgg ZHJpdmVycy9uZXQvM2M1MjcuYwotLS0gMjUvZHJpdmVycy9uZXQvM2M1MjcuY34zYzUyNy1yYWNl LWZpeAkyMDAzLTEwLTIxIDAxOjAzOjIyLjAwMDAwMDAwMCAtMDcwMAorKysgMjUtYWtwbS9kcml2 ZXJzL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mV0dXJuIDA7CkBAIC0xMjM0 LDcgKzEyMzYsNyBAQCBzdGF0aWMgdm9pZCBtYzMyX3R4X3Jpbmcoc3RydWN0IG5ldF9kZXZpCiAJ ICogY29uZGl0aW9uIHdpdGggJ3F1ZXVlIGZ1bGwnCiAJICovCiAKLQl3aGlsZSAobHAtPnR4X3Jp bmdfdGFpbCAhPSBscC0+dHhfcmluZ19oZWFkKSAgCisJd2hpbGUgKGxwLT50eF9yaW5nX3RhaWwg IT0gYXRvbWljX3JlYWQoJmxwLT50eF9yaW5nX2hlYWQpKQogCXsgICAKIAkJdTE2IHQ7IAogCkBA IC0xMzg2LDkgKzEzODgsNyBAQCBzdGF0aWMgaXJxcmV0dXJuX3QgbWMzMl9pbnRlcnJ1cHQoaW50 IGlyCiAJCQkJaWYgKGxwLT5tY19yZWxvYWRfd2FpdCkgCiAJCQkJCW1jMzJfcmVzZXRfbXVsdGlj YXN0X2xpc3QoZGV2KTsKIAkJCX0KLQkJCWVsc2UgewotCQkJCWNvbXBsZXRlKCZscC0+ZXhlY3V0 aW9uX2NtZCk7Ci0JCQl9CisJCQllbHNlIGNvbXBsZXRlKCZscC0+ZXhlY3V0aW9uX2NtZCk7CiAJ CX0KIAkJaWYoc3RhdHVzJjIpCiAJCXsKCl8K --Multipart=_Wed__29_Oct_2003_11_59_51_-0800_=QFIBBK4SI818vCp Content-Type: application/octet-stream; name="3c527-module-license.patch" Content-Disposition: attachment; filename="3c527-module-license.patch" Content-Transfer-Encoding: base64 CgpJdCB0YWludHMgdGhlIGtlcm5lbC4gICBJIGFzc3VtZSBBbGFuIGlzIE9LIHdpdGggR1BMIDsp CgoKCiBkcml2ZXJzL25ldC8zYzUyNy5jIHwgICAgMiArKwogMSBmaWxlcyBjaGFuZ2VkLCAyIGlu c2VydGlvbnMoKykKCmRpZmYgLXB1TiBkcml2ZXJzL25ldC8zYzUyNy5jfjNjNTI3LW1vZHVsZS1s aWNlbnNlIGRyaXZlcnMvbmV0LzNjNTI3LmMKLS0tIDI1L2RyaXZlcnMvbmV0LzNjNTI3LmN+M2M1 MjctbW9kdWxlLWxpY2Vuc2UJMjAwMy0xMC0xOCAxOTowNToxMC4wMDAwMDAwMDAgLTA3MDAKKysr IDI1LWFrcG0vZHJpdmVycy9uZXQvM2M1MjcuYwkyMDAzLTEwLTE4IDE5OjA1OjUxLjAwMDAwMDAw MCAtMDcwMApAQCAtMTEyLDYgKzExMiw4IEBAIERSVl9OQU1FICIuYzp2IiBEUlZfVkVSU0lPTiAi ICIgRFJWX1JFTEQKIAogI2luY2x1ZGUgIjNjNTI3LmgiCiAKK01PRFVMRV9MSUNFTlNFKCJHUEwi KTsKKwogLyoKICAqIFRoZSBuYW1lIG9mIHRoZSBjYXJkLiBJcyB1c2VkIGZvciBtZXNzYWdlcyBh bmQgaW4gdGhlIHJlcXVlc3RzIGZvcgogICogaW8gcmVnaW9ucywgaXJxcyBhbmQgZG1hIGNoYW5u ZWxzCgpfCg== --Multipart=_Wed__29_Oct_2003_11_59_51_-0800_=QFIBBK4SI818vCp-- From jgarzik@pobox.com Wed Oct 29 12:01:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 12:02:26 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TK1q25016114 for ; Wed, 29 Oct 2003 12:01:53 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:38239 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AEwVq-0004Q9-HB; Wed, 29 Oct 2003 20:01:50 +0000 Message-ID: <3FA01CA2.6030706@pobox.com> Date: Wed, 29 Oct 2003 15:01:38 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Amir Noam CC: davem@redhat.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH 2/10] [bonding 2.6] fix monitoring functions References: <200310121642.26285.amir.noam@intel.com> In-Reply-To: <200310121642.26285.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1105 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 applied to 2.6. does this need to go into 2.4, too? From jgarzik@pobox.com Wed Oct 29 12:10:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 12:10:46 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TKAB25016563 for ; Wed, 29 Oct 2003 12:10:12 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:38258 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AEwdu-0004Vg-Tb; Wed, 29 Oct 2003 20:10:11 +0000 Message-ID: <3FA01E96.8070006@pobox.com> Date: Wed, 29 Oct 2003 15:09:58 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Morton CC: rnp@paradise.net.nz, felipewd@terra.com.br, netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: [PATCH] SMP support on 3c527 net driver for 2.6 References: <3FA018D4.30006@pobox.com> <20031029115951.7d7e6c12.akpm@osdl.org> In-Reply-To: <20031029115951.7d7e6c12.akpm@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1106 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 Andrew Morton wrote: > Jeff Garzik wrote: > >>applied both patches to my net-drivers-2.5-exp queue. >> > > > Which patches? I have three. Attached. The two patches that were attached to Richard's message, "jeff-to-andrew" and "race". I'll go out on a limb and guess that I still need -module-license from your list. I'll take a look... Jeff From ak@suse.de Wed Oct 29 12:14:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 12:15:02 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TKED25016933 for ; Wed, 29 Oct 2003 12:14:19 -0800 Received: from Hermes.suse.de (Hermes.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 17B17176C03F; Wed, 29 Oct 2003 20:47:09 +0100 (CET) Date: Wed, 29 Oct 2003 20:47:07 +0100 From: Andi Kleen To: "David S. Miller" Cc: davidm@hpl.hp.com, davidm@napali.hpl.hp.com, netdev@oss.sgi.com Subject: Re: SOMAXCONN too low Message-Id: <20031029204707.67f9a2e1.ak@suse.de> In-Reply-To: <20031029105809.0a1f27a1.davem@redhat.com> References: <200310290658.h9T6w04k015302@napali.hpl.hp.com> <20031029105809.0a1f27a1.davem@redhat.com> X-Mailer: Sylpheed version 0.8.9 (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: 1107 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 Wed, 29 Oct 2003 10:58:09 -0800 "David S. Miller" wrote: > On Tue, 28 Oct 2003 22:58:00 -0800 > David Mosberger wrote: > > > You obviously want some control over how big the listen queue can > > grow, but it seems to me that a sysctl would be in place. I found > > this patch to do that, but no reaction to it: > > > > http://www.ussg.iu.edu/hypermail/linux/kernel/0205.0/1287.html > > I think I'm going to apply this patch. > > People can then set the limit to what they want, the default > stays at 128, and the SOMAXCONN define itself does not change. > > Ok David? Can I respectfully ask to name the sysctl net/core/somaxconn ? That is the name used in the SuSE/UL kernels and has been shipping for some time and already has a big user base, and there is no reason to break compatibility for them. Thanks, -Andi From fubar@us.ibm.com Wed Oct 29 12:27:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 12:27:49 -0800 (PST) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.105]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TKR825020517 for ; Wed, 29 Oct 2003 12:27:15 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e5.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9TKQen9336654; Wed, 29 Oct 2003 15:26:41 -0500 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9TKQZdI092554; Wed, 29 Oct 2003 15:26:37 -0500 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h9TKQNwG013890; Wed, 29 Oct 2003 12:26:28 -0800 Message-Id: <200310292026.h9TKQNwG013890@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: Jeff Garzik cc: Amir Noam , bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH 2/10] [bonding 2.6] fix monitoring functions In-Reply-To: Message from Jeff Garzik of "Wed, 29 Oct 2003 15:01:38 EST." <3FA01CA2.6030706@pobox.com> Date: Wed, 29 Oct 2003 12:26:23 -0800 From: Jay Vosburgh X-archive-position: 1108 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev >applied to 2.6. does this need to go into 2.4, too? No, it went in to 2.4.23-pre3. -J From garzik@gtf.org Wed Oct 29 13:21:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 13:21:42 -0800 (PST) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TLL025022844 for ; Wed, 29 Oct 2003 13:21:04 -0800 Received: by havoc.gtf.org (Postfix, from userid 500) id 1CA5966C1; Wed, 29 Oct 2003 16:20:54 -0500 (EST) Date: Wed, 29 Oct 2003 16:20:54 -0500 From: Jeff Garzik To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [BK PATCHES] 2.4.x experimental net driver queue Message-ID: <20031029212054.GA6445@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 1109 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 BK users: bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.4-exp Patch: ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.4/2.4.22-bk43-netdrvr-exp1.patch.bz2 This will update the following files: drivers/net/8139too.c | 51 +++++++++++++++-------- drivers/net/Makefile.lib | 1 drivers/net/natsemi.c | 101 +++++++++++++++-------------------------------- 3 files changed, 68 insertions(+), 85 deletions(-) through these ChangeSets: (03/10/14 1.1148.17.2) [netdrvr natsemi] backport 2.6 fixes and cleanups (03/10/14 1.1148.17.1) [netdrvr 8139too] support netif_msg_* interface From garzik@gtf.org Wed Oct 29 13:52:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 13:53:04 -0800 (PST) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TLqH25024481 for ; Wed, 29 Oct 2003 13:52:17 -0800 Received: by havoc.gtf.org (Postfix, from userid 500) id CE90D66FB; Wed, 29 Oct 2003 16:23:22 -0500 (EST) Date: Wed, 29 Oct 2003 16:23:22 -0500 From: Jeff Garzik To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [BK PATCHES] 2.6.x experimental net driver queue Message-ID: <20031029212322.GA6621@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 1110 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 Main items of interest: * shemminger's merge of viro's probe work * NAPI support for tulip (Robert Ollson and friends) * Matt Mackall's netpoll/netconsole stuff Coming soon: * shemminger/ogawa's NAPI support for 8139too BK users: bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5-exp Patch: ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test9-bk3-netdrvr-exp1.patch.bz2 This will update the following files: Documentation/networking/netconsole.txt | 57 ++ drivers/net/3c501.c | 116 ++--- drivers/net/3c501.h | 1 drivers/net/3c505.c | 128 +++--- drivers/net/3c507.c | 110 ++--- drivers/net/3c515.c | 23 - drivers/net/3c527.c | 584 +++++++++++++---------------- drivers/net/8139too.c | 51 +- drivers/net/82596.c | 83 ++-- drivers/net/Kconfig | 7 drivers/net/Makefile | 1 drivers/net/Space.c | 161 +++++--- drivers/net/de620.c | 63 ++- drivers/net/defxx.c | 2 drivers/net/dummy.c | 2 drivers/net/eql.c | 2 drivers/net/natsemi.c | 39 + drivers/net/netconsole.c | 120 ++++++ drivers/net/ni5010.c | 184 ++++----- drivers/net/ni52.c | 118 +++-- drivers/net/ni65.c | 101 +++-- drivers/net/ns83820.c | 2 drivers/net/plip.c | 14 drivers/net/shaper.c | 11 drivers/net/sk_g16.c | 179 +++------ drivers/net/skfp/skfddi.c | 32 - drivers/net/tg3.c | 12 drivers/net/tokenring/proteon.c | 184 ++++----- drivers/net/tokenring/skisa.c | 182 ++++----- drivers/net/tokenring/smctr.c | 194 +++++---- drivers/net/tulip/Kconfig | 20 + drivers/net/tulip/interrupt.c | 410 +++++++++++++++----- drivers/net/tulip/tulip.h | 18 drivers/net/tulip/tulip_core.c | 55 +- drivers/net/tun.c | 18 drivers/net/wan/lmc/lmc_main.c | 375 ++++++------------ drivers/net/wan/lmc/lmc_var.h | 15 drivers/net/wireless/arlan-main.c | 261 ++++--------- drivers/net/wireless/arlan.h | 6 drivers/net/wireless/wavelan.c | 171 +++----- drivers/net/wireless/wavelan.p.h | 5 include/linux/netdevice.h | 18 include/linux/netpoll.h | 38 + net/Kconfig | 20 - net/core/Makefile | 1 net/core/dev.c | 39 + net/core/netpoll.c | 636 ++++++++++++++++++++++++++++++++ net/wanrouter/wanmain.c | 2 48 files changed, 2889 insertions(+), 1982 deletions(-) through these ChangeSets: (03/10/29 1.1389.1.3) [NET] use the netpoll API to transmit kernel printks over UDP (03/10/29 1.1389.1.2) [NET] Add netpoll support for tg3 (03/10/29 1.1389.1.1) [NET] add netpoll API (03/10/29 1.1397) [PATCH] trivial -- skfp_probe should be static skfp_probe used to be called from Space.c but isn't any more. Therefore it no longer needs to be global. All the calls to insert_device() pass skfp_probe as a second arg, so just use it directly. Jeff, this also is janitor type stuff, so just put it in net-2.5-exp (03/10/29 1.1396) [PATCH] (4/6) skisa -- probe2 Convert the SK-NET TMS380 ISA card to the new probe2 format. (03/10/29 1.1395) [PATCH] (3/6) proteon -- probe2 Convert proteon token ring driver to new probing. (03/10/29 1.1394) [PATCH] (2/6) smctr -- probe2 Convert the SMC tokenring driver to new probing. (03/10/29 1.1393) [PATCH] (1/6) tokenring probing change Ugh, two patches got crossed. This is the correct first one. (03/10/29 1.1392) [netdrvr 3c527] fix race (03/10/29 1.1391) [netdrvr 3c527] whitespace changes (sync up with maintainer) (03/10/14 1.1337.26.21) [PATCH] (12/12) Probe2 -- 82596 Originally by Al Viro (NE23-82596) * switched 82596 to dynamic allocation * 82596: fixed resource leaks on failure exits Updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.20) [PATCH] (11/12) Probe2 -- 3c501 >From viro NE22-3c501 * switched 3c501 to dynamic allocation * 3c501: embedded ->priv * 3c501: fixed clobbering on autoprobe * 3c501: fixed resource leaks on failure exits Additional: * probe correctly when no device present * fix loop forever bug in probing * free_netdev (03/10/14 1.1337.26.19) [PATCH] (10/12) Probe2 -- wavelan Original by Al Viro (NE21-wavelan) * switched wavelan to dynamic allocation * wavelan: embedded ->priv * wavelan: fixed clobbering on autoprobe * wavelan: fixed IO before request_region() * wavelan: fixed resource leaks on failure exits * wavelan: fixed order of freeing bugs Updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.18) [PATCH] (09/12) Probe2 -- arlan Convert arlan driver to new probing. This meant a rather large rework of the probing code for this driver since it did a lot ofnon standard things. (03/10/14 1.1337.26.17) [PATCH] (08/12) Probe2 -- 3c507 Originally by Al Viro (NE19-3c507) * switched 3c507 to dynamic allocation * 3c507: embedded ->priv * 3c507: fixed clobbering on autoprobe * NB: 3c507.c buggers port 0x100 without claiming it. Most likely it should be doing request_region() there. Updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.16) [PATCH] (07/12) Probe2 -- 3c505 from viro NE18-3c505 * switched 3c505 to dynamic allocation * 3c505: embedded ->priv * 3c505: fixed use of uninitialized variable * 3c505: fixed resource leaks on failure exits Additional: * add free_netdev (03/10/14 1.1337.26.15) [PATCH] (06/12) Probe2 -- sk16 from viro NE17-sk16 * switched sk_g16 to dynamic allocation * sk_g16: embedded ->priv * sk_g16: fixed buggy check for signature (|| instead of &&, somebody forgot to replace it when inverting the test). * sk_g16: fixed use after kfree() * sk_g16: fixed init_etherdev() race Additional: * add free_netdev (03/10/14 1.1337.26.14) [PATCH] (05/12) Probe2 -- ni5010 from viro NE16-ni5010 * switched ni5010 to dynamic allocation * ni5010: embedded ->priv * ni5010: fixed clobbering ->irq * ni5010: fixed IO before request_region() Additional: * add free_netdev (03/10/14 1.1337.26.13) [PATCH] (04/12) Probe2 -- ni52 >From viro NE15-ni52 * switched ni52 to dynamic allocation * ni52: embedded ->priv * ni52: fixed clobbering of everything on autoprobe Additional: * add free_netdev (03/10/14 1.1337.26.12) [PATCH] (03/12) Probe2 -- ni65 Convert ni65 driver to new probing; patch sequence goes bottom up on the probe list. * switched ni65 to dynamic allocation * ni65: fixed ->irq and ->dma clobbering on autoprobe (03/10/14 1.1337.26.11) [PATCH] (2/12) Probe2 -- de620 Rework de620 driver to new dynamic allocation Originally by Al Viro. * switched de620 to dynamic allocation * de620: embedded ->priv * de620: fixed IO before request_region() Updated to ~jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.10) [PATCH] (1/12) Probe2 infrastructure for 2.6 experimental New infrastructure to allow probing older builtin drivers (like ISA) Originally by Al Viro, updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.9) [netdrvr tulip] support NAPI Contributed by Robert Ollsson. (03/10/14 1.1337.26.8) [PATCH] smctr - get rid of MOD_INC/DEC Get rid of warning now that module refcounting now done by network code not drivers. Not tested on real hardware. (03/10/14 1.1337.26.7) [PATCH] janitor: insert missing iounmap(), add error handling Hi, Please apply to 2.6.0-test6-current. Thanks, -- ~Randy From: Leann Ogasawara Subject: Re: [Kernel-janitors] [PATCH] insert missing iounmap() > > Patch inserts a missing iounmap(). Implements a cleanup path > > for error handling as well. Feedback is much appreciated. Thanks :) ===== drivers/net/natsemi.c 1.55 vs edited ===== linux-260-test6-kj1-rddunlap/drivers/net/natsemi.c | 39 ++++++++++----------- 1 files changed, 20 insertions(+), 19 deletions(-) (03/10/14 1.1337.26.6) [PATCH] release region in skfddi driver This is a multi-part message in MIME format. (03/10/14 1.1337.26.5) [netdrvr 3c527] remove cli/sti Richard Procter and I worked to remove cli/sti to add proper SMP support (I did the original stuff and Richard did the actual current code :)). Besides that, Richard did a great jog improving the perfomance of the driver quite a bit: - Improve mc32_command by 770% (438% non-inlined) over the semaphore version (at a cost of 1 sem + 2 completions per driver). - Removed mutex covering mc32_send_packet (hard_start_xmit). This lets the interrupt handler operate concurrently and removes unnecessary locking. It makes the code only slightly more brittle Original post: http://marc.theaimsgroup.com/?l=linux-netdev&m=106438449315202&w=2 Since it didn't apply cleanly against 2.6.0-test6, I forward ported it. Patch attached. Jeff, please consider applying, Thanks. (03/10/14 1.1337.26.4) [PATCH] remove dev_get from wanrouter The call to dev_get() in wanrouter_device_new_if is racy and redundant and should be removed. The later 'register_netdev()' does the same test internally and will return the appropriate error if the name already exists. This patch is against 2.6.0-test6. Resend of earlier patch because it was ignored, or missed. (03/10/14 1.1337.26.3) [PATCH] 2.6.0-test6 - more free_netdev() conversion Compiles ok (with true .o generated, yeah). Please review. free_netdev() of devices allocated through use of alloc_netdev(). Though baroque, drivers/net/3c515.c now uses alloc_etherdev(). drivers/net/3c515.c | 23 ++++++++++++----------- drivers/net/defxx.c | 2 +- drivers/net/dummy.c | 2 +- drivers/net/eql.c | 2 +- drivers/net/ns83820.c | 2 +- drivers/net/plip.c | 14 ++++++++++---- drivers/net/shaper.c | 11 ++++++++--- drivers/net/tun.c | 18 +++++++++--------- 9 files changed, 43 insertions(+), 31 deletions(-) (03/10/14 1.1337.26.2) [PATCH] wan/lmc -- convert to new network device model Resend of LMC driver patch for 2.6.0-test6 * do proper probing * allocate network device with alloc_netdev * use standard pci_id's instead of local defines * use standard PCI device interface to find and remove devices. (03/10/14 1.1337.26.1) [netdrvr 8139too] support netif_msg_* interface From garzik@gtf.org Wed Oct 29 15:38:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 15:39:14 -0800 (PST) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9TNca25026674 for ; Wed, 29 Oct 2003 15:38:36 -0800 Received: by havoc.gtf.org (Postfix, from userid 500) id AC72666FB; Wed, 29 Oct 2003 18:34:11 -0500 (EST) Date: Wed, 29 Oct 2003 18:34:11 -0500 From: Jeff Garzik To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [BK PATCHES] 2.6.x experimental net driver queue Message-ID: <20031029233411.GA21890@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 1111 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 Andi Kleen was kind enough to gather up and send the vendor netpoll patches that have been lying around in various vendor, -aa, etc. trees and send them along. So here goes -test9-bk3-netdrvr-exp2. BK users: bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5-exp Patch: ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test9-bk3-netdrvr-exp2.patch.bz2 This will update the following files: Documentation/networking/netconsole.txt | 57 ++ drivers/net/3c501.c | 116 ++--- drivers/net/3c501.h | 1 drivers/net/3c505.c | 128 +++--- drivers/net/3c507.c | 110 ++--- drivers/net/3c515.c | 23 - drivers/net/3c527.c | 584 +++++++++++++---------------- drivers/net/3c59x.c | 15 drivers/net/8139too.c | 51 +- drivers/net/82596.c | 83 ++-- drivers/net/Kconfig | 7 drivers/net/Makefile | 1 drivers/net/Space.c | 161 +++++--- drivers/net/amd8111e.c | 14 drivers/net/de620.c | 63 ++- drivers/net/defxx.c | 2 drivers/net/dummy.c | 2 drivers/net/eepro100.c | 21 + drivers/net/eql.c | 2 drivers/net/natsemi.c | 39 + drivers/net/netconsole.c | 120 ++++++ drivers/net/ni5010.c | 184 ++++----- drivers/net/ni52.c | 118 +++-- drivers/net/ni65.c | 101 +++-- drivers/net/ns83820.c | 2 drivers/net/pcnet32.c | 11 drivers/net/plip.c | 14 drivers/net/shaper.c | 11 drivers/net/sk_g16.c | 179 +++------ drivers/net/skfp/skfddi.c | 32 - drivers/net/tg3.c | 16 drivers/net/tokenring/proteon.c | 184 ++++----- drivers/net/tokenring/skisa.c | 182 ++++----- drivers/net/tokenring/smctr.c | 194 +++++---- drivers/net/tulip/Kconfig | 20 + drivers/net/tulip/interrupt.c | 410 +++++++++++++++----- drivers/net/tulip/tulip.h | 18 drivers/net/tulip/tulip_core.c | 76 ++- drivers/net/tun.c | 18 drivers/net/wan/lmc/lmc_main.c | 375 ++++++------------ drivers/net/wan/lmc/lmc_var.h | 15 drivers/net/wireless/arlan-main.c | 261 ++++--------- drivers/net/wireless/arlan.h | 6 drivers/net/wireless/wavelan.c | 171 +++----- drivers/net/wireless/wavelan.p.h | 5 include/linux/netdevice.h | 18 include/linux/netpoll.h | 38 + net/Kconfig | 20 - net/core/Makefile | 1 net/core/dev.c | 39 + net/core/netpoll.c | 636 ++++++++++++++++++++++++++++++++ net/wanrouter/wanmain.c | 2 52 files changed, 2971 insertions(+), 1986 deletions(-) through these ChangeSets: (03/10/29 1.1404) [PATCH] netpoll for eepro100 netpoll for eepro100 This was in Ingo's old original netconsole patches. (03/10/29 1.1403) [PATCH] fix tg3 netpoll No need to use disable_irq because tg3 is properly spinlocked. Can just call the interrupt handler directly. (03/10/29 1.1402) [PATCH] Netpoll for pcnet32 netpoll for pcnet32 (03/10/29 1.1401) [PATCH] netpoll for amd8111e netpoll for amd8111e (03/10/29 1.1400) [PATCH] netpoll for tulip Netpoll for tulip. Uses disable_irq() because tulip is unfortunately still lockless. (03/10/29 1.1399) [PATCH] netpoll for 3c59x >From the old -aa tree with minor changes. Orginally done by Andrea I think. (03/10/29 1.1389.1.3) [NET] use the netpoll API to transmit kernel printks over UDP (03/10/29 1.1389.1.2) [NET] Add netpoll support for tg3 (03/10/29 1.1389.1.1) [NET] add netpoll API (03/10/29 1.1397) [PATCH] trivial -- skfp_probe should be static skfp_probe used to be called from Space.c but isn't any more. Therefore it no longer needs to be global. All the calls to insert_device() pass skfp_probe as a second arg, so just use it directly. Jeff, this also is janitor type stuff, so just put it in net-2.5-exp (03/10/29 1.1396) [PATCH] (4/6) skisa -- probe2 Convert the SK-NET TMS380 ISA card to the new probe2 format. (03/10/29 1.1395) [PATCH] (3/6) proteon -- probe2 Convert proteon token ring driver to new probing. (03/10/29 1.1394) [PATCH] (2/6) smctr -- probe2 Convert the SMC tokenring driver to new probing. (03/10/29 1.1393) [PATCH] (1/6) tokenring probing change Ugh, two patches got crossed. This is the correct first one. (03/10/29 1.1392) [netdrvr 3c527] fix race (03/10/29 1.1391) [netdrvr 3c527] whitespace changes (sync up with maintainer) (03/10/14 1.1337.26.21) [PATCH] (12/12) Probe2 -- 82596 Originally by Al Viro (NE23-82596) * switched 82596 to dynamic allocation * 82596: fixed resource leaks on failure exits Updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.20) [PATCH] (11/12) Probe2 -- 3c501 >From viro NE22-3c501 * switched 3c501 to dynamic allocation * 3c501: embedded ->priv * 3c501: fixed clobbering on autoprobe * 3c501: fixed resource leaks on failure exits Additional: * probe correctly when no device present * fix loop forever bug in probing * free_netdev (03/10/14 1.1337.26.19) [PATCH] (10/12) Probe2 -- wavelan Original by Al Viro (NE21-wavelan) * switched wavelan to dynamic allocation * wavelan: embedded ->priv * wavelan: fixed clobbering on autoprobe * wavelan: fixed IO before request_region() * wavelan: fixed resource leaks on failure exits * wavelan: fixed order of freeing bugs Updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.18) [PATCH] (09/12) Probe2 -- arlan Convert arlan driver to new probing. This meant a rather large rework of the probing code for this driver since it did a lot ofnon standard things. (03/10/14 1.1337.26.17) [PATCH] (08/12) Probe2 -- 3c507 Originally by Al Viro (NE19-3c507) * switched 3c507 to dynamic allocation * 3c507: embedded ->priv * 3c507: fixed clobbering on autoprobe * NB: 3c507.c buggers port 0x100 without claiming it. Most likely it should be doing request_region() there. Updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.16) [PATCH] (07/12) Probe2 -- 3c505 from viro NE18-3c505 * switched 3c505 to dynamic allocation * 3c505: embedded ->priv * 3c505: fixed use of uninitialized variable * 3c505: fixed resource leaks on failure exits Additional: * add free_netdev (03/10/14 1.1337.26.15) [PATCH] (06/12) Probe2 -- sk16 from viro NE17-sk16 * switched sk_g16 to dynamic allocation * sk_g16: embedded ->priv * sk_g16: fixed buggy check for signature (|| instead of &&, somebody forgot to replace it when inverting the test). * sk_g16: fixed use after kfree() * sk_g16: fixed init_etherdev() race Additional: * add free_netdev (03/10/14 1.1337.26.14) [PATCH] (05/12) Probe2 -- ni5010 from viro NE16-ni5010 * switched ni5010 to dynamic allocation * ni5010: embedded ->priv * ni5010: fixed clobbering ->irq * ni5010: fixed IO before request_region() Additional: * add free_netdev (03/10/14 1.1337.26.13) [PATCH] (04/12) Probe2 -- ni52 >From viro NE15-ni52 * switched ni52 to dynamic allocation * ni52: embedded ->priv * ni52: fixed clobbering of everything on autoprobe Additional: * add free_netdev (03/10/14 1.1337.26.12) [PATCH] (03/12) Probe2 -- ni65 Convert ni65 driver to new probing; patch sequence goes bottom up on the probe list. * switched ni65 to dynamic allocation * ni65: fixed ->irq and ->dma clobbering on autoprobe (03/10/14 1.1337.26.11) [PATCH] (2/12) Probe2 -- de620 Rework de620 driver to new dynamic allocation Originally by Al Viro. * switched de620 to dynamic allocation * de620: embedded ->priv * de620: fixed IO before request_region() Updated to ~jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.10) [PATCH] (1/12) Probe2 infrastructure for 2.6 experimental New infrastructure to allow probing older builtin drivers (like ISA) Originally by Al Viro, updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.9) [netdrvr tulip] support NAPI Contributed by Robert Ollsson. (03/10/14 1.1337.26.8) [PATCH] smctr - get rid of MOD_INC/DEC Get rid of warning now that module refcounting now done by network code not drivers. Not tested on real hardware. (03/10/14 1.1337.26.7) [PATCH] janitor: insert missing iounmap(), add error handling Hi, Please apply to 2.6.0-test6-current. Thanks, -- ~Randy From: Leann Ogasawara Subject: Re: [Kernel-janitors] [PATCH] insert missing iounmap() > > Patch inserts a missing iounmap(). Implements a cleanup path > > for error handling as well. Feedback is much appreciated. Thanks :) ===== drivers/net/natsemi.c 1.55 vs edited ===== linux-260-test6-kj1-rddunlap/drivers/net/natsemi.c | 39 ++++++++++----------- 1 files changed, 20 insertions(+), 19 deletions(-) (03/10/14 1.1337.26.6) [PATCH] release region in skfddi driver This is a multi-part message in MIME format. (03/10/14 1.1337.26.5) [netdrvr 3c527] remove cli/sti Richard Procter and I worked to remove cli/sti to add proper SMP support (I did the original stuff and Richard did the actual current code :)). Besides that, Richard did a great jog improving the perfomance of the driver quite a bit: - Improve mc32_command by 770% (438% non-inlined) over the semaphore version (at a cost of 1 sem + 2 completions per driver). - Removed mutex covering mc32_send_packet (hard_start_xmit). This lets the interrupt handler operate concurrently and removes unnecessary locking. It makes the code only slightly more brittle Original post: http://marc.theaimsgroup.com/?l=linux-netdev&m=106438449315202&w=2 Since it didn't apply cleanly against 2.6.0-test6, I forward ported it. Patch attached. Jeff, please consider applying, Thanks. (03/10/14 1.1337.26.4) [PATCH] remove dev_get from wanrouter The call to dev_get() in wanrouter_device_new_if is racy and redundant and should be removed. The later 'register_netdev()' does the same test internally and will return the appropriate error if the name already exists. This patch is against 2.6.0-test6. Resend of earlier patch because it was ignored, or missed. (03/10/14 1.1337.26.3) [PATCH] 2.6.0-test6 - more free_netdev() conversion Compiles ok (with true .o generated, yeah). Please review. free_netdev() of devices allocated through use of alloc_netdev(). Though baroque, drivers/net/3c515.c now uses alloc_etherdev(). drivers/net/3c515.c | 23 ++++++++++++----------- drivers/net/defxx.c | 2 +- drivers/net/dummy.c | 2 +- drivers/net/eql.c | 2 +- drivers/net/ns83820.c | 2 +- drivers/net/plip.c | 14 ++++++++++---- drivers/net/shaper.c | 11 ++++++++--- drivers/net/tun.c | 18 +++++++++--------- 9 files changed, 43 insertions(+), 31 deletions(-) (03/10/14 1.1337.26.2) [PATCH] wan/lmc -- convert to new network device model Resend of LMC driver patch for 2.6.0-test6 * do proper probing * allocate network device with alloc_netdev * use standard pci_id's instead of local defines * use standard PCI device interface to find and remove devices. (03/10/14 1.1337.26.1) [netdrvr 8139too] support netif_msg_* interface From paulus@ozlabs.org Wed Oct 29 18:27:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 18:27:45 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9U2R825031288 for ; Wed, 29 Oct 2003 18:27:12 -0800 Received: by ozlabs.org (Postfix, from userid 1003) id 36D5D2BD41; Thu, 30 Oct 2003 13:27:02 +1100 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16288.30574.745348.194005@cargo.ozlabs.ibm.com> Date: Thu, 30 Oct 2003 13:29:02 +1100 From: Paul Mackerras To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Bug somewhere in crypto or ipsec stuff X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 1112 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: paulus@samba.org Precedence: bulk X-list: netdev I get this oops in strcmp, called from crypto_alg_lookup, when I run the "spi" command from a freeswan snapshot from 13 October this year. The kernel is 2.6.0-test9. Oops: kernel access of bad area, sig: 11 [#1] NIP: C001323C LR: C00CEE6C SP: CB8D1C60 REGS: cb8d1bb0 TRAP: 0301 Not tainted MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11 DAR: 00000000, DSISR: 40000000 TASK = ca0c2320[934] 'spi' Last syscall: 4 GPR00: C02D5204 CB8D1C60 CA0C2320 00000063 FFFFFFFF C02D5284 CB472A38 00000003 GPR08: C03D0C84 C033BCBC 00000000 C00CF03C C03D0C84 Call trace: [c00cf058] crypto_alloc_tfm+0x1c/0x104 [cd97fb34] ipcomp_init_state+0x90/0x118 [ipcomp] [c0233a2c] pfkey_msg2xfrm_state+0x598/0x740 [c0233ed4] pfkey_add+0x2c/0x148 [c0235bb4] pfkey_process+0xb8/0xc0 [c0236ba0] pfkey_sendmsg+0x124/0x204 [c01c2018] sock_aio_write+0xe8/0x104 [c0054e6c] do_sync_write+0x74/0xb8 [c0054fc0] vfs_write+0x110/0x128 [c005508c] sys_write+0x40/0x74 [c0007a9c] ret_from_syscall+0x0/0x44 The problem is basically that crypto_alg_lookup gets called with NULL for the `name' parameter. The command that provokes the oops is: spi --af inet --said tun.1234@10.61.2.68 --ip4 --src 10.61.2.90 \ --dst 10.61.2.68 I was trying this because the freeswan web pages claim that they have some preliminary support for 2.6 in their user command set. I was only half expecting the spi command to work, but it shouldn't have been able to cause an oops. Paul. From yoshfuji@linux-ipv6.org Wed Oct 29 19:17:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 19:18:04 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9U3HT25001310 for ; Wed, 29 Oct 2003 19:17:30 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9U3HWlg002608; Thu, 30 Oct 2003 12:17:32 +0900 Date: Thu, 30 Oct 2003 12:17:32 +0900 (JST) Message-Id: <20031030.121732.12858700.yoshfuji@linux-ipv6.org> To: paulus@samba.org Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, davem@redhat.com, jmorris@redhat.com Subject: Re: Bug somewhere in crypto or ipsec stuff From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <16288.30574.745348.194005@cargo.ozlabs.ibm.com> References: <16288.30574.745348.194005@cargo.ozlabs.ibm.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1113 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 <16288.30574.745348.194005@cargo.ozlabs.ibm.com> (at Thu, 30 Oct 2003 13:29:02 +1100), Paul Mackerras says: > I get this oops in strcmp, called from crypto_alg_lookup, when I run > the "spi" command from a freeswan snapshot from 13 October this year. > The kernel is 2.6.0-test9. > > Oops: kernel access of bad area, sig: 11 [#1] : > Call trace: > [c00cf058] crypto_alloc_tfm+0x1c/0x104 > [cd97fb34] ipcomp_init_state+0x90/0x118 [ipcomp] : > The problem is basically that crypto_alg_lookup gets called with NULL > for the `name' parameter. I would just disallow name == NULL, well, what algorithm do you expect? ===== crypto/api.c 1.30 vs edited ===== --- 1.30/crypto/api.c Sat Mar 29 20:16:58 2003 +++ edited/crypto/api.c Thu Oct 30 12:07:43 2003 @@ -36,6 +36,9 @@ struct crypto_alg *crypto_alg_lookup(const char *name) { struct crypto_alg *q, *alg = NULL; + + if (!name) + return NULL; down_read(&crypto_alg_sem); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From jmorris@redhat.com Wed Oct 29 19:22:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 19:22:38 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9U3M525001668 for ; Wed, 29 Oct 2003 19:22:05 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h9U3M1M24254; Wed, 29 Oct 2003 22:22:01 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.64.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9U3M0608572; Wed, 29 Oct 2003 22:22:00 -0500 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.65.238]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id h9U3Lx4s022922; Wed, 29 Oct 2003 22:21:59 -0500 Date: Wed, 29 Oct 2003 22:22:50 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= cc: paulus@samba.org, , , Subject: Re: Bug somewhere in crypto or ipsec stuff In-Reply-To: <20031030.121732.12858700.yoshfuji@linux-ipv6.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-archive-position: 1114 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev On Thu, 30 Oct 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote: > I would just disallow name == NULL, > well, what algorithm do you expect? Good question. It seems to me to be a bug in the calling code if it is trying to look up nothing -- I'd rather not paper that over. - James -- James Morris From yoshfuji@linux-ipv6.org Wed Oct 29 19:41:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 19:41:57 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9U3fL25002502 for ; Wed, 29 Oct 2003 19:41:22 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9U3fOlg002806; Thu, 30 Oct 2003 12:41:24 +0900 Date: Thu, 30 Oct 2003 12:41:24 +0900 (JST) Message-Id: <20031030.124124.26191552.yoshfuji@linux-ipv6.org> To: jmorris@redhat.com Cc: paulus@samba.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, davem@redhat.com, yoshfuji@linux-ipv6.org Subject: Re: Bug somewhere in crypto or ipsec stuff From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20031030.121732.12858700.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1115 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 (at Wed, 29 Oct 2003 22:22:50 -0500 (EST)), James Morris says: > On Thu, 30 Oct 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote: > > > > I would just disallow name == NULL, > > well, what algorithm do you expect? > > Good question. It seems to me to be a bug in the calling code if it is > trying to look up nothing -- I'd rather not paper that over. Do you mean that we need to fix the caller? Well, people may want to get just any algorithm. In such case, - crypto allows name == NULL, and return any algorithm (for example, an algorithm that we see first.) - caller may filter name == NULL case if it is ambiguous in their context. --yoshfuji From Valdis.Kletnieks@vt.edu Wed Oct 29 20:33:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 20:34:07 -0800 (PST) Received: from turing-police.cc.vt.edu (h80ad26bd.async.vt.edu [128.173.38.189]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9U4XW25008874 for ; Wed, 29 Oct 2003 20:33:33 -0800 Received: from turing-police.cc.vt.edu (IDENT:valdis@localhost [127.0.0.1]) by turing-police.cc.vt.edu (8.12.10/8.12.10) with ESMTP id h9U4X49X010982; Wed, 29 Oct 2003 23:33:04 -0500 Message-Id: <200310300433.h9U4X49X010982@turing-police.cc.vt.edu> X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4+dev To: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Bug somewhere in crypto or ipsec stuff In-Reply-To: Your message of "Thu, 30 Oct 2003 12:41:24 +0900." <20031030.124124.26191552.yoshfuji@linux-ipv6.org> From: Valdis.Kletnieks@vt.edu References: <20031030.121732.12858700.yoshfuji@linux-ipv6.org> <20031030.124124.26191552.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_-1784525846P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Wed, 29 Oct 2003 23:33:03 -0500 X-archive-position: 1116 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Valdis.Kletnieks@vt.edu Precedence: bulk X-list: netdev --==_Exmh_-1784525846P Content-Type: text/plain; charset=us-ascii On Thu, 30 Oct 2003 12:41:24 +0900, YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= said: > Well, people may want to get just any algorithm. > In such case, > - crypto allows name == NULL, and return any algorithm > (for example, an algorithm that we see first.) This could be embarasssing if somebody happened to have the rot13 debugging algorithm loaded..... --==_Exmh_-1784525846P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Exmh version 2.5 07/13/2001 iD8DBQE/oJR/cC3lWbTT17ARAlPEAKCjUMEEZAQSkrLUBgHwAelA+d/xOQCdF76k qjzL1sHOGwz+5yOIN0nGoNo= =x8w/ -----END PGP SIGNATURE----- --==_Exmh_-1784525846P-- From jmorris@redhat.com Wed Oct 29 20:46:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 20:46:59 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9U4kJ25009643 for ; Wed, 29 Oct 2003 20:46:26 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h9U4kFM13616; Wed, 29 Oct 2003 23:46:15 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.64.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9U4kE632321; Wed, 29 Oct 2003 23:46:14 -0500 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.65.238]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id h9U4kE4s026124; Wed, 29 Oct 2003 23:46:14 -0500 Date: Wed, 29 Oct 2003 23:47:05 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= cc: paulus@samba.org, , , Subject: Re: Bug somewhere in crypto or ipsec stuff In-Reply-To: <20031030.124124.26191552.yoshfuji@linux-ipv6.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-archive-position: 1117 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev On Thu, 30 Oct 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote: > In article (at Wed, 29 Oct 2003 22:22:50 -0500 (EST)), James Morris says: > > > On Thu, 30 Oct 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote: > > > > > > > I would just disallow name == NULL, > > > well, what algorithm do you expect? > > > > Good question. It seems to me to be a bug in the calling code if it is > > trying to look up nothing -- I'd rather not paper that over. > > Do you mean that we need to fix the caller? Yes. > > Well, people may want to get just any algorithm. > In such case, > - crypto allows name == NULL, and return any algorithm > (for example, an algorithm that we see first.) > - caller may filter name == NULL case if it is ambiguous in their context. I think that could be dangerous, including if calling with null is a bug, and they get an inappropriate algorithm. An incorrect algorithm type could also be returned (e.g. digest instead of a cipher). - James -- James Morris From yoshfuji@linux-ipv6.org Wed Oct 29 21:24:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 29 Oct 2003 21:25:32 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9U5Ot25010641 for ; Wed, 29 Oct 2003 21:24:58 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id h9U5Owlg003518; Thu, 30 Oct 2003 14:24:59 +0900 Date: Thu, 30 Oct 2003 14:24:58 +0900 (JST) Message-Id: <20031030.142458.350988313.yoshfuji@linux-ipv6.org> To: jmorris@redhat.com Cc: paulus@samba.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, davem@redhat.com, yoshfuji@linux-ipv6.org Subject: Re: Bug somewhere in crypto or ipsec stuff From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20031030.124124.26191552.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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 XEmacs 21.4.6 (Common Lisp) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1118 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 (at Wed, 29 Oct 2003 23:47:05 -0500 (EST)), James Morris says: > > Do you mean that we need to fix the caller? > > Yes. > > - crypto allows name == NULL, and return any algorithm > > (for example, an algorithm that we see first.) > > - caller may filter name == NULL case if it is ambiguous in their context. > > I think that could be dangerous, including if calling with null is a > bug, and they get an inappropriate algorithm. An incorrect algorithm type > could also be returned (e.g. digest instead of a cipher). okay. how about this? ===== crypto/api.c 1.30 vs edited ===== --- 1.30/crypto/api.c Sat Mar 29 20:16:58 2003 +++ edited/crypto/api.c Thu Oct 30 14:21:53 2003 @@ -36,6 +36,9 @@ struct crypto_alg *crypto_alg_lookup(const char *name) { struct crypto_alg *q, *alg = NULL; + + if (!name) + return NULL; down_read(&crypto_alg_sem); ===== net/ipv4/ipcomp.c 1.16 vs edited ===== --- 1.16/net/ipv4/ipcomp.c Mon Aug 18 20:14:38 2003 +++ edited/net/ipv4/ipcomp.c Thu Oct 30 14:18:49 2003 @@ -360,7 +360,12 @@ ipcd->scratch = kmalloc(IPCOMP_SCRATCH_SIZE, GFP_KERNEL); if (!ipcd->scratch) goto error; - + + if (!x->calg->alg_name) { + err = -EINVAL; + goto error; + } + ipcd->tfm = crypto_alloc_tfm(x->calg->alg_name, 0); if (!ipcd->tfm) goto error; ===== net/ipv6/ipcomp6.c 1.7 vs edited ===== --- 1.7/net/ipv6/ipcomp6.c Mon Aug 18 20:14:38 2003 +++ edited/net/ipv6/ipcomp6.c Thu Oct 30 14:18:49 2003 @@ -293,6 +293,11 @@ if (!ipcd->scratch) goto error; + if (!x->calg->alg_name) { + err = -EINVAL; + goto error; + } + ipcd->tfm = crypto_alloc_tfm(x->calg->alg_name, 0); if (!ipcd->tfm) goto error; From amir.noam@intel.com Thu Oct 30 00:56:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 00:56:56 -0800 (PST) Received: from petasus.isw.intel.com (petasus.isw.intel.com [192.55.37.196]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9U8uJ25020730 for ; Thu, 30 Oct 2003 00:56:20 -0800 Received: from petasus.iil.intel.com (petasus.iil.intel.com [143.185.77.3]) by petasus.isw.intel.com (8.11.6-20030918-01/8.11.6/d: solo.mc,v 1.56 2003/05/22 21:18:22 rfjohns1 Exp $) with ESMTP id h9U8tpp21488 for ; Thu, 30 Oct 2003 08:55:52 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h9U8xO709692 for ; Thu, 30 Oct 2003 08:59:24 GMT Received: from sun111.npdj.intel.com ([10.12.254.111]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003103010560831070 ; Thu, 30 Oct 2003 10:56:08 +0200 Received: from jrslxjul4.npdj.intel.com (jrslxjul4 [10.12.254.188]) by sun111.npdj.intel.com (8.12.9/8.12.9/MailSET/Hub) with ESMTP id h9U8sXBN015565; Thu, 30 Oct 2003 10:54:33 +0200 (IST) Content-Type: text/plain; charset="iso-8859-1" From: Amir Noam To: "Jeff Garzik" Subject: Re: [Bonding-devel] Re: [PATCH 2/10] [bonding 2.6] fix monitoring functions Date: Thu, 30 Oct 2003 10:56:07 +0200 User-Agent: KMail/1.4.3 Cc: , , References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310301056.07221.amir.noam@intel.com> X-archive-position: 1119 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev On Wednesday 29 October 2003 10:01 pm, Jeff Garzik wrote: > applied to 2.6. does this need to go into 2.4, too? As Jay has pointed out this is already in 2.4. However, the following patch that restores backward compatibility with old ifenslave is still needed for 2.6. I see that it's already been applied by David Miller to 2.4. Amir diff -Naurp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Oct 30 10:38:34 2003 +++ b/drivers/net/bonding/bond_main.c Thu Oct 30 10:45:02 2003 @@ -3047,6 +3047,10 @@ static int bond_ioctl(struct net_device case SIOCBONDRELEASE: ret = bond_release(master_dev, slave_dev); break; + case BOND_SETHWADDR_OLD: + case SIOCBONDSETHWADDR: + res = bond_sethwaddr(bond_dev, slave_dev); + break; case BOND_CHANGE_ACTIVE_OLD: case SIOCBONDCHANGEACTIVE: if (USES_PRIMARY(bond_mode)) { From akpm@osdl.org Thu Oct 30 01:37:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 01:38:09 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9U9bU25023125 for ; Thu, 30 Oct 2003 01:37:30 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h9U9bDC12062; Thu, 30 Oct 2003 01:37:13 -0800 Date: Thu, 30 Oct 2003 01:39:04 -0800 From: Andrew Morton To: "Alexander V. Lukyanov" Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.6.0-test9: access beyond end of device Message-Id: <20031030013904.6acaefe3.akpm@osdl.org> In-Reply-To: <20031030092248.GA7649@swing.yars.free.net> References: <20031029101240.GA12958@night.netis.priv> <20031029124003.4510bb1d.akpm@osdl.org> <20031030092248.GA7649@swing.yars.free.net> X-Mailer: Sylpheed version 0.9.4 (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: 1120 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev "Alexander V. Lukyanov" wrote: > > On Wed, Oct 29, 2003 at 12:40:03PM -0800, Andrew Morton wrote: > > > heavily loaded squid server with two ext3 filesystems for cache on > > > two IC35L040AVVN07-0 40GiB hard disks (ibm), TCQ enabled. > > > > Please force an fsck against those partitions, then see if it is repeatable > > with TCQ disabled. > > Ok, without TCQ it worked a little longer, but produced another error. > Now it can be related to network interface configuration: it has two > 100Mb ethernets, one of which has mtu 576. kernel 2.4.22 used to produce > warning "sending pkt_too_big to myself" from time to time. > Congratulations, you broke the 2.6 networking code! Please send a full report, including your .config and a description of how you have set everything up to netdev@oss.sgi.com. Is it repeatable? Oct 30 11:41:52 mars kernel: BUG: dst underflow 0: c01d15f1 Oct 30 11:41:52 mars kernel: recvmsg bug: copied F7C6B8D0 seq F7C6BE78 Oct 30 11:41:52 mars last message repeated 31 times Oct 30 11:41:52 mars kernel: KERNEL: assertion (!sk->sk_forward_alloc) Oct 30 11:41:52 mars kernel: recvmsg bug: copied F7C6B8D0 seq F7C6BE78 Oct 30 11:41:52 mars last message repeated 4 times Oct 30 11:41:52 mars Oct 30 11:41:52 Oct 30 11:41:52 mars E Oct 30 11:41:52 mars kernel: KERNEL: assertion (!atomic_read(&sk->sk_rmem_alloc)) failed at net/ipv4/af_inet.c (154) Oct 30 11:41:52 mars kernel: KERNEL: assertion (!sk->sk_forward_alloc) failed at net/ipv4/af_inet.c (157) Oct 30 11:42:00 mars kernel: process `named' is using obsolete setsockopt SO_BSDCOMPAT Oct 30 11:42:21 mars last message repeated 4 times Oct 30 11:42:23 mars kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1565) Oct 30 11:42:23 mars kernel: recvmsg bug: copied 38B12037 seq 38B1205F Oct 30 11:42:39 mars kernel: process `named' is using obsolete setsockopt SO_BSDCOMPAT Oct 30 11:42:41 mars kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1565) Oct 30 11:42:41 mars kernel: recvmsg bug: copied DEEFC9B5 seq DEEFCA39 Oct 30 11:43:18 mars kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1565) Oct 30 11:43:18 mars kernel: recvmsg bug: copied DEEFC9B5 seq DEEFCA39 Oct 30 11:43:18 mars kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1565) Oct 30 11:43:18 mars kernel: recvmsg bug: copied DEEFC9B5 seq DEEFCA39 ...lots and lots of the same KERNEL and recvmsg messages. Oct 30 11:47:45 mars kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1565) Oct 30 11:47:45 mars kernel: recvmsg bug: copied DEEFC9B5 seq DEEFCA39 Oct 30 11:47:46 mars kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1565) Oct 30 11:47:46 mars kernel: recvmsg bug: copied DEEFC9B5 seq DEEFCA39 Oct 30 11:48:06 mars squid[579]: Squid Parent: child process 582 exited due to signal 11 Oct 30 11:48:06 mars kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1565) Oct 30 11:48:06 mars kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1565) Oct 30 11:48:06 mars kernel: Unable to handle kernel paging request at virtual address 005e1a00 Oct 30 11:48:06 mars kernel: printing eip: Oct 30 11:48:06 mars kernel: c01d14a0 Oct 30 11:48:06 mars kernel: *pde = 00000000 Oct 30 11:48:06 mars kernel: Oops: 0000 [#1] Oct 30 11:48:06 mars kernel: CPU: 0 Oct 30 11:48:06 mars kernel: EIP: 0060:[] Not tainted Oct 30 11:48:06 mars kernel: EFLAGS: 00010207 Oct 30 11:48:06 mars kernel: EIP is at skb_release_data+0x37/0x9f Oct 30 11:48:06 mars kernel: eax: c4e82480 ebx: d022f080 ecx: c4e82480 edx: 005e1a00 Oct 30 11:48:06 mars kernel: esi: 00000000 edi: 00000001 ebp: 00000000 esp: e1163eb0 Oct 30 11:48:06 mars kernel: ds: 007b es: 007b ss: 0068 Oct 30 11:48:06 mars kernel: Process squid (pid: 582, threadinfo=e1162000 task=e0ef26a0) Oct 30 11:48:06 mars kernel: Stack: 00000000 d022f080 dc10cb80 c01d151b d022f080 00000000 00000000 c01d15b6 Oct 30 11:48:06 mars kernel: d022f080 00000000 00000001 dc10cbc4 c01f45f1 d022f080 00000000 266e2ecf Oct 30 11:48:06 mars kernel: 00000000 00000000 e0ef26a0 c01f5434 d9fb0100 00000000 00000000 c39889a4 Oct 30 11:48:06 mars kernel: Call Trace: Oct 30 11:48:06 mars kernel: [] kfree_skbmem+0x13/0x2c Oct 30 11:48:06 mars kernel: [] __kfree_skb+0x82/0xfa Oct 30 11:48:06 mars kernel: [] tcp_close+0x98/0x6eb Oct 30 11:48:06 mars kernel: [] tcp_setsockopt+0xfe/0x68a Oct 30 11:48:06 mars kernel: [] inet_release+0x53/0x61 Oct 30 11:48:06 mars kernel: [] sock_release+0x5d/0x66 Oct 30 11:48:06 mars kernel: [] sock_close+0x36/0x4e Oct 30 11:48:06 mars kernel: [] __fput+0xb3/0xc5 Oct 30 11:48:06 mars kernel: [] filp_close+0x59/0x86 Oct 30 11:48:06 mars kernel: [] sys_close+0x50/0x5f Oct 30 11:48:06 mars kernel: [] sysenter_past_esp+0x52/0x71 Oct 30 11:48:06 mars kernel: Oct 30 11:48:06 mars kernel: Code: 8b 02 a9 00 08 00 00 75 17 8b 42 04 85 c0 74 48 ff 4a 04 0f From an3h0ny@yahoo.fr Thu Oct 30 01:48:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 01:48:46 -0800 (PST) Received: from web11104.mail.yahoo.com (web11104.mail.yahoo.com [216.136.131.151]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9U9mD25023521 for ; Thu, 30 Oct 2003 01:48:13 -0800 Message-ID: <20031030094813.23865.qmail@web11104.mail.yahoo.com> Received: from [195.68.44.148] by web11104.mail.yahoo.com via HTTP; Thu, 30 Oct 2003 10:48:13 CET Date: Thu, 30 Oct 2003 10:48:13 +0100 (CET) From: =?iso-8859-1?q?an7?= Subject: Van's trick To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1121 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: an3h0ny@yahoo.fr Precedence: bulk X-list: netdev hello ! ;) > To _combine_ checksumming and copy to user. User > memory space > is accessible only from process context, moreover, > exactly from context > where read() is made. ok. so packets are put on a device interrupt directly on the socket receive queue (there is the problem to know which socket receive queue choose),we do checksum and copying to the user buffer. This can be done simultaneously because we can access user space memory as we are in process context (read() one). the prequeue simply is an intermediate queue before effectively copying data to the user buffer. (ucopy.prequeue) That solutions improves performance (latency) but breaks TCP IP layering. That is to say, i suppose that while copying to the user buffer, IP and TCP tests are done (not only checksumming,referred in van's post as TCP processing),as the packet comes directly from the device receive queue.. that's interesting. ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From lav@night.yars.free.net Thu Oct 30 03:03:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 03:03:56 -0800 (PST) Received: from fire.yars.free.net (fire.yars.free.net [193.233.48.99]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UB3H25027350 for ; Thu, 30 Oct 2003 03:03:21 -0800 Received: from night.yars.free.net (night.netis.priv [10.0.0.89]) by fire.yars.free.net (8.12.10/8.12.10) with ESMTP id h9UB2xwD012888; Thu, 30 Oct 2003 14:03:00 +0300 (MSK) Received: (from lav@localhost) by night.yars.free.net (8.11.6+Sun/8.11.6) id h9UB2x413700; Thu, 30 Oct 2003 14:02:59 +0300 (MSK) Date: Thu, 30 Oct 2003 14:02:59 +0300 From: "Alexander V. Lukyanov" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.6.0-test9: access beyond end of device Message-ID: <20031030110258.GA13681@night.netis.priv> References: <20031029101240.GA12958@night.netis.priv> <20031029124003.4510bb1d.akpm@osdl.org> <20031030092248.GA7649@swing.yars.free.net> <20031030013904.6acaefe3.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031030013904.6acaefe3.akpm@osdl.org> User-Agent: Mutt/1.4i X-NETIS-MailScanner-Information: Please contact NETIS Telecom for more information (+7 0852 797709) X-NETIS-MailScanner: Found to be clean X-NETIS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-7.1, required 5, AWL 0.00, BAYES_20 -2.60, EMAIL_ATTRIBUTION -0.50, IN_REP_TO -0.37, REFERENCES -0.00, REPLY_WITH_QUOTES 0.00, USER_AGENT_MUTT -2.80) X-archive-position: 1122 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lav@netis.ru Precedence: bulk X-list: netdev On Thu, Oct 30, 2003 at 01:39:04AM -0800, Andrew Morton wrote: > Congratulations, you broke the 2.6 networking code! Probably not. I have found a problem in ip_wccp module which I have loaded. It used ip_rcv while netif_rx is the proper function to use. After I have fixed that, linux-2.6.0-test9 works well. Sorry for confusion. I'll report if I find other problems. Thanks! -- Alexander. From evil@g-house.de Thu Oct 30 05:03:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 05:04:26 -0800 (PST) Received: from mail.g-house.de (mail.g-housing.de [62.75.136.201]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UD3o25001299 for ; Thu, 30 Oct 2003 05:03:51 -0800 Received: from da6c7.d.pppool.de ([80.184.166.199] helo=g-house.de) by mail.g-house.de with asmtp (TLSv1:RC4-MD5:128) (Exim 4.20) id 1AFCSo-0000CE-GD for netdev@oss.sgi.com; Thu, 30 Oct 2003 14:03:47 +0100 Message-ID: <3FA10C2E.1000205@g-house.de> Date: Thu, 30 Oct 2003 14:03:42 +0100 From: Christian User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20030924 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: ppc32 lockups with 2.6 (maybe network related) X-Enigmail-Version: 0.81.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1123 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: evil@g-house.de Precedence: bulk X-list: netdev I am not subscribed to netdev@oss.sgi.com, please CC me. i posted to LKML too, but followed an advise better posting to this list. moin, i have problems with my ppc32 (PReP) machine and 2.6.0-test* kernels. since this is some kind of home "server", i did not test any ealier versions, but 2.6.0-test{7|8|9}. all show the same behaviour, somewhere during the bootup, the machine just freezes. i found out, that upon configuring my thernet devices the lockups occur. so, i have 2 network cards, both are working under 2.4 with the 3c59x (eth0) and tulip (eth1, it's an on-board 21140). loading the drivers by using insmod / modprobe succeeds, the driver registers, some messages are printed. e.g. Linux Tulip driver version 1.1.13 (May 11, 2002) PCI: Enabling device 0000:00:04.0 (0000 -> 0003) tulip0: EEPROM default media type Autosense. tulip0: Index #0 - Media AUI (#2) described by a 21140 non-MII (0) block. tulip0: Index #1 - Media MII (#11) described by a 21140 MII PHY (1) block. tulip0: MII transceiver #8 config 3100 status 786b advertising 01e1. eth0: Digital DS21140 Tulip rev 34 at 0x1800, 08:00:3E:29:0B:B6, IRQ 9. or 3c59x: Donald Becker and others. www.scyld.com/network/vortex.html See Documentation/networking/vortex.txt 0000:00:06.0: 3Com PCI 3c905C Tornado at 0x1000. Vers LK1.1.19 00:01:02:f1:83:37, IRQ 11 product code 464a rev 00.13 date 11-12-00 Internal config register is 1800000, transceivers 0xa. 8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate interface. MII transceiver found at address 24, status 782d. Enabling bus-master transmits and whole-frame receives. 0000:00:06.0: scatter/gather enabled. h/w checksums enabled "ifconfig eth0" gives then an unconfigured eth0, ok. but using "ifconfig eth0 192.168.1.1" results in a lockup. no oops printed, no SysReq anymore. i tried with the "tulip" modul first, and could "strace" the ifconfig, until it freezes. http://nerdbynature.de/bits/sheep/network/ifc-tulip.log the 3c59x module however acted somehow differently: upon using "ifconfig eth0 192.168.1.1" the screen filled with strange chars in some pattern, i've never seen before on a linux box (no, i was clean :-)) (ok, the pattern is probably not important, but it's on [1] anyway) then, the system locked up too. as you can see (http://nerdbynature.de/bits/sheep/network/config) i have then compiled some debug options into the kernel, i loaded the 3c59x module with "debug=6". also, i want to say that this is not my first build of a 2.6 kernel, i have a i386 running pretty stable with 2.6 for weeks now; some time ago i used to have an Alpha (AXP) with 2.5.x running 24x7. please let me know, i have forgotten something or where to look further. i will be glad to help with running tests and the like. i don't suspect hw errors here, because both cards are happy working under 2.4. some details about the PrEP machine: [1] http://nerdbynature.de/bits/ Thank you, Christian. -- BOFH excuse #132: SCSI Chain overterminated From mehul.patel@in.ibm.com Thu Oct 30 05:03:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 05:04:36 -0800 (PST) Received: from ausmtp02.au.ibm.com (ausmtp02.au.ibm.com [202.81.18.187]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UD3q25001298 for ; Thu, 30 Oct 2003 05:03:55 -0800 Received: from sd0112e0.au.ibm.com (d23rh903.au.ibm.com [202.81.18.201]) by ausmtp02.au.ibm.com (8.12.10/8.12.9) with ESMTP id h9UD2kTv003676; Fri, 31 Oct 2003 00:02:46 +1100 Received: from d23m0178.in.ibm.com (d23av02.au.ibm.com [9.190.250.243]) by sd0112e0.au.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9UD3bxU120732; Fri, 31 Oct 2003 00:03:38 +1100 To: Olaf Hering Cc: Anil K Prasad , Anil K Prasad , Kaena Freitas , Matthias Fruehauf , olaf@suse.de, netdev@oss.sgi.com, Mehulkumar J Patel MIME-Version: 1.0 Subject: Re: Linux kernel updates and ip_crossover patch X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mehulkumar J Patel Date: Thu, 30 Oct 2003 18:33:57 +0530 X-MIMETrack: Serialize by Router on d23m0178/23/M/IBM(Release 6.0.1 [IBM]|May 16, 2003) at 10/30/2003 18:34:01, Serialize complete at 10/30/2003 18:34:01 Content-Type: multipart/alternative; boundary="=_alternative 004828A165256DCF_=" X-archive-position: 1124 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mehul.patel@in.ibm.com Precedence: bulk X-list: netdev This is a multipart message in MIME format. --=_alternative 004828A165256DCF_= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello All, Any update on this. Basically we need IP CROSSOVER patch to be part of pseries kernel. best regards, Mehul. Olaf Hering 29/09/2003 16:40 =20 To: Kaena Freitas , Mehulkumar J Patel/India/= IBM@IBMIN cc: Mehulkumar J Patel/India/IBM@IBMIN, Matthias Fruehauf ,=20 olaf@suse.de, Anil K Prasad/India/IBM@IBMIN, Daljeet Maini/India/IBM@IBMIN Subject: Re: Linux kernel updates and ip=5Fcrossover patch =20 On Wed, Sep 24, Kaena Freitas wrote: >=20 >=20 >=20 >=20 > Hello Mehul - >=20 > Sorry it has taken me a while to respond. We do not keep any code in=20 CMVC. > All code we get from SuSE is on the ftp3 site along with all the source > RPMs. We do have internel CVS trees, but there is no guarantee that=20 those > trees are current with the code we get from SuSE which is what your team > should be testing. >=20 > As for the htx patch you've provided, I have copied SuSE on this email=20 to > get their comments if it can be part of their distribution. Good morning, did you sent the patch to netdev@oss.sgi.com? What opinion have the network and iptables maintainers about this feature? > (See attached file: hxecom=5Fpatch)forgot to attach the patch. >=20 >=20 > e-mail: mehul.patel@in.ibm.com > IBM Global Services > Bangalore, India. > Tel: 091-80-5094160 >=20 >=20 >=20 > =20 > Mehulkumar J =20 > Patel To: Kaena=20 Freitas/Austin/IBM=20 > cc: Anil K=20 Prasad/India/IBM@IBMIN, Daljeet=20 > 23/09/2003 18:38 Maini/India/IBM@IBMIN = =20 > Please respond to From: Mehulkumar J=20 Patel/India/IBM@IBMIN=20 > Subject: Linux kernel=20 updates and ip=5Fcrossover patch=20 > =20 > =20 > =20 >=20 >=20 >=20 > Hi, >=20 > We are HTX Team. > We get affected by changes in Linux kernel in a way where we have to=20 update > our build environment > continuously. As of now we are doing so manually. But considering the > effort we are thinking of making > it automated. >=20 > Can you please tell us if there is a fixed place from where we can sync > Linux kernel sources through > scripts. Or do you put Linux kernel sources in cmvc or any other version > control system. >=20 > Also, we have an exerciser named "hxecom" which requires an external=20 patch, > ip=5Fcrossover for hxecom > to work in single system test. > This patch helps us in sending packets destined to IP address on the=20 same > machine without looping > back at IP layer. Packet actually goes out to hardware and thus we are=20 able > to stress network cards. > For this patch to work, kernel should have been compiled with netfilter. > If netfilter is not enabled and ip=5Fcrossover patch is not applied, we=20 end > up recompiling the whole > stuff and need to copy kernel and /lib/modules on all the test machines, > which is bit ugly. > Can you please include these two request from us in all p-series kernels = ? >=20 > I am attaching the patch here. >=20 > best regards, > Mehul. > e-mail: mehul.patel@in.ibm.com > IBM Global Services > Bangalore, India. > Tel: 091-80-5094160 >=20 >=20 >=20 --=20 USB is for mice, FireWire is for men! sUse lINUX ag, n=DCRNBERG --=_alternative 004828A165256DCF_= Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello All,

Any update on this.

Basically we need IP CROSSOVER patch= to be part of pseries kernel.

best regards,
Mehul.


Olaf Hering <olh@suse.de>

29/09/2003 16:40

       
        To: &nbs= p;      Kaena Freitas <kaena@us.ibm.com>, Mehulkumar J= Patel/India/IBM@IBMIN
        cc: &nbs= p;      Mehulkumar J Patel/India/IBM@IBMIN, Matthias Fruehau= f <mfrueh@suse.de>, olaf@suse.de, Anil K Prasad/India/IBM@IBMIN, Dalj= eet Maini/India/IBM@IBMIN
        Subject:=        Re: Linux kernel updates and ip=5Fcrossover pat= ch

       


 On Wed, Sep 24, Kaena Freitas= wrote:

>
>
>
>
> Hello Mehul -
>
> Sorry it has taken me a while to respond. We do not keep any code in C= MVC.
> All code we get from SuSE is on the ftp3 site along with all the sourc= e
> RPMs. We do have internel CVS trees, but there is no guarantee that th= ose
> trees are current with the code we get from SuSE which is what your te= am
> should be testing.
>
> As for the htx patch you've provided, I have copied SuSE on this email= to
> get their comments if it can be part of their distribution.

Good morning,

did you sent the patch to netdev@oss.sgi.com?
What opinion have the network and iptables maintainers about this feature?<= br>

> (See attached file: hxecom=5Fpatch)forgot to attach the patch.
>
>
> e-mail: mehul.patel@in.ibm.com
> IBM Global Services
> Bangalore, India.
> Tel: 091-80-5094160
>
>
>
>                     =                      = ;                     &nb= sp;                     &= nbsp;                    =          
>                     =   Mehulkumar J                =                     &nbs= p;                     &n= bsp;                     =
>                     =   Patel                  =  To:       Kaena Freitas/Austin/IBM     &nbs= p;                     &n= bsp;      
>                     =                      = ;      cc:       Anil K Prasad/India/IBM@IBMI= N, Daljeet                   &= nbsp;

>         &n= bsp;             23/09/2003 18:38   &nbs= p;      Maini/India/IBM@IBMIN         &n= bsp;                     =                
>                     =   Please respond to        From:     Meh= ulkumar J Patel/India/IBM@IBMIN             &= nbsp;          
>                     =                      = ;      Subject:  Linux kernel updates and ip=5Fcrossove= r patch              
>                     =                      = ;                     &nb= sp;                     &= nbsp;                    =          
>                     =                      = ;                     &nb= sp;                     &= nbsp;                    =          
>                     =                      = ;                     &nb= sp;                     &= nbsp;                    =          
>
>
>
> Hi,
>
> We are HTX Team.
> We get affected by changes in Linux kernel in a way where we have to u= pdate
> our build environment
> continuously. As of now we are doing so manually. But considering the<= br> > effort we are thinking of making
> it automated.
>
> Can you please tell us if there is a fixed place from where we can syn= c
> Linux kernel sources through
> scripts. Or do you put Linux kernel sources in cmvc or any other versi= on
> control system.
>
> Also, we have an exerciser named "hxecom" which requires an = external patch,
> ip=5Fcrossover for hxecom
>  to work in single system test.
> This patch helps us in sending packets destined to IP address on the s= ame
> machine without looping
> back at IP layer. Packet actually goes out to hardware and thus we are= able
> to stress network cards.
> For this patch to work, kernel should have been compiled with netfilte= r.
> If netfilter is not enabled and ip=5Fcrossover patch is not applied, w= e end
> up recompiling the whole
> stuff and need to copy kernel and /lib/modules on all the test machine= s,
> which is bit ugly.
> Can you please include these two request from us in all p-series kerne= ls ?
>
> I am attaching the patch here.
>
> best regards,
> Mehul.
> e-mail: mehul.patel@in.ibm.com
> IBM Global Services
> Bangalore, India.
> Tel: 091-80-5094160
>
>
>



--
USB is for mice, FireWire is for men!

sUse lINUX ag, n=DCRNBERG


--=_alternative 004828A165256DCF_=-- From mfrueh@suse.de Thu Oct 30 05:16:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 05:17:19 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UDGa25002072 for ; Thu, 30 Oct 2003 05:16:37 -0800 Received: from Hermes.suse.de (Hermes.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 AB641177199F; Thu, 30 Oct 2003 14:16:30 +0100 (CET) Received: by blueberry.suse.de (Postfix, from userid 11992) id CB8FB9EE17; Thu, 30 Oct 2003 14:16:29 +0100 (CET) Date: Thu, 30 Oct 2003 14:16:29 +0100 From: Matthias Fruehauf To: Mehulkumar J Patel Cc: Olaf Hering , Anil K Prasad , Kaena Freitas , olaf@suse.de, netdev@oss.sgi.com Subject: Re: Linux kernel updates and ip_crossover patch Message-ID: <20031030131628.GL17431@suse.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4i X-archive-position: 1125 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mfrueh@suse.de Precedence: bulk X-list: netdev On Thu, Oct 30, Mehulkumar J Patel wrote: > > Hello All, > > Any update on this. > > Basically we need IP CROSSOVER patch to be part of pseries kernel. Well, I am not completly sure what we are talking about here ... ;-) The usuall way if someone wants features to become part of the kernel is via the community, in this case via the network guys as Olaf suggested or if it is a plattform specific thing via the plattform maintainer, which is David Engebretsen for example for PPC at IBM. In case that there is for some reason no solution going this path, IBM has the possibility to request features from SuSE via the brands and via the LTC. This is organized by Mark VanderWiele . To be more specific: For 2.4 kernel the door is allready closed since some weeks. In case you would like to see this patch in an upcoming SLES 9 and a 2.6 kernel, get in contact with Dave and Mark. Hope this helps for the moment. > best regards, > Mehul. > Best regards, Matthias Frühauf > > Olaf Hering > To: Kaena Freitas , Mehulkumar > J Patel/India/IBM@IBMIN > 29/09/2003 cc: Mehulkumar J Patel/India/IBM@IBMIN, Matthias > 16:40 Fruehauf , olaf@suse.de, Anil K Prasad/India/ > IBM@IBMIN, Daljeet Maini/India/IBM@IBMIN > Subject: Re: Linux kernel updates and > ip_crossover patch > > > > > > On Wed, Sep 24, Kaena Freitas wrote: > > > > > > > > > > > Hello Mehul - > > > > Sorry it has taken me a while to respond. We do not keep any code in CMVC. > > All code we get from SuSE is on the ftp3 site along with all the source > > RPMs. We do have internel CVS trees, but there is no guarantee that those > > trees are current with the code we get from SuSE which is what your team > > should be testing. > > > > As for the htx patch you've provided, I have copied SuSE on this email to > > get their comments if it can be part of their distribution. > > Good morning, > > did you sent the patch to netdev@oss.sgi.com? > What opinion have the network and iptables maintainers about this feature? > > > > (See attached file: hxecom_patch)forgot to attach the patch. > > > > > > e-mail: mehul.patel@in.ibm.com > > IBM Global Services > > Bangalore, India. > > Tel: 091-80-5094160 > > > > > > > > > > > Mehulkumar J > > > Patel To: Kaena Freitas/Austin > /IBM > > cc: Anil K Prasad/India/ > IBM@IBMIN, Daljeet > > 23/09/2003 18:38 Maini/India/IBM@IBMIN > > > Please respond to From: Mehulkumar J Patel/ > India/IBM@IBMIN > > Subject: Linux kernel updates > and ip_crossover patch > > > > > > > > > > > > > > > > > Hi, > > > > We are HTX Team. > > We get affected by changes in Linux kernel in a way where we have to update > > our build environment > > continuously. As of now we are doing so manually. But considering the > > effort we are thinking of making > > it automated. > > > > Can you please tell us if there is a fixed place from where we can sync > > Linux kernel sources through > > scripts. Or do you put Linux kernel sources in cmvc or any other version > > control system. > > > > Also, we have an exerciser named "hxecom" which requires an external patch, > > ip_crossover for hxecom > > to work in single system test. > > This patch helps us in sending packets destined to IP address on the same > > machine without looping > > back at IP layer. Packet actually goes out to hardware and thus we are able > > to stress network cards. > > For this patch to work, kernel should have been compiled with netfilter. > > If netfilter is not enabled and ip_crossover patch is not applied, we end > > up recompiling the whole > > stuff and need to copy kernel and /lib/modules on all the test machines, > > which is bit ugly. > > Can you please include these two request from us in all p-series kernels ? > > > > I am attaching the patch here. > > > > best regards, > > Mehul. > > e-mail: mehul.patel@in.ibm.com > > IBM Global Services > > Bangalore, India. > > Tel: 091-80-5094160 > > > > > > > > > > -- > USB is for mice, FireWire is for men! > > sUse lINUX ag, nÜRNBERG > > -- Matthias Frühauf Member of the spicy SuSE Linux PPC Team ------------------------------------------------------------ SuSE AG, Tel: +49-911-74053-658 Deutschherrnstr. 15-19, Fax: +49-911-74053-483 90429 Nuernberg Germany --- Peace, Love and Linux --- From daniel.blueman@gmx.net Thu Oct 30 08:10:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 08:11:06 -0800 (PST) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UGAV25006354 for ; Thu, 30 Oct 2003 08:10:32 -0800 Received: (qmail 12060 invoked by uid 0); 30 Oct 2003 16:10:25 -0000 Received: from 194.202.174.105 by www3.gmx.net with HTTP; Thu, 30 Oct 2003 17:10:25 +0100 (MET) Date: Thu, 30 Oct 2003 17:10:25 +0100 (MET) From: "Daniel Blueman" To: netdev@oss.sgi.com, linux-net@vger.kernel.org, devik@cdi.cz, linux-kernel@vger.kernel.org MIME-Version: 1.0 Subject: [2.6.0-test9] QoS HTB crash... X-Priority: 3 (Normal) X-Authenticated: #8973862 Message-ID: <26412.1067530225@www3.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-archive-position: 1126 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: daniel.blueman@gmx.net Precedence: bulk X-list: netdev With the LARTC 'wondershaper' HTB script [1] for good latency over ADSL, I get an oops [3] when sending traffic via ppp0 (and when bringing the interface down). Kernel is 2.6.0-test9 and 'debug 3333333' appended to the 'tc' command, to show HTB debug information [2] (not shown in [1]). Please CC me when replying, and I can provide further details, debugging, testing etc...this problem has been around for a while it seems. --- [1] (relevant lines from http://lartc.org/wondershaper/) tc qdisc add dev ppp0 root handle 1: htb default 20 tc class add dev ppp0 parent 1: classid 1:1 htb rate 210kbit burst 6k tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 210kbit burst 6k prio 1 tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 189kbit burst 6k prio 2 tc class add dev ppp0 parent 1:1 classid 1:30 htb rate 168kbit burst 6k prio 2 --- [2] (HTB debug messages) HTB init, kernel part version 3.13 htb_init sch=dc28e7f8 handle=10000 r2q=10 htb_dump sch=dc28e7f8, handle=10000 htb*g j=179519 lj=0 htb*r7 m=0 htb*r6 m=0 htb*r5 m=0 htb*r4 m=0 htb*r3 m=0 htb*r2 m=0 htb*r1 m=0 htb*r0 m=0 htb_get clid=10010 q=dc28e86c cl=00000000 ref=0 htb_get clid=10010 q=dc28e86c cl=00000000 ref=0 htb_get clid=10020 q=dc28e86c cl=00000000 ref=0 htb_get clid=10020 q=dc28e86c cl=00000000 ref=0 htb_get clid=10030 q=dc28e86c cl=00000000 ref=0 htb_get clid=10030 q=dc28e86c cl=00000000 ref=0 htb_tcf q=dc28e86c clid=0 fref=0 fl=00000000 htb_bind q=dc28e86c clid=10010 cl=00000000 fref=0 htb_tcf q=dc28e86c clid=0 fref=1 fl=df4ecd7c htb_bind q=dc28e86c clid=10010 cl=00000000 fref=1 htb_tcf q=dc28e86c clid=0 fref=2 fl=df4ecd7c htb_bind q=dc28e86c clid=10010 cl=00000000 fref=2 htb_tcf q=dc28e86c clid=0 fref=3 fl=df4ecd7c htb_bind q=dc28e86c clid=10020 cl=00000000 fref=3 htb_reset sch=dc28e7f8, handle=10000 --- [3] (ksymoops-processed oops report) Oops: 0000 [#1] CPU: 0 EIP: 0060:[] Not tainted >>EIP; c02cbbad <===== >>ebx; ffffffff <__kernel_rt_sigreturn+1bbf/????> >>ecx; dc28e86c <_end+1be20f60/3fb906f4> >>esi; d9cf3f50 <_end+19886644/3fb906f4> >>edi; dc28e7f8 <_end+1be20eec/3fb906f4> >>ebp; dbef5ab8 <_end+1ba881ac/3fb906f4> >>esp; dbef5a9c <_end+1ba88190/3fb906f4> Trace; c02b3570 Trace; c02e9c98 Trace; c02e9d97 Trace; c02c0259 Trace; c02e9c98 Trace; c02e76d7 Trace; c02e9c98 Trace; c02bff12 Trace; c02e9c80 Trace; c02c0259 Trace; c02e9c6b Trace; c02e9620 Trace; c02e9c6b Trace; c030da69 Trace; c030e1b4 Trace; c031900a Trace; c02aa4cc Trace; c02aa582 Trace; c02a9f68 Trace; c02b01a0 Trace; c02ac13d Trace; c0141e28 Trace; c0155610 Trace; c0155c54 Trace; c018becd Trace; c0119419 Trace; c02ac67e Trace; c0164327 Trace; c010a3eb Code; c02cbbad 00000000 <_EIP>: Code; c02cbbad <===== 0: 8b 43 04 mov 0x4(%ebx),%eax <===== Code; c02cbbb0 3: 89 44 24 04 mov %eax,0x4(%esp,1) Code; c02cbbb4 7: c7 04 24 2b 30 38 c0 movl $0xc038302b,(%esp,1) Code; c02cbbbb e: e8 e3 6e e5 ff call ffe56ef6 <_EIP+0xffe56ef6> Code; c02cbbc0 13: 31 00 xor %eax,(%eax) <0>Kernel panic: Fatal exception in interrupt -- Daniel J Blueman NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ From fubar@us.ibm.com Thu Oct 30 09:13:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 09:13:55 -0800 (PST) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.104]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UHDM25021492 for ; Thu, 30 Oct 2003 09:13:22 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e4.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9UHCZhn584062; Thu, 30 Oct 2003 12:12:35 -0500 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9UHCVcV221804; Thu, 30 Oct 2003 12:12:33 -0500 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h9UHCJNI014973; Thu, 30 Oct 2003 09:12:20 -0800 Message-Id: <200310301712.h9UHCJNI014973@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: Amir Noam cc: "Jeff Garzik" , davem@redhat.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] Re: [PATCH 2/10] [bonding 2.6] fix monitoring functions In-Reply-To: Message from Amir Noam of "Thu, 30 Oct 2003 10:56:07 +0200." <200310301056.07221.amir.noam@intel.com> Date: Thu, 30 Oct 2003 09:12:18 -0800 From: Jay Vosburgh X-archive-position: 1128 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev >However, the following patch that restores backward compatibility with >old ifenslave is still needed for 2.6. I see that it's already been >applied by David Miller to 2.4. I thought we were dropping the ancient (SIOCDEVPRIVATE) backwards compatibility in 2.6. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From hirofumi@mail.parknet.co.jp Thu Oct 30 09:13:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 09:13:40 -0800 (PST) Received: from mail.parknet.co.jp (mail.parknet.co.jp [210.171.160.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UHD325021487 for ; Thu, 30 Oct 2003 09:13:04 -0800 Received: from ibmpc.myhome.or.jp [210.171.161.166] by mail.parknet.co.jp with ESMTP (SMTPD32-4.10) id A55B2F570138; Fri, 31 Oct 2003 02:11:39 +0900 Received: from devron.myhome.or.jp (root@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.12.9/8.12.9/Debian-5) with ESMTP id h9UHCkXB003326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 31 Oct 2003 02:12:47 +0900 Received: from devron.myhome.or.jp (hirofumi@localhost [127.0.0.1]) by devron.myhome.or.jp (8.12.9/8.12.9/Debian-5) with ESMTP id h9UHCj1g032587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 31 Oct 2003 02:12:45 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.12.9/8.12.9/Debian-5) id h9UHCfHd032583; Fri, 31 Oct 2003 02:12:41 +0900 To: Jeff Garzik Cc: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [PATCH] Updated 8139too with NAPI References: <3F9070B6.9090306@pobox.com> <873cdqbt6z.fsf@devron.myhome.or.jp> <20031020131106.6862e951.shemminger@osdl.org> <877k2ysohc.fsf@devron.myhome.or.jp> <20031028114707.1d234da6.shemminger@osdl.org> <3FA01629.2080202@pobox.com> From: OGAWA Hirofumi Date: Fri, 31 Oct 2003 02:12:41 +0900 In-Reply-To: <3FA01629.2080202@pobox.com> Message-ID: <873cdaabue.fsf@devron.myhome.or.jp> Lines: 52 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 1127 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hirofumi@mail.parknet.co.jp Precedence: bulk X-list: netdev Jeff Garzik writes: > I'd like to apply this to net-drivers-2.[45]-exp, but it doesn't apply > cleanly. Can you wait a bit, for my posting of those queues, and then > resend? Probably more tester/reviewer is always welcome, so I think it's good. Stephen Hemminger writes: > + /* Receive packets are processed by poll routine. > + If not running start it now. */ > + if (status & RxAckBits){ > + if (netif_rx_schedule_prep(dev)) { > + RTL_W16_F (IntrMask, rtl8139_norx_intr_mask); > + __netif_rx_schedule (dev); > } I think that this style is common issues of NIC drivers for "NAPI support and intr-mask" handling. Looks like __netif_poll_disable() also has the following problem. For example, in ISR [...] if (status & RxAckBits){ if (netif_rx_schedule_prep(dev)) { RTL_W16_F (IntrMask, rtl8139_norx_intr_mask); __netif_rx_schedule (dev); } } [...] in dev_close() [...] while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) { /* No hurry. */ current->state = TASK_INTERRUPTIBLE; schedule_timeout(1); } --------- (*) if (dev->stop) dev->stop(dev); [...] If Rx interrupt happen on (*) point, ISR can't ack or disable. Then it will start busy Rx interrupt loop. So if this happen, it's seriously problem on UP system. -- OGAWA Hirofumi From davem@pizda.ninka.net Thu Oct 30 10:00:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 10:01:09 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UI0925022996 for ; Thu, 30 Oct 2003 10:00:30 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA16627; Thu, 30 Oct 2003 09:53:12 -0800 Date: Thu, 30 Oct 2003 09:53:12 -0800 From: "David S. Miller" To: Mehulkumar J Patel Cc: olh@suse.de, aprasad@in.ibm.com, kaena@us.ibm.com, mfrueh@suse.de, olaf@suse.de, netdev@oss.sgi.com, mehul.patel@in.ibm.com Subject: Re: Linux kernel updates and ip_crossover patch Message-Id: <20031030095312.6ef82ff7.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1129 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 On Thu, 30 Oct 2003 18:33:57 +0530 Mehulkumar J Patel wrote: > Basically we need IP CROSSOVER patch to be part of pseries kernel. This is not how the Linux community works. You don't say "hey, we _NEED_ this" and like magic it gets added to the Linux kernel. Rather, it gets added because someone submits it and the community sees a need for the feature. As networking maintainer what I see is that this feature is needed by and used by only a very small group of people for very specialized purposes. Therefore there is no urgency to add this to the kernel sources any time soon. You can continue whining, complaining about how much you personally _NEED_ the ip_crossover patch, but that isn't going to help you arrive at your goal. Rather you should spend time explaining to the community what value it gives to them and why it would be useful to anything other than very specialized cases and uses. From jleu@mindspring.com Thu Oct 30 10:17:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 10:18:17 -0800 (PST) Received: from localhost.localdomain (jleu-laptop.dhcp.internetnoc.com [209.249.160.113]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UIHg25023512 for ; Thu, 30 Oct 2003 10:17:43 -0800 Received: from localhost.localdomain (jleu-laptop [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h9UIHVeT001532; Thu, 30 Oct 2003 12:17:31 -0600 Received: (from jleu@localhost) by localhost.localdomain (8.12.8/8.12.8/Submit) id h9UIHUNu001530; Thu, 30 Oct 2003 12:17:30 -0600 X-Authentication-Warning: localhost.localdomain: jleu set sender to jleu@mindspring.com using -f Date: Thu, 30 Oct 2003 12:17:30 -0600 From: "James R. Leu" To: netdev@oss.sgi.com Cc: Mehulkumar J Patel , olh@suse.de, aprasad@in.ibm.com, kaena@us.ibm.com, mfrueh@suse.de, olaf@suse.de, davem@redhat.com Subject: Re: Linux kernel updates and ip_crossover patch Message-ID: <20031030181654.GA1474@mindspring.com> Reply-To: jleu@mindspring.com References: <20031030095312.6ef82ff7.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031030095312.6ef82ff7.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 1130 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jleu@mindspring.com Precedence: bulk X-list: netdev I agree with David that this patch has a very narrow scope. I think a more generic solution for a virtualized IP stack would be used by many more people, and still solve this specific problem. I have a patch for 'virtualizing' the IPv4 stack for the 2.4 kernel series. I'm working on porting it to the 2.6 kernels and adding the same functionality for IPv6. If you're interested in checking out the 2.4 kernel patch you can get the latest stable version from http://linux-vrf.sf.net/ That page also descibes howto get the most recent version from my development tree. -- James R. Leu jleu@mindspring.com On Thu, Oct 30, 2003 at 09:53:12AM -0800, David S. Miller wrote: > On Thu, 30 Oct 2003 18:33:57 +0530 > Mehulkumar J Patel wrote: > > > Basically we need IP CROSSOVER patch to be part of pseries kernel. > > This is not how the Linux community works. You don't say "hey, we > _NEED_ this" and like magic it gets added to the Linux kernel. > > Rather, it gets added because someone submits it and the community > sees a need for the feature. > > As networking maintainer what I see is that this feature is needed by > and used by only a very small group of people for very specialized > purposes. Therefore there is no urgency to add this to the kernel > sources any time soon. > > You can continue whining, complaining about how much you personally > _NEED_ the ip_crossover patch, but that isn't going to help you > arrive at your goal. Rather you should spend time explaining to > the community what value it gives to them and why it would be useful > to anything other than very specialized cases and uses. From pekkas@netcore.fi Thu Oct 30 11:09:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 11:09:48 -0800 (PST) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UJ9B25024272 for ; Thu, 30 Oct 2003 11:09:13 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h9UJ93S22855 for ; Thu, 30 Oct 2003 21:09:04 +0200 Date: Thu, 30 Oct 2003 21:09:03 +0200 (EET) From: Pekka Savola To: netdev@oss.sgi.com Subject: IPv6 on-link assumption considered harmful Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: X-archive-position: 1131 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev FYI, IPv6 Neighbor Discovery installs default routes on every interface with a high metric, i.e., if no other way to know how to treat the packet, it's assumed to be "on-link". This causes a number of problems, especially if you have enabled IPv6 but don't have IPv6 connectivity yet. This "feature" will likely be removed from Neighbor Discovery in its revision. Just to give a heads-up before this is finalized, to give people ability to prepare or comment prior to this process is formalized in the IETF. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings ---------- Forwarded message ---------- Date: Thu, 23 Oct 2003 09:30:54 -0400 From: Internet-Drafts@ietf.org To: IETF-Announce: ; Cc: v6ops@ops.ietf.org Subject: I-D ACTION:draft-ietf-v6ops-onlinkassumption-00.txt A New Internet-Draft is available from the on-line Internet-Drafts directories. This draft is a work item of the IPv6 Operations Working Group of the IETF. Title : IPv6 Neighbor Discovery On-Link Assumption Considered Harmful Author(s) : S. Roy, et. al. Filename : draft-ietf-v6ops-onlinkassumption-00.txt Pages : 11 Date : 2003-10-22 This document proposes a change to the IPv6 Neighbor Discovery conceptual host sending algorithm. According to the algorithm, when a host's default router list is empty, the host assumes that all destinations are on-link. This document describes how making this assumption causes problems, and describes how these problems outweigh the benefits of this part of the conceptual sending algorithm. A URL for this Internet-Draft is: http://www.ietf.org/internet-drafts/draft-ietf-v6ops-onlinkassumption-00.txt To remove yourself from the IETF Announcement list, send a message to ietf-announce-request with the word unsubscribe in the body of the message. Internet-Drafts are also available by anonymous FTP. Login with the username "anonymous" and a password of your e-mail address. After logging in, type "cd internet-drafts" and then "get draft-ietf-v6ops-onlinkassumption-00.txt". A list of Internet-Drafts directories can be found in http://www.ietf.org/shadow.html or ftp://ftp.ietf.org/ietf/1shadow-sites.txt Internet-Drafts can also be obtained by e-mail. Send a message to: mailserv@ietf.org. In the body type: "FILE /internet-drafts/draft-ietf-v6ops-onlinkassumption-00.txt". NOTE: The mail server at ietf.org can return the document in MIME-encoded form by using the "mpack" utility. To use this feature, insert the command "ENCODING mime" before the "FILE" command. To decode the response(s), you will need "munpack" or a MIME-compliant mail reader. Different MIME-compliant mail readers exhibit different behavior, especially when dealing with "multipart" MIME messages (i.e. documents which have been split up into multiple messages), so check your local documentation on how to manipulate these messages. Below is the data which will enable a MIME compliant mail reader implementation to automatically retrieve the ASCII version of the Internet-Draft. From cfriesen@nortelnetworks.com Thu Oct 30 11:59:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 12:00:21 -0800 (PST) Received: from zcars04f.nortelnetworks.com (zcars04f.nortelnetworks.com [47.129.242.57]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UJxg25024941 for ; Thu, 30 Oct 2003 11:59:43 -0800 Received: from zcard307.ca.nortel.com (americasm07.nt.com [47.129.242.67]) by zcars04f.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id h9UJxZM21034; Thu, 30 Oct 2003 14:59:35 -0500 (EST) Received: from zcard0k6.ca.nortel.com ([47.129.242.158]) by zcard307.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id VZTY4K53; Thu, 30 Oct 2003 14:59:35 -0500 Received: from pcard0ks.ca.nortel.com ([47.129.117.131]) by zcard0k6.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id V8PGYLDG; Thu, 30 Oct 2003 14:59:36 -0500 Received: from nortelnetworks.com (localhost.localdomain [127.0.0.1]) by pcard0ks.ca.nortel.com (Postfix) with ESMTP id 612FB2E14A; Thu, 30 Oct 2003 14:59:34 -0500 (EST) Message-ID: <3FA16DA6.9090707@nortelnetworks.com> Date: Thu, 30 Oct 2003 14:59:34 -0500 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: issues with SO_PRIORITY and IP_TOS Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1132 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've been doing some experimenting with both of the options mentioned in the subject line, and it seems that there is some strangeness in the current handling. First, setting IP_TOS sets the whole 8 bits of the tos field in the packet header. However, the code then uses the 4 bits defined as the tos field to generate the packet priority value. This is bad for two reasons. Firstly, if we're using the old bit fields it should be the precedence bits that are used for the skb priority rather than the tos field. Secondly, the whole precedence/tos thing has been obsoleted by the 6-bit DSCP field, of which the first 3 bits are supposed to be backwards compatible with the old precedence field. Shouldn't we properly handle that? Secondly, for vlan priority tagging there are only 3 bits available. This means that practically speaking anyone using vlan priorities needs to limit themselves to priorities 0-7. Currently, for me to send a packet with IP precedence bits set to a nonzero value *and* vlan priority set to the same value, I have to do the following: int opt = PRIORITY << 5; setsockopt(mysocks[i], SOL_IP, IP_TOS, &opt, sizeof(opt)); opt = PRIORITY; setsockopt(mysocks[i], SOL_SOCKET, SO_PRIORITY, &opt, sizeof(opt)); The first call sets the IP precedence bits, and also incorrectly sets the socket priority. The second call sets the proper socket priority so that the vlan egress mapping works properly. This is kind of ugly. I propose adding a new IP socket option, IP_DSCP, which would let you set the 6-bit DSCP value (which is then shifted by two bits in the kernel to generate the 8-bit value for the header field). The high-order 3 bits would then be automatically used to set the socket priority to make a vlan egress mapping simple. Does this make any sense? Chris -- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com From devik@cdi.cz Thu Oct 30 12:08:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 12:08:46 -0800 (PST) Received: from www1.cdi.cz (www1.cdi.cz [194.213.194.49]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UK8825025452 for ; Thu, 30 Oct 2003 12:08:09 -0800 Received: from gprs194-125.eurotel.cz ([160.218.194.125] helo=devix) by www1.cdi.cz with asmtp (Exim 3.34 #3) id 1AFJ5O-0000qM-00; Thu, 30 Oct 2003 21:08:04 +0100 Received: from devik (helo=localhost) by devix with local-esmtp (Exim 3.16 #8) id 1AFIoC-0005eY-00; Thu, 30 Oct 2003 20:50:16 +0100 Date: Thu, 30 Oct 2003 20:50:16 +0100 (CET) From: devik X-X-Sender: To: Daniel Blueman cc: , , Subject: Re: [2.6.0-test9] QoS HTB crash... In-Reply-To: <26412.1067530225@www3.gmx.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-2 X-CDI: passed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by oss.sgi.com id h9UK8825025452 X-archive-position: 1133 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: devik@cdi.cz Precedence: bulk X-list: netdev Hi, thanks for the report. I know that there is an issue regarding HTB in 2.6.x. Please send me net/sched/sch_htb.o, net/sched/sch_htb.c (just to be sure) and be sure that you build the kernel with debugging symbols (see debugging section of menuconfig/xconfig). thanks, ------------------------------- Martin Devera aka devik Linux kernel QoS/HTB maintainer http://luxik.cdi.cz/~devik/ On Thu, 30 Oct 2003, Daniel Blueman wrote: > With the LARTC 'wondershaper' HTB script [1] for good latency over ADSL, I > get an oops [3] when sending traffic via ppp0 (and when bringing the interface > down). > > Kernel is 2.6.0-test9 and 'debug 3333333' appended to the 'tc' command, to > show HTB debug information [2] (not shown in [1]). > > Please CC me when replying, and I can provide further details, debugging, > testing etc...this problem has been around for a while it seems. > > --- [1] (relevant lines from http://lartc.org/wondershaper/) > > tc qdisc add dev ppp0 root handle 1: htb default 20 > tc class add dev ppp0 parent 1: classid 1:1 htb rate 210kbit burst 6k > tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 210kbit burst 6k prio > 1 > tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 189kbit burst 6k prio > 2 > tc class add dev ppp0 parent 1:1 classid 1:30 htb rate 168kbit burst 6k prio > 2 > > --- [2] (HTB debug messages) > > HTB init, kernel part version 3.13 > htb_init sch=dc28e7f8 handle=10000 r2q=10 > htb_dump sch=dc28e7f8, handle=10000 > htb*g j=179519 lj=0 > htb*r7 m=0 > htb*r6 m=0 > htb*r5 m=0 > htb*r4 m=0 > htb*r3 m=0 > htb*r2 m=0 > htb*r1 m=0 > htb*r0 m=0 > htb_get clid=10010 q=dc28e86c cl=00000000 ref=0 > htb_get clid=10010 q=dc28e86c cl=00000000 ref=0 > htb_get clid=10020 q=dc28e86c cl=00000000 ref=0 > htb_get clid=10020 q=dc28e86c cl=00000000 ref=0 > htb_get clid=10030 q=dc28e86c cl=00000000 ref=0 > htb_get clid=10030 q=dc28e86c cl=00000000 ref=0 > htb_tcf q=dc28e86c clid=0 fref=0 fl=00000000 > htb_bind q=dc28e86c clid=10010 cl=00000000 fref=0 > htb_tcf q=dc28e86c clid=0 fref=1 fl=df4ecd7c > htb_bind q=dc28e86c clid=10010 cl=00000000 fref=1 > htb_tcf q=dc28e86c clid=0 fref=2 fl=df4ecd7c > htb_bind q=dc28e86c clid=10010 cl=00000000 fref=2 > htb_tcf q=dc28e86c clid=0 fref=3 fl=df4ecd7c > htb_bind q=dc28e86c clid=10020 cl=00000000 fref=3 > htb_reset sch=dc28e7f8, handle=10000 > > --- [3] (ksymoops-processed oops report) > > Oops: 0000 [#1] > CPU: 0 > EIP: 0060:[] Not tainted > > >>EIP; c02cbbad <===== > > >>ebx; ffffffff <__kernel_rt_sigreturn+1bbf/????> > >>ecx; dc28e86c <_end+1be20f60/3fb906f4> > >>esi; d9cf3f50 <_end+19886644/3fb906f4> > >>edi; dc28e7f8 <_end+1be20eec/3fb906f4> > >>ebp; dbef5ab8 <_end+1ba881ac/3fb906f4> > >>esp; dbef5a9c <_end+1ba88190/3fb906f4> > > Trace; c02b3570 > Trace; c02e9c98 > Trace; c02e9d97 > Trace; c02c0259 > Trace; c02e9c98 > Trace; c02e76d7 > Trace; c02e9c98 > Trace; c02bff12 > Trace; c02e9c80 > Trace; c02c0259 > Trace; c02e9c6b > Trace; c02e9620 > Trace; c02e9c6b > Trace; c030da69 > Trace; c030e1b4 > Trace; c031900a > Trace; c02aa4cc > Trace; c02aa582 > Trace; c02a9f68 > Trace; c02b01a0 > Trace; c02ac13d > Trace; c0141e28 > Trace; c0155610 > Trace; c0155c54 > Trace; c018becd > Trace; c0119419 > Trace; c02ac67e > Trace; c0164327 > Trace; c010a3eb > > Code; c02cbbad > 00000000 <_EIP>: > Code; c02cbbad <===== > 0: 8b 43 04 mov 0x4(%ebx),%eax <===== > Code; c02cbbb0 > 3: 89 44 24 04 mov %eax,0x4(%esp,1) > Code; c02cbbb4 > 7: c7 04 24 2b 30 38 c0 movl $0xc038302b,(%esp,1) > Code; c02cbbbb > e: e8 e3 6e e5 ff call ffe56ef6 <_EIP+0xffe56ef6> > Code; c02cbbc0 > 13: 31 00 xor %eax,(%eax) > > <0>Kernel panic: Fatal exception in interrupt > > -- > Daniel J Blueman > > NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... > Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService > > Jetzt kostenlos anmelden unter http://www.gmx.net > > +++ GMX - die erste Adresse für Mail, Message, More! +++ > > > From shemminger@osdl.org Thu Oct 30 13:00:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 13:01:16 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9UL0f25029228 for ; Thu, 30 Oct 2003 13:00:42 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9UL07C17903; Thu, 30 Oct 2003 13:00:07 -0800 Date: Thu, 30 Oct 2003 13:00:23 -0800 From: Stephen Hemminger To: "David Liontooth" Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] Fix for ipx interface module_get panic. Message-Id: <20031030130023.44bd9b6a.shemminger@osdl.org> In-Reply-To: <20031028040421.98826.qmail@mail.com> References: <20031028040421.98826.qmail@mail.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (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: 1134 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 is the fix for the ipx module_get oops; it has been tested by acme. The problem was that ipx was trying to use module counts to keep from being unloaded when it had bottom half interfaces. And one of these interfaces could be created automatically when packet was received and no sockets open (module ref count was zero). The fix is to get rid of using module ref counts to control this, and instead cleanup the table on module exit. diff -Nru a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c --- a/net/ipx/af_ipx.c Thu Oct 30 12:01:21 2003 +++ b/net/ipx/af_ipx.c Thu Oct 30 12:01:21 2003 @@ -326,7 +326,6 @@ if (intrfc->if_dev) dev_put(intrfc->if_dev); kfree(intrfc); - module_put(THIS_MODULE); } void ipxitf_down(struct ipx_interface *intrfc) @@ -358,6 +357,17 @@ return NOTIFY_DONE; } + +static __exit void ipxitf_cleanup(void) +{ + struct ipx_interface *i, *tmp; + + spin_lock_bh(&ipx_interfaces_lock); + list_for_each_entry_safe(i, tmp, &ipx_interfaces, node) + __ipxitf_put(i); + spin_unlock_bh(&ipx_interfaces_lock); +} + static void ipxitf_def_skb_handler(struct sock *sock, struct sk_buff *skb) { if (sock_queue_rcv_skb(sock, skb) < 0) @@ -888,7 +898,6 @@ INIT_HLIST_HEAD(&intrfc->if_sklist); atomic_set(&intrfc->refcnt, 1); spin_lock_init(&intrfc->if_sklist_lock); - __module_get(THIS_MODULE); } return intrfc; @@ -1979,20 +1988,12 @@ static void __exit ipx_proto_finito(void) { - /* - * No need to worry about having anything on the ipx_interfaces list, - * when a interface is created we increment the module usage count, so - * the module will only be unloaded when there are no more interfaces - */ - if (unlikely(!list_empty(&ipx_interfaces))) - BUG(); - if (unlikely(!list_empty(&ipx_routes))) - BUG(); - ipx_proc_exit(); ipx_unregister_sysctl(); unregister_netdevice_notifier(&ipx_dev_notifier); + + ipxitf_cleanup(); unregister_snap_client(pSNAP_datalink); pSNAP_datalink = NULL; From davem@pizda.ninka.net Thu Oct 30 13:16:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 13:16:45 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9ULGA25000476 for ; Thu, 30 Oct 2003 13:16:11 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA17359; Thu, 30 Oct 2003 13:08:59 -0800 Date: Thu, 30 Oct 2003 13:08:59 -0800 From: "David S. Miller" To: devik Cc: daniel.blueman@gmx.net, netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [2.6.0-test9] QoS HTB crash... Message-Id: <20031030130859.605f856d.davem@redhat.com> In-Reply-To: References: <26412.1067530225@www3.gmx.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1135 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 On Thu, 30 Oct 2003 20:50:16 +0100 (CET) devik wrote: > thanks for the report. I know that there is an issue regarding > HTB in 2.6.x. Please send me net/sched/sch_htb.o, > net/sched/sch_htb.c (just to be sure) and be sure that you > build the kernel with debugging symbols (see debugging section > of menuconfig/xconfig). I think the problem is the changes that were made in 2.5.x to htb_next_rb_node(). It used to be: static void htb_next_rb_node(rb_node_t **n) { rb_node_t *p; if ((*n)->rb_right) { /* child at right. use it or its leftmost ancestor */ *n = (*n)->rb_right; while ((*n)->rb_left) *n = (*n)->rb_left; return; } while ((p = (*n)->rb_parent) != NULL) { /* if we've arrived from left child then we have next node */ if (p->rb_left == *n) break; *n = p; } *n = p; } But it was changed into: static void htb_next_rb_node(struct rb_node **n) { *n = rb_next(*n); } This is wrong, the new code has much different side effects than the original code. This looks like the problem, devik what do you think? From ak@suse.de Thu Oct 30 19:44:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 19:45:05 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9V3iD25001493 for ; Thu, 30 Oct 2003 19:44:14 -0800 Received: from Hermes.suse.de (Hermes.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 999411776804; Fri, 31 Oct 2003 04:16:04 +0100 (CET) Date: Fri, 31 Oct 2003 04:16:02 +0100 From: Andi Kleen To: Mehulkumar J Patel Cc: olh@suse.de, aprasad@in.ibm.com, kaena@us.ibm.com, mfrueh@suse.de, olaf@suse.de, netdev@oss.sgi.com, mehul.patel@in.ibm.com Subject: Re: Linux kernel updates and ip_crossover patch Message-Id: <20031031041602.0fc4f8b1.ak@suse.de> In-Reply-To: References: X-Mailer: Sylpheed version 0.8.9 (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: 1136 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 Oct 2003 18:33:57 +0530 Mehulkumar J Patel wrote: > Any update on this. > > Basically we need IP CROSSOVER patch to be part of pseries kernel. I don't think it will happen anytime soon. But the ip_crossover patch just create a single file which is a self contained module. You can compile that file outside the kernel tree and load it into your running kernel. See http://www.kernelnewbies.org etc. on how to build external modules. -Andi From devik@cdi.cz Thu Oct 30 23:46:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Oct 2003 23:47:09 -0800 (PST) Received: from www1.cdi.cz (www1.cdi.cz [194.213.194.49]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9V7kV25018639 for ; Thu, 30 Oct 2003 23:46:34 -0800 Received: from gprs194-125.eurotel.cz ([160.218.194.125] helo=devix) by www1.cdi.cz with asmtp (Exim 3.34 #3) id 1AFTzF-0006FC-00; Fri, 31 Oct 2003 08:46:27 +0100 Received: from devik (helo=localhost) by devix with local-esmtp (Exim 3.16 #8) id 1AFTt8-0006k3-00; Fri, 31 Oct 2003 08:40:06 +0100 Date: Fri, 31 Oct 2003 08:40:06 +0100 (CET) From: devik X-X-Sender: To: "David S. Miller" cc: , , , Subject: Re: [2.6.0-test9] QoS HTB crash... In-Reply-To: <20031030130859.605f856d.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-CDI: passed X-archive-position: 1137 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: devik@cdi.cz Precedence: bulk X-list: netdev Hmm - I have to look at 2.6's definition of rb_next. It might be the case ! I'll check it. Thanks, devik On Thu, 30 Oct 2003, David S. Miller wrote: > On Thu, 30 Oct 2003 20:50:16 +0100 (CET) > devik wrote: > > > thanks for the report. I know that there is an issue regarding > > HTB in 2.6.x. Please send me net/sched/sch_htb.o, > > net/sched/sch_htb.c (just to be sure) and be sure that you > > build the kernel with debugging symbols (see debugging section > > of menuconfig/xconfig). > > I think the problem is the changes that were made > in 2.5.x to htb_next_rb_node(). It used to be: > > static void htb_next_rb_node(rb_node_t **n) > { > rb_node_t *p; > if ((*n)->rb_right) { > /* child at right. use it or its leftmost ancestor */ > *n = (*n)->rb_right; > while ((*n)->rb_left) > *n = (*n)->rb_left; > return; > } > while ((p = (*n)->rb_parent) != NULL) { > /* if we've arrived from left child then we have next node */ > if (p->rb_left == *n) break; > *n = p; > } > *n = p; > } > > But it was changed into: > > static void htb_next_rb_node(struct rb_node **n) > { > *n = rb_next(*n); > } > > This is wrong, the new code has much different side effects > than the original code. > > This looks like the problem, devik what do you think? > > From dwmw2@infradead.org Fri Oct 31 07:56:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 07:56:40 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.86.99.235]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VFu425004696 for ; Fri, 31 Oct 2003 07:56:05 -0800 Received: from fish.redhat.com ([213.86.99.237] helo=hades.cambridge.redhat.com) by pentafluge.infradead.org with asmtp (Exim 4.22 #5 (Red Hat Linux)) id 1AFbeE-00067f-Mw; Fri, 31 Oct 2003 15:57:14 +0000 Subject: Re: IPv6 on-link assumption considered harmful From: David Woodhouse To: Pekka Savola Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1067615762.3423.264.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Fri, 31 Oct 2003 15:56:02 +0000 Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: dwmw2@infradead.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-Pentafluge-Mail-From: X-archive-position: 1138 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Thu, 2003-10-30 at 21:09 +0200, Pekka Savola wrote: > Just to give a heads-up before this is finalized, to give people ability > to prepare or comment prior to this process is formalized in the IETF. With corresponding changes to the route advertisement protocol as used by radvd, so that routes can actually be advertised to autoconfigured nodes? Or does that already exist and I just missed it when I was looking? -- dwmw2 From sfeldma@pobox.com Fri Oct 31 10:09:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 10:09:42 -0800 (PST) Received: from out005.verizon.net (out005pub.verizon.net [206.46.170.143]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VI9825009477 for ; Fri, 31 Oct 2003 10:09:08 -0800 Received: from [192.168.0.156] ([4.5.127.80]) by out005.verizon.net (InterMail vM.5.01.05.33 201-253-122-126-133-20030313) with ESMTP id <20031031180902.PMKQ1313.out005.verizon.net@[192.168.0.156]>; Fri, 31 Oct 2003 12:09:02 -0600 Subject: Re: PROBLEM: kernel BUG at dev.c:998! - panic w/ uml/bridge and Intel 82562 (e100) From: Scott Feldman Reply-To: sfeldma@pobox.com To: Benjamin Low Cc: netdev@oss.sgi.com In-Reply-To: <8a2645d5.d697cfd3.857ad00@mirapoint.uow.edu.au> References: <8a2645d5.d697cfd3.857ad00@mirapoint.uow.edu.au> Content-Type: text/plain Organization: Message-Id: <1067623740.2703.2.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 31 Oct 2003 10:09:01 -0800 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out005.verizon.net from [4.5.127.80] at Fri, 31 Oct 2003 12:09:01 -0600 X-archive-position: 1139 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sfeldma@pobox.com Precedence: bulk X-list: netdev > [1.] panic when starting uml host with bridged networking on an Intel > 82562 (e100 driver) This is probably the bridge bug that was fixed recently where the skb->ip_summed field wasn't being clear from Rx to Tx through the bridge. Turn off Rx checksum offloading in e100 for temp fix. -scott From fubar@us.ibm.com Fri Oct 31 11:35:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 11:35:40 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VJYw25001282 for ; Fri, 31 Oct 2003 11:35:07 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9VJYjYJ273428; Fri, 31 Oct 2003 14:34:45 -0500 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9VJYeKG077512; Fri, 31 Oct 2003 14:34:42 -0500 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h9VJYMTs016412; Fri, 31 Oct 2003 11:34:23 -0800 Message-Id: <200310311934.h9VJYMTs016412@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: Amir Noam cc: jgarzik@pobox.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] [PATCH] [bonding 2.4] fix creating/destroying the /proc/net/bonding dir In-Reply-To: Message from Amir Noam of "Thu, 23 Oct 2003 17:39:42 +0200." <200310231739.42556.amir.noam@intel.com> Date: Fri, 31 Oct 2003 11:34:22 -0800 From: Jay Vosburgh X-archive-position: 1140 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev >This patch makes bonding create the /proc/net/bonding directory only >if it exists (and destroy it only if it's empty). > >Synchronization with the NETDEV_CHANGENAME event is achieved through >the RTNL semaphore. I've managed to break this running some scripts/programs to simultaneously insmod/rmmod bonding, change the interface names, and cat /proc/net/bonding/bondX files. After the scripts run for a while, the system ends up in a state where /proc/net/bonding/ is always empty, no matter how many instances of bonding are loaded. Removing all instances of bonding also removes /proc/net/bonding/ from /proc/net ("ls /proc/net" does not show it), but "ls /proc/net/bonding" will succeed, showing an empty directory. A subsequent insmod of bonding will create an always-empty /proc/net/bonding (which again shows up in "ls /proc/net"). This seems to be bad. I'm running this test on a 2 way 933, 640MB memory running 2.4.23-pre9 with the patch appiled. I've reproduced this result twice by running all three scripts simultaneously. I haven't yet determined what the problem is, but I'm presuming there's a race in the patched code somewhere. My test programs (3 scripts and a C program) are appended. When the "readproc-random" script stops printing "success" messages, the error has occured. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com insmod-random.sh: #!/bin/sh isucc=0 rsucc=0 while /bin/true; do insert=${RANDOM}; insert=`expr ${insert} % 2` num=${RANDOM}; num=`expr ${num} % 10`; if [ ${insert} -eq 1 ]; then insmod -o bonding${num} bonding mode=0 > /dev/null 2>&1 if [ $? -eq 0 ]; then isucc=`expr ${isucc} + 1`; echo "insmod success " ${isucc}; fi else rmmod bonding${num} > /dev/null 2>&1 if [ $? -eq 0 ]; then rsucc=`expr ${rsucc} + 1`; echo "rmmod success " ${rsucc}; fi fi done readproc-random.sh: #!/bin/sh succ=0 while /bin/true; do num=`expr ${RANDOM} % 10`; cat /proc/net/bonding/bond${num} > /dev/null 2>&1 if [ $? -eq 0 ]; then succ=`expr ${succ} + 1` echo "success " ${succ}; fi done sifname-random.sh: #!/bin/sh succ=0; while /bin/true; do num1=`expr ${RANDOM} % 10`; num2=`expr ${RANDOM} % 10`; if [ ${num1} -eq ${num2} ]; then continue; fi ./sifname bond${num1} bond${num2} > /dev/null 2>&1 if [ $? -eq 0]; then succ=`expr ${succ} + 1` echo "success " ${succ}; fi done sifname.c: #include #include #include #include #include #include int main(int argc, char **argv) { int rv, s; struct ifreq ifr; if (argc != 3) { fprintf(stderr, "usage: %s oldifname newifname\n", argv[0]); exit(1); } s = socket(PF_INET, SOCK_STREAM, 0); if (-1 == s) { perror("socket"); exit(1); } memset(&ifr, 0, sizeof(ifr)); memmove(&ifr.ifr_name, argv[1], strlen(argv[1])); memmove(&ifr.ifr_newname, argv[2], strlen(argv[2])); rv = ioctl(s, SIOCSIFNAME, &ifr); if (-1 == rv) { perror("ioctl(SIOCSIFNAME)"); exit(1); } return 0; } From davem@pizda.ninka.net Fri Oct 31 11:54:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 11:54:56 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VJsI25001826 for ; Fri, 31 Oct 2003 11:54:19 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA01117; Fri, 31 Oct 2003 11:47:15 -0800 Date: Fri, 31 Oct 2003 11:47:15 -0800 From: "David S. Miller" To: Jay Vosburgh Cc: amir.noam@intel.com, jgarzik@pobox.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] [PATCH] [bonding 2.4] fix creating/destroying the /proc/net/bonding dir Message-Id: <20031031114715.55a38c7f.davem@redhat.com> In-Reply-To: <200310311934.h9VJYMTs016412@death.ibm.com> References: <200310231739.42556.amir.noam@intel.com> <200310311934.h9VJYMTs016412@death.ibm.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1141 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 I think it's not worthwhile trying to break procfs handling wrt. any kind of network devices in 2.4.x, there are lots of known far reaching problems in this area (none of which are bonding specific) that require large intrusive changes to fix and therefore are not likely to be cured in the 2.4.x tree. Simply stated, references to procfs files do not create the necessary references to the network devices they are created for and therefore anything stressing this sort of thing is going to explode. We fixed all of this in 2.6.x From fubar@us.ibm.com Fri Oct 31 12:11:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 12:11:48 -0800 (PST) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.105]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VKBA25002352 for ; Fri, 31 Oct 2003 12:11:12 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e5.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id h9VKAun9736622; Fri, 31 Oct 2003 15:10:56 -0500 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h9VKAqFA211730; Fri, 31 Oct 2003 15:10:53 -0500 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h9VKAaDs016486; Fri, 31 Oct 2003 12:10:37 -0800 Message-Id: <200310312010.h9VKAaDs016486@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: "David S. Miller" cc: amir.noam@intel.com, jgarzik@pobox.com, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] [PATCH] [bonding 2.4] fix creating/destroying the /proc/net/bonding dir In-Reply-To: Message from "David S. Miller" of "Fri, 31 Oct 2003 11:47:15 PST." <20031031114715.55a38c7f.davem@redhat.com> Date: Fri, 31 Oct 2003 12:10:36 -0800 From: Jay Vosburgh X-archive-position: 1142 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev >I think it's not worthwhile trying to break procfs handling >wrt. any kind of network devices in 2.4.x, there are lots >of known far reaching problems in this area (none of which >are bonding specific) that require large intrusive changes >to fix and therefore are not likely to be cured in the 2.4.x >tree. > >Simply stated, references to procfs files do not create the >necessary references to the network devices they are created >for and therefore anything stressing this sort of thing >is going to explode. Well, never mind, then! Jeff, can you apply Amir's patch, as it seems to work just fine except for this ignorable problem? I'll append the patch below for your convenience. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From: Amir Noam To: Jay Vosburgh , jgarzik@pobox.com Subject: [PATCH] [bonding 2.4] fix creating/destroying the /proc/net/bonding dir Date: Thu, 23 Oct 2003 17:39:42 +0200 This patch makes bonding create the /proc/net/bonding directory only if it exists (and destroy it only if it's empty). Synchronization with the NETDEV_CHANGENAME event is achieved through the RTNL semaphore. The patch applies on 2.4.23-pre8, after applying the patch that restores backward compatibility sent by Shmulik on 2003/10/12. Amir diff -Narup a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Oct 23 14:47:31 2003 +++ b/drivers/net/bonding/bond_main.c Thu Oct 23 17:04:52 2003 @@ -3574,6 +3574,62 @@ static void bond_destroy_proc_info(struc bond->bond_proc_file = NULL; } } + +/* Create the bonding directory under /proc/net, if doesn't exist yet. + * Caller must hold rtnl_lock. + */ +static void bond_create_proc_dir(void) +{ + int len = strlen(DRV_NAME); + + for (bond_proc_dir = proc_net->subdir; bond_proc_dir; + bond_proc_dir = bond_proc_dir->next) { + if ((bond_proc_dir->namelen == len) && + !memcmp(bond_proc_dir->name, DRV_NAME, len)) { + break; + } + } + + if (!bond_proc_dir) { + bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); + if (bond_proc_dir) { + bond_proc_dir->owner = THIS_MODULE; + } else { + printk(KERN_WARNING DRV_NAME + ": Warning: cannot create /proc/net/%s\n", + DRV_NAME); + } + } +} + +/* Destroy the bonding directory under /proc/net, if empty. + * Caller must hold rtnl_lock. + */ +static void bond_destroy_proc_dir(void) +{ + struct proc_dir_entry *de; + + if (!bond_proc_dir) { + return; + } + + /* verify that the /proc dir is empty */ + for (de = bond_proc_dir->subdir; de; de = de->next) { + /* ignore . and .. */ + if (*(de->name) != '.') { + break; + } + } + + if (de) { + if (bond_proc_dir->owner == THIS_MODULE) { + bond_proc_dir->owner = NULL; + } + } else { + remove_proc_entry(DRV_NAME, proc_net); + bond_proc_dir = NULL; + } +} #endif /* CONFIG_PROC_FS */ /* @@ -3829,6 +3885,9 @@ static struct notifier_block bond_netdev .notifier_call = bond_netdev_event, }; +/* De-initialize device specific data. + * Caller must hold rtnl_lock. + */ static inline void bond_deinit(struct net_device *dev) { struct bonding *bond = dev->priv; @@ -3840,6 +3899,9 @@ static inline void bond_deinit(struct ne #endif } +/* Unregister and free all bond devices. + * Caller must hold rtnl_lock. + */ static void bond_free_all(void) { struct bonding *bond, *nxt; @@ -3847,16 +3909,13 @@ static void bond_free_all(void) list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) { struct net_device *dev = bond->device; - unregister_netdev(dev); + unregister_netdevice(dev); bond_deinit(dev); free_netdev(dev); } #ifdef CONFIG_PROC_FS - if (bond_proc_dir) { - remove_proc_entry(DRV_NAME, proc_net); - bond_proc_dir = NULL; - } + bond_destroy_proc_dir(); #endif } @@ -4234,18 +4293,12 @@ static int __init bonding_init(void) primary = NULL; } + rtnl_lock(); + #ifdef CONFIG_PROC_FS - bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); - if (bond_proc_dir == NULL) { - printk(KERN_WARNING - "bonding_init(): can not create /proc/net/" DRV_NAME); - } else { - bond_proc_dir->owner = THIS_MODULE; - } + bond_create_proc_dir(); #endif - rtnl_lock(); - err = 0; for (no = 0; no < max_bonds; no++) { struct net_device *dev; @@ -4288,18 +4341,21 @@ static int __init bonding_init(void) return 0; out_err: - rtnl_unlock(); - /* free and unregister all bonds that were successfully added */ bond_free_all(); + rtnl_unlock(); + return err; } static void __exit bonding_exit(void) { unregister_netdevice_notifier(&bond_netdev_notifier); + + rtnl_lock(); bond_free_all(); + rtnl_unlock(); } module_init(bonding_init); From joe@perches.com Fri Oct 31 13:24:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 13:25:17 -0800 (PST) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VLOY25006010 for ; Fri, 31 Oct 2003 13:24:39 -0800 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id NAA08786 for ; Fri, 31 Oct 2003 13:16:51 -0800 Subject: Re: [IPX]: Fix checksum computation. From: Joe Perches To: netdev@oss.sgi.com In-Reply-To: <200310312006.h9VK62Hh005910@hera.kernel.org> References: <200310312006.h9VK62Hh005910@hera.kernel.org> Content-Type: text/plain Message-Id: <1067635446.11564.92.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 31 Oct 2003 13:24:06 -0800 Content-Transfer-Encoding: 7bit X-archive-position: 1143 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 On Thu, 2003-10-30 at 19:43, Linux Kernel Mailing List wrote: > ChangeSet 1.1399, 2003/10/30 19:43:04-08:00, davem@nuts.ninka.net > [IPX]: Fix checksum computation. > diff -Nru a/net/appletalk/ddp.c b/net/appletalk/ddp.c > --- a/net/appletalk/ddp.c Fri Oct 31 12:06:06 2003 > +++ b/net/appletalk/ddp.c Fri Oct 31 12:06:06 2003 > @@ -937,9 +937,13 @@ > { > /* This ought to be unwrapped neatly. I'll trust gcc for now */ > while (len--) { > - sum += *data++; > + sum += *data; > sum <<= 1; > - sum = ((sum >> 16) + sum) & 0xFFFF; > + if (sum & 0x10000) { > + sum++; > + sum &= 0xffff; > + } > + data++; > } > return sum; > } This change didn't appear on this list for comment, it just appeared in the source. Why is this a "fix"? Performance? It seems more like someone's idea of code neatening. If this is done, why not if (unlikely()) From davem@pizda.ninka.net Fri Oct 31 13:30:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 13:31:30 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VLUa25006387 for ; Fri, 31 Oct 2003 13:30:56 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA01472; Fri, 31 Oct 2003 13:23:31 -0800 Date: Fri, 31 Oct 2003 13:23:31 -0800 From: "David S. Miller" To: Joe Perches Cc: netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-Id: <20031031132331.35a9aaca.davem@redhat.com> In-Reply-To: <1067635446.11564.92.camel@localhost.localdomain> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1144 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 On Fri, 31 Oct 2003 13:24:06 -0800 Joe Perches wrote: > Why is this a "fix"? Performance? > It seems more like someone's idea of code neatening. IPC checksums were being miscomputed in the original code, we're as mystified as you are as to why it is that: if (sum & 0x10000) { sum++; sum &= 0xffff; } works while: sum = ((sym >> 16) + sum) & 0xffff; does not. The theory was that it might be some x86 gcc bug, but looking at the assembler diff Arnaldo Carvalho de Melo (the appletalk maintainer) showed me between the before and after: xorl %eax, %eax - decl %ecx movb (%ebx), %al - incl %ebx addl %eax, %edx addl %edx, %edx - movl %edx, %eax - shrl $16, %eax - addl %edx, %eax - movzwl %ax,%edx + testl $65536, %edx + je .L982 + incl %edx + andl $65535, %edx +.L982: + decl %ecx + incl %ebx cmpl $-1, %ecx we still can't see what's wrong. He did confirm that the change in question makes IPX compute checksums correctly. From acme@conectiva.com.br Fri Oct 31 13:32:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 13:32:39 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VLW425006620 for ; Fri, 31 Oct 2003 13:32:05 -0800 Received: from [200.181.168.139] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AFgtP-0006bA-00; Fri, 31 Oct 2003 19:33:16 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id CB2BB1966D; Fri, 31 Oct 2003 21:31:59 +0000 (UTC) Date: Fri, 31 Oct 2003 19:31:59 -0200 From: Arnaldo Carvalho de Melo To: Joe Perches Cc: netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-ID: <20031031213159.GO3705@conectiva.com.br> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1067635446.11564.92.camel@localhost.localdomain> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1145 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 Em Fri, Oct 31, 2003 at 01:24:06PM -0800, Joe Perches escreveu: > On Thu, 2003-10-30 at 19:43, Linux Kernel Mailing List wrote: > > ChangeSet 1.1399, 2003/10/30 19:43:04-08:00, davem@nuts.ninka.net > > [IPX]: Fix checksum computation. > > diff -Nru a/net/appletalk/ddp.c b/net/appletalk/ddp.c > > --- a/net/appletalk/ddp.c Fri Oct 31 12:06:06 2003 > > +++ b/net/appletalk/ddp.c Fri Oct 31 12:06:06 2003 > > @@ -937,9 +937,13 @@ > > { > > /* This ought to be unwrapped neatly. I'll trust gcc for now */ > > while (len--) { > > - sum += *data++; > > + sum += *data; > > sum <<= 1; > > - sum = ((sum >> 16) + sum) & 0xFFFF; > > + if (sum & 0x10000) { > > + sum++; > > + sum &= 0xffff; > > + } > > + data++; > > } > > return sum; > > } > > This change didn't appear on this list for comment, > it just appeared in the source. > > Why is this a "fix"? Performance? > It seems more like someone's idea of code neatening. > > If this is done, why not if (unlikely()) No, the reverse is true, with the patch it is the same as in 2.4, when Stephen did the conversion to handle paged skbs it did what you called "neatening" (i.e. without the patch above), now, if you care, go try to use this with recent gcc, and get back with your results. Mine were: reversing this patch makes the checksum calculations sometimes wrong, preventing Appletalk from working. Mind boggling? Yes, did it fixed a problem? Yes. - Arnaldo From acme@conectiva.com.br Fri Oct 31 13:34:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 13:34:56 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VLYM25007074 for ; Fri, 31 Oct 2003 13:34:23 -0800 Received: from [200.181.168.139] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AFgve-0006bJ-00; Fri, 31 Oct 2003 19:35:35 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id B66561966D; Fri, 31 Oct 2003 21:34:17 +0000 (UTC) Date: Fri, 31 Oct 2003 19:34:17 -0200 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: Joe Perches , netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-ID: <20031031213417.GP3705@conectiva.com.br> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031132331.35a9aaca.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031031132331.35a9aaca.davem@redhat.com> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1146 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 Em Fri, Oct 31, 2003 at 01:23:31PM -0800, David S. Miller escreveu: > On Fri, 31 Oct 2003 13:24:06 -0800 > He did confirm that the change in question makes IPX compute checksums > correctly. s/IPX/Appletalk/g 8) - Arnaldo From joe@perches.com Fri Oct 31 13:50:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 13:51:13 -0800 (PST) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VLod25007588 for ; Fri, 31 Oct 2003 13:50:39 -0800 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id NAA08866; Fri, 31 Oct 2003 13:42:49 -0800 Subject: Re: [IPX]: Fix checksum computation. From: Joe Perches To: David S Miller Cc: netdev@oss.sgi.com In-Reply-To: <20031031132331.35a9aaca.davem@redhat.com> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031132331.35a9aaca.davem@redhat.com> Content-Type: text/plain Message-Id: <1067637004.11564.98.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 31 Oct 2003 13:50:04 -0800 Content-Transfer-Encoding: 7bit X-archive-position: 1147 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 On Fri, 2003-10-31 at 13:23, David S. Miller wrote: > we're as mystified as you are as to why it is that: > if (sum & 0x10000) { > sum++; > sum &= 0xffff; > } > works while: > sum = ((sym >> 16) + sum) & 0xffff; > does not. The theory was that it might be some x86 gcc bug, > but looking at the assembler diff Arnaldo Carvalho de Melo > (the appletalk maintainer) showed me between the before and > after: > xorl %eax, %eax > - decl %ecx > movb (%ebx), %al > - incl %ebx > addl %eax, %edx > addl %edx, %edx > - movl %edx, %eax > - shrl $16, %eax > - addl %edx, %eax > - movzwl %ax,%edx > + testl $65536, %edx > + je .L982 > + incl %edx > + andl $65535, %edx > +.L982: > + decl %ecx > + incl %ebx > cmpl $-1, %ecx > > we still can't see what's wrong. > He did confirm that the change in question makes IPX compute checksums > correctly. If so, something major is WRONG. Code all over the place would need this "fix". Was an old NG Sniffer being used to verify this? Sniffer had a long term problem with IPX checksums. Has the gcc team been contacted? From acme@conectiva.com.br Fri Oct 31 13:57:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 13:57:35 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VLuv25008376 for ; Fri, 31 Oct 2003 13:57:00 -0800 Received: from [200.181.168.139] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AFhHU-0006gN-00; Fri, 31 Oct 2003 19:58:10 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 72B471966D; Fri, 31 Oct 2003 21:56:52 +0000 (UTC) Date: Fri, 31 Oct 2003 19:56:52 -0200 From: Arnaldo Carvalho de Melo To: Joe Perches Cc: David S Miller , netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-ID: <20031031215652.GR3705@conectiva.com.br> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031132331.35a9aaca.davem@redhat.com> <1067637004.11564.98.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1067637004.11564.98.camel@localhost.localdomain> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1148 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 Em Fri, Oct 31, 2003 at 01:50:04PM -0800, Joe Perches escreveu: > On Fri, 2003-10-31 at 13:23, David S. Miller wrote: > > we're as mystified as you are as to why it is that: > > if (sum & 0x10000) { > > sum++; > > sum &= 0xffff; > > } > > works while: > > sum = ((sym >> 16) + sum) & 0xffff; > > does not. The theory was that it might be some x86 gcc bug, > > but looking at the assembler diff Arnaldo Carvalho de Melo > > (the appletalk maintainer) showed me between the before and > > after: > > xorl %eax, %eax > > - decl %ecx > > movb (%ebx), %al > > - incl %ebx > > addl %eax, %edx > > addl %edx, %edx > > - movl %edx, %eax > > - shrl $16, %eax > > - addl %edx, %eax > > - movzwl %ax,%edx > > + testl $65536, %edx > > + je .L982 > > + incl %edx > > + andl $65535, %edx > > +.L982: > > + decl %ecx > > + incl %ebx > > cmpl $-1, %ecx > > > > we still can't see what's wrong. > > He did confirm that the change in question makes IPX compute checksums > > correctly. > > If so, something major is WRONG. I guess so. If people with an Appletalk testbed could try with and without the patch, that would be great. > Code all over the place would need this "fix". Haven't noticed any other place with this problem, but yes, this is something that may well happen in other code. > Was an old NG Sniffer being used to verify this? Nope, MacOS 7.5.5 and 9 just hang when communicating with the machine without this patch, gcc 3.3.1/2 was used. > Sniffer had a long term problem with IPX checksums. I added back the old atalk_checksum from 2.4 and compared the results, not all were wrong, but some were. > Has the gcc team been contacted? Nope, feel free to forward this message. - Arnaldo From davem@pizda.ninka.net Fri Oct 31 14:00:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 14:01:06 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VM0X25008790 for ; Fri, 31 Oct 2003 14:00:33 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA01629; Fri, 31 Oct 2003 13:53:29 -0800 Date: Fri, 31 Oct 2003 13:53:28 -0800 From: "David S. Miller" To: Joe Perches Cc: netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-Id: <20031031135328.2a997f6a.davem@redhat.com> In-Reply-To: <1067637004.11564.98.camel@localhost.localdomain> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031132331.35a9aaca.davem@redhat.com> <1067637004.11564.98.camel@localhost.localdomain> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1149 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 On Fri, 31 Oct 2003 13:50:04 -0800 Joe Perches wrote: > Was an old NG Sniffer being used to verify this? > Sniffer had a long term problem with IPX checksums. No, Arnaldo would verify the checksum by running the old code and the new code, they produced different checksums on every sendmsg() call. He then tested it further by making sure he could use netatalk successfully between a 2.4.x Linux appletalk box and a 2.6.x system with the checksum patch applied. Without the patch the 2.4.x system would reject all packets sent by the 2.6.x box. Don't assume that we're a bunch of fucknuts and didn't verify things to the best of our abilities ok? Thanks. > Has the gcc team been contacted? Why would we contact them before we even know if it's a gcc bug or not? It could be a sign extension issue or something else that our brains are not grokking at the moment. Contacting the gcc team would be utterly premature. Here is something you could do for us instead of your current blabbering. Why don't you take a look at the assembler diff I posted and try to figure out how the before code produces a different checksum than the after code? From shemminger@osdl.org Fri Oct 31 14:21:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 14:22:31 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VMLu25009484 for ; Fri, 31 Oct 2003 14:21:57 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9VMLDC05799; Fri, 31 Oct 2003 14:21:13 -0800 Date: Fri, 31 Oct 2003 14:21:31 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: Joe Perches , netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-Id: <20031031142131.07176dd7.shemminger@osdl.org> In-Reply-To: <20031031135328.2a997f6a.davem@redhat.com> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031132331.35a9aaca.davem@redhat.com> <1067637004.11564.98.camel@localhost.localdomain> <20031031135328.2a997f6a.davem@redhat.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1150 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 On Fri, 31 Oct 2003 13:53:28 -0800 "David S. Miller" wrote: > On Fri, 31 Oct 2003 13:50:04 -0800 > Joe Perches wrote: > > > Was an old NG Sniffer being used to verify this? > > Sniffer had a long term problem with IPX checksums. > > No, Arnaldo would verify the checksum by running the > old code and the new code, they produced different > checksums on every sendmsg() call. > > He then tested it further by making sure he could use > netatalk successfully between a 2.4.x Linux appletalk > box and a 2.6.x system with the checksum patch applied. > Without the patch the 2.4.x system would reject all packets > sent by the 2.6.x box. > Actually, the before the "optimization" went in I did testing between old 2.4.x and 2.6.x as well as standalone comparisons. The problem is a compiler screwup, that probably isn't worth investigating further. From acme@conectiva.com.br Fri Oct 31 14:46:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 14:46:44 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VMk925010829 for ; Fri, 31 Oct 2003 14:46:10 -0800 Received: from [200.181.168.139] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AFi37-0006il-00; Fri, 31 Oct 2003 20:47:22 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 891561966D; Fri, 31 Oct 2003 22:46:04 +0000 (UTC) Date: Fri, 31 Oct 2003 20:46:04 -0200 From: Arnaldo Carvalho de Melo To: Stephen Hemminger Cc: "David S. Miller" , Joe Perches , netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-ID: <20031031224603.GT3705@conectiva.com.br> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031132331.35a9aaca.davem@redhat.com> <1067637004.11564.98.camel@localhost.localdomain> <20031031135328.2a997f6a.davem@redhat.com> <20031031142131.07176dd7.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031031142131.07176dd7.shemminger@osdl.org> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1151 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 Em Fri, Oct 31, 2003 at 02:21:31PM -0800, Stephen Hemminger escreveu: > On Fri, 31 Oct 2003 13:53:28 -0800 > "David S. Miller" wrote: > > > On Fri, 31 Oct 2003 13:50:04 -0800 > > Joe Perches wrote: > > > > > Was an old NG Sniffer being used to verify this? > > > Sniffer had a long term problem with IPX checksums. > > > > No, Arnaldo would verify the checksum by running the > > old code and the new code, they produced different > > checksums on every sendmsg() call. > > > > He then tested it further by making sure he could use > > netatalk successfully between a 2.4.x Linux appletalk > > box and a 2.6.x system with the checksum patch applied. > > Without the patch the 2.4.x system would reject all packets > > sent by the 2.6.x box. > > > > Actually, the before the "optimization" went in I did testing between > old 2.4.x and 2.6.x as well as standalone comparisons. The problem is > a compiler screwup, that probably isn't worth investigating further. But if someone wants to I'd be glad to receive test reports with and without the patch. Hey, that way we can get more testers for Appletalk in 2.6 8) - Arnaldo From akpm@osdl.org Fri Oct 31 14:55:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 14:55:59 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VMtO25011286 for ; Fri, 31 Oct 2003 14:55:24 -0800 Received: from akpm.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h9VMtIC10809; Fri, 31 Oct 2003 14:55:18 -0800 Date: Fri, 31 Oct 2003 14:55:42 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: Raffaele Brancaleoni Subject: Fw: Oops in 2.6.0-test[89] in tcp_v4_get_port (kernel with IPv6 enabled) Message-Id: <20031031145542.28e8b820.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.6 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1152 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Fri, 31 Oct 2003 12:30:06 +0100 From: Raffaele Brancaleoni To: linux-kernel@vger.kernel.org Subject: Oops in 2.6.0-test[89] in tcp_v4_get_port (kernel with IPv6 enabled) Hello everyone, I just encountered a oops with kernels 2.6.0-test8 and -test9 (system freezes the hard way, not even magic-key works). Problem does not exist in 2.4.20. It looks to me its a regression (or has it ever been integrated?) of bug 456 (from bugme.osdl.org) but I'm far from being an expert. I can trigger it easily by running the test suite of mod_perl 1.99 (it crashes systematically at the very end of the tests). You'll find below all details I could collect about this issue (linux_ver, ksymoops, the oops I wrote down). I found a thread about similar issue in the archive (thread subject: "oops in inet_bind/tcp_v4_get_port"). Yoshifuji Hideaki provided a patch but unfortunately it causes some problems with ip_nat_helper and ip_nat_cores modules compilation (duplicate functions definitions)... Can anyone help with this? Do not hesitate to let me know would you need other data to help in investigating this issue. Thanks, Raffaele. P.S.: I don't know how reliable the ksymoops output is due to the fact I could not save the kallsyms at the time of the oops. Anyway, as modules are force-loaded at boot in the same order, I hope it will still be useful. P.S.2: For any reply, would you mind CC:'ing me as I'm not on the list? ____ Unable to handle kernel paging request at virtual 010000c8 *pde = 00000000 Oops: 0000 [#1] CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010246 EIP is at tcp_v4_get_port+0x331/0x350 eax: 0100007f ebx: d6234470 ecx: d02df730 edx: d02df720 esi: 00002151 edi: d5c14060 ebp: d02df7b0 esp: d316bc70 ds: 007b es: 007b ss: 0068 Process TEST (pid: 4984, threadinfo=d316a000 task=d5ab46a0) Stack: 00000000 00000000 00000000 00000000 00000001 00000000 00000000 00000000 00000000 00000001 d7ac8544 ffffffea d5c14060 d5c14188 d316bec8 c0328c62 d5c14060 00002151 c02dc2dc 00000003 00002151 d5c763a0 d316bce8 00000010 Call Trace: [] inet_bind+0x1c2/0x2c0 [] move_addr_to_kernel+0x5e/0xa0 [] sys_bind+0x7b/0xb0 [] schedule+0x2f2/0x590 [] sys_socketcall+0xd3/0x2c0 [] ptrace_notify+0x4a/0x74 [] do_syscall_trace+0x48/0x80 [] syscall_call+0x7/0xb Code: 0f b6 40 49 24 20 84 c0 75 a0 eb 88 8b 7c 24 40 8b 7f 24 89 <0> Kernel panic: fatal exception in interrupt In interrupt handler - not syncing ____ Linux nightawk 2.6.0-test9 #2 Thu Oct 30 12:52:54 CET 2003 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux Gnu C 3.2.3 Gnu make 3.80 util-linux 2.11z mount 2.11z module-init-tools 0.9.12 e2fsprogs 1.33 reiserfsprogs 3.6.8 pcmcia-cs 3.2.4 PPP 2.4.1 nfs-utils 1.0.6 Linux C Library 2.3.2 Dynamic linker (ldd) 2.3.2 Procps 3.1.9 Net-tools 1.60 Kbd 1.06 Sh-utils 5.0 Modules Loaded uhci_hcd usbcore autofs4 twofish sha512 blowfish sha256 pppoe pppox ppp_generic slhc ircomm_tty ircomm irtty_sir sir_dev irport irda ipt_MASQUERADE ipt_owner ipt_SAME ipt_helper ipt_NETMAP ip_nat_snmp_basic arpt_mangle ipt_REDIRECT ipt_ULOG ipt_mark smbfs nfsd exportfs lockd sunrpc snd_pcm_oss snd_mixer_oss snd_au8810 snd_pcm snd_page_alloc snd_timer snd_ac97_codec snd_mpu401_uart snd_rawmidi snd_seq_device snd soundcore fan thermal processor button battery ac 8139too mii _____ ksymoops 2.4.9 on i686 2.6.0-test9. Options used -V (default) -k /proc/kallsyms (specified) -l /proc/modules (specified) -o /lib/modules/2.6.0-test9 (specified) -m /boot/System.map-2.6.0-test9 (specified) Warning (read_ksyms): no kernel symbols in ksyms, is /proc/kallsyms a valid ksym s file? No modules in ksyms, skipping objects No ksyms, skipping lsmod Unable to handle kernel paging request at virtual 010000c8 *pde = 00000000 Oops: 0000 [#1] CPU: 0 EIP: 0060:[] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00010246 eax: 0100007f ebx: d6234470 ecx: d02df730 edx: d02df720 esi: 00002151 edi: d5c14060 ebp: d02df7b0 esp: d316bc70 ds: 007b es: 007b ss: 0068 Stack: 00000000 00000000 00000000 00000000 00000001 00000000 00000000 00000000 00000000 00000001 d7ac8544 ffffffea d5c14060 d5c14188 d316bec8 c0328c62 d5c14060 00002151 c02dc2dc 00000003 00002151 d5c763a0 d316bce8 00000010 Call Trace: [] inet_bind+0x1c2/0x2c0 [] move_addr_to_kernel+0x5e/0xa0 [] sys_bind+0x7b/0xb0 [] schedule+0x2f2/0x590 [] sys_socketcall+0xd3/0x2c0 [] ptrace_notify+0x4a/0x74 [] do_syscall_trace+0x48/0x80 [] syscall_call+0x7/0xb Code: 0f b6 40 49 24 20 84 c0 75 a0 eb 88 8b 7c 24 40 8b 7f 24 89 >>EIP; c0315951 <===== >>eax; 0100007f <__crc_ide_driveid_update+33f88/a9af9> >>ebx; d6234470 <__crc_ide_error+795b4/84c4e> >>ecx; d02df730 <__crc_pcmcia_request_configuration+c5a37/47edc2> >>edx; d02df720 <__crc_pcmcia_request_configuration+c5a27/47edc2> >>edi; d5c14060 <__crc_sockfd_lookup+d86e8/3f795e> >>ebp; d02df7b0 <__crc_pcmcia_request_configuration+c5ab7/47edc2> >>esp; d316bc70 <__crc_dst_alloc+16f570/20c86c> Trace; c0328c62 Trace; c02dc2dc Trace; c02dd8eb Trace; c011e742 Trace; c02de703 Trace; c012994a Trace; c010ff18 Trace; c010b4db Code; c0315951 00000000 <_EIP>: Code; c0315951 <===== 0: 0f b6 40 49 movzbl 0x49(%eax),%eax <===== Code; c0315955 4: 24 20 and $0x20,%al Code; c0315957 6: 84 c0 test %al,%al Code; c0315959 8: 75 a0 jne ffffffaa <_EIP+0xffffffaa> Code; c031595b a: eb 88 jmp ffffff94 <_EIP+0xffffff94> Code; c031595d c: 8b 7c 24 40 mov 0x40(%esp,1),%edi Code; c0315961 10: 8b 7f 24 mov 0x24(%edi),%edi Code; c0315964 13: 89 00 mov %eax,(%eax) <0> Kernel panic: fatal exception in interrupt 1 warning issued. Results may not be reliable. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ From acme@conectiva.com.br Fri Oct 31 15:14:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 15:14:41 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VNE625011920 for ; Fri, 31 Oct 2003 15:14:07 -0800 Received: from [200.181.168.139] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AFiUB-0006lg-00; Fri, 31 Oct 2003 21:15:20 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 2F4351966D; Fri, 31 Oct 2003 23:14:01 +0000 (UTC) Date: Fri, 31 Oct 2003 21:14:00 -0200 From: Arnaldo Carvalho de Melo To: Andrew Morton Cc: netdev@oss.sgi.com, Raffaele Brancaleoni Subject: Re: Fw: Oops in 2.6.0-test[89] in tcp_v4_get_port (kernel with IPv6 enabled) Message-ID: <20031031231400.GV3705@conectiva.com.br> References: <20031031145542.28e8b820.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031031145542.28e8b820.akpm@osdl.org> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1153 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 Em Fri, Oct 31, 2003 at 02:55:42PM -0800, Andrew Morton escreveu: > > > Begin forwarded message: > > Date: Fri, 31 Oct 2003 12:30:06 +0100 > From: Raffaele Brancaleoni > To: linux-kernel@vger.kernel.org > Subject: Oops in 2.6.0-test[89] in tcp_v4_get_port (kernel with IPv6 enabled) > > > Hello everyone, > > I just encountered a oops with kernels 2.6.0-test8 and -test9 (system > freezes the hard way, not even magic-key works). Problem does not exist > in 2.4.20. > > It looks to me its a regression (or has it ever been integrated?) of > bug 456 (from bugme.osdl.org) but I'm far from being an expert. > > I can trigger it easily by running the test suite of mod_perl 1.99 > (it crashes systematically at the very end of the tests). Ouch, it seems this one is a die hard, Rafaelle, could you please test it without IPv6? - Arnaldo From mhuth@mvista.com Fri Oct 31 15:19:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 15:19:39 -0800 (PST) Received: from zipcode.az.mvista.com (rav-az.mvista.com [65.200.49.157]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9VNJ625012666 for ; Fri, 31 Oct 2003 15:19:06 -0800 Received: from mvista.com ([10.50.1.182]) by zipcode.az.mvista.com (8.9.3/8.9.3) with ESMTP id QAA25762; Fri, 31 Oct 2003 16:37:10 -0700 Message-ID: <3FA2F069.4070005@mvista.com> Date: Fri, 31 Oct 2003 16:29:45 -0700 From: Mark Huth User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Joe Perches , netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031132331.35a9aaca.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1154 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mhuth@mvista.com Precedence: bulk X-list: netdev David S. Miller wrote: >On Fri, 31 Oct 2003 13:24:06 -0800 >Joe Perches wrote: > > > >>Why is this a "fix"? Performance? >>It seems more like someone's idea of code neatening. >> >> > >IPC checksums were being miscomputed in the original code, >we're as mystified as you are as to why it is that: > > if (sum & 0x10000) { > sum++; > sum &= 0xffff; > } > >works while: > > sum = ((sym >> 16) + sum) & 0xffff; > >does not. The theory was that it might be some x86 gcc bug, >but looking at the assembler diff Arnaldo Carvalho de Melo >(the appletalk maintainer) showed me between the before and >after: > Nah, they are different algorithms, as the assembler code clearly demonstrates. The above snippet is incomplete, with the crucial multiply by 2 or the shift left omitted. The assembler code reveals this crucial piece of information. > > xorl %eax, %eax >- decl %ecx > movb (%ebx), %al >- incl %ebx > addl %eax, %edx > addl %edx, %edx >- movl %edx, %eax >- shrl $16, %eax >- addl %edx, %eax > The previous instruction adds 0, 1, or 2 to the checksum accumulation. That's because in the case where the byte added to the accumulation (addl %eax, %edx) causes the 16 bit to set, then when multiplied by 2 (addl %edx, %edx) the 17 bit is set and the 16 bit is clear. >- movzwl %ax,%edx >+ testl $65536, %edx >+ je .L982 > This version adds one to the accumulation iff bit 16 is set following the multiply. The results are clearly different. This latter version would be a correct implementation of feedback shiftregister algorithm, assuming that is what is being computed instead of a simple checksum. Not knowing the specification for the algorithm offhand, I can't say which is correct. They will, however, _sometimes_ give the same results. That probably explains the rest of the comments in this thread. >+ incl %edx >+ andl $65535, %edx >+.L982: >+ decl %ecx >+ incl %ebx > cmpl $-1, %ecx > >we still can't see what's wrong. > >He did confirm that the change in question makes IPX compute checksums >correctly. > > > > > From joe@perches.com Fri Oct 31 16:32:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 16:33:07 -0800 (PST) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA10WX25017460 for ; Fri, 31 Oct 2003 16:32:34 -0800 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id QAA09254; Fri, 31 Oct 2003 16:24:11 -0800 Subject: Re: [IPX]: Fix checksum computation. From: Joe Perches To: Mark Huth Cc: David S Miller , netdev@oss.sgi.com In-Reply-To: <3FA2F069.4070005@mvista.com> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031132331.35a9aaca.davem@redhat.com> <3FA2F069.4070005@mvista.com> Content-Type: text/plain Message-Id: <1067646688.11564.189.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 31 Oct 2003 16:31:29 -0800 Content-Transfer-Encoding: 7bit X-archive-position: 1156 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 On Fri, 2003-10-31 at 15:29, Mark Huth wrote: > Nah, they are different algorithms, as the assembler code clearly > demonstrates. The above snippet is incomplete, with the crucial > multiply by 2 or the shift left omitted. The assembler code reveals > this crucial piece of information. Right. My mistake. Clear upon explanation, thanks. I think I misread based on expectation rather than code. From davem@pizda.ninka.net Fri Oct 31 16:32:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 16:32:59 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA10WN25017455 for ; Fri, 31 Oct 2003 16:32:24 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA01981; Fri, 31 Oct 2003 16:25:16 -0800 Date: Fri, 31 Oct 2003 16:25:16 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: joe@perches.com, netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-Id: <20031031162516.0b2bd38d.davem@redhat.com> In-Reply-To: <20031031142131.07176dd7.shemminger@osdl.org> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031132331.35a9aaca.davem@redhat.com> <1067637004.11564.98.camel@localhost.localdomain> <20031031135328.2a997f6a.davem@redhat.com> <20031031142131.07176dd7.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1155 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 On Fri, 31 Oct 2003 14:21:31 -0800 Stephen Hemminger wrote: > Actually, the before the "optimization" went in I did testing between > old 2.4.x and 2.6.x as well as standalone comparisons. The problem is > a compiler screwup, that probably isn't worth investigating further. See Mark Huth's email, I think his analysis is correct and that the two pieces of C code are really doing different things. From davem@pizda.ninka.net Fri Oct 31 16:38:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 16:39:03 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA10cU25018167 for ; Fri, 31 Oct 2003 16:38:30 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA02013; Fri, 31 Oct 2003 16:31:24 -0800 Date: Fri, 31 Oct 2003 16:31:24 -0800 From: "David S. Miller" To: Joe Perches Cc: mhuth@mvista.com, netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-Id: <20031031163124.35e14643.davem@redhat.com> In-Reply-To: <1067646688.11564.189.camel@localhost.localdomain> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031132331.35a9aaca.davem@redhat.com> <3FA2F069.4070005@mvista.com> <1067646688.11564.189.camel@localhost.localdomain> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1157 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 On Fri, 31 Oct 2003 16:31:29 -0800 Joe Perches wrote: > Right. My mistake. Clear upon explanation, thanks. > I think I misread based on expectation rather than code. Good thing we didn't report this to the gcc developers. ROFL... From shemminger@osdl.org Fri Oct 31 16:39:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 16:39:49 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA10dD25018213 for ; Fri, 31 Oct 2003 16:39:14 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA10cPC27232; Fri, 31 Oct 2003 16:38:25 -0800 Date: Fri, 31 Oct 2003 16:38:43 -0800 From: Stephen Hemminger To: Arnaldo Carvalho de Melo Cc: Joe Perches , netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-Id: <20031031163843.6bcf4ca4.shemminger@osdl.org> In-Reply-To: <20031031213159.GO3705@conectiva.com.br> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031213159.GO3705@conectiva.com.br> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1158 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 Okay, here is the standard: (Inside Appletalk) > The DDP checksum is provided to detect errors caused by faulty operation (such as memor > data bus errors) within routers on the internet. Implementers of DDP should treat generati > the checksum as an optional feature. The 16-bit DDP checksum is computed as follows: > CkSum := 0 ; > FOR each datagram byte starting with the byte immediately following th > Checksum field > REPEAT the following algorithm: > CkSum := CkSum + byte; (unsigned addition) > Rotate CkSum left one bit, rotating the most significant bit in > least significant bit; > IF, at the end, CkSum = 0 THEN > CkSum := $FFFF (all ones). > Reception of a datagram with CkSum equal to 0 implies that a checksum is not performed. Here is the old loop: while (len--) { sum += *data; sum <<=1; if (sum & 0x10000) { sum++; sum &= 0xffff; } data++; } My buggy loop is: while (len--) { sum += *data++; sum <<= 1; sum = ((sum >> 16) + sum) & 0xFFFF; } The problem is the carry from the first addition needs to be dropped not folded back (like IP). Corrected fast code is: while (len--) { sum += *data++; sum <<= 1; sum = (((sum & 0x10000) >> 16) + sum) & 0xffff; } At least it is correct on the standalone random data test, and the new code is 30% faster for the cached memory case (13.7 clks/byte vs 18 clks/byte). From acme@conectiva.com.br Fri Oct 31 17:13:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 17:13:45 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA11D925019541 for ; Fri, 31 Oct 2003 17:13:10 -0800 Received: from [200.181.168.139] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AFkLN-0006u0-00; Fri, 31 Oct 2003 23:14:24 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id D123A1966D; Sat, 1 Nov 2003 01:13:01 +0000 (UTC) Date: Fri, 31 Oct 2003 23:13:01 -0200 From: Arnaldo Carvalho de Melo To: Stephen Hemminger Cc: Joe Perches , netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-ID: <20031101011301.GW3705@conectiva.com.br> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031213159.GO3705@conectiva.com.br> <20031031163843.6bcf4ca4.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031031163843.6bcf4ca4.shemminger@osdl.org> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1159 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 Em Fri, Oct 31, 2003 at 04:38:43PM -0800, Stephen Hemminger escreveu: > > Okay, here is the standard: (Inside Appletalk) > > > The DDP checksum is provided to detect errors caused by faulty operation (such as memor > > data bus errors) within routers on the internet. Implementers of DDP should treat generati > > the checksum as an optional feature. The 16-bit DDP checksum is computed as follows: > > CkSum := 0 ; > > FOR each datagram byte starting with the byte immediately following th > > Checksum field > > REPEAT the following algorithm: > > CkSum := CkSum + byte; (unsigned addition) > > Rotate CkSum left one bit, rotating the most significant bit in > > least significant bit; > > IF, at the end, CkSum = 0 THEN > > CkSum := $FFFF (all ones). > > Reception of a datagram with CkSum equal to 0 implies that a checksum is not performed. > > > Here is the old loop: > > while (len--) { > sum += *data; > sum <<=1; > if (sum & 0x10000) { > sum++; > sum &= 0xffff; > } > data++; > } > > My buggy loop is: > > while (len--) { > sum += *data++; > sum <<= 1; > sum = ((sum >> 16) + sum) & 0xFFFF; > } > > The problem is the carry from the first addition needs to be dropped > not folded back (like IP). > > Corrected fast code is: > > while (len--) { > sum += *data++; > sum <<= 1; > sum = (((sum & 0x10000) >> 16) + sum) & 0xffff; > } > > At least it is correct on the standalone random data test, and the > new code is 30% faster for the cached memory case (13.7 clks/byte vs 18 clks/byte). Testing... From acme@conectiva.com.br Fri Oct 31 17:19:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 17:20:06 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA11JT25023592 for ; Fri, 31 Oct 2003 17:19:30 -0800 Received: from [200.181.168.139] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AFkRX-0006uQ-00; Fri, 31 Oct 2003 23:20:44 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 456871966D; Sat, 1 Nov 2003 01:19:27 +0000 (UTC) Date: Fri, 31 Oct 2003 23:19:26 -0200 From: Arnaldo Carvalho de Melo To: Stephen Hemminger Cc: Joe Perches , netdev@oss.sgi.com Subject: Re: [IPX]: Fix checksum computation. Message-ID: <20031101011926.GX3705@conectiva.com.br> References: <200310312006.h9VK62Hh005910@hera.kernel.org> <1067635446.11564.92.camel@localhost.localdomain> <20031031213159.GO3705@conectiva.com.br> <20031031163843.6bcf4ca4.shemminger@osdl.org> <20031101011301.GW3705@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031101011301.GW3705@conectiva.com.br> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1160 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 Em Fri, Oct 31, 2003 at 11:13:01PM -0200, Arnaldo C. Melo escreveu: > Em Fri, Oct 31, 2003 at 04:38:43PM -0800, Stephen Hemminger escreveu: > > > > Okay, here is the standard: (Inside Appletalk) > > > > > The DDP checksum is provided to detect errors caused by faulty operation (such as memor > > > data bus errors) within routers on the internet. Implementers of DDP should treat generati > > > the checksum as an optional feature. The 16-bit DDP checksum is computed as follows: > > > CkSum := 0 ; > > > FOR each datagram byte starting with the byte immediately following th > > > Checksum field > > > REPEAT the following algorithm: > > > CkSum := CkSum + byte; (unsigned addition) > > > Rotate CkSum left one bit, rotating the most significant bit in > > > least significant bit; > > > IF, at the end, CkSum = 0 THEN > > > CkSum := $FFFF (all ones). > > > Reception of a datagram with CkSum equal to 0 implies that a checksum is not performed. > > > > > > Here is the old loop: > > > > while (len--) { > > sum += *data; > > sum <<=1; > > if (sum & 0x10000) { > > sum++; > > sum &= 0xffff; > > } > > data++; > > } > > > > My buggy loop is: > > > > while (len--) { > > sum += *data++; > > sum <<= 1; > > sum = ((sum >> 16) + sum) & 0xFFFF; > > } > > > > The problem is the carry from the first addition needs to be dropped > > not folded back (like IP). > > > > Corrected fast code is: > > > > while (len--) { > > sum += *data++; > > sum <<= 1; > > sum = (((sum & 0x10000) >> 16) + sum) & 0xffff; > > } > > > > At least it is correct on the standalone random data test, and the > > new code is 30% faster for the cached memory case (13.7 clks/byte vs 18 clks/byte). > > Testing... [root@lolo apple]# md5sum b/kernel-2.4.21-32898cl.i586.rpm kernel-2.4.21-32898cl.i586.rpm 79adde6c4dd97fb214d30009e100a835 b/kernel-2.4.21-32898cl.i586.rpm 79adde6c4dd97fb214d30009e100a835 kernel-2.4.21-32898cl.i586.rpm [root@lolo apple]# Perfect, it works as well, but as this is not bugfixing, but an improvement, I'd say this can well wait for 2.6.1 :-) Case closed. - Arnaldo From yoshfuji@linux-ipv6.org Fri Oct 31 19:15:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 19:16:14 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA13Fd25028988 for ; Fri, 31 Oct 2003 19:15:40 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hA13Fclg016507; Sat, 1 Nov 2003 12:15:38 +0900 Date: Sat, 01 Nov 2003 12:15:37 +0900 (JST) Message-Id: <20031101.121537.105697095.yoshfuji@linux-ipv6.org> To: raffaele.brancaleoni@sun.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org, akpm@digeo.com Subject: Re: Oops in 2.6.0-test[89] in tcp_v4_get_port (kernel with IPv6 enabled) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031031145542.28e8b820.akpm@osdl.org> References: <20031031145542.28e8b820.akpm@osdl.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA 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: 1161 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 <20031031145542.28e8b820.akpm@osdl.org> (at Fri, 31 Oct 2003 14:55:42 -0800), Andrew Morton says: > Date: Fri, 31 Oct 2003 12:30:06 +0100 > From: Raffaele Brancaleoni > To: linux-kernel@vger.kernel.org > Subject: Oops in 2.6.0-test[89] in tcp_v4_get_port (kernel with IPv6 enabled) : > I just encountered a oops with kernels 2.6.0-test8 and -test9 (system > freezes the hard way, not even magic-key works). Problem does not exist > in 2.4.20. : > I found a thread about similar issue in the archive > (thread subject: "oops in inet_bind/tcp_v4_get_port"). Yoshifuji Hideaki > provided a patch but unfortunately it causes some problems with > ip_nat_helper and ip_nat_cores modules compilation (duplicate functions > definitions)... Please try the latest bk tree (with IPv6 enable, of course). Thanks. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From evil@g-house.de Fri Oct 31 20:31:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 20:31:36 -0800 (PST) Received: from mail.g-house.de (mail.g-housing.de [62.75.136.201]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA14V125000487 for ; Fri, 31 Oct 2003 20:31:02 -0800 Received: from dadc1.d.pppool.de ([80.184.173.193] helo=g-house.de) by mail.g-house.de with asmtp (TLSv1:RC4-MD5:128) (Exim 4.20) id 1AFnPd-0003wu-BX; Sat, 01 Nov 2003 05:30:57 +0100 Message-ID: <3FA33702.60401@g-house.de> Date: Sat, 01 Nov 2003 05:30:58 +0100 From: Christian User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20030924 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: linux-kernel , netdev@oss.sgi.com Subject: ppc32 lockups with 2.6 X-Enigmail-Version: 0.81.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1162 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: evil@g-house.de Precedence: bulk X-list: netdev moin, i have problems with my ppc32 (PReP) machine and 2.6.0-test* kernels. since this is some kind of home "server", i did not test any ealier versions, but 2.6.0-test{7|8|9}. all show the same behaviour, somewhere during the bootup, the machine just freezes. i found out, that upon configuring my thernet devices the lockups occur. so, i have 2 network cards, both are working under 2.4 with the 3c59x (eth0) and tulip (eth1, it's an on-board 21140). loading the drivers by using insmod / modprobe succeeds, the driver registers, some messages are printed. e.g. Linux Tulip driver version 1.1.13 (May 11, 2002) PCI: Enabling device 0000:00:04.0 (0000 -> 0003) tulip0: EEPROM default media type Autosense. tulip0: Index #0 - Media AUI (#2) described by a 21140 non-MII (0) block. tulip0: Index #1 - Media MII (#11) described by a 21140 MII PHY (1) block. tulip0: MII transceiver #8 config 3100 status 786b advertising 01e1. eth0: Digital DS21140 Tulip rev 34 at 0x1800, 08:00:3E:29:0B:B6, IRQ 9. or 3c59x: Donald Becker and others. www.scyld.com/network/vortex.html See Documentation/networking/vortex.txt 0000:00:06.0: 3Com PCI 3c905C Tornado at 0x1000. Vers LK1.1.19 00:01:02:f1:83:37, IRQ 11 product code 464a rev 00.13 date 11-12-00 Internal config register is 1800000, transceivers 0xa. 8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate interface. MII transceiver found at address 24, status 782d. Enabling bus-master transmits and whole-frame receives. 0000:00:06.0: scatter/gather enabled. h/w checksums enabled "ifconfig eth0" gives then an unconfigured eth0, ok. but using "ifconfig eth0 192.168.1.1" results in a lockup. no oops printed, no SysReq anymore. i tried with the "tulip" modul first, and could "strace" the ifconfig, until it freezes. http://nerdbynature.de/bits/sheep/network/ifc-tulip.log the 3c59x module however acted somehow differently: upon using "ifconfig eth0 192.168.1.1" the screen filled with strange chars in some pattern, i've never seen before on a linux box (no, i was clean :-)) (ok, the pattern is probably not important, but it's on [1] anyway) then, the system locked up too. as you can see (http://nerdbynature.de/bits/sheep/network/config) i have then compiled some debug options into the kernel, i loaded the 3c59x module with "debug=6". also, i want to say that this is not my first build of a 2.6 kernel, i have a i386 running pretty stable with 2.6 for weeks now; some time ago i used to have an Alpha (AXP) with 2.5.x running 24x7. please let me know, i have forgotten something or where to look further. i will be glad to help with running tests and the like. i don't suspect hw errors here, because both cards are happy working under 2.4. some details about the PrEP machine: [1] http://nerdbynature.de/bits/ Thank you, Christian. -- BOFH excuse #396: Mail server hit by UniSpammer. From acme@conectiva.com.br Fri Oct 31 21:19:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 21:20:07 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA15JV25001550 for ; Fri, 31 Oct 2003 21:19:32 -0800 Received: from [200.181.168.139] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AFoBq-00077X-00; Sat, 01 Nov 2003 03:20:46 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 64F761966D; Sat, 1 Nov 2003 05:19:31 +0000 (UTC) Date: Sat, 1 Nov 2003 03:19:31 -0200 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: Jean Tourrilhes , Linux Networking Development Mailing List Subject: [PATCH] fix skb leak in af_irda.c Message-ID: <20031101051931.GI3705@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1163 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 Hi David, Jean, Please apply. - Arnaldo ===== net/irda/af_irda.c 1.46 vs edited ===== --- 1.46/net/irda/af_irda.c Sat Aug 30 23:15:30 2003 +++ edited/net/irda/af_irda.c Sat Nov 1 03:18:02 2003 @@ -187,12 +187,12 @@ IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); + dev_kfree_skb(skb); + // Should be ??? skb_queue_tail(&sk->sk_receive_queue, skb); + sk = self->sk; if (sk == NULL) return; - - dev_kfree_skb(skb); - // Should be ??? skb_queue_tail(&sk->sk_receive_queue, skb); /* How much header space do we need to reserve */ self->max_header_size = max_header_size; From acme@conectiva.com.br Fri Oct 31 22:11:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 22:12:01 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA16BP25002253 for ; Fri, 31 Oct 2003 22:11:26 -0800 Received: from [200.181.168.139] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AFp04-00079d-00; Sat, 01 Nov 2003 04:12:40 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 057331966D; Sat, 1 Nov 2003 06:11:24 +0000 (UTC) Date: Sat, 1 Nov 2003 04:11:24 -0200 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: Jean Tourrilhes , Linux Networking Development Mailing List Subject: [PATCH] IRDA: fix skb leak in irda_connect_indication Message-ID: <20031101061124.GJ3705@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1164 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 Hi David, Jean, Please apply. - Arnaldo ===== net/irda/af_irda.c 1.46 vs edited ===== --- 1.46/net/irda/af_irda.c Sat Aug 30 23:15:30 2003 +++ edited/net/irda/af_irda.c Sat Nov 1 04:07:41 2003 @@ -248,8 +248,10 @@ IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); sk = self->sk; - if (sk == NULL) + if (sk == NULL) { + kfree_skb(skb); return; + } /* How much header space do we need to reserve */ self->max_header_size = max_header_size; From acme@conectiva.com.br Fri Oct 31 22:55:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Oct 2003 22:56:00 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA16t525002850 for ; Fri, 31 Oct 2003 22:55:26 -0800 Received: from [200.181.168.139] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AFpgK-0007Ba-00; Sat, 01 Nov 2003 04:56:20 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 2650A1966D; Sat, 1 Nov 2003 06:55:04 +0000 (UTC) Date: Sat, 1 Nov 2003 04:55:04 -0200 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: Linux Networking Development Mailing List Subject: [PATCH] LLC: fix procfs reading when there are saps without sockets Message-ID: <20031101065504.GK3705@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1165 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 Hi David, Noticed while on a ssh over PF_LLC session on a machine that had Appletalk/SNAP running, doing a cat /proc/net/llc/socket returned nothing when there were the sshd listening socket and the ssh connection. Just removing this anyway uneeded test fix this bug. Please apply. Best Regards, - Arnaldo ===== net/llc/llc_proc.c 1.20 vs edited ===== --- 1.20/net/llc/llc_proc.c Thu Oct 30 16:35:41 2003 +++ edited/net/llc/llc_proc.c Sat Nov 1 04:48:06 2003 @@ -48,8 +48,6 @@ --pos; } read_unlock_bh(&sap->sk_list.lock); - if (!pos) - break; } sk = NULL; found: