From herbert@gondor.apana.org.au Tue Jun 1 05:26:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 05:26:24 -0700 (PDT) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51CQFgi031236 for ; Tue, 1 Jun 2004 05:26:17 -0700 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1BV8LC-0007jA-00; Tue, 01 Jun 2004 22:26:02 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1BV8L9-00059K-00; Tue, 01 Jun 2004 22:25:59 +1000 Date: Tue, 1 Jun 2004 22:25:59 +1000 To: "David S. Miller" , netdev@oss.sgi.com Subject: [IPSEC] Fix xfrm_tunnel leak Message-ID: <20040601122559.GA19761@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i From: Herbert Xu X-archive-position: 5515 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dave: I recently managed to create a mode=tunnel state that I couldn't get rid of: 192.168.0.6 192.168.0.178 unspec mode=tunnel spi=3232235526(0xc0a80006) reqid=0(0x00000000) seq=0x00000000 replay=0 flags=0x00000000 state=mature created: May 29 13:20:10 2004 current: Jun 1 22:23:15 2004 diff: 291785(s) hard: 0(s) soft: 0(s) last: hard: 0(s) soft: 0(s) current: 0(bytes) hard: 0(bytes) soft: 0(bytes) allocated: 0 hard: 0 soft: 0 sadb_seq=0 pid=19776 refcnt=0 Turns out that the IPIP tunnel used by IPCOMP states are only freed if the IPCOMP state is deleted by xfrm_state_delete. This is not the case for all states. For example, an immature IPCOMP state that dies in add_sa will not go through xfrm_state_delete. The following patch moves the delete_tunnel call into IPCOMP's destructor. I think it makes more sense there as IPCOMP is the only user of the tunnel anyway. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv4/ipcomp.c 1.19 vs edited ===== --- 1.19/net/ipv4/ipcomp.c 2004-04-17 06:54:43 +10:00 +++ edited/net/ipv4/ipcomp.c 2004-06-01 22:21:02 +10:00 @@ -339,6 +339,7 @@ struct ipcomp_data *ipcd = x->data; if (!ipcd) return; + xfrm_state_delete_tunnel(x); ipcomp_free_data(ipcd); kfree(ipcd); } ===== net/xfrm/xfrm_state.c 1.44 vs edited ===== --- 1.44/net/xfrm/xfrm_state.c 2004-05-30 18:20:34 +10:00 +++ edited/net/xfrm/xfrm_state.c 2004-06-01 22:18:09 +10:00 @@ -231,7 +231,6 @@ void xfrm_state_delete(struct xfrm_state *x) { - xfrm_state_delete_tunnel(x); spin_lock_bh(&x->lock); __xfrm_state_delete(x); spin_unlock_bh(&x->lock); --UugvWAfsgieZRqgk-- From margitsw@t-online.de Tue Jun 1 08:46:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 08:46:11 -0700 (PDT) Received: from mailout10.sul.t-online.com (mailout10.sul.t-online.com [194.25.134.21]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51Fk7gi006616 for ; Tue, 1 Jun 2004 08:46:08 -0700 Received: from fwd08.aul.t-online.de by mailout10.sul.t-online.com with smtp id 1BUWdP-0006Jx-00; Sun, 30 May 2004 22:10:19 +0200 Received: from margit.t-online.de (TJ+RCBZAZenhvOVdrTt86V8tPLyzw4zj-lx7EhfiyPRDdZsSCLqfck@[80.128.220.231]) by fwd08.sul.t-online.com with esmtp id 1BUWd9-087UY40; Sun, 30 May 2004 22:10:03 +0200 Message-Id: <5.1.0.14.2.20040530215351.0c1f6cb8@pop.t-online.de> X-Sender: margitsw@pop.t-online.de X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sun, 30 May 2004 22:04:21 +0200 To: netdev@oss.sgi.com From: margitsw@t-online.de (Margit Schubert-While) Subject: [PATCH 14/17 linux-2.6.7-rc2] prism54: Reduce module verbosity Cc: jgarzik@pobox.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_50528325==_" X-Seen: false X-ID: TJ+RCBZAZenhvOVdrTt86V8tPLyzw4zj-lx7EhfiyPRDdZsSCLqfck X-archive-position: 5516 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev --=====================_50528325==_ Content-Type: text/plain; charset="us-ascii"; format=flowed 2004-05-01 Margit Schubert-While * Reduce module verbosity --=====================_50528325==_ Content-Type: application/octet-stream; name="14-reduce-verbosity.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="14-reduce-verbosity.patch" ZGlmZiAtTmF1ckViQiBsaW51eC0yLjYuNmN0L2RyaXZlcnMvbmV0L3dpcmVsZXNzL3ByaXNtNTQv aXNscGNpX2Rldi5jIGxpbnV4LTIuNi42LTAxL2RyaXZlcnMvbmV0L3dpcmVsZXNzL3ByaXNtNTQv aXNscGNpX2Rldi5jCi0tLSBsaW51eC0yLjYuNmN0L2RyaXZlcnMvbmV0L3dpcmVsZXNzL3ByaXNt NTQvaXNscGNpX2Rldi5jCTIwMDQtMDUtMjggMTU6NDg6MzQuMTU2MTEyMDMyICswMjAwCisrKyBs aW51eC0yLjYuNi0wMS9kcml2ZXJzL25ldC93aXJlbGVzcy9wcmlzbTU0L2lzbHBjaV9kZXYuYwky MDA0LTA1LTI4IDE1OjQ3OjUyLjkxNzM4MTI3MiArMDIwMApAQCAtNjksNyArNjksOSBAQAogCWlm IChyZWcgJiBJU0wzOFhYX0NUUkxfU1RBVF9TTEVFUE1PREUpCiAJCS8qIGRldmljZSBpcyBpbiBz bGVlcCBtb2RlLCBJUlEgd2FzIGdlbmVyYXRlZCBieSBzb21lb25lIGVsc2UgKi8KIAl7Ci0JCXBy aW50ayhLRVJOX0RFQlVHICJBc3N1bWluZyBzb21lb25lIGVsc2UgY2FsbGVkIHRoZSBJUlFcbiIp OworI2lmIFZFUkJPU0UgPiBTSE9XX0VSUk9SX01FU1NBR0VTCisJCURFQlVHKFNIT1dfVFJBQ0lO RywgIkFzc3VtaW5nIHNvbWVvbmUgZWxzZSBjYWxsZWQgdGhlIElSUVxuIik7CisjZW5kaWYKIAkJ cmV0dXJuIElSUV9OT05FOwogCX0KIAo= --=====================_50528325==_-- From shemminger@osdl.org Tue Jun 1 09:15:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 09:15:30 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51GFQgi007971 for ; Tue, 1 Jun 2004 09:15:26 -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 i51GDrr12390; Tue, 1 Jun 2004 09:13:53 -0700 Date: Tue, 1 Jun 2004 09:13:53 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: Herbert Xu , debian.bugs@kepier.clara.net, 251215@bugs.debian.org, jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: Bug#251215: kernel-image-2.6.6-1-k7: pppd locks up, cannot be killed, during ppp shutdown Message-Id: <20040601091353.53275685@dell_ss3.pdx.osdl.net> In-Reply-To: <20040529124833.5eca66d7.davem@redhat.com> References: <20040528124355.GA2391@gondor.apana.org.au> <40B744DC.9956BF50@kepier.clara.net> <20040529051736.GA11303@gondor.apana.org.au> <20040529124833.5eca66d7.davem@redhat.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i386-redhat-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: 5518 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: 1030 Lines: 33 On Sat, 29 May 2004 12:48:33 -0700 "David S. Miller" wrote: > On Sat, 29 May 2004 15:17:36 +1000 > Herbert Xu wrote: > > > Why do we need to call free_netdev after unregistering the netdev > > from the drivers at all? What's wrong with calling it from run_todo > > itself? > > Because the driver is the only agent which knows when it is safe > to free up the structure. It may still have some attached memory > to free, for example, ala: > > unregister_netdev(dev); > kfree(dev->priv); > free_netdev(dev); > > This is common, for example in drivers/net/tg3.c:tg3_remove_one() we > have: > > struct tg3 *tp = netdev_priv(dev); > > unregister_netdev(dev); > iounmap((void *)tp->regs); > free_netdev(dev); > Also, for those device that don't want to do anything in between: dev->destructor = free_netdev; Will end up calling free_netdev in the run_todo processing. This can be very handy when unregister needs to happen in some context already called with RTNL. From bogdan.costescu@iwr.uni-heidelberg.de Tue Jun 1 09:49:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 09:49:12 -0700 (PDT) Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51Gn7gi008972 for ; Tue, 1 Jun 2004 09:49:08 -0700 Received: from mail.iwr.uni-heidelberg.de (mail.iwr.uni-heidelberg.de [129.206.104.30]) by relay.uni-heidelberg.de (8.12.10/8.12.10) with ESMTP id i51Gmv1K022929; Tue, 1 Jun 2004 18:48:57 +0200 (MET DST) Received: from kenzo.iwr.uni-heidelberg.de (IDENT:qun9XNNMwSAhVLnStO7X4a//H7LYsWpP@kenzo.iwr.uni-heidelberg.de [129.206.120.29]) by mail.iwr.uni-heidelberg.de (8.12.10/8.12.9) with ESMTP id i51GmvrT009382; Tue, 1 Jun 2004 18:48:57 +0200 (MET DST) Received: from kenzo.iwr.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by kenzo.iwr.uni-heidelberg.de (8.12.8/8.12.8) with ESMTP id i51GmvCL005416; Tue, 1 Jun 2004 18:48:57 +0200 Received: from localhost (bogdan@localhost) by kenzo.iwr.uni-heidelberg.de (8.12.8/8.12.8/Submit) with ESMTP id i51Gmvnh005412; Tue, 1 Jun 2004 18:48:57 +0200 Date: Tue, 1 Jun 2004 18:48:57 +0200 (CEST) From: Bogdan Costescu To: netdev@oss.sgi.com cc: Andrew Morton Subject: [3c59x] Add support for ATI Radeon 9100 IGP Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5519 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bogdan.costescu@iwr.uni-heidelberg.de Precedence: bulk X-list: netdev Content-Length: 1936 Lines: 58 Hi! [ I don't know if Andrew (3c59x maintainer) still reads the vortex mailing list where I just posted the same patch, so I thought mentioning it on netdev as well would be a good idea. ] The patch adds support for the 3Com networking core found in the ATI Radeon 9100 IGP southbridge used on boards like Asus P4R800-VM. The patch is against the 3c59x driver from 2.6.6; it should apply cleanly to most other 2.6 versions and applies with some offsets also for 2.4.2x. A bit of discussion about the patch can be found on the vortex list archives, like: http://marc.theaimsgroup.com/?l=linux-vortex&m=108610754614149&w=2 --- linux-2.6.6-orig/drivers/net/3c59x.c 2004-05-10 04:31:55.000000000 +0200 +++ linux-2.6.6/drivers/net/3c59x.c 2004-05-25 23:45:29.000000000 +0200 @@ -446,6 +446,7 @@ CH_3C905B_2, CH_3C905B_FX, CH_3C905C, + CH_3C9202, CH_3C980, CH_3C9805, @@ -521,6 +522,8 @@ PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, }, {"3c905C Tornado", PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, }, + {"3C920B-EMB-WNM (ATI Radeon 9100 IGP)", + PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_MII|HAS_HWCKSM, 128, }, {"3c980 Cyclone", PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, }, {"3c980C Python-T", @@ -597,6 +600,7 @@ { 0x10B7, 0x9058, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_2 }, { 0x10B7, 0x905A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_FX }, { 0x10B7, 0x9200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905C }, + { 0x10B7, 0x9202, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C9202 }, { 0x10B7, 0x9800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C980 }, { 0x10B7, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C9805 }, -- Bogdan Costescu IWR - Interdisziplinaeres Zentrum fuer Wissenschaftliches Rechnen Universitaet Heidelberg, INF 368, D-69120 Heidelberg, GERMANY Telephone: +49 6221 54 8869, Telefax: +49 6221 54 8868 E-mail: Bogdan.Costescu@IWR.Uni-Heidelberg.De From davem@redhat.com Tue Jun 1 12:37:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 12:37:15 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51Jakgi027783 for ; Tue, 1 Jun 2004 12:37:09 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i51Jaci5030123; Tue, 1 Jun 2004 15:36:38 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i51Jab029371; Tue, 1 Jun 2004 15:36:37 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i51JaT4o003403; Tue, 1 Jun 2004 15:36:29 -0400 Date: Tue, 1 Jun 2004 12:35:42 -0700 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [IPSEC] Fix xfrm_tunnel leak Message-Id: <20040601123542.48e364e4.davem@redhat.com> In-Reply-To: <20040601122559.GA19761@gondor.apana.org.au> References: <20040601122559.GA19761@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5520 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: 566 Lines: 16 On Tue, 1 Jun 2004 22:25:59 +1000 Herbert Xu wrote: > Turns out that the IPIP tunnel used by IPCOMP states are only freed > if the IPCOMP state is deleted by xfrm_state_delete. > > This is not the case for all states. For example, an immature IPCOMP > state that dies in add_sa will not go through xfrm_state_delete. > > The following patch moves the delete_tunnel call into IPCOMP's > destructor. I think it makes more sense there as IPCOMP is the > only user of the tunnel anyway. Looks perfect, patch applied. Thanks Herbert. From margitsw@t-online.de Tue Jun 1 13:12:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 13:12:08 -0700 (PDT) Received: from mailout11.sul.t-online.com (mailout11.sul.t-online.com [194.25.134.85]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51KC0gi028855 for ; Tue, 1 Jun 2004 13:12:04 -0700 Received: from fwd05.aul.t-online.de by mailout11.sul.t-online.com with smtp id 1BUWbx-0003M4-00; Sun, 30 May 2004 22:08:49 +0200 Received: from margit.t-online.de (G59megZdQeSfVxZnmpeOox8UHYhYJc0-Z0sDLziBHT3YhthnJdiU6e@[80.128.220.231]) by fwd05.sul.t-online.com with esmtp id 1BUWbn-1HmenI0; Sun, 30 May 2004 22:08:39 +0200 Message-Id: <5.1.0.14.2.20040530213959.00b07890@pop.t-online.de> X-Sender: margitsw@pop.t-online.de X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sun, 30 May 2004 22:03:21 +0200 To: netdev@oss.sgi.com From: margitsw@t-online.de (Margit Schubert-While) Subject: [PATCH 7/17 linux-2.6.7-rc2] prism54: Fix endian patch Cc: jgarzik@pobox.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_50441250==_" X-Seen: false X-ID: G59megZdQeSfVxZnmpeOox8UHYhYJc0-Z0sDLziBHT3YhthnJdiU6e X-archive-position: 5521 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 3570 Lines: 54 --=====================_50441250==_ Content-Type: text/plain; charset="us-ascii"; format=flowed * Split out patch islpci_eth.c : * Fix endian problem (bug 74/75 related) --=====================_50441250==_ Content-Type: application/octet-stream; name="07-fix-endian.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="07-fix-endian.patch" ZGlmZiAtTmF1ckViIGxpbnV4LTIuNi42Y3QvZHJpdmVycy9uZXQvd2lyZWxlc3MvcHJpc201NC9p c2xwY2lfZXRoLmMgbGludXgtMi42LjYtMDEvZHJpdmVycy9uZXQvd2lyZWxlc3MvcHJpc201NC9p c2xwY2lfZXRoLmMKLS0tIGxpbnV4LTIuNi42Y3QvZHJpdmVycy9uZXQvd2lyZWxlc3MvcHJpc201 NC9pc2xwY2lfZXRoLmMJMjAwNC0wNS0yOCAxNDo0MDoyNi45OTY0NTQ3NDQgKzAyMDAKKysrIGxp bnV4LTIuNi42LTAxL2RyaXZlcnMvbmV0L3dpcmVsZXNzL3ByaXNtNTQvaXNscGNpX2V0aC5jCTIw MDQtMDUtMjggMTQ6MjU6MzAuMDY1ODA4OTI4ICswMjAwCkBAIC0yNjIsOSArMjYyLDkgQEAKIAlp ZiAocHJpdi0+bmRldi0+dHlwZSA9PSBBUlBIUkRfSUVFRTgwMjExX1BSSVNNKSB7CiAJCXN0cnVj dCBhdnNfODAyMTFfMV9oZWFkZXIgKmF2czsKIAkJLyogZXh0cmFjdCB0aGUgcmVsZXZhbnQgZGF0 YSBmcm9tIHRoZSBoZWFkZXIgKi8KLQkJdTMyIGNsb2NrID0gaGRyLT5jbG9jazsKKwkJdTMyIGNs b2NrID0gbGUzMl90b19jcHUoaGRyLT5jbG9jayk7CiAJCXU4IHJhdGUgPSBoZHItPnJhdGU7Ci0J CXUxNiBmcmVxID0gYmUxNl90b19jcHUoaGRyLT5mcmVxKTsKKwkJdTE2IGZyZXEgPSBsZTE2X3Rv X2NwdShoZHItPmZyZXEpOwogCQl1OCByc3NpID0gaGRyLT5yc3NpOwogCiAJCXNrYl9wdWxsKCpz a2IsIHNpemVvZiAoc3RydWN0IHJmbW9uX2hlYWRlcikpOwpAQCAtMjg4LDIwICsyODgsMjAgQEAK IAkJCQkJCQkgICBzaXplb2YgKHN0cnVjdAogCQkJCQkJCQkgICBhdnNfODAyMTFfMV9oZWFkZXIp KTsKIAotCQlhdnMtPnZlcnNpb24gPSBodG9ubChQODAyMTFDQVBUVVJFX1ZFUlNJT04pOwotCQlh dnMtPmxlbmd0aCA9IGh0b25sKHNpemVvZiAoc3RydWN0IGF2c184MDIxMV8xX2hlYWRlcikpOwot CQlhdnMtPm1hY3RpbWUgPSBfX2NwdV90b19iZTY0KGNsb2NrKTsKLQkJYXZzLT5ob3N0dGltZSA9 IF9fY3B1X3RvX2JlNjQoamlmZmllcyk7Ci0JCWF2cy0+cGh5dHlwZSA9IGh0b25sKDYpOwkvKk9G RE06IDYgZm9yIChnKSwgOCBmb3IgKGEpICovCi0JCWF2cy0+Y2hhbm5lbCA9IGh0b25sKGNoYW5u ZWxfb2ZfZnJlcShmcmVxKSk7Ci0JCWF2cy0+ZGF0YXJhdGUgPSBodG9ubChyYXRlICogNSk7Ci0J CWF2cy0+YW50ZW5uYSA9IGh0b25sKDApOwkvKnVua25vd24gKi8KLQkJYXZzLT5wcmlvcml0eSA9 IGh0b25sKDApOwkvKnVua25vd24gKi8KLQkJYXZzLT5zc2lfdHlwZSA9IGh0b25sKDIpOwkvKjI6 IGRCbSwgMzogcmF3IFJTU0kgKi8KLQkJYXZzLT5zc2lfc2lnbmFsID0gaHRvbmwocnNzaSk7Ci0J CWF2cy0+c3NpX25vaXNlID0gaHRvbmwocHJpdi0+bG9jYWxfaXdzdGF0aXN0aWNzLnF1YWwubm9p c2UpOwkvKmJldHRlciB0aGFuICd1bmRlZmluZWQnLCBJIGFzc3VtZSAqLwotCQlhdnMtPnByZWFt YmxlID0gaHRvbmwoMCk7CS8qdW5rbm93biAqLwotCQlhdnMtPmVuY29kaW5nID0gaHRvbmwoMCk7 CS8qdW5rbm93biAqLworCQlhdnMtPnZlcnNpb24gPSBjcHVfdG9fYmUzMihQODAyMTFDQVBUVVJF X1ZFUlNJT04pOworCQlhdnMtPmxlbmd0aCA9IGNwdV90b19iZTMyKHNpemVvZiAoc3RydWN0IGF2 c184MDIxMV8xX2hlYWRlcikpOworCQlhdnMtPm1hY3RpbWUgPSBjcHVfdG9fYmU2NChsZTY0X3Rv X2NwdShjbG9jaykpOworCQlhdnMtPmhvc3R0aW1lID0gY3B1X3RvX2JlNjQoamlmZmllcyk7CisJ CWF2cy0+cGh5dHlwZSA9IGNwdV90b19iZTMyKDYpOwkvKk9GRE06IDYgZm9yIChnKSwgOCBmb3Ig KGEpICovCisJCWF2cy0+Y2hhbm5lbCA9IGNwdV90b19iZTMyKGNoYW5uZWxfb2ZfZnJlcShmcmVx KSk7CisJCWF2cy0+ZGF0YXJhdGUgPSBjcHVfdG9fYmUzMihyYXRlICogNSk7CisJCWF2cy0+YW50 ZW5uYSA9IGNwdV90b19iZTMyKDApOwkvKnVua25vd24gKi8KKwkJYXZzLT5wcmlvcml0eSA9IGNw dV90b19iZTMyKDApOwkvKnVua25vd24gKi8KKwkJYXZzLT5zc2lfdHlwZSA9IGNwdV90b19iZTMy KDMpOwkvKjI6IGRCbSwgMzogcmF3IFJTU0kgKi8KKwkJYXZzLT5zc2lfc2lnbmFsID0gY3B1X3Rv X2JlMzIocnNzaSAmIDB4N2YpOworCQlhdnMtPnNzaV9ub2lzZSA9IGNwdV90b19iZTMyKHByaXYt PmxvY2FsX2l3c3RhdGlzdGljcy5xdWFsLm5vaXNlKTsJLypiZXR0ZXIgdGhhbiAndW5kZWZpbmVk JywgSSBhc3N1bWUgKi8KKwkJYXZzLT5wcmVhbWJsZSA9IGNwdV90b19iZTMyKDApOwkvKnVua25v d24gKi8KKwkJYXZzLT5lbmNvZGluZyA9IGNwdV90b19iZTMyKDApOwkvKnVua25vd24gKi8KIAl9 IGVsc2UKIAkJc2tiX3B1bGwoKnNrYiwgc2l6ZW9mIChzdHJ1Y3QgcmZtb25faGVhZGVyKSk7CiAK --=====================_50441250==_-- From ebs@ebshome.net Tue Jun 1 13:17:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 13:17:34 -0700 (PDT) Received: from gate.ebshome.net (gate.ebshome.net [66.92.248.57]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51KHTgi029252 for ; Tue, 1 Jun 2004 13:17:32 -0700 Received: (qmail 19060 invoked by uid 1000); 1 Jun 2004 13:17:24 -0700 Date: Tue, 1 Jun 2004 13:17:24 -0700 From: Eugene Surovegin To: Herbert Xu Cc: netdev@oss.sgi.com, davem@redhat.com Subject: Re: [IPSEC] fix ref counting in __xfrm4_bundle_create() Message-ID: <20040601201724.GA17412@gate.ebshome.net> Mail-Followup-To: Herbert Xu , netdev@oss.sgi.com, davem@redhat.com References: <20040529001450.GA647@gate.ebshome.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ICQ-UIN: 1193073 X-Operating-System: Linux i686 User-Agent: Mutt/1.5.5.1i X-archive-position: 5522 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ebs@ebshome.net Precedence: bulk X-list: netdev Content-Length: 310 Lines: 9 On Sat, May 29, 2004 at 01:27:13PM +1000, Herbert Xu wrote: > However, can you see if the following patch fixes this problem as well? > It moves the dst->xfrm assignment to a spot where errors cannot occur. Yes, your version is OK. We haven't got the crash during our testing. Thanks a lot, Herbert. Eugene From dlstevens@us.ibm.com Tue Jun 1 13:19:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 13:19:27 -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.9) with SMTP id i51KJNgi029576 for ; Tue, 1 Jun 2004 13:19:25 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i51KJ6Y0642848; Tue, 1 Jun 2004 16:19:07 -0400 Received: from d03nm121.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i51KJ65n195444; Tue, 1 Jun 2004 14:19:06 -0600 In-Reply-To: <20040531151843.7144dfce.akpm@osdl.org> To: Andrew Morton Cc: netdev@oss.sgi.com, Russell Leighton MIME-Version: 1.0 Subject: Re: Fw: F_SETSIG broken/changed in 2.6 for UDP and TCP sockets? X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Tue, 1 Jun 2004 14:19:04 -0600 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF259 | March 11, 2004) at 06/01/2004 14:19:06, Serialize complete at 06/01/2004 14:19:06 Content-Type: text/plain; charset="US-ASCII" X-archive-position: 5523 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: 1008 Lines: 21 > In the udp case, I when I listen for multicast packets my app only > receives them when I am running a tcpdump (bizarre!). Russ, This piece (which I expect has nothing to do with the other problems you mentioned) sounds like you haven't joined the groups on the interface on which you're receiving the multicast packets. "tcpdump" will place the interface in "promiscuous mode" which will receive all packets, and ordinary packet delivery will allow the application to receive them, even if you haven't joined the group on the relevant interface. To verify if the group joins is broken, you can look at /proc/net/igmp. If the groups you're joining are not listed on the interface you want, the program isn't joining the groups correctly. Group membership is per-interface, so joining a group on one interface does not join it on another. Feel free to contact me if you need some help debugging the multicast problem. +-DLS From margitsw@t-online.de Tue Jun 1 13:45:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 13:45:06 -0700 (PDT) Received: from mailout06.sul.t-online.com (mailout06.sul.t-online.com [194.25.134.19]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51Kj1gi030513 for ; Tue, 1 Jun 2004 13:45:02 -0700 Received: from fwd01.aul.t-online.de by mailout06.sul.t-online.com with smtp id 1BUWcn-0000uN-09; Sun, 30 May 2004 22:09:41 +0200 Received: from margit.t-online.de (Xdua3BZLZewH9yNGwCyVKv-O4YQ+XIYJCDQwCblzaeWfpo4P4ZvxoF@[80.128.220.231]) by fwd01.sul.t-online.com with esmtp id 1BUWck-0pdcQa0; Sun, 30 May 2004 22:09:38 +0200 Message-Id: <5.1.0.14.2.20040530215003.00b1f4d0@pop.t-online.de> X-Sender: margitsw@pop.t-online.de X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sun, 30 May 2004 22:00:09 +0200 To: netdev@oss.sgi.com From: margitsw@t-online.de (Margit Schubert-While) Subject: [PATCH 12/17 linux-2.6.7-rc2] prism54: Add likely/unlikely, KO wds completely Cc: jgarzik@pobox.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_50498543==_" X-Seen: false X-ID: Xdua3BZLZewH9yNGwCyVKv-O4YQ+XIYJCDQwCblzaeWfpo4P4ZvxoF X-archive-position: 5524 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 7424 Lines: 107 --=====================_50498543==_ Content-Type: text/plain; charset="us-ascii"; format=flowed 2004-04-26 Margit Schubert-While * islpci_mgt.h : Replace init_wds with a define. The compiler does not optimize it out (and also generates the field in the ro section of every module) * prismcompat.h : Include linux/compiler.h Now we can play with the likely/unlikely macros --=====================_50498543==_ Content-Type: application/octet-stream; name="12-add-likely.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="12-add-likely.patch" ZGlmZiAtTmF1ckViQiBsaW51eC0yLjYuNmN0L2RyaXZlcnMvbmV0L3dpcmVsZXNzL3ByaXNtNTQv aXNsX2lvY3RsLmMgbGludXgtMi42LjYtMDEvZHJpdmVycy9uZXQvd2lyZWxlc3MvcHJpc201NC9p c2xfaW9jdGwuYwotLS0gbGludXgtMi42LjZjdC9kcml2ZXJzL25ldC93aXJlbGVzcy9wcmlzbTU0 L2lzbF9pb2N0bC5jCTIwMDQtMDUtMjggMTU6MTQ6NDkuNDE4OTE4ODcyICswMjAwCisrKyBsaW51 eC0yLjYuNi0wMS9kcml2ZXJzL25ldC93aXJlbGVzcy9wcmlzbTU0L2lzbF9pb2N0bC5jCTIwMDQt MDUtMjggMTU6MzM6NDIuMTg0NzEyMjk2ICswMjAwCkBAIC0yMTUyLDcgKzIxNDYsNyBAQAogCXtQ UklTTTU0X0RCR19PSUQsIElXX1BSSVZfVFlQRV9JTlQgfCBJV19QUklWX1NJWkVfRklYRUQgfCAx LCAwLAogCSAiZGJnX29pZCJ9LAogCXtQUklTTTU0X0RCR19HRVRfT0lELCAwLCBJV19QUklWX1RZ UEVfQllURSB8IDI1NiwgImRiZ19nZXRfb2lkIn0sCi0Je1BSSVNNNTRfREJHX1NFVF9PSUQsIElX X1BSSVZfVFlQRV9CWVRFIHwgMjU2LCAwLCAiZGJnX2dldF9vaWQifSwKKwl7UFJJU001NF9EQkdf U0VUX09JRCwgSVdfUFJJVl9UWVBFX0JZVEUgfCAyNTYsIDAsICJkYmdfc2V0X29pZCJ9LAogCS8q IC0tLSBzdWItaW9jdGxzIGhhbmRsZXJzIC0tLSAqLwogCXtQUklTTTU0X0dFVF9PSUQsCiAJIDAs IElXX1BSSVZfVFlQRV9DSEFSIHwgSVdfUFJJVl9TSVpFX0ZJWEVEIHwgUFJJVl9TVFJfU0laRSwg IiJ9LApkaWZmIC1OYXVyRWJCIGxpbnV4LTIuNi42Y3QvZHJpdmVycy9uZXQvd2lyZWxlc3MvcHJp c201NC9pc2xwY2lfZXRoLmMgbGludXgtMi42LjYtMDEvZHJpdmVycy9uZXQvd2lyZWxlc3MvcHJp c201NC9pc2xwY2lfZXRoLmMKLS0tIGxpbnV4LTIuNi42Y3QvZHJpdmVycy9uZXQvd2lyZWxlc3Mv cHJpc201NC9pc2xwY2lfZXRoLmMJMjAwNC0wNS0yOCAxNDo0MTozMi44MjA0NDc5NzYgKzAyMDAK KysrIGxpbnV4LTIuNi42LTAxL2RyaXZlcnMvbmV0L3dpcmVsZXNzL3ByaXNtNTQvaXNscGNpX2V0 aC5jCTIwMDQtMDUtMjggMTU6MzM6NDIuMTg3NzExODQwICswMjAwCkBAIC0xMDUsNyArMTA1LDcg QEAKIAogCS8qIGNoZWNrIHdoZXRoZXIgdGhlIGRlc3RpbmF0aW9uIHF1ZXVlIGhhcyBlbm91Z2gg ZnJhZ21lbnRzIGZvciB0aGUgZnJhbWUgKi8KIAljdXJyX2ZyYWcgPSBsZTMyX3RvX2NwdShjYi0+ ZHJpdmVyX2N1cnJfZnJhZ1tJU0wzOFhYX0NCX1RYX0RBVEFfTFFdKTsKLQlpZiAoY3Vycl9mcmFn IC0gcHJpdi0+ZnJlZV9kYXRhX3R4ID49IElTTDM4WFhfQ0JfVFhfUVNJWkUpIHsKKwlpZiAodW5s aWtlbHkoY3Vycl9mcmFnIC0gcHJpdi0+ZnJlZV9kYXRhX3R4ID49IElTTDM4WFhfQ0JfVFhfUVNJ WkUpKSB7CiAJCXByaW50ayhLRVJOX0VSUiAiJXM6IHRyYW5zbWl0IGRldmljZSBxdWV1ZSBmdWxs IHdoZW4gYXdha2VcbiIsCiAJCSAgICAgICBuZGV2LT5uYW1lKTsKIAkJbmV0aWZfc3RvcF9xdWV1 ZShuZGV2KTsKQEAgLTEyMSw3ICsxMjEsNyBAQAogCS8qIENoZWNrIGFsaWdubWVudCBhbmQgV0RT IGZyYW1lIGZvcm1hdHRpbmcuIFRoZSBzdGFydCBvZiB0aGUgcGFja2V0IHNob3VsZAogCSAqIGJl IGFsaWduZWQgb24gYSA0LWJ5dGUgYm91bmRhcnkuIElmIFdEUyBpcyBlbmFibGVkIGFkZCBhbm90 aGVyIDYgYnl0ZXMKIAkgKiBhbmQgYWRkIFdEUyBhZGRyZXNzIGluZm9ybWF0aW9uICovCi0JaWYg KCgobG9uZykgc2tiLT5kYXRhICYgMHgwMykgfCBpbml0X3dkcykgeworCWlmICh1bmxpa2VseSgo KGxvbmcpIHNrYi0+ZGF0YSAmIDB4MDMpIHwgaW5pdF93ZHMpKSB7CiAJCS8qIGdldCB0aGUgbnVt YmVyIG9mIGJ5dGVzIHRvIGFkZCBhbmQgcmUtYWxsaWduICovCiAJCW9mZnNldCA9ICg0IC0gKGxv bmcpIHNrYi0+ZGF0YSkgJiAweDAzOwogCQlvZmZzZXQgKz0gaW5pdF93ZHMgPyA2IDogMDsKQEAg LTE5Miw3ICsxOTIsNyBAQAogCXBjaV9tYXBfYWRkcmVzcyA9IHBjaV9tYXBfc2luZ2xlKHByaXYt PnBkZXYsCiAJCQkJCSAodm9pZCAqKSBza2ItPmRhdGEsIHNrYi0+bGVuLAogCQkJCQkgUENJX0RN QV9UT0RFVklDRSk7Ci0JaWYgKHBjaV9tYXBfYWRkcmVzcyA9PSAwKSB7CisJaWYgKHVubGlrZWx5 KHBjaV9tYXBfYWRkcmVzcyA9PSAwKSkgewogCQlwcmludGsoS0VSTl9XQVJOSU5HICIlczogY2Fu bm90IG1hcCBidWZmZXIgdG8gUENJXG4iLAogCQkgICAgICAgbmRldi0+bmFtZSk7CiAKQEAgLTM4 MiwxMCArMzgyLDEwIEBACiAJc2tiLT5kZXYgPSBuZGV2OwogCiAJLyogdGFrZSBjYXJlIG9mIG1v bml0b3IgbW9kZSBhbmQgc3B5IG1vbml0b3JpbmcuICovCi0JaWYgKHByaXYtPml3X21vZGUgPT0g SVdfTU9ERV9NT05JVE9SKQorCWlmICh1bmxpa2VseShwcml2LT5pd19tb2RlID09IElXX01PREVf TU9OSVRPUikpCiAJCWRpc2NhcmQgPSBpc2xwY2lfbW9uaXRvcl9yeChwcml2LCAmc2tiKTsKIAll bHNlIHsKLQkJaWYgKHNrYi0+ZGF0YVsyICogRVRIX0FMRU5dID09IDApIHsKKwkJaWYgKHVubGlr ZWx5KHNrYi0+ZGF0YVsyICogRVRIX0FMRU5dID09IDApKSB7CiAJCQkvKiBUaGUgcGFja2V0IGhh cyBhIHJ4X2FubmV4LiBSZWFkIGl0IGZvciBzcHkgbW9uaXRvcmluZywgVGhlbgogCQkJICogcmVt b3ZlIGl0LCB3aGlsZSBrZWVwaW5nIHRoZSAyIGxlYWRpbmcgTUFDIGFkZHIuCiAJCQkgKi8KQEAg LTQxOCw3ICs0MTgsNyBAQAogCSAgICAgc2tiLT5kYXRhWzBdLCBza2ItPmRhdGFbMV0sIHNrYi0+ ZGF0YVsyXSwgc2tiLT5kYXRhWzNdLAogCSAgICAgc2tiLT5kYXRhWzRdLCBza2ItPmRhdGFbNV0p OwogI2VuZGlmCi0JaWYgKGRpc2NhcmQpIHsKKwlpZiAodW5saWtlbHkoZGlzY2FyZCkpIHsKIAkJ ZGV2X2tmcmVlX3NrYihza2IpOwogCQlza2IgPSBOVUxMOwogCX0gZWxzZQpAQCAtNDM0LDcgKzQz NCw4IEBACiAJICAgICAgIGluZGV4IC0gcHJpdi0+ZnJlZV9kYXRhX3J4IDwgSVNMMzhYWF9DQl9S WF9RU0laRSkgewogCQkvKiBhbGxvY2F0ZSBhbiBza19idWZmIGZvciByZWNlaXZlZCBkYXRhIGZy YW1lcyBzdG9yYWdlCiAJCSAqIGluY2x1ZGUgYW55IHJlcXVpcmVkIGFsbGlnbm1lbnQgb3BlcmF0 aW9ucyAqLwotCQlpZiAoc2tiID0gZGV2X2FsbG9jX3NrYihNQVhfRlJBR01FTlRfU0laRV9SWCAr IDIpLCBza2IgPT0gTlVMTCkgeworCQlza2IgPSBkZXZfYWxsb2Nfc2tiKE1BWF9GUkFHTUVOVF9T SVpFX1JYICsgMik7CisJCWlmICh1bmxpa2VseShza2IgPT0gTlVMTCkpIHsKIAkJCS8qIGVycm9y IGFsbG9jYXRpbmcgYW4gc2tfYnVmZiBzdHJ1Y3R1cmUgZWxlbWVudHMgKi8KIAkJCURFQlVHKFNI T1dfRVJST1JfTUVTU0FHRVMsICJFcnJvciBhbGxvY2F0aW5nIHNrYiBcbiIpOwogCQkJYnJlYWs7 CkBAIC00NTQsNyArNDU1LDcgQEAKIAkJICAgIHBjaV9tYXBfc2luZ2xlKHByaXYtPnBkZXYsICh2 b2lkICopIHNrYi0+ZGF0YSwKIAkJCQkgICBNQVhfRlJBR01FTlRfU0laRV9SWCArIDIsCiAJCQkJ ICAgUENJX0RNQV9GUk9NREVWSUNFKTsKLQkJaWYgKHByaXYtPnBjaV9tYXBfcnhfYWRkcmVzc1tp bmRleF0gPT0gKGRtYV9hZGRyX3QpIE5VTEwpIHsKKwkJaWYgKHVubGlrZWx5KHByaXYtPnBjaV9t YXBfcnhfYWRkcmVzc1tpbmRleF0gPT0gKGRtYV9hZGRyX3QpIE5VTEwpKSB7CiAJCQkvKiBlcnJv ciBtYXBwaW5nIHRoZSBidWZmZXIgdG8gZGV2aWNlIGFjY2Vzc2FibGUgbWVtb3J5IGFkZHJlc3Mg Ki8KIAkJCURFQlVHKFNIT1dfRVJST1JfTUVTU0FHRVMsCiAJCQkgICAgICAiRXJyb3IgbWFwcGlu ZyBETUEgYWRkcmVzc1xuIik7CmRpZmYgLU5hdXJFYkIgbGludXgtMi42LjZjdC9kcml2ZXJzL25l dC93aXJlbGVzcy9wcmlzbTU0L2lzbHBjaV9tZ3QuaCBsaW51eC0yLjYuNi0wMS9kcml2ZXJzL25l dC93aXJlbGVzcy9wcmlzbTU0L2lzbHBjaV9tZ3QuaAotLS0gbGludXgtMi42LjZjdC9kcml2ZXJz L25ldC93aXJlbGVzcy9wcmlzbTU0L2lzbHBjaV9tZ3QuaAkyMDA0LTA1LTI4IDE0OjQwOjI3LjAw MDQ1NDEzNiArMDIwMAorKysgbGludXgtMi42LjYtMDEvZHJpdmVycy9uZXQvd2lyZWxlc3MvcHJp c201NC9pc2xwY2lfbWd0LmgJMjAwNC0wNS0yOCAxNTozMzo0Mi4xODg3MTE2ODggKzAyMDAKQEAg LTM0LDcgKzM0LDcgQEAKICNkZWZpbmUgVFJBQ0UoZGV2bmFtZSkgICBLX0RFQlVHKFNIT1dfVFJB Q0lORywgVkVSQk9TRSwgIiVzOiAgLT4gIiBfX0ZVTkNUSU9OX18gIigpXG4iLCBkZXZuYW1lKQog CiBleHRlcm4gaW50IHBjX2RlYnVnOwotc3RhdGljIGNvbnN0IGludCBpbml0X3dkcyA9IDA7CS8q IGhlbHAgY29tcGlsZXIgb3B0aW1pemUgYXdheSBkZWFkIGNvZGUgKi8KKyNkZWZpbmUgaW5pdF93 ZHMgICAwCS8qIGhlbHAgY29tcGlsZXIgb3B0aW1pemUgYXdheSBkZWFkIGNvZGUgKi8KIAogCiAv KiBHZW5lcmFsIGRyaXZlciBkZWZpbml0aW9ucyAqLwpkaWZmIC1OYXVyRWJCIGxpbnV4LTIuNi42 Y3QvZHJpdmVycy9uZXQvd2lyZWxlc3MvcHJpc201NC9wcmlzbWNvbXBhdC5oIGxpbnV4LTIuNi42 LTAxL2RyaXZlcnMvbmV0L3dpcmVsZXNzL3ByaXNtNTQvcHJpc21jb21wYXQuaAotLS0gbGludXgt Mi42LjZjdC9kcml2ZXJzL25ldC93aXJlbGVzcy9wcmlzbTU0L3ByaXNtY29tcGF0LmgJMjAwNC0w NS0yOCAxNDo0MDoyNy4wMDM0NTM2ODAgKzAyMDAKKysrIGxpbnV4LTIuNi42LTAxL2RyaXZlcnMv bmV0L3dpcmVsZXNzL3ByaXNtNTQvcHJpc21jb21wYXQuaAkyMDA0LTA1LTI4IDE1OjMzOjQyLjE5 MDcxMTM4NCArMDIwMApAQCAtMzIsNiArMzIsNyBAQAogI2luY2x1ZGUgPGxpbnV4L2NvbmZpZy5o PgogI2luY2x1ZGUgPGxpbnV4L21vZHVsZXBhcmFtLmg+CiAjaW5jbHVkZSA8bGludXgvd29ya3F1 ZXVlLmg+CisjaW5jbHVkZSA8bGludXgvY29tcGlsZXIuaD4KIAogI2lmICFkZWZpbmVkKENPTkZJ R19GV19MT0FERVIpICYmICFkZWZpbmVkKENPTkZJR19GV19MT0FERVJfTU9EVUxFKQogI2Vycm9y IEZpcm13YXJlIExvYWRpbmcgaXMgbm90IGNvbmZpZ3VyZWQgaW4gdGhlIGtlcm5lbCAhCg== --=====================_50498543==_-- From russ@elegant-software.com Tue Jun 1 15:45:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 15:45:34 -0700 (PDT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51MjPgi001064 for ; Tue, 1 Jun 2004 15:45:26 -0700 Received: from michael.elegant-software.com (pcp04414833pcs.nrockv01.md.comcast.net[69.140.188.59]) by comcast.net (sccrmhc13) with ESMTP id <2004060122451901600q73fne>; Tue, 1 Jun 2004 22:45:19 +0000 Received: from elegant-software.com (unknown [192.168.2.4]) by michael.elegant-software.com (Postfix) with ESMTP id DE6CD47831; Tue, 1 Jun 2004 18:48:28 -0400 (EDT) Message-ID: <40BD07BC.8030302@elegant-software.com> Date: Tue, 01 Jun 2004 18:48:28 -0400 From: Russell Leighton User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Stevens Cc: Andrew Morton , netdev@oss.sgi.com Subject: Re: Fw: F_SETSIG broken/changed in 2.6 for UDP and TCP sockets? References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------040609040703050508040004" X-archive-position: 5525 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: russ@elegant-software.com Precedence: bulk X-list: netdev Content-Length: 10559 Lines: 279 This is a multi-part message in MIME format. --------------040609040703050508040004 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thanks for the suggestion. I tried using the interface itself and INADDR_ANY...the signals are not being received under 2.6 (FedoraCore2) UNLESS tcpdump is running...note this works fine under 2.4. Below is the code fragment that sets up the socket (the previous email had the code fragment that sets up the posix rt signals on the fd), any help would be greatly appreciated: /* mc_fd */ { /* make it */ if ( (h->state.mc_fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1 ) { aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler cannot create socket: %s", strerror(errno)); goto error; } /* set it to nonblocking so that this can be async */ if ( fcntl(h->state.mc_fd, F_SETFL, O_NONBLOCK) == -1) { aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler cannot set socket nonblocking: %s", strerror(errno)); goto error; } /* set the mc interface */ if ( setsockopt(h->state.mc_fd, IPPROTO_IP, IP_MULTICAST_IF, &(h->mcast_if_addr), sizeof(h->mcast_if_addr)) < 0 ) { u_int8_t *ip = (u_int8_t *)&(h->mcast_if_addr); aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler cannot set socket IP_MULTICAST_IF for %u.%u.%u.%u: %s", ip[0],ip[1],ip[2],ip[4], strerror(errno)); goto error; } { /* debugging where packets are going when you have many interfaces is a pain, you want to log this! */ u_int8_t *ip = (u_int8_t *)&(h->mcast_if_addr); aw_log(h->handler_header.logger, AW_INFO_LOG_LEVEL, "mcrxhandler running multicast on interface %u.%u.%u.%u", ip[0],ip[1],ip[2],ip[3]); } /* use setsockopt() to request that the kernel join a multicast group */ { struct ip_mreq mreq; /* set up */ memset(&mreq, 0 , sizeof(mreq)); mreq.imr_multiaddr.s_addr= h->mcast_grp_addr.sin_addr.s_addr; mreq.imr_interface.s_addr= h->mcast_if_addr.s_addr; if (setsockopt(h->state.mc_fd, IPPROTO_IP,IP_ADD_MEMBERSHIP, (char *)&mreq, sizeof(mreq)) < 0) { aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler cannot set socket IPPROTO_IP,IP_ADD_MEMBERSHIP: %s", strerror(errno)); goto error; } } /* so we can have many processes listening to mcast */ { int32_t itmp = 1; if ( setsockopt(h->state.mc_fd, SOL_SOCKET, SO_REUSEADDR , (char *)&itmp, sizeof(itmp)) < 0 ) { aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler cannot set socket SO_REUSEADDR: %s", strerror(errno)); } } /* bind to receive messages */ if (bind(h->state.mc_fd, (struct sockaddr *)&(h->mcast_grp_addr), sizeof(h->mcast_grp_addr)) < 0) { aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler cannot bind to multicast socket", strerror(errno)); goto error ; } /* add callback to handle packets on mc_fd */ aw_add_handler_fdcallback(mon, (aw_handler_t *)h, h->state.mc_fd, do_read); } /* end mc_fd */ David Stevens wrote: >>In the udp case, I when I listen for multicast packets my app only >>receives them when I am running a tcpdump (bizarre!). >> >> > >Russ, > This piece (which I expect has nothing to do with the other >problems you mentioned) sounds like you haven't joined the groups on >the interface on which you're receiving the multicast packets. >"tcpdump" will place the interface in "promiscuous mode" which will >receive all packets, and ordinary packet delivery will allow >the application to receive them, even if you haven't joined the group >on the relevant interface. > To verify if the group joins is broken, you can look at >/proc/net/igmp. If the groups you're joining are not listed on the >interface you want, the program isn't joining the groups correctly. >Group membership is per-interface, so joining a group on one interface >does not join it on another. > Feel free to contact me if you need some help debugging the >multicast problem. > > +-DLS > > > > > --------------040609040703050508040004 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Thanks for the suggestion.

I tried using the interface itself and INADDR_ANY...the signals are not being received under 2.6 (FedoraCore2) UNLESS tcpdump is running...note this works fine under 2.4.

Below is the code fragment that sets up the socket (the previous email had the code fragment that sets up the posix rt signals on the fd), any help would be greatly appreciated:

  /* mc_fd */
  {

    /* make it */
    if ( (h->state.mc_fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1 ) {
      aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler cannot create socket: %s", strerror(errno));
      goto error;
    }

    /* set it to nonblocking so that this can be async */
    if ( fcntl(h->state.mc_fd,  F_SETFL, O_NONBLOCK)  == -1) {
      aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler cannot set socket nonblocking: %s", strerror(errno));
      goto error;
    }

    /* set the mc interface */
    if ( setsockopt(h->state.mc_fd, IPPROTO_IP, IP_MULTICAST_IF, &(h->mcast_if_addr), sizeof(h->mcast_if_addr)) < 0 ) {
      u_int8_t
    *ip = (u_int8_t *)&(h->mcast_if_addr);

      aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL,
         "mcrxhandler cannot set socket IP_MULTICAST_IF for %u.%u.%u.%u: %s",
         ip[0],ip[1],ip[2],ip[4],
         strerror(errno));
      goto error;
    }

    { /* debugging where packets are going when you have many interfaces is a pain, you want to log this! */
      u_int8_t
    *ip = (u_int8_t *)&(h->mcast_if_addr);
      aw_log(h->handler_header.logger,  AW_INFO_LOG_LEVEL, "mcrxhandler running multicast on interface %u.%u.%u.%u",
         ip[0],ip[1],ip[2],ip[3]);
    }

    /* use setsockopt() to request that the kernel join a multicast group */
    {
      struct ip_mreq
    mreq;

      /* set up */
      memset(&mreq, 0 , sizeof(mreq));
      mreq.imr_multiaddr.s_addr= h->mcast_grp_addr.sin_addr.s_addr;
      mreq.imr_interface.s_addr= h->mcast_if_addr.s_addr;

      if (setsockopt(h->state.mc_fd, IPPROTO_IP,IP_ADD_MEMBERSHIP, (char *)&mreq, sizeof(mreq)) < 0) {
    aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL,
           "mcrxhandler cannot set socket IPPROTO_IP,IP_ADD_MEMBERSHIP: %s", strerror(errno));
    goto error;
      }
    }

    /* so we can have many processes listening to mcast */
    {
      int32_t
    itmp = 1;
      if ( setsockopt(h->state.mc_fd, SOL_SOCKET, SO_REUSEADDR , (char *)&itmp, sizeof(itmp)) < 0 ) {
    aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler cannot set socket SO_REUSEADDR: %s", strerror(errno));
      }
    }

    /* bind to receive messages */
    if (bind(h->state.mc_fd, (struct sockaddr *)&(h->mcast_grp_addr), sizeof(h->mcast_grp_addr)) < 0) {
      aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler cannot bind to multicast socket", strerror(errno));
      goto error ;
    }

    /* add callback to handle packets on mc_fd */
    aw_add_handler_fdcallback(mon, (aw_handler_t *)h, h->state.mc_fd, do_read);

  } /* end mc_fd */




David Stevens wrote:
In the udp case, I when I listen for multicast packets my app only
receives them when I am running a tcpdump (bizarre!).
    

Russ,
        This piece (which I expect has nothing to do with the other
problems you mentioned) sounds like you haven't joined the groups on
the interface on which you're receiving the multicast packets.
"tcpdump" will place the interface in "promiscuous mode" which will
receive all packets, and ordinary packet delivery will allow
the application to receive them, even if you haven't joined the group
on the relevant interface.
        To verify if the group joins is broken, you can look at
/proc/net/igmp. If the groups you're joining are not listed on the
interface you want, the program isn't joining the groups correctly.
Group membership is per-interface, so joining a group on one interface
does not join it on another.
        Feel free to contact me if you need some help debugging the
multicast problem.

                                                        +-DLS



  

--------------040609040703050508040004-- From russ@elegant-software.com Tue Jun 1 16:05:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 16:05:51 -0700 (PDT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51N5ngi002060 for ; Tue, 1 Jun 2004 16:05:49 -0700 Received: from michael.elegant-software.com (pcp04414833pcs.nrockv01.md.comcast.net[69.140.188.59]) by comcast.net (sccrmhc13) with ESMTP id <2004060123054301600q6aq5e>; Tue, 1 Jun 2004 23:05:43 +0000 Received: from elegant-software.com (unknown [192.168.2.4]) by michael.elegant-software.com (Postfix) with ESMTP id 7DC8947831; Tue, 1 Jun 2004 19:08:48 -0400 (EDT) Message-ID: <40BD0C80.7080607@elegant-software.com> Date: Tue, 01 Jun 2004 19:08:48 -0400 From: Russell Leighton User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Stevens Cc: Andrew Morton , netdev@oss.sgi.com Subject: Re: Fw: F_SETSIG broken/changed in 2.6 for UDP and TCP sockets? References: <40BD07BC.8030302@elegant-software.com> In-Reply-To: <40BD07BC.8030302@elegant-software.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5526 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: russ@elegant-software.com Precedence: bulk X-list: netdev Content-Length: 4769 Lines: 144 I forgot to answer your question, I confirmed via the proc interface that the group has been joined. I am thinking the issue is related to F_SETSIG. I don't read() until I get a signal and I am not getting ANY signals for the multicast data. Googling around a little I saw changes in the futex code around FUTEX_FD ... perhaps there is a bug? Cobbling together a small test piece of code is the next thing to do... Russell Leighton wrote: > Thanks for the suggestion. > > I tried using the interface itself and INADDR_ANY...the signals are > not being received under 2.6 (FedoraCore2) UNLESS tcpdump is > running...note this works fine under 2.4. > > Below is the code fragment that sets up the socket (the previous email > had the code fragment that sets up the posix rt signals on the fd), > any help would be greatly appreciated: > > /* mc_fd */ > { > > /* make it */ > if ( (h->state.mc_fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1 ) { > aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, > "mcrxhandler cannot create socket: %s", strerror(errno)); > goto error; > } > > /* set it to nonblocking so that this can be async */ > if ( fcntl(h->state.mc_fd, F_SETFL, O_NONBLOCK) == -1) { > aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, > "mcrxhandler cannot set socket nonblocking: %s", strerror(errno)); > goto error; > } > > /* set the mc interface */ > if ( setsockopt(h->state.mc_fd, IPPROTO_IP, IP_MULTICAST_IF, > &(h->mcast_if_addr), sizeof(h->mcast_if_addr)) < 0 ) { > u_int8_t > *ip = (u_int8_t *)&(h->mcast_if_addr); > > aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, > "mcrxhandler cannot set socket IP_MULTICAST_IF for > %u.%u.%u.%u: %s", > ip[0],ip[1],ip[2],ip[4], > strerror(errno)); > goto error; > } > > { /* debugging where packets are going when you have many > interfaces is a pain, you want to log this! */ > u_int8_t > *ip = (u_int8_t *)&(h->mcast_if_addr); > aw_log(h->handler_header.logger, AW_INFO_LOG_LEVEL, > "mcrxhandler running multicast on interface %u.%u.%u.%u", > ip[0],ip[1],ip[2],ip[3]); > } > > /* use setsockopt() to request that the kernel join a multicast > group */ > { > struct ip_mreq > mreq; > > /* set up */ > memset(&mreq, 0 , sizeof(mreq)); > mreq.imr_multiaddr.s_addr= h->mcast_grp_addr.sin_addr.s_addr; > mreq.imr_interface.s_addr= h->mcast_if_addr.s_addr; > > if (setsockopt(h->state.mc_fd, IPPROTO_IP,IP_ADD_MEMBERSHIP, > (char *)&mreq, sizeof(mreq)) < 0) { > aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, > "mcrxhandler cannot set socket > IPPROTO_IP,IP_ADD_MEMBERSHIP: %s", strerror(errno)); > goto error; > } > } > > /* so we can have many processes listening to mcast */ > { > int32_t > itmp = 1; > if ( setsockopt(h->state.mc_fd, SOL_SOCKET, SO_REUSEADDR , (char > *)&itmp, sizeof(itmp)) < 0 ) { > aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, "mcrxhandler > cannot set socket SO_REUSEADDR: %s", strerror(errno)); > } > } > > /* bind to receive messages */ > if (bind(h->state.mc_fd, (struct sockaddr *)&(h->mcast_grp_addr), > sizeof(h->mcast_grp_addr)) < 0) { > aw_log(h->handler_header.logger, AW_ERROR_LOG_LEVEL, > "mcrxhandler cannot bind to multicast socket", strerror(errno)); > goto error ; > } > > /* add callback to handle packets on mc_fd */ > aw_add_handler_fdcallback(mon, (aw_handler_t *)h, h->state.mc_fd, > do_read); > > } /* end mc_fd */ > > > > > David Stevens wrote: > >>>In the udp case, I when I listen for multicast packets my app only >>>receives them when I am running a tcpdump (bizarre!). >>> >>> >> >>Russ, >> This piece (which I expect has nothing to do with the other >>problems you mentioned) sounds like you haven't joined the groups on >>the interface on which you're receiving the multicast packets. >>"tcpdump" will place the interface in "promiscuous mode" which will >>receive all packets, and ordinary packet delivery will allow >>the application to receive them, even if you haven't joined the group >>on the relevant interface. >> To verify if the group joins is broken, you can look at >>/proc/net/igmp. If the groups you're joining are not listed on the >>interface you want, the program isn't joining the groups correctly. >>Group membership is per-interface, so joining a group on one interface >>does not join it on another. >> Feel free to contact me if you need some help debugging the >>multicast problem. >> >> +-DLS >> >> >> >> >> > From herbert@gondor.apana.org.au Tue Jun 1 16:29:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 16:29:09 -0700 (PDT) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i51NT1gi006029 for ; Tue, 1 Jun 2004 16:29:03 -0700 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1BVIgD-0005oY-00; Wed, 02 Jun 2004 09:28:25 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1BVIg3-0006jc-00; Wed, 02 Jun 2004 09:28:15 +1000 Date: Wed, 2 Jun 2004 09:28:15 +1000 To: Jeff Garzik , netdev@oss.sgi.com Subject: [PLIP] Check cmd in plip_ioctl Message-ID: <20040601232814.GA25876@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i From: Herbert Xu X-archive-position: 5527 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1069 Lines: 39 --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Jeff: I received a bug report that a PLIP interface was incorrectly identified as wireless because plip_ioctl did not check what the value of cmd is before processing the request. This patch fixes exactly that. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== drivers/net/plip.c 1.20 vs edited ===== --- 1.20/drivers/net/plip.c 2004-03-04 05:52:24 +11:00 +++ edited/drivers/net/plip.c 2004-06-02 09:21:05 +10:00 @@ -1219,6 +1219,9 @@ struct net_local *nl = netdev_priv(dev); struct plipconf *pc = (struct plipconf *) &rq->ifr_data; + if (cmd != SIOCDEVPLIP) + return -EOPNOTSUPP; + switch(pc->pcmd) { case PLIP_GET_TIMEOUT: pc->trigger = nl->trigger; --oyUTqETQ0mS9luUI-- From tharbaugh@lnxi.com Tue Jun 1 21:02:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 21:02:17 -0700 (PDT) Received: from ash.lnxi.com (208.177.141.226.ptr.us.xo.net [208.177.141.226]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i5242Dgi016568 for ; Tue, 1 Jun 2004 21:02:13 -0700 Received: (qmail 16728 invoked from network); 1 Jun 2004 23:18:46 -0000 Received: from tubarao.lnxi.com (HELO ?192.168.15.106?) (192.168.15.106) by ash.lnxi.com with SMTP; 1 Jun 2004 23:18:46 -0000 Subject: [PATCH] abysmal e1000 performance (DITR) From: Thayne Harbaugh Reply-To: tharbaugh@lnxi.com To: netdev@oss.sgi.com Cc: ganesh.venkatesan@intel.com Content-Type: text/plain Organization: Linux Networx Message-Id: <1086131111.20113.22.camel@tubarao> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 01 Jun 2004 17:05:12 -0600 Content-Transfer-Encoding: 7bit X-archive-position: 5529 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tharbaugh@lnxi.com Precedence: bulk X-list: netdev Content-Length: 4106 Lines: 99 The introduction of Dynamic Interrupt Throttling Rate (DITR) in the 4.x -> 5.x e1000 driver change can cause serious performance problems. The ITR can be reduced when the system is *not* under load which results in gratuitous latencies for network traffic. In other words - why is the interrupt load reduced when the system isn't under load? This is a patch to include system load when calculating the DITR. It only allows the diff/goc ratio to factor into the DITR when the 1 minute load average is above .50. It appears to work quite well and prevents throttling when the load is below .50 and allows throttling when the load is in excess of .50. There are a few concerns. The patch requires kernel/timer.c to EXPORT_SYMBOL(avenrun) - otherwise the symbol isn't available to the driver when built as a module. This symbol "clutter" may be undesirable to some. Another concern is that NAPI accomplishes a similar interrupt load reduction and is likely a better solution than ITR. diff -ur linux-2.4.21-99/drivers/net/e1000/e1000_main.c linux-2.4.21-99-e1000/drivers/net/e1000/e1000_main.c --- linux-2.4.21-99/drivers/net/e1000/e1000_main.c 2003-09-24 05:47:33.000000000 -0700 +++ linux-2.4.21-99-e1000/drivers/net/e1000/e1000_main.c 2004-05-27 23:38:02.000000000 -0700 @@ -27,6 +27,8 @@ *******************************************************************************/ #include "e1000.h" +/* for avenrun[] */ +#include /* Change Log * @@ -1429,14 +1431,34 @@ /* Dynamic mode for Interrupt Throttle Rate (ITR) */ if(adapter->hw.mac_type >= e1000_82540 && adapter->itr == 1) { + /* fixed fractional part of .50 */ +#define FIXED_F50 (FIXED_1 >> 1) + /* This maps the range of .50-.99 -> 0-100 */ +#define FIXED_1_MAPPED (FIXED_1 - FIXED_F50) + unsigned long laf; /* load average fractional part */ + uint32_t goc; /* good octet count */ + uint32_t dif; /* dif between tx and rx goc */ + uint32_t itr; /* inturrept throttle rate */ + /* laf range is mapped: + * .00-.50 -> .00 + * .50-.99 -> .00-.99 + * 1.00+ -> 1.00 */ + if (avenrun[0] + FIXED_1/200 > FIXED_1) + laf = FIXED_1_MAPPED; + else if (avenrun[0] + FIXED_1/200 < FIXED_F50) + laf = 0; + else + laf = ((avenrun[0] + FIXED_1/2000) & (FIXED_1 - 1)) - FIXED_1_MAPPED; /* Symmetric Tx/Rx gets a reduced ITR=2000; Total * asymmetrical Tx or Rx gets ITR=8000; everyone * else is between 2000-8000. */ - uint32_t goc = (adapter->gotcl + adapter->gorcl) / 10000; - uint32_t dif = (adapter->gotcl > adapter->gorcl ? - adapter->gotcl - adapter->gorcl : - adapter->gorcl - adapter->gotcl) / 10000; - uint32_t itr = goc > 0 ? (dif * 6000 / goc + 2000) : 8000; + goc = (adapter->gotcl + adapter->gorcl) / 10000; + dif = (adapter->gotcl > adapter->gorcl ? + adapter->gotcl - adapter->gorcl : + adapter->gorcl - adapter->gotcl) / 10000; + itr = goc > 0 + ? 8000 + 6000*laf/FIXED_1_MAPPED*dif/goc - 6000*laf/FIXED_1_MAPPED + : 8000; E1000_WRITE_REG(&adapter->hw, ITR, 1000000000 / (itr * 256)); } diff -ur linux-2.4.21-99/kernel/Makefile linux-2.4.21-99-e1000/kernel/Makefile --- linux-2.4.21-99/kernel/Makefile 2003-09-24 05:47:27.000000000 -0700 +++ linux-2.4.21-99-e1000/kernel/Makefile 2004-05-26 23:45:47.000000000 -0700 @@ -11,7 +11,7 @@ export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o exec_domain.o \ printk.o cpufreq.o rcupdate.o syscall_ksyms.o fork.o hook.o \ - rashooks.o module.o + rashooks.o module.o timer.o obj-y = sched.o dma.o fork.o exec_domain.o panic.o printk.o \ module.o exit.o itimer.o info.o time.o softirq.o resource.o \ diff -ur linux-2.4.21-99/kernel/timer.c linux-2.4.21-99-e1000/kernel/timer.c --- linux-2.4.21-99/kernel/timer.c 2003-09-24 05:47:27.000000000 -0700 +++ linux-2.4.21-99-e1000/kernel/timer.c 2004-05-27 00:54:29.000000000 -0700 @@ -686,6 +686,7 @@ * all seem to differ on different machines. */ unsigned long avenrun[3]; +EXPORT_SYMBOL(avenrun); static inline void calc_load(unsigned long ticks) { -- Thayne Harbaugh Linux Networx From amit_kulkarni@fastermail.com Tue Jun 1 22:23:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 01 Jun 2004 22:23:57 -0700 (PDT) Received: from webmail-outgoing.us4.outblaze.com (webmail-outgoing.us4.outblaze.com [205.158.62.67]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i525Nugi020087 for ; Tue, 1 Jun 2004 22:23:56 -0700 Received: from wfilter.us4.outblaze.com (wfilter.us4.outblaze.com [205.158.62.180]) by webmail-outgoing.us4.outblaze.com (Postfix) with QMQP id 7285D1800DF2 for ; Wed, 2 Jun 2004 05:23:51 +0000 (GMT) X-OB-Received: from unknown (205.158.62.133) by wfilter.us4.outblaze.com; 2 Jun 2004 05:23:24 -0000 Received: by ws5-3.us4.outblaze.com (Postfix, from userid 1001) id F110123BFE; Wed, 2 Jun 2004 05:23:54 +0000 (GMT) Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-Mailer: MIME-tools 5.41 (Entity 5.404) Received: from [203.190.146.100] by ws5-3.us4.outblaze.com with http for amit_kulkarni@fastermail.com; Wed, 02 Jun 2004 13:23:54 +0800 From: "am ku" To: netdev@oss.sgi.com Date: Wed, 02 Jun 2004 13:23:54 +0800 Subject: need some help aboot queueing disciplines X-Originating-Ip: 203.190.146.100 X-Originating-Server: ws5-3.us4.outblaze.com Message-Id: <20040602052354.F110123BFE@ws5-3.us4.outblaze.com> X-archive-position: 5533 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amit_kulkarni@fastermail.com Precedence: bulk X-list: netdev Content-Length: 575 Lines: 11 heelo all, i am trying to get some knowledge on the queueing disciplines, i have gone through "Linux advanced routing and traffic control HOWTO". i need to know which discipline is the best for clients. i.e can i impart the parameter of say, htb on systems which are in client server architecture and ar eworking as clients. or it is best suited for servers only. can anyone who has already worked on this guide me. please reply as soon as possible. amit -- _______________________________________________ Get your free email from http://fastermail.com Powered by Outblaze From mcgrof@studorgs.rutgers.edu Wed Jun 2 00:14:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 00:15:14 -0700 (PDT) Received: from ruslug.rutgers.edu (studorgs.rutgers.edu [128.6.24.131]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i527Eogi023870 for ; Wed, 2 Jun 2004 00:14:51 -0700 Received: by ruslug.rutgers.edu (Postfix, from userid 503) id EB056F9D4B; Wed, 2 Jun 2004 03:14:49 -0400 (EDT) Date: Wed, 2 Jun 2004 03:14:49 -0400 To: Netdev Cc: hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel Subject: Prism54 WPA Support - wpa_supplicant - Linux general wpa support Message-ID: <20040602071449.GJ10723@ruslug.rutgers.edu> Mail-Followup-To: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NU0Ex4SbNnrxsi6C" Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Operating-System: 2.4.18-1-686 Organization: Rutgers University Student Linux Users Group From: mcgrof@studorgs.rutgers.edu (Luis R. Rodriguez) X-archive-position: 5536 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mcgrof@studorgs.rutgers.edu Precedence: bulk X-list: netdev Content-Length: 1679 Lines: 49 --NU0Ex4SbNnrxsi6C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable So WPA is now a priority for prism54 development. Here's where we're at.=20 Long ago in January Jouni had added some wpa supplicant support into=20 prism54. It's not until today when I started looking into wpa_supplicant. I'm glad wpa_supplicant exists :). Interacting with it *is* our missing link to getting full WPA support (great job Jouni). In wpa_supplicant=20 cvs I see a base code for driver_prism54.c (empty routines, just providing = skeleton). Well I'll be diving in it now and see where I can get. If anyone else is interested in helping with WPA support for prism54, working with wpa_supplicant is the way to go. I'm curious though -- wpa_supplicant is pretty much userspace. This was done with good intentions from what I read but before we get dirty=20 with wpa_supplicant I'm wondering if we should just integrate a lot of=20 wpa_supplicant into kernel space (specifically wireless tools). Regardless, as Jouni points out, there is still a framework for WPA that ne= eds to be written for all linux wireless drivers, whether it's to assist wpa_supplicant framework or to integrate wpa_supplicant into kernel space. What's the plan? Luis --=20 GnuPG Key fingerprint =3D 113F B290 C6D2 0251 4D84 A34A 6ADD 4937 E20A 525E --NU0Ex4SbNnrxsi6C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAvX5pat1JN+IKUl4RAryQAJ4tsfPhMRmq85oWK85LGz5PE0XK1ACfSpIO S4LRkAtZVTbKdKpKb3oZ0e4= =XKLg -----END PGP SIGNATURE----- --NU0Ex4SbNnrxsi6C-- From pj@sgi.com Wed Jun 2 02:21:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 02:21:56 -0700 (PDT) Received: from omx2.sgi.com (mtvcafw.sgi.com [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i529Lngi032112 for ; Wed, 2 Jun 2004 02:21:49 -0700 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by omx2.sgi.com (8.12.11/8.12.9/linux-outbound_gateway-1.1) with ESMTP id i529RwFe019662 for ; Wed, 2 Jun 2004 02:27:58 -0700 Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.103]) by cthulhu.engr.sgi.com (SGI-8.12.5/8.12.5) with SMTP id i529LSl614158725; Wed, 2 Jun 2004 02:21:28 -0700 (PDT) Date: Wed, 2 Jun 2004 02:21:30 -0700 From: Paul Jackson To: Andrew Morton Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: 2.6.7-rc2-mm1 - bk-netdev.patch e1000_ethtool.c doesn't build Message-Id: <20040602022130.35a7571d.pj@sgi.com> In-Reply-To: <20040601021539.413a7ad7.akpm@osdl.org> References: <20040601021539.413a7ad7.akpm@osdl.org> Organization: SGI X-Mailer: Sylpheed version 0.9.8 (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: 5537 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pj@sgi.com Precedence: bulk X-list: netdev Content-Length: 1203 Lines: 28 The patch bk-netdev.patch in 2.6.7-rc2-mm1 doesn't compile. It contains the following change, which creates two identical e1000_gstrings_stats[] opening declaration lines in a row, and many many gcc errors, starting with: > drivers/net/e1000/e1000_ethtool.c:57: error: parse error before "static" diff -Nru a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c --- a/drivers/net/e1000/e1000_ethtool.c 2004-05-31 16:18:26 -07:00 +++ b/drivers/net/e1000/e1000_ethtool.c 2004-05-31 16:18:26 -07:00 @@ -54,6 +54,7 @@ #define E1000_STAT(m) sizeof(((struct e1000_adapter *)0)->m), \ offsetof(struct e1000_adapter, m) static const struct e1000_stats e1000_gstrings_stats[] = { +static const struct e1000_stats e1000_gstrings_stats[] = { { "rx_packets", E1000_STAT(net_stats.rx_packets) }, { "tx_packets", E1000_STAT(net_stats.tx_packets) }, { "rx_bytes", E1000_STAT(net_stats.rx_bytes) }, There may or may not be other errors past this - I have not gone there yet. -- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson 1.650.933.1373 From pj@sgi.com Wed Jun 2 02:43:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 02:43:31 -0700 (PDT) Received: from zok.sgi.com (mtvcafw.sgi.com [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i529hTgi002413 for ; Wed, 2 Jun 2004 02:43:29 -0700 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by zok.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id i529g2hv014449 for ; Wed, 2 Jun 2004 02:42:02 -0700 Received: from sam.engr.sgi.com (sam.engr.sgi.com [163.154.6.103]) by cthulhu.engr.sgi.com (SGI-8.12.5/8.12.5) with SMTP id i529fGl614151562; Wed, 2 Jun 2004 02:41:16 -0700 (PDT) Date: Wed, 2 Jun 2004 02:41:18 -0700 From: Paul Jackson To: Paul Jackson Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: 2.6.7-rc2-mm1 - bk-netdev.patch e1000_ethtool.c doesn't build Message-Id: <20040602024118.40dc9359.pj@sgi.com> In-Reply-To: <20040602022130.35a7571d.pj@sgi.com> References: <20040601021539.413a7ad7.akpm@osdl.org> <20040602022130.35a7571d.pj@sgi.com> Organization: SGI X-Mailer: Sylpheed version 0.9.8 (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: 5539 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pj@sgi.com Precedence: bulk X-list: netdev Content-Length: 766 Lines: 22 > There may or may not be other errors past this ... There are other errors - many more such duplicated and near-duplicated lines, such as for one example the following. Someone's shotgun misfired and hit someone's foot. @@ -1440,8 +1554,10 @@ static void e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) +e1000_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) { struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(dev); struct e1000_hw *hw = &adapter->hw; switch(adapter->hw.device_id) { -- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson 1.650.933.1373 From mitch@sfgoth.com Wed Jun 2 03:27:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 03:27:45 -0700 (PDT) Received: from gaz.sfgoth.com (gaz.sfgoth.com [69.36.241.230]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52ARfgi004160 for ; Wed, 2 Jun 2004 03:27:41 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.10/8.12.9) with ESMTP id i52AURIp075888; Wed, 2 Jun 2004 03:30:27 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.10/8.12.6/Submit) id i52AURLi075887; Wed, 2 Jun 2004 03:30:27 -0700 (PDT) (envelope-from mitch) Date: Wed, 2 Jun 2004 03:30:27 -0700 From: Mitchell Blank Jr To: "Ihar 'Philips' Filipau" Cc: netdev@oss.sgi.com, Linux Kernel Mailing List Subject: Re: e1000 question Message-ID: <20040602103027.GA74881@gaz.sfgoth.com> References: <40BD8E49.3070605@giga-stream.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40BD8E49.3070605@giga-stream.de> User-Agent: Mutt/1.4.2.1i X-archive-position: 5540 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 Content-Length: 815 Lines: 18 Ihar 'Philips' Filipau wrote: > Functions e1000_clean_{t,r}x_irq are very similar: both of them are > checking descriptor flag updated by nic. > Host CPU, obviously, to perform this check, will cache descriptor. > If, say e1000_clean_rx_irq() will be called twice in short time > range, I expect that it can miss change of the flag, since old flag may > still sit in host CPU cache. Please see Documentation/DMA-mapping.txt; especially the part starting at "There are two types of DMA mappings..." Ring buffers are allocated as "consistent" DMA memory. For most architectures this will mean that the cache hardware snoops the PCI bus and automatically invalidates cache lines as they are written to. For architectures that can't do that then Linux will mark those memory regions uncacheable. -Mitch From P@draigBrady.com Wed Jun 2 03:35:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 03:35:45 -0700 (PDT) Received: from corvil.com (gate.corvil.net [213.94.219.177]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52AZggi004897 for ; Wed, 2 Jun 2004 03:35:43 -0700 Received: from draigBrady.com (pixelbeat.local.corvil.com [172.18.1.170]) by corvil.com (8.12.9/8.12.5) with ESMTP id i52AZfaq010038 for ; Wed, 2 Jun 2004 11:35:41 +0100 (IST) (envelope-from P@draigBrady.com) Message-ID: <40BDAD7D.2010307@draigBrady.com> Date: Wed, 02 Jun 2004 11:35:41 +0100 From: P@draigBrady.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040124 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: BCM570[13] packet classification? Content-Type: text/plain; charset=UTF-8; format=flowed X-MIME-Autoconverted: from 8bit to quoted-printable by corvil.com id i52AZfaq010038 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i52AZggi004897 X-archive-position: 5542 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: P@draigBrady.com Precedence: bulk X-list: netdev Content-Length: 261 Lines: 13 Hi, I just noticed that on broadcom's site they mention that the BCM570[13] controllers can do packet classification: http://www.broadcom.com/collateral/pb/5703-PB01-RDS.pdf However I can't find any thirdparty references to it. Any ideas? thanks, Pádraig. From ifilipau@giga-stream.de Wed Jun 2 04:24:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 04:24:17 -0700 (PDT) Received: from natsmtp00.rzone.de (natsmtp00.rzone.de [81.169.145.165]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52BO8gi010083 for ; Wed, 2 Jun 2004 04:24:09 -0700 Received: from giga-stream.de ([212.18.200.6]) by post.webmailer.de (8.12.10/8.12.10) with ESMTP id i52AZ2qK025382; Wed, 2 Jun 2004 12:35:02 +0200 (MEST) Message-ID: <40BDAD3C.3030103@giga-stream.de> Date: Wed, 02 Jun 2004 12:34:36 +0200 From: "Ihar 'Philips' Filipau" Organization: Giga Stream User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040116 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mitchell Blank Jr CC: netdev@oss.sgi.com, Linux Kernel Mailing List Subject: Re: e1000 question References: <40BD8E49.3070605@giga-stream.de> <20040602103027.GA74881@gaz.sfgoth.com> In-Reply-To: <20040602103027.GA74881@gaz.sfgoth.com> Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms050103070102000008040302" X-archive-position: 5544 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ifilipau@giga-stream.de Precedence: bulk X-list: netdev Content-Length: 6703 Lines: 117 This is a cryptographically signed message in MIME format. --------------ms050103070102000008040302 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thanks, Mitch! That explains everything. Went reading pci_alloc_consistent()'s RTFM. That is exactly what I was missing in couple of my drivers. Mitchell Blank Jr wrote: > Ihar 'Philips' Filipau wrote: > >> Functions e1000_clean_{t,r}x_irq are very similar: both of them are >>checking descriptor flag updated by nic. >> Host CPU, obviously, to perform this check, will cache descriptor. >> If, say e1000_clean_rx_irq() will be called twice in short time >>range, I expect that it can miss change of the flag, since old flag may >>still sit in host CPU cache. > > > Please see Documentation/DMA-mapping.txt; especially the part starting > at "There are two types of DMA mappings..." Ring buffers are allocated > as "consistent" DMA memory. > > For most architectures this will mean that the cache hardware snoops the > PCI bus and automatically invalidates cache lines as they are written to. > For architectures that can't do that then Linux will mark those memory > regions uncacheable. > -- Johnson's law: Systems resemble the organizations that create them. -- ___ ___ Ihar 'Philips' Filipau \ / Sr. Software Developer Tel: +49 681 959 16 0 \ / GIGA STREAM Fax: +49 681 959 16 100 \/ Konrad Zuse Strasse 7 Mobile: +49 173 39 462 49 /\ 66115 Saarbruecken email: ifilipau@giga-stream.de / \ Germany www: http://www.giga-stream.de ___/ \___ Switching for success --------------ms050103070102000008040302 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJXDCC AwwwggJ1oAMCAQICAwp5RzANBgkqhkiG9w0BAQQFADCBkjELMAkGA1UEBhMCWkExFTATBgNV BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMQ8wDQYDVQQKEwZUaGF3dGUx HTAbBgNVBAsTFENlcnRpZmljYXRlIFNlcnZpY2VzMSgwJgYDVQQDEx9QZXJzb25hbCBGcmVl bWFpbCBSU0EgMjAwMC44LjMwMB4XDTAzMDgwNDEyMDI1OVoXDTA0MDgwMzEyMDI1OVowSTEf MB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEmMCQGCSqGSIb3DQEJARYXaWZpbGlw YXVAZ2lnYS1zdHJlYW0uZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCh23lX NmvjlqAwzhanhztIary04F8dGaAt4ABMEMiNf+XD353lzpIHcHVzTH0OY4c9LtFNbt5V+XZT JoENrCLlDDCerzYgVNEejB173dpMQW1mAoYgl5AJZArvjgojcSKWG+BMaD2ozo3NVAPMAkwD Zhk25/WtbqN4UDf2mGljaU4/SETZKUJ+pNeeiXoz2KHlkJyZ8zubjJuR7xf5hPMpfsV+ePHI ohDZAFlM58D6wpgbDp8DO5CL4dnqSLeW+xCv+ETDIATu8B80Cv4QifhTWIJsosEzFP6CljUE hdBDbr3sgPTdVbTewTptD4hKodp67/2WjWsS6DMZwZl7oyTTAgMBAAGjNDAyMCIGA1UdEQQb MBmBF2lmaWxpcGF1QGdpZ2Etc3RyZWFtLmRlMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEE BQADgYEAXUjvmMsvEKRjvE8E2xjjymWYARwQ9fj/jbf/bpEy+fxub4It78X93RyBEazIciky +H3ZVmjTUH+dnxzYpBrEztVIuKDsCkuF5++j+NXDsELsuOFNX+1Z/YZ4ol5rJaensb/ZwflA byaeNV7+nl7qUgPxTanF16QDv13+EumlMdUwggMMMIICdaADAgECAgMKeUcwDQYJKoZIhvcN AQEEBQAwgZIxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcT CUNhcGUgVG93bjEPMA0GA1UEChMGVGhhd3RlMR0wGwYDVQQLExRDZXJ0aWZpY2F0ZSBTZXJ2 aWNlczEoMCYGA1UEAxMfUGVyc29uYWwgRnJlZW1haWwgUlNBIDIwMDAuOC4zMDAeFw0wMzA4 MDQxMjAyNTlaFw0wNDA4MDMxMjAyNTlaMEkxHzAdBgNVBAMTFlRoYXd0ZSBGcmVlbWFpbCBN ZW1iZXIxJjAkBgkqhkiG9w0BCQEWF2lmaWxpcGF1QGdpZ2Etc3RyZWFtLmRlMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAodt5VzZr45agMM4Wp4c7SGq8tOBfHRmgLeAATBDI jX/lw9+d5c6SB3B1c0x9DmOHPS7RTW7eVfl2UyaBDawi5Qwwnq82IFTRHowde93aTEFtZgKG IJeQCWQK744KI3EilhvgTGg9qM6NzVQDzAJMA2YZNuf1rW6jeFA39phpY2lOP0hE2SlCfqTX nol6M9ih5ZCcmfM7m4ybke8X+YTzKX7FfnjxyKIQ2QBZTOfA+sKYGw6fAzuQi+HZ6ki3lvsQ r/hEwyAE7vAfNAr+EIn4U1iCbKLBMxT+gpY1BIXQQ2697ID03VW03sE6bQ+ISqHaeu/9lo1r EugzGcGZe6Mk0wIDAQABozQwMjAiBgNVHREEGzAZgRdpZmlsaXBhdUBnaWdhLXN0cmVhbS5k ZTAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBBAUAA4GBAF1I75jLLxCkY7xPBNsY48plmAEc EPX4/423/26RMvn8bm+CLe/F/d0cgRGsyHIpMvh92VZo01B/nZ8c2KQaxM7VSLig7ApLhefv o/jVw7BC7LjhTV/tWf2GeKJeayWnp7G/2cH5QG8mnjVe/p5e6lID8U2pxdekA79d/hLppTHV MIIDODCCAqGgAwIBAgIQZkVyt8x09c9jdkWE0C6RATANBgkqhkiG9w0BAQQFADCB0TELMAkG A1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRow GAYDVQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 aWNlcyBEaXZpc2lvbjEkMCIGA1UEAxMbVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIENBMSsw KQYJKoZIhvcNAQkBFhxwZXJzb25hbC1mcmVlbWFpbEB0aGF3dGUuY29tMB4XDTAwMDgzMDAw MDAwMFoXDTA0MDgyNzIzNTk1OVowgZIxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJu IENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEPMA0GA1UEChMGVGhhd3RlMR0wGwYDVQQLExRD ZXJ0aWZpY2F0ZSBTZXJ2aWNlczEoMCYGA1UEAxMfUGVyc29uYWwgRnJlZW1haWwgUlNBIDIw MDAuOC4zMDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA3jMypmPHCSVFPtJueCdngcXa iBmClw7jRCmKYzUqbXA8+tyu9+50bzC8M5B/+TRxoKNtmPHDT6Jl2w36S/HW3WGl+YXNVZo1 Gp2Sdagnrthy+boC9tewkd4c6avgGAOofENCUFGHgzzwObSbVIoTh/+zm51JZgAtCYnslGvp oWkCAwEAAaNOMEwwKQYDVR0RBCIwIKQeMBwxGjAYBgNVBAMTEVByaXZhdGVMYWJlbDEtMjk3 MBIGA1UdEwEB/wQIMAYBAf8CAQAwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBAUAA4GBADGx S0dd+QFx5fVTbF151j2YwCYTYoEipxL4IpXoG0m3J3sEObr85vIk65H6vewNKjj3UFWobPcN rUwbvAP0teuiR59sogxYjTFCCRFssBpp0SsSskBdavl50OouJd2K5PzbDR+dAvNa28o89kTq JmmHf0iezqWf54TYyWJirQXGMYID1TCCA9ECAQEwgZowgZIxCzAJBgNVBAYTAlpBMRUwEwYD VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEPMA0GA1UEChMGVGhhd3Rl MR0wGwYDVQQLExRDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEoMCYGA1UEAxMfUGVyc29uYWwgRnJl ZW1haWwgUlNBIDIwMDAuOC4zMAIDCnlHMAkGBSsOAwIaBQCgggIPMBgGCSqGSIb3DQEJAzEL BgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA0MDYwMjEwMzQzNlowIwYJKoZIhvcNAQkE MRYEFJv4LpGyY/ToFFenFqRYT+Yaw6+1MFIGCSqGSIb3DQEJDzFFMEMwCgYIKoZIhvcNAwcw DgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3DQMCAgEo MIGrBgkrBgEEAYI3EAQxgZ0wgZowgZIxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJu IENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEPMA0GA1UEChMGVGhhd3RlMR0wGwYDVQQLExRD ZXJ0aWZpY2F0ZSBTZXJ2aWNlczEoMCYGA1UEAxMfUGVyc29uYWwgRnJlZW1haWwgUlNBIDIw MDAuOC4zMAIDCnlHMIGtBgsqhkiG9w0BCRACCzGBnaCBmjCBkjELMAkGA1UEBhMCWkExFTAT BgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMQ8wDQYDVQQKEwZUaGF3 dGUxHTAbBgNVBAsTFENlcnRpZmljYXRlIFNlcnZpY2VzMSgwJgYDVQQDEx9QZXJzb25hbCBG cmVlbWFpbCBSU0EgMjAwMC44LjMwAgMKeUcwDQYJKoZIhvcNAQEBBQAEggEAWdFo0RZHu1If VOAFDP3OJ5SuKfa+zLUTiVtm03QSwobW2etA+mOir55ykHc+DAkQuz5rKEnioHctkq2H/pPl 8Aet4ZaXcYdlrIItQwdsmlsH2yyhruZMZjspjI4JZLSFDZD8NvruGLOciCuhFhqwg/3EmHUJ hHZN7K6YllILywp+lod2p1mFrcHFe8COsIv5lqp2ZnBv86LHEqYEYik6aWBnkWzepbr5CfDP 2bMcGTjz6QnEPY0lRgIH12Q8B7irPePD7gwaWu/EqYxdU8z4uLOaadFy5pOSRbArk3Kwarjw 9fz2GBds58stav+7nzZ4klo75SM2/wB/QJyjsv2oRgAAAAAAAA== --------------ms050103070102000008040302-- From rl@hellgate.ch Wed Jun 2 04:59:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 04:59:29 -0700 (PDT) Received: from mail5.bluewin.ch (mail5.bluewin.ch [195.186.1.207]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52BxKgi011032 for ; Wed, 2 Jun 2004 04:59:21 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail5.bluewin.ch (Bluewin AG 7.0.028) id 40A46B2100256F5E; Wed, 2 Jun 2004 11:59:01 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id 4DED58CA75E; Wed, 2 Jun 2004 13:59:00 +0200 (CEST) Date: Wed, 2 Jun 2004 13:59:00 +0200 From: Roger Luethi To: Jeff Garzik , Andrew Morton Cc: netdev@oss.sgi.com Subject: [7/9][PATCH 2.6] Rewrite special-casing Message-ID: <20040602115900.GA17578@k3.hellgate.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602115703.GA16079@k3.hellgate.ch> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5545 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 9492 Lines: 333 Use PCI revision to determine special cases. One bit field replaces a bunch of data structures holding special case information. Replace chip_id, drv_flags in rhine_private with quirks Remove enum rhine_chips, struct rhine_chip_info (and array), enum chip_capability_flags Add enum rhine_revs, enum rhine_quirks (some values in preparation for subsequent changes) wait_for_reset() and enable_mmio() now use quirks instead of chip_id Remove model names from ident strings for now. Signed-off-by: Roger Luethi --- orig/drivers/net/via-rhine.c +++ mod/drivers/net/via-rhine.c @@ -354,48 +354,46 @@ second only the 1234 card. */ -enum rhine_chips { - VT86C100A = 0, - VT6102, - VT6105, - VT6105M +enum rhine_revs { + VT86C100A = 0x00, + VT6102 = 0x40, + VT8231 = 0x50, /* Integrated MAC */ + VT8233 = 0x60, /* Integrated MAC */ + VT8235 = 0x74, /* Integrated MAC */ + VT8237 = 0x78, /* Integrated MAC */ + VTunknown0 = 0x7C, + VT6105 = 0x80, + VT6105_B0 = 0x83, + VT6105L = 0x8A, + VT6107 = 0x8C, + VTunknown1 = 0x8E, + VT6105M = 0x90, }; -struct rhine_chip_info { - const char *name; - int io_size; - int drv_flags; -}; - - -enum chip_capability_flags { - HasDavicomPhy=4, - ReqTxAlign=0x10, HasWOL=0x20, +enum rhine_quirks { + rqWOL = 0x0001, /* Wake-On-LAN support */ + rqForceReset = 0x0002, + rqDavicomPhy = 0x0020, + rq6patterns = 0x0040, /* 6 instead of 4 patterns for WOL */ + rqStatusWBRace = 0x0080, /* Tx Status Writeback Error possible */ + rqRhineI = 0x0100, /* See comment below */ }; +/* + * rqRhineI: VT86C100A (aka Rhine-I) uses different bits to enable + * MMIO as well as for the collision counter and the Tx FIFO underflow + * indicator. In addition, Tx and Rx buffers need to 4 byte aligned. + */ /* Beware of PCI posted writes */ #define IOSYNC do { readb(dev->base_addr + StationAddr); } while (0) -/* directly indexed by enum rhine_chips, above */ -static struct rhine_chip_info rhine_chip_info[] __devinitdata = -{ - { "VIA VT86C100A Rhine", 128, - ReqTxAlign | HasDavicomPhy }, - { "VIA VT6102 Rhine-II", 256, - HasWOL }, - { "VIA VT6105 Rhine-III", 256, - HasWOL }, - { "VIA VT6105M Rhine-III", 256, - HasWOL }, -}; - static struct pci_device_id rhine_pci_tbl[] = { - {0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT86C100A}, - {0x1106, 0x3065, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6102}, - {0x1106, 0x3106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6105}, /* 6105{,L,LOM} */ - {0x1106, 0x3053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6105M}, - {0,} /* terminate list */ + {0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT86C100A */ + {0x1106, 0x3065, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT6102 */ + {0x1106, 0x3106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* 6105{,L,LOM} */ + {0x1106, 0x3053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT6105M */ + { } /* terminate list */ }; MODULE_DEVICE_TABLE(pci, rhine_pci_tbl); @@ -503,7 +501,7 @@ spinlock_t lock; /* Frequently used values: keep some adjacent for cache effect. */ - int chip_id, drv_flags; + u32 quirks; struct rx_desc *rx_head_desc; unsigned int cur_rx, dirty_rx; /* Producer/consumer ring indices */ unsigned int cur_tx, dirty_tx; @@ -545,12 +543,12 @@ intr_status = readw(ioaddr + IntrStatus); /* On Rhine-II, Bit 3 indicates Tx descriptor write-back race. */ - if (rp->chip_id == VT6102) + if (rp->quirks & rqStatusWBRace) intr_status |= readb(ioaddr + IntrStatus2) << 16; return intr_status; } -static void wait_for_reset(struct net_device *dev, int chip_id, char *name) +static void wait_for_reset(struct net_device *dev, u32 quirks, char *name) { long ioaddr = dev->base_addr; int boguscnt = 20; @@ -562,7 +560,7 @@ "Trying harder.\n", name); /* Rhine-II needs to be forced sometimes */ - if (chip_id == VT6102) + if (quirks & rqForceReset) writeb(0x40, ioaddr + MiscCmd); /* VT86C100A may need long delay after reset (dlink) */ @@ -578,10 +576,10 @@ } #ifdef USE_MMIO -static void __devinit enable_mmio(long ioaddr, int chip_id) +static void __devinit enable_mmio(long ioaddr, u32 quirks) { int n; - if (chip_id == VT86C100A) { + if (quirks & rqRhineI) { /* More recent docs say that this bit is reserved ... */ n = inb(ioaddr + ConfigA) | 0x20; outb(n, ioaddr + ConfigA); @@ -617,7 +615,8 @@ struct net_device *dev; struct rhine_private *rp; int i, option, rc; - int chip_id = (int) ent->driver_data; + u8 pci_rev; + u32 quirks; static int card_idx = -1; long ioaddr; long memaddr; @@ -626,6 +625,7 @@ #ifdef USE_MMIO long ioaddr0; #endif + const char *name; /* when built into the kernel, we only print version if device is found */ #ifndef MODULE @@ -636,7 +636,26 @@ card_idx++; option = card_idx < MAX_UNITS ? options[card_idx] : 0; - io_size = rhine_chip_info[chip_id].io_size; + pci_read_config_byte(pdev, PCI_REVISION_ID, &pci_rev); + + io_size = 256; + if (pci_rev < VT6102) { + quirks = rqRhineI | rqDavicomPhy; + io_size = 128; + name = "VT86C100A Rhine"; + } + else { + quirks = rqWOL | rqForceReset; + if (pci_rev < VT6105) { + name = "Rhine II"; + quirks |= rqStatusWBRace; /* Rhine-II exclusive */ + } + else { + name = "Rhine III"; + if (pci_rev >= VT6105_B0) + quirks |= rq6patterns; + } + } rc = pci_enable_device(pdev); if (rc) @@ -679,7 +698,7 @@ #ifdef USE_MMIO ioaddr0 = ioaddr; - enable_mmio(ioaddr0, chip_id); + enable_mmio(ioaddr0, quirks); ioaddr = (long) ioremap(memaddr, io_size); if (!ioaddr) { @@ -705,7 +724,7 @@ #endif /* USE_MMIO */ /* D-Link provided reset code (with comment additions) */ - if (rhine_chip_info[chip_id].drv_flags & HasWOL) { + if (quirks & rqWOL) { unsigned char byOrgValue; /* clear sticky bit before reset & read ethernet address */ @@ -726,7 +745,7 @@ writew(CmdReset, ioaddr + ChipCmd); dev->base_addr = ioaddr; - wait_for_reset(dev, chip_id, shortname); + wait_for_reset(dev, quirks, shortname); /* Reload the station address from the EEPROM. */ #ifdef USE_MMIO @@ -734,7 +753,7 @@ /* Reloading from eeprom overwrites cfgA-D, so we must re-enable MMIO. If reload_eeprom() was done first this could be avoided, but it is not known if that still works with the "win98-reboot" problem. */ - enable_mmio(ioaddr0, chip_id); + enable_mmio(ioaddr0, quirks); #else reload_eeprom(ioaddr); #endif @@ -748,7 +767,7 @@ goto err_out_unmap; } - if (chip_id == VT6102) { + if (quirks & rqWOL) { /* * for 3065D, EEPROM reloaded will cause bit 0 in MAC_REG_CFGA * turned on. it makes MAC receive magic packet @@ -766,9 +785,8 @@ rp = netdev_priv(dev); spin_lock_init(&rp->lock); - rp->chip_id = chip_id; - rp->drv_flags = rhine_chip_info[chip_id].drv_flags; rp->pdev = pdev; + rp->quirks = quirks; rp->mii_if.dev = dev; rp->mii_if.mdio_read = mdio_read; rp->mii_if.mdio_write = mdio_write; @@ -791,7 +809,7 @@ #ifdef CONFIG_NET_POLL_CONTROLLER dev->poll_controller = rhine_poll; #endif - if (rp->drv_flags & ReqTxAlign) + if (rp->quirks & rqRhineI) dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM; /* dev->name not defined before register_netdev()! */ @@ -813,8 +831,8 @@ rp->mii_if.force_media = 1; } - printk(KERN_INFO "%s: %s at 0x%lx, ", - dev->name, rhine_chip_info[chip_id].name, + printk(KERN_INFO "%s: VIA %s at 0x%lx, ", + dev->name, name, #ifdef USE_MMIO memaddr #else @@ -896,7 +914,7 @@ printk(KERN_ERR "Could not allocate DMA memory.\n"); return -ENOMEM; } - if (rp->drv_flags & ReqTxAlign) { + if (rp->quirks & rqRhineI) { rp->tx_bufs = pci_alloc_consistent(rp->pdev, PKT_BUF_SZ * TX_RING_SIZE, &rp->tx_bufs_dma); @@ -1154,7 +1172,7 @@ return i; alloc_rbufs(dev); alloc_tbufs(dev); - wait_for_reset(dev, rp->chip_id, dev->name); + wait_for_reset(dev, rp->quirks, dev->name); init_registers(dev); if (debug > 2) printk(KERN_DEBUG "%s: Done rhine_open(), status %4.4x " @@ -1260,7 +1278,7 @@ alloc_rbufs(dev); /* Reinitialize the hardware. */ - wait_for_reset(dev, rp->chip_id, dev->name); + wait_for_reset(dev, rp->quirks, dev->name); init_registers(dev); spin_unlock(&rp->lock); @@ -1291,7 +1309,7 @@ rp->tx_skbuff[entry] = skb; - if ((rp->drv_flags & ReqTxAlign) && + if ((rp->quirks & rqRhineI) && (((long)skb->data & 3) || skb_shinfo(skb)->nr_frags != 0 || skb->ip_summed == CHECKSUM_HW)) { /* Must use alignment buffer. */ if (skb->len > PKT_BUF_SZ) { @@ -1440,7 +1458,7 @@ if (txstatus & 0x0200) rp->stats.tx_window_errors++; if (txstatus & 0x0100) rp->stats.tx_aborted_errors++; if (txstatus & 0x0080) rp->stats.tx_heartbeat_errors++; - if (((rp->chip_id == VT86C100A) && txstatus & 0x0002) || + if (((rp->quirks & rqRhineI) && txstatus & 0x0002) || (txstatus & 0x0800) || (txstatus & 0x1000)) { rp->stats.tx_fifo_errors++; rp->tx_ring[entry].tx_status = cpu_to_le32(DescOwn); @@ -1448,7 +1466,7 @@ } /* Transmitter restarted in 'abnormal' handler. */ } else { - if (rp->chip_id == VT86C100A) + if (rp->quirks & rqRhineI) rp->stats.collisions += (txstatus >> 3) & 0x0F; else rp->stats.collisions += txstatus & 0x0F; @@ -1660,7 +1678,7 @@ if (intr_status & (IntrLinkChange)) { if (readb(ioaddr + MIIStatus) & 0x02) { /* Link failed, restart autonegotiation. */ - if (rp->drv_flags & HasDavicomPhy) + if (rp->quirks & rqRhineI) mdio_write(dev, rp->phys[0], MII_BMCR, 0x3300); } else rhine_check_duplex(dev); From rl@hellgate.ch Wed Jun 2 04:59:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 04:59:46 -0700 (PDT) Received: from mail1.bluewin.ch (mail1.bluewin.ch [195.186.1.74]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52Bxdgi011059 for ; Wed, 2 Jun 2004 04:59:40 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail1.bluewin.ch (Bluewin AG 7.0.028) id 40BC705C00039939; Wed, 2 Jun 2004 11:59:21 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id 25C048CA75E; Wed, 2 Jun 2004 13:59:20 +0200 (CEST) Date: Wed, 2 Jun 2004 13:59:20 +0200 From: Roger Luethi To: Jeff Garzik , Andrew Morton Cc: netdev@oss.sgi.com Subject: [9/9][PATCH 2.6] Restructure reset code Message-ID: <20040602115920.GA17634@k3.hellgate.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602115703.GA16079@k3.hellgate.ch> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5546 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 6819 Lines: 268 Restructure code to make it easier to maintain. rhine_hw_init: resets chip, reloads eeprom rhine_chip_reset: chip reset + what used to be wait_for_reset rhine_reload_eeprom: reload eeprom, re-enable MMIO, disable EEPROM-controlled WOL Note: Chip reset clears a bunch of registers that should be reloaded from EEPROM (which turns off MMIO). Deal with that later. Signed-off-by: Roger Luethi --- orig/drivers/net/via-rhine.c +++ mod/drivers/net/via-rhine.c @@ -579,56 +579,76 @@ } } -static void wait_for_reset(struct net_device *dev, u32 quirks, char *name) +static void rhine_chip_reset(struct net_device *dev) { long ioaddr = dev->base_addr; + struct rhine_private *rp = netdev_priv(dev); int boguscnt = 20; + writew(CmdReset, ioaddr + ChipCmd); IOSYNC; if (readw(ioaddr + ChipCmd) & CmdReset) { printk(KERN_INFO "%s: Reset not complete yet. " - "Trying harder.\n", name); + "Trying harder.\n", DRV_NAME); - /* Rhine-II needs to be forced sometimes */ - if (quirks & rqForceReset) + /* Force reset */ + if (rp->quirks & rqForceReset) writeb(0x40, ioaddr + MiscCmd); - /* VT86C100A may need long delay after reset (dlink) */ - /* Seen on Rhine-II as well (rl) */ + /* Reset can take somewhat longer (rare) */ while ((readw(ioaddr + ChipCmd) & CmdReset) && --boguscnt) udelay(5); - } if (debug > 1) - printk(KERN_INFO "%s: Reset %s.\n", name, + printk(KERN_INFO "%s: Reset %s.\n", pci_name(rp->pdev), boguscnt ? "succeeded" : "failed"); } #ifdef USE_MMIO -static void __devinit enable_mmio(long ioaddr, u32 quirks) +static void __devinit enable_mmio(long pioaddr, u32 quirks) { int n; if (quirks & rqRhineI) { /* More recent docs say that this bit is reserved ... */ - n = inb(ioaddr + ConfigA) | 0x20; - outb(n, ioaddr + ConfigA); + n = inb(pioaddr + ConfigA) | 0x20; + outb(n, pioaddr + ConfigA); } else { - n = inb(ioaddr + ConfigD) | 0x80; - outb(n, ioaddr + ConfigD); + n = inb(pioaddr + ConfigD) | 0x80; + outb(n, pioaddr + ConfigD); } } #endif -static void __devinit reload_eeprom(long ioaddr) +/* + * Loads bytes 0x00-0x05, 0x6E-0x6F, 0x78-0x7B from EEPROM + */ +static void __devinit rhine_reload_eeprom(long pioaddr, struct net_device *dev) { + long ioaddr = dev->base_addr; + struct rhine_private *rp = netdev_priv(dev); int i; - outb(0x20, ioaddr + MACRegEEcsr); + + outb(0x20, pioaddr + MACRegEEcsr); /* Typically 2 cycles to reload. */ for (i = 0; i < 150; i++) - if (! (inb(ioaddr + MACRegEEcsr) & 0x20)) + if (! (inb(pioaddr + MACRegEEcsr) & 0x20)) break; + +#ifdef USE_MMIO + /* + * Reloading from EEPROM overwrites ConfigA-D, so we must re-enable + * MMIO. If reloading EEPROM was done first this could be avoided, but + * it is not known if that still works with the "win98-reboot" problem. + */ + enable_mmio(pioaddr, rp->quirks); +#endif + + /* Turn off EEPROM-controlled wake-up (magic packet) */ + if (rp->quirks & rqWOL) + writeb(readb(ioaddr + ConfigA) & 0xFE, ioaddr + ConfigA); + } #ifdef CONFIG_NET_POLL_CONTROLLER @@ -640,6 +660,15 @@ } #endif +static void rhine_hw_init(struct net_device *dev, long pioaddr) +{ + /* Reset the chip to erase previous misconfiguration. */ + rhine_chip_reset(dev); + + /* Reload EEPROM controlled bytes cleared by soft reset */ + rhine_reload_eeprom(pioaddr, dev); +} + static int __devinit rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -649,13 +678,11 @@ u8 pci_rev; u32 quirks; static int card_idx = -1; - long ioaddr; + long pioaddr; long memaddr; + long ioaddr; int io_size; int phy, phy_idx = 0; -#ifdef USE_MMIO - long ioaddr0; -#endif const char *name; /* when built into the kernel, we only print version if device is found */ @@ -708,7 +735,7 @@ goto err_out; } - ioaddr = pci_resource_start(pdev, 0); + pioaddr = pci_resource_start(pdev, 0); memaddr = pci_resource_start(pdev, 1); pci_set_master(pdev); @@ -728,8 +755,7 @@ goto err_out_free_netdev; #ifdef USE_MMIO - ioaddr0 = ioaddr; - enable_mmio(ioaddr0, quirks); + enable_mmio(pioaddr, quirks); ioaddr = (long) ioremap(memaddr, io_size); if (!ioaddr) { @@ -743,7 +769,7 @@ i = 0; while (mmio_verify_registers[i]) { int reg = mmio_verify_registers[i++]; - unsigned char a = inb(ioaddr0+reg); + unsigned char a = inb(pioaddr+reg); unsigned char b = readb(ioaddr+reg); if (a != b) { rc = -EIO; @@ -752,26 +778,18 @@ goto err_out_unmap; } } +#else + ioaddr = pioaddr; #endif /* USE_MMIO */ + dev->base_addr = ioaddr; + rp = netdev_priv(dev); + rp->quirks = quirks; rhine_power_init(dev); /* Reset the chip to erase previous misconfiguration. */ - writew(CmdReset, ioaddr + ChipCmd); - - wait_for_reset(dev, quirks, shortname); - - /* Reload the station address from the EEPROM. */ -#ifdef USE_MMIO - reload_eeprom(ioaddr0); - /* Reloading from eeprom overwrites cfgA-D, so we must re-enable MMIO. - If reload_eeprom() was done first this could be avoided, but it is - not known if that still works with the "win98-reboot" problem. */ - enable_mmio(ioaddr0, quirks); -#else - reload_eeprom(ioaddr); -#endif + rhine_hw_init(dev, pioaddr); for (i = 0; i < 6; i++) dev->dev_addr[i] = readb(ioaddr + StationAddr + i); @@ -782,15 +800,6 @@ goto err_out_unmap; } - if (quirks & rqWOL) { - /* - * for 3065D, EEPROM reloaded will cause bit 0 in MAC_REG_CFGA - * turned on. it makes MAC receive magic packet - * automatically. So, we turn it off. (D-Link) - */ - writeb(readb(ioaddr + ConfigA) & 0xFE, ioaddr + ConfigA); - } - /* Select backoff algorithm */ if (backoff) writeb(readb(ioaddr + ConfigD) & (0xF0 | backoff), @@ -798,10 +807,8 @@ dev->irq = pdev->irq; - rp = netdev_priv(dev); spin_lock_init(&rp->lock); rp->pdev = pdev; - rp->quirks = quirks; rp->mii_if.dev = dev; rp->mii_if.mdio_read = mdio_read; rp->mii_if.mdio_write = mdio_write; @@ -1170,9 +1177,6 @@ long ioaddr = dev->base_addr; int i; - /* Reset the chip. */ - writew(CmdReset, ioaddr + ChipCmd); - i = request_irq(rp->pdev->irq, &rhine_interrupt, SA_SHIRQ, dev->name, dev); if (i) @@ -1187,7 +1191,7 @@ return i; alloc_rbufs(dev); alloc_tbufs(dev); - wait_for_reset(dev, rp->quirks, dev->name); + rhine_chip_reset(dev); init_registers(dev); if (debug > 2) printk(KERN_DEBUG "%s: Done rhine_open(), status %4.4x " @@ -1283,9 +1287,6 @@ spin_lock(&rp->lock); - /* Reset the chip. */ - writew(CmdReset, ioaddr + ChipCmd); - /* clear all descriptors */ free_tbufs(dev); free_rbufs(dev); @@ -1293,7 +1294,7 @@ alloc_rbufs(dev); /* Reinitialize the hardware. */ - wait_for_reset(dev, rp->quirks, dev->name); + rhine_chip_reset(dev); init_registers(dev); spin_unlock(&rp->lock); From rl@hellgate.ch Wed Jun 2 05:33:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 05:33:33 -0700 (PDT) Received: from mail4.bluewin.ch (mail4.bluewin.ch [195.186.4.74]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52CXSgi012241 for ; Wed, 2 Jun 2004 05:33:29 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail4.bluewin.ch (Bluewin AG 7.0.028) id 40A46A68002308C2; Wed, 2 Jun 2004 11:59:06 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id B41E28CA75E; Wed, 2 Jun 2004 13:59:06 +0200 (CEST) Date: Wed, 2 Jun 2004 13:59:06 +0200 From: Roger Luethi To: Jeff Garzik , Andrew Morton Cc: netdev@oss.sgi.com Subject: [8/9][PATCH 2.6] Add rhine_power_init(): get power regs into sane state Message-ID: <20040602115906.GA17612@k3.hellgate.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602115703.GA16079@k3.hellgate.ch> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5547 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 2645 Lines: 92 Add rhine_power_init(): get power regs into sane state. Move the respective code out of rhine_init_one. Add code for two additional patterns (Rhine III). Signed-off-by: Roger Luethi --- orig/drivers/net/via-rhine.c +++ mod/drivers/net/via-rhine.c @@ -408,8 +408,10 @@ MIICmd=0x70, MIIRegAddr=0x71, MIIData=0x72, MACRegEEcsr=0x74, ConfigA=0x78, ConfigB=0x79, ConfigC=0x7A, ConfigD=0x7B, RxMissed=0x7C, RxCRCErrs=0x7E, MiscCmd=0x81, - StickyHW=0x83, IntrStatus2=0x84, WOLcrClr=0xA4, WOLcgClr=0xA7, - PwrcsrClr=0xAC, + StickyHW=0x83, IntrStatus2=0x84, + WOLcrSet=0xA0, WOLcrClr=0xA4, WOLcrClr1=0xA6, + WOLcgClr=0xA7, + PwrcsrSet=0xA8, PwrcsrSet1=0xA9, PwrcsrClr=0xAC, PwrcsrClr1=0xAD, }; /* Bits in ConfigD */ @@ -548,6 +550,35 @@ return intr_status; } +/* + * Get power related registers into sane state. + * Returns content of power-event (WOL) registers. + */ +static void rhine_power_init(struct net_device *dev) +{ + long ioaddr = dev->base_addr; + struct rhine_private *rp = netdev_priv(dev); + + if (rp->quirks & rqWOL) { + /* Make sure chip is in power state D0 */ + writeb(readb(ioaddr + StickyHW) & 0xFC, ioaddr + StickyHW); + + /* Disable "force PME-enable" */ + writeb(0x80, ioaddr + WOLcgClr); + + /* Clear power-event config bits (WOL) */ + writeb(0xFF, ioaddr + WOLcrClr); + /* More recent cards can manage two additional patterns */ + if (rp->quirks & rq6patterns) + writeb(0x03, ioaddr + WOLcrClr1); + + /* Clear power-event status bits */ + writeb(0xFF, ioaddr + PwrcsrClr); + if (rp->quirks & rq6patterns) + writeb(0x03, ioaddr + PwrcsrClr1); + } +} + static void wait_for_reset(struct net_device *dev, u32 quirks, char *name) { long ioaddr = dev->base_addr; @@ -722,29 +753,13 @@ } } #endif /* USE_MMIO */ + dev->base_addr = ioaddr; - /* D-Link provided reset code (with comment additions) */ - if (quirks & rqWOL) { - unsigned char byOrgValue; - - /* clear sticky bit before reset & read ethernet address */ - byOrgValue = readb(ioaddr + StickyHW); - byOrgValue = byOrgValue & 0xFC; - writeb(byOrgValue, ioaddr + StickyHW); - - /* (bits written are cleared?) */ - /* disable force PME-enable */ - writeb(0x80, ioaddr + WOLcgClr); - /* disable power-event config bit */ - writeb(0xFF, ioaddr + WOLcrClr); - /* clear power status (undocumented in vt6102 docs?) */ - writeb(0xFF, ioaddr + PwrcsrClr); - } + rhine_power_init(dev); /* Reset the chip to erase previous misconfiguration. */ writew(CmdReset, ioaddr + ChipCmd); - dev->base_addr = ioaddr; wait_for_reset(dev, quirks, shortname); /* Reload the station address from the EEPROM. */ From jm@jm.kir.nu Wed Jun 2 06:24:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 06:24:42 -0700 (PDT) Received: from jm.kir.nu (dsl017-049-110.sfo4.dsl.speakeasy.net [69.17.49.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52DObgi013821 for ; Wed, 2 Jun 2004 06:24:37 -0700 Received: from jm by jm.kir.nu with local (Exim 4.34) id 1BVVi6-0001zJ-8R; Wed, 02 Jun 2004 06:23:14 -0700 Date: Wed, 2 Jun 2004 06:23:14 -0700 From: Jouni Malinen To: "Luis R. Rodriguez" Cc: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support Message-ID: <20040602132313.GB7341@jm.kir.nu> Mail-Followup-To: "Luis R. Rodriguez" , Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel References: <20040602071449.GJ10723@ruslug.rutgers.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602071449.GJ10723@ruslug.rutgers.edu> User-Agent: Mutt/1.5.6i X-archive-position: 5548 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jkmaline@cc.hut.fi Precedence: bulk X-list: netdev Content-Length: 2229 Lines: 41 On Wed, Jun 02, 2004 at 03:14:49AM -0400, Luis R. Rodriguez wrote: > I'm glad wpa_supplicant exists :). Interacting with it *is* our missing > link to getting full WPA support (great job Jouni). In wpa_supplicant > cvs I see a base code for driver_prism54.c (empty routines, just providing skeleton). > Well I'll be diving in it now and see where I can get. If anyone else is > interested in helping with WPA support for prism54, working with > wpa_supplicant is the way to go. I have a bit more code for this in my work directory somewhere (setting the WPA IE and a new ioctl for this for the driver). I did not submit these yet since the extended MLME mode was not working and the changes were not yet really working properly. I can try to find these patches somewhere.. Anyway, I would first like to see the extended MLME mode working with any (even plaintext) AP and then somehow add the WPA IE to the AssocReq. After that, it should be only TKIP/CCMP key configuration and that's about it.. > I'm curious though -- wpa_supplicant is pretty much userspace. This was > done with good intentions from what I read but before we get dirty > with wpa_supplicant I'm wondering if we should just integrate a lot of > wpa_supplicant into kernel space (specifically wireless tools). Why? Which functionality would you like to move into kernel? Not that I'm against moving some parts, but I would certainly like to hear good reasons whenever moving something to kernel space if it can be done (or in this case, has already been done) in user space.. > Regardless, as Jouni points out, there is still a framework for WPA that needs > to be written for all linux wireless drivers, whether it's to assist > wpa_supplicant framework or to integrate wpa_supplicant into kernel space. The first thing I would like to see is an addition to Linux wireless extensions for WPA/WPA2 so that we can get rid of the private ioctls in the drivers. Even though these can often be similar, it would be nice to just write one driver interface code in wpa_supplicant and have it working with all Linu drivers.. I hope to find some time to write a proposal for this. -- Jouni Malinen PGP id EFC895FA From rl@hellgate.ch Wed Jun 2 06:34:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 06:34:05 -0700 (PDT) Received: from mail1.bluewin.ch (mail1.bluewin.ch [195.186.1.74]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52DY2gi014357 for ; Wed, 2 Jun 2004 06:34:03 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail1.bluewin.ch (Bluewin AG 7.0.028) id 40BC705C00039683; Wed, 2 Jun 2004 11:57:03 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id 061978CA75E; Wed, 2 Jun 2004 13:57:04 +0200 (CEST) Date: Wed, 2 Jun 2004 13:57:03 +0200 From: Roger Luethi To: Jeff Garzik , Andrew Morton Cc: netdev@oss.sgi.com Subject: [0/9][2.6] via-rhine patches Message-ID: <20040602115703.GA16079@k3.hellgate.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5549 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 431 Lines: 11 More changes for via-rhine, part of my clean-up effort to make via-rhine easier to maintain. After this batch, I have a few clean-up patches that are a tad more intrusive, plus fixes for broken functionality and new features. Big thanks to A.J. from VIA Networking Technologies, Inc. who has provided detailed information on Rhine chip behavior. Without him, many of the via-rhine patches to come would not have happened. Roger From rl@hellgate.ch Wed Jun 2 07:03:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 07:03:33 -0700 (PDT) Received: from mail4.bluewin.ch (mail4.bluewin.ch [195.186.4.74]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52E3Sgi015303 for ; Wed, 2 Jun 2004 07:03:29 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail4.bluewin.ch (Bluewin AG 7.0.028) id 40A46A680023080D; Wed, 2 Jun 2004 11:58:06 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id 3099B8CA75E; Wed, 2 Jun 2004 13:58:06 +0200 (CEST) Date: Wed, 2 Jun 2004 13:58:06 +0200 From: Roger Luethi To: Jeff Garzik , Andrew Morton Cc: netdev@oss.sgi.com Subject: [2/9][PATCH 2.6] Nuke CanHaveMII and related code Message-ID: <20040602115805.GA17418@k3.hellgate.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602115703.GA16079@k3.hellgate.ch> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5550 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 3474 Lines: 134 All Rhines can have a MII. Signed-off-by: Roger Luethi --- orig/drivers/net/via-rhine.c +++ mod/drivers/net/via-rhine.c @@ -375,7 +375,7 @@ enum chip_capability_flags { - CanHaveMII=1, HasESIPhy=2, HasDavicomPhy=4, + HasESIPhy=2, HasDavicomPhy=4, ReqTxAlign=0x10, HasWOL=0x20, }; @@ -391,13 +391,13 @@ static struct rhine_chip_info rhine_chip_info[] __devinitdata = { { "VIA VT86C100A Rhine", RHINE_IOTYPE, 128, - CanHaveMII | ReqTxAlign | HasDavicomPhy }, + ReqTxAlign | HasDavicomPhy }, { "VIA VT6102 Rhine-II", RHINE_IOTYPE, 256, - CanHaveMII | HasWOL }, + HasWOL }, { "VIA VT6105 Rhine-III", RHINE_IOTYPE, 256, - CanHaveMII | HasWOL }, + HasWOL }, { "VIA VT6105M Rhine-III", RHINE_IOTYPE, 256, - CanHaveMII | HasWOL }, + HasWOL }, }; static struct pci_device_id rhine_pci_tbl[] = @@ -635,6 +635,7 @@ long memaddr; int io_size; int pci_flags; + int phy, phy_idx = 0; #ifdef USE_MMIO long ioaddr0; #endif @@ -830,32 +831,29 @@ pci_set_drvdata(pdev, dev); - if (rp->drv_flags & CanHaveMII) { - int phy, phy_idx = 0; - rp->phys[0] = 1; /* Standard for this chip. */ - for (phy = 1; phy < 32 && phy_idx < MAX_MII_CNT; phy++) { - int mii_status = mdio_read(dev, phy, 1); - if (mii_status != 0xffff && mii_status != 0x0000) { - rp->phys[phy_idx++] = phy; - rp->mii_if.advertising = mdio_read(dev, phy, 4); - printk(KERN_INFO "%s: MII PHY found at address " - "%d, status 0x%4.4x advertising %4.4x " - "Link %4.4x.\n", dev->name, phy, - mii_status, rp->mii_if.advertising, - mdio_read(dev, phy, 5)); - - /* set IFF_RUNNING */ - if (mii_status & BMSR_LSTATUS) - netif_carrier_on(dev); - else - netif_carrier_off(dev); + rp->phys[0] = 1; /* Standard for this chip. */ + for (phy = 1; phy < 32 && phy_idx < MAX_MII_CNT; phy++) { + int mii_status = mdio_read(dev, phy, 1); + if (mii_status != 0xffff && mii_status != 0x0000) { + rp->phys[phy_idx++] = phy; + rp->mii_if.advertising = mdio_read(dev, phy, 4); + printk(KERN_INFO "%s: MII PHY found at address " + "%d, status 0x%4.4x advertising %4.4x " + "Link %4.4x.\n", dev->name, phy, + mii_status, rp->mii_if.advertising, + mdio_read(dev, phy, 5)); + + /* set IFF_RUNNING */ + if (mii_status & BMSR_LSTATUS) + netif_carrier_on(dev); + else + netif_carrier_off(dev); - break; - } + break; } - rp->mii_cnt = phy_idx; - rp->mii_if.phy_id = rp->phys[0]; } + rp->mii_cnt = phy_idx; + rp->mii_if.phy_id = rp->phys[0]; /* Allow forcing the media type. */ if (option > 0) { @@ -1800,9 +1798,6 @@ struct rhine_private *rp = netdev_priv(dev); int rc; - if (!(rp->drv_flags & CanHaveMII)) - return -EINVAL; - spin_lock_irq(&rp->lock); rc = mii_ethtool_gset(&rp->mii_if, cmd); spin_unlock_irq(&rp->lock); @@ -1815,9 +1810,6 @@ struct rhine_private *rp = netdev_priv(dev); int rc; - if (!(rp->drv_flags & CanHaveMII)) - return -EINVAL; - spin_lock_irq(&rp->lock); rc = mii_ethtool_sset(&rp->mii_if, cmd); spin_unlock_irq(&rp->lock); @@ -1829,9 +1821,6 @@ { struct rhine_private *rp = netdev_priv(dev); - if (!(rp->drv_flags & CanHaveMII)) - return -EINVAL; - return mii_nway_restart(&rp->mii_if); } @@ -1839,9 +1828,6 @@ { struct rhine_private *rp = netdev_priv(dev); - if (!(rp->drv_flags & CanHaveMII)) - return 0; /* -EINVAL */ - return mii_link_ok(&rp->mii_if); } From rl@hellgate.ch Wed Jun 2 07:29:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 07:29:51 -0700 (PDT) Received: from mail6.bluewin.ch (mail6.bluewin.ch [195.186.4.229]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52ETggi016391 for ; Wed, 2 Jun 2004 07:29:42 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail6.bluewin.ch (Bluewin AG 7.0.028) id 40A46BD30022DD38; Wed, 2 Jun 2004 11:58:42 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id 8949D8CA75E; Wed, 2 Jun 2004 13:58:42 +0200 (CEST) Date: Wed, 2 Jun 2004 13:58:42 +0200 From: Roger Luethi To: Jeff Garzik , Andrew Morton Cc: netdev@oss.sgi.com Subject: [5/9][PATCH 2.6] Nuke all pci_flags Message-ID: <20040602115842.GA17533@k3.hellgate.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602115703.GA16079@k3.hellgate.ch> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5551 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 2342 Lines: 98 All this code together can be replaced with a single #ifdef USE_MMIO. Signed-off-by: Roger Luethi --- orig/drivers/net/via-rhine.c +++ mod/drivers/net/via-rhine.c @@ -354,11 +354,6 @@ second only the 1234 card. */ -enum pci_flags_bit { - PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, - PCI_ADDR0=0x10<<0, PCI_ADDR1=0x10<<1, PCI_ADDR2=0x10<<2, PCI_ADDR3=0x10<<3, -}; - enum rhine_chips { VT86C100A = 0, VT6102, @@ -368,7 +363,6 @@ struct rhine_chip_info { const char *name; - u16 pci_flags; int io_size; int drv_flags; }; @@ -379,24 +373,19 @@ ReqTxAlign=0x10, HasWOL=0x20, }; -#ifdef USE_MMIO -#define RHINE_IOTYPE (PCI_USES_MEM | PCI_USES_MASTER | PCI_ADDR1) -#else -#define RHINE_IOTYPE (PCI_USES_IO | PCI_USES_MASTER | PCI_ADDR0) -#endif /* Beware of PCI posted writes */ #define IOSYNC do { readb(dev->base_addr + StationAddr); } while (0) /* directly indexed by enum rhine_chips, above */ static struct rhine_chip_info rhine_chip_info[] __devinitdata = { - { "VIA VT86C100A Rhine", RHINE_IOTYPE, 128, + { "VIA VT86C100A Rhine", 128, ReqTxAlign | HasDavicomPhy }, - { "VIA VT6102 Rhine-II", RHINE_IOTYPE, 256, + { "VIA VT6102 Rhine-II", 256, HasWOL }, - { "VIA VT6105 Rhine-III", RHINE_IOTYPE, 256, + { "VIA VT6105 Rhine-III", 256, HasWOL }, - { "VIA VT6105M Rhine-III", RHINE_IOTYPE, 256, + { "VIA VT6105M Rhine-III", 256, HasWOL }, }; @@ -633,7 +622,6 @@ long ioaddr; long memaddr; int io_size; - int pci_flags; int phy, phy_idx = 0; #ifdef USE_MMIO long ioaddr0; @@ -649,7 +637,6 @@ card_idx++; option = card_idx < MAX_UNITS ? options[card_idx] : 0; io_size = rhine_chip_info[chip_id].io_size; - pci_flags = rhine_chip_info[chip_id].pci_flags; if (pci_enable_device(pdev)) goto err_out; @@ -671,8 +658,7 @@ ioaddr = pci_resource_start(pdev, 0); memaddr = pci_resource_start(pdev, 1); - if (pci_flags & PCI_USES_MASTER) - pci_set_master(pdev); + pci_set_master(pdev); dev = alloc_etherdev(sizeof(*rp)); if (dev == NULL) { @@ -821,7 +807,12 @@ printk(KERN_INFO "%s: %s at 0x%lx, ", dev->name, rhine_chip_info[chip_id].name, - (pci_flags & PCI_USES_IO) ? ioaddr : memaddr); +#ifdef USE_MMIO + memaddr +#else + ioaddr +#endif + ); for (i = 0; i < 5; i++) printk("%2.2x:", dev->dev_addr[i]); From sam@errno.com Wed Jun 2 09:32:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 09:32:11 -0700 (PDT) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52GW5gi016917 for ; Wed, 2 Jun 2004 09:32:07 -0700 Received: from [66.127.85.91] ([66.127.85.91]) (authenticated bits=0) by ebb.errno.com (8.12.9/8.12.6) with ESMTP id i52GW1WR035169 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Wed, 2 Jun 2004 09:32:02 -0700 (PDT) (envelope-from sam@errno.com) From: Sam Leffler Organization: Errno Consulting To: hostap@shmoo.com Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support Date: Wed, 2 Jun 2004 09:28:07 -0700 User-Agent: KMail/1.6.1 Cc: mcgrof@studorgs.rutgers.edu (Luis R. Rodriguez), Netdev , prism54-devel@prism54.org, Jean Tourrilhes , Linux Kernel , Jeff Garzik References: <20040602071449.GJ10723@ruslug.rutgers.edu> In-Reply-To: <20040602071449.GJ10723@ruslug.rutgers.edu> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406020928.07513.sam@errno.com> X-archive-position: 5555 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sam@errno.com Precedence: bulk X-list: netdev Content-Length: 1907 Lines: 35 On Wednesday 02 June 2004 12:14 am, Luis R. Rodriguez wrote: > So WPA is now a priority for prism54 development. Here's where we're at. > Long ago in January Jouni had added some wpa supplicant support into > prism54. It's not until today when I started looking into > wpa_supplicant. > > I'm glad wpa_supplicant exists :). Interacting with it *is* our missing > link to getting full WPA support (great job Jouni). In wpa_supplicant > cvs I see a base code for driver_prism54.c (empty routines, just providing > skeleton). Well I'll be diving in it now and see where I can get. If anyone > else is interested in helping with WPA support for prism54, working with > wpa_supplicant is the way to go. > > I'm curious though -- wpa_supplicant is pretty much userspace. This was > done with good intentions from what I read but before we get dirty > with wpa_supplicant I'm wondering if we should just integrate a lot of > wpa_supplicant into kernel space (specifically wireless tools). > Regardless, as Jouni points out, there is still a framework for WPA that > needs to be written for all linux wireless drivers, whether it's to assist > wpa_supplicant framework or to integrate wpa_supplicant into kernel space. > > What's the plan? I think wpa_supplicant takes the right approach (i.e. putting the majority of the code in user space). The supplicant is not performance intensive and there's little justification for it going in the kernel on other grounds (like security). I've had madwifi working with wpa_supplicant for quite a while and have also done a rough port of wpa_supplicant to the bsd world too so it's design is proven (and in general I think it's excellent work). I'd second Jouni's comments about moving the wireless extensions support forward. Aside from WPA there are a few private mechanisms required for multi-mode devices that should be handled through a standard API. Sam From rl@hellgate.ch Wed Jun 2 09:33:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 09:33:32 -0700 (PDT) Received: from mail4.bluewin.ch (mail4.bluewin.ch [195.186.4.74]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52GXSgi017454 for ; Wed, 2 Jun 2004 09:33:29 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail4.bluewin.ch (Bluewin AG 7.0.028) id 40A46A68002307E2; Wed, 2 Jun 2004 11:57:54 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id 8D7048CA75E; Wed, 2 Jun 2004 13:57:54 +0200 (CEST) Date: Wed, 2 Jun 2004 13:57:54 +0200 From: Roger Luethi To: Jeff Garzik , Andrew Morton Cc: netdev@oss.sgi.com Subject: [1/9][PATCH 2.6] Nuke HAS_IP_COPYSUM Message-ID: <20040602115754.GA17396@k3.hellgate.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602115703.GA16079@k3.hellgate.ch> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5556 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 703 Lines: 25 HAS_IP_COPYSUM has been utterly meaningless for a long time. Signed-off-by: Roger Luethi --- orig/drivers/net/via-rhine.c +++ mod/drivers/net/via-rhine.c @@ -1563,15 +1563,10 @@ eth_copy_and_sum is memcpy for all archs so this is kind of pointless right now ... or? */ -#if HAS_IP_COPYSUM /* Call copy + cksum if available. */ eth_copy_and_sum(skb, rp->rx_skbuff[entry]->tail, pkt_len, 0); skb_put(skb, pkt_len); -#else - memcpy(skb_put(skb, pkt_len), - rp->rx_skbuff[entry]->tail, pkt_len); -#endif pci_dma_sync_single_for_device(rp->pdev, rp->rx_skbuff_dma[entry], rp->rx_buf_sz, From mcgrof@studorgs.rutgers.edu Wed Jun 2 09:34:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 09:34:06 -0700 (PDT) Received: from ruslug.rutgers.edu (studorgs.rutgers.edu [128.6.24.131]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52GXpgi017631 for ; Wed, 2 Jun 2004 09:33:51 -0700 Received: by ruslug.rutgers.edu (Postfix, from userid 503) id E6BC6F9D4B; Wed, 2 Jun 2004 11:55:42 -0400 (EDT) Date: Wed, 2 Jun 2004 11:55:42 -0400 To: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support Message-ID: <20040602155542.GC24822@ruslug.rutgers.edu> Mail-Followup-To: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel References: <20040602071449.GJ10723@ruslug.rutgers.edu> <20040602132313.GB7341@jm.kir.nu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yNb1oOkm5a9FJOVX" Content-Disposition: inline In-Reply-To: <20040602132313.GB7341@jm.kir.nu> User-Agent: Mutt/1.3.28i X-Operating-System: 2.4.18-1-686 Organization: Rutgers University Student Linux Users Group From: mcgrof@studorgs.rutgers.edu (Luis R. Rodriguez) X-archive-position: 5557 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mcgrof@studorgs.rutgers.edu Precedence: bulk X-list: netdev Content-Length: 3404 Lines: 81 --yNb1oOkm5a9FJOVX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 02, 2004 at 06:23:14AM -0700, Jouni Malinen wrote: > On Wed, Jun 02, 2004 at 03:14:49AM -0400, Luis R. Rodriguez wrote: >=20 > > I'm glad wpa_supplicant exists :). Interacting with it *is* our missing > > link to getting full WPA support (great job Jouni). In wpa_supplicant= =20 > > cvs I see a base code for driver_prism54.c (empty routines, just provid= ing skeleton). > > Well I'll be diving in it now and see where I can get. If anyone else is > > interested in helping with WPA support for prism54, working with > > wpa_supplicant is the way to go. >=20 > I have a bit more code for this in my work directory somewhere (setting > the WPA IE and a new ioctl for this for the driver). I did not submit > these yet since the extended MLME mode was not working and the changes > were not yet really working properly. I can try to find these patches > somewhere.. Anyway, I would first like to see the extended MLME mode > working with any (even plaintext) AP and then somehow add the WPA IE to > the AssocReq. After that, it should be only TKIP/CCMP key configuration > and that's about it.. If you find the patches that'd be great :). I'll see what I can do about fixing up extended MLME. I'll keep you posted.=20 > > I'm curious though -- wpa_supplicant is pretty much userspace. This was > > done with good intentions from what I read but before we get dirty=20 > > with wpa_supplicant I'm wondering if we should just integrate a lot of= =20 > > wpa_supplicant into kernel space (specifically wireless tools). >=20 > Why? Which functionality would you like to move into kernel? Not that > I'm against moving some parts, but I would certainly like to hear good > reasons whenever moving something to kernel space if it can be done (or > in this case, has already been done) in user space.. I have yet to review most of the wpa_supplicant code so I cannot say for sure yet what I think should go into the kernel. I e-mailed most lists mainly to get comments from others who have poked at wpa_supplicant and/or are looking into adding WPA client support into their drivers. I just wanted to make sure we were heading in the right direction since I only see 2 drivers that are currently using wpa_supplicant. > > Regardless, as Jouni points out, there is still a framework for WPA tha= t needs > > to be written for all linux wireless drivers, whether it's to assist > > wpa_supplicant framework or to integrate wpa_supplicant into kernel spa= ce. >=20 > The first thing I would like to see is an addition to Linux wireless > extensions for WPA/WPA2 so that we can get rid of the private ioctls in > the drivers. Even though these can often be similar, it would be nice to > just write one driver interface code in wpa_supplicant and have it > working with all Linu drivers.. I hope to find some time to write a > proposal for this. I agree :). Jean? *poke* Luis --=20 GnuPG Key fingerprint =3D 113F B290 C6D2 0251 4D84 A34A 6ADD 4937 E20A 525E --yNb1oOkm5a9FJOVX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAvfh+at1JN+IKUl4RArobAJ90VhiqoBhMVDqVYNyrSVF7/oCWpwCcCgMw BNTyXala+SrO9iduCpBy7CQ= =FuH1 -----END PGP SIGNATURE----- --yNb1oOkm5a9FJOVX-- From rl@hellgate.ch Wed Jun 2 11:34:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 11:34:09 -0700 (PDT) Received: from mail1.bluewin.ch (mail1.bluewin.ch [195.186.1.74]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52IY2gi022962 for ; Wed, 2 Jun 2004 11:34:03 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail1.bluewin.ch (Bluewin AG 7.0.028) id 40BC705C00039807; Wed, 2 Jun 2004 11:58:18 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id B0E238DFAEA; Wed, 2 Jun 2004 13:58:18 +0200 (CEST) Date: Wed, 2 Jun 2004 13:58:18 +0200 From: Roger Luethi To: Jeff Garzik , Andrew Morton Cc: netdev@oss.sgi.com Subject: [3/9][PATCH 2.6] Nuke HasESIPhy and related code Message-ID: <20040602115818.GA17462@k3.hellgate.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602115703.GA16079@k3.hellgate.ch> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5559 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 716 Lines: 28 This has been dead code forever. Signed-off-by: Roger Luethi --- orig/drivers/net/via-rhine.c +++ mod/drivers/net/via-rhine.c @@ -375,7 +375,7 @@ enum chip_capability_flags { - HasESIPhy=2, HasDavicomPhy=4, + HasDavicomPhy=4, ReqTxAlign=0x10, HasWOL=0x20, }; @@ -1085,9 +1085,8 @@ /* The LED outputs of various MII xcvrs should be configured. */ /* For NS or Mison phys, turn on bit 1 in register 0x17 */ - /* For ESI phys, turn on bit 7 in register 0x17. */ mdio_write(dev, rp->phys[0], 0x17, mdio_read(dev, rp->phys[0], 0x17) | - (rp->drv_flags & HasESIPhy) ? 0x0080 : 0x0001); + 0x0001); } /* Read and write over the MII Management Data I/O (MDIO) interface. */ From margitsw@t-online.de Wed Jun 2 11:56:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 11:56:33 -0700 (PDT) Received: from mailout09.sul.t-online.com (mailout09.sul.t-online.com [194.25.134.84]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52IuWgi023699 for ; Wed, 2 Jun 2004 11:56:32 -0700 Received: from fwd05.aul.t-online.de by mailout09.sul.t-online.com with smtp id 1BUWZZ-0000ar-00; Sun, 30 May 2004 22:06:21 +0200 Received: from margit.t-online.de (TtKdIrZSwe9NSlkPb49k25BepXPTyFeZC6PZyh7VmZ6W+f+kt-5G0I@[80.128.220.231]) by fwd05.sul.t-online.com with esmtp id 1BUWZX-0oGeJc0; Sun, 30 May 2004 22:06:19 +0200 Message-Id: <5.1.0.14.2.20040530211258.00ae3b70@pop.t-online.de> X-Sender: margitsw@pop.t-online.de X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sun, 30 May 2004 22:07:15 +0200 To: netdev@oss.sgi.com From: margitsw@t-online.de (Margit Schubert-While) Subject: [PATCH 0/17 linux-2.6.7-rc2] prism54: Bring prism54 up to sync Cc: jgarzik@pobox.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Seen: false X-ID: TtKdIrZSwe9NSlkPb49k25BepXPTyFeZC6PZyh7VmZ6W+f+kt-5G0I X-archive-position: 5560 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 1266 Lines: 26 Please apply the following patches to linux-2.6.7-rc2. These patches bring the kernel tree up to sync with prism54.org's 1.2 release. [PATCH 1/17 linux-2.6.7-rc1] prism54: delete cvs tags [PATCH 2/17 linux-2.6.7-rc1] prism54: add new private ioctls [PATCH 3/17 linux-2.6.7-rc1] prism54: reset card on tx_timeout [PATCH 4/17 linux-2.6.7-rc1] prism54: add iwspy support [PATCH 5/17 linux-2.6.7-rc1] prism54: add support for avs header in monitor mode [PATCH 6/17 linux-2.6.7-rc1] prism54: new prism54 kernel compatibility [PATCH 7/17 linux-2.6.7-rc1] prism54: Fix endian bug [PATCH 8/17 linux-2.6.7-rc1] prism54: Fix prism54.org bugs 74, 75 [PATCH 9/17 linux-2.6.7-rc1] prism54: Fix prism54.org bugs 39, 73 [PATCH 10/17 linux-2.6.7-rc1] prism54: Fix prism54.org bug 77; strengthened oid transaction [PATCH 11/17 linux-2.6.7-rc1] prism54: Don't allow mib reads while unconfigured [PATCH 12/17 linux-2.6.7-rc1] prism54: Start using likely/unlikely [PATCH 13/17 linux-2.6.7-rc1] prism54: Align skb data [PATCH 14/17 linux-2.6.7-rc1] prism54: Reduce verbosity [PATCH 15/17 linux-2.6.7-rc1] prism54: Fix channel stats; bump to 1.2 [PATCH 16/17 linux-2.6.7-rc1] prism54: Simplify firmware load call [PATCH 17/17 linux-2.6.7-rc1] prism54: White space and indent Margit From marc.herbert@free.fr Wed Jun 2 12:11:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 12:11:28 -0700 (PDT) Received: from relay03s.clb.oleane.net (relay03s.clb.oleane.net [213.56.31.144]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52JBFgi024864 for ; Wed, 2 Jun 2004 12:11:15 -0700 Received: from [10.0.0.3] ([194.2.198.253]) by relay03s.clb.oleane.net with ESMTP id i52JB3sE026871; Wed, 2 Jun 2004 21:11:09 +0200 Date: Wed, 2 Jun 2004 21:11:04 +0200 (CEST) From: Marc Herbert X-X-Sender: mherbert@fcat To: Ricardo C Gonzalez cc: netdev@oss.sgi.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by relay03s.clb.oleane.net id i52JB3sE026871 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i52JBFgi024864 X-archive-position: 5561 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@free.fr Precedence: bulk X-list: netdev Content-Length: 1072 Lines: 29 On Tue, 18 May 2004, Ricardo C Gonzalez wrote: > Are you considering the case of small packets? Good point: I was not, because it adds some complexity :-/ > Many applications use > lots of small packets. Example is the volano benchmark. Well... isn't that example a bit extreme, rather than representative? > You needs to look at throughput rates for small packets. A 1GB ethernet > can send something like 1.4 Million 64 byte packets per second. > > Let me know what you think. I said in some previous message that, from the point of view of IP "applications" in the very broad sense (i.e., including TCP) the txqueuelen should ideally be defined in milliseconds, in order to give an upper bound to latency. I reiterate that. So, for a given Ethernet link _speed_, this would translates into an ideal definition of txqueuelen in _bytes_ and not in _packets_. The current approximation (in packets) seems to assume that people wishing to send a whole lot of small packets are seldom, and can set the txqueuelen by themselves. This seems sensible to me. From marc.herbert@free.fr Wed Jun 2 12:14:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 12:14:38 -0700 (PDT) Received: from relay02s.clb.oleane.net (relay02s.clb.oleane.net [213.56.31.143]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52JEVgi025204 for ; Wed, 2 Jun 2004 12:14:32 -0700 Received: from [10.0.0.3] ([194.2.198.253]) by relay02s.clb.oleane.net with ESMTP id i52JENC0003387; Wed, 2 Jun 2004 21:14:23 +0200 Date: Wed, 2 Jun 2004 21:14:24 +0200 (CEST) From: Marc Herbert X-X-Sender: mherbert@fcat To: "Brandeburg, Jesse" cc: netdev@oss.sgi.com Subject: RE: TxDescriptors -> 1024 default. Please not for every NIC! In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by relay02s.clb.oleane.net id i52JENC0003387 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i52JEVgi025204 X-archive-position: 5562 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@free.fr Precedence: bulk X-list: netdev Content-Length: 8512 Lines: 201 On Wed, 26 May 2004, Brandeburg, Jesse wrote: > I'm not sure that you could actually get the problem to occur on 100 > or 10Mb/s hardware however because of TCP window size limitation and > such. What I'm getting at is that even if you have a device that can > queue lots of packets, it probably won't unless you're using an > unreliable protocol like UDP. Theoretically it's a problem, but I'm > not convinced that in real world scenarios it actually creates any > issues. Do you have a test that demonstrates the problem? OK, let's go for it. The following message details a simple experiment demonstrating how a too big (1000-packet) txqueuelen creates a dreaded latency at the IP level inside the sender for under-gigabit Ethernet interfaces, and so finally advocates a default 1000-packet txqueuelen defined _only_ by/for the _GigE_ drivers, leaving the previous (before sep 2003 in 2.4) 100-packet default untouched for slower interfaces. The experiment should be very quick and easy to reproduce in your lab, even in your home. Sorry, this message is way too long because it's... detailed, and tries to anticipate questions, hopefully avoiding the need to come back on this issue. The counter-part is that it's not dense and thus hopefully quick to read for anyone in the field. And please pardon my english mistakes. Detailed Experiment ------------------- You need at least 2 hosts, but ideally 3. The sender "S", the receiver "R1", and some witness host "R2". R1 and R2can probably be collapsed together if you don't have enough hosts but I am afraid of unknown nasty side effects in this case. Host S is using a simple TCP connection to upload an infinite file to host R. The bottleneck is S's own 100Mb/s (or worst, 10Mb/s) network interface. This is very important: no packet drop must occur elsewhere between Sand R, else TCP congestion avoidance algorithm will interpret this as a congestion sign and throttle down, and the txqueue will stay empty. If your TCP connection is under-performing your sending wire for any reason, you will obviously never fill your txqueue. The ACK-clocking property of TCP has for consequence that only the queue of the bottleneck of the path may fill up (except in very dynamic environnements where the bottleneck may be fast-changing, but let's stay simple). Actually almost everything below is still true when the bottleneck is elsewhere in some router further on the path instead of local in the sender. It's still true, just... elsewhere. For instance if you use a linux box as a router, and if it happens to be the bottleneck, I suspect this latency issue will appear more or less the same. But again, let's stay simple for the moment, forget those further routers and get back to this _local_ IP bottleneck and its too big txqueuelen. By the way, forcing your GigE interface to 100 or 10is ok. I used iperf to upload the infinite file, but any equivalent tool should do it. Since your TCP connection will suffer this artificial txqueue latency, you also need to increase SND_BUF and RCV_BUF, else the number of TCP packets sent (and thus the txqueue filling) will be capped (wait below for more about this). - So just run: host_R $ iperf --server --interval 1 --window 1M host_S $ iperf --client R --time 1000 --window 1M Check that you get a full 94.1Mb/s (resp. 9.4Mb/s) wire-rate. If not, investigate why and don't bother going on. - Now just watch the latency between S some other host "R2". For instance using mtr: S$ mtr -l R2 As the txqueue fills up, you will see perceived latency increasing every round-trip time, up to 120ms (worst with 10Mb/s: up to 1.2s!). When the txqueue is full, TCP detects it and enters congestion window reduction, providing some temporary relief. Then the artificial latency quickly ramps up again. - You can also try to start another simultaneous upload to R2: host_R2 $ iperf -s -i 1 host_S $ iperf -c R2 -t 1000 ... and watch how the artificial latency harms the start of the other TCP connection, which need ages to ramp up it's throughput. I also heard from here: "A Map of the Networking Code in Linux Kernel 2.4.20", Technical Report DataTAG-2004-1, section 4.4 http://datatag.web.cern.ch/datatag/publications.html that you can get interesting qdisc stats using such commands: # tc qdisc add dev eth1 root pfifo limit 100 #tc -s -d qdisc show dev eth1 But I did not tried them. Warning: the interface tx_ring size has to be added to the qdisc's txqueuelen to get the total sender's queue length perceived by TCP. Some drivers may also set it big. Solution -------- Now reduce the txqueuelen to the previous value: ifconfig eth1 txqueuelen 100 for 10Mb/s you can even try: ifconfig eth1 txqueuelen 10 Now your latency is now back to a sensible value (12ms max), and everything works fine. It's a simple as that. Throughput is not harmed at all, you still get the full 94.1 Mb/s wire-rate. If this (previous) setting was harmful to throughput for 100Mb/s interfaces, people would have complained since long. The more complex truth ----------------------- If there is a real-world, distance-caused latency between S and R, then having some equivalent amount of buffering in txqueuelen helps average performance, because the interface has then a backlog of packets to send while TCP takes time to ramp up its congestion window again a decrease, the former compensating the latter. (This may be what the e1000 guys observed in the first place, motivating the increase to 1000? After all, 1.2ms of buffering was small) The txqueue may smooth the sawtooth evolution of TCP congestion window, minimizing the interface idle time. But increased perceived latency is the price to pay for this nice damper. There is a tradeoff between latency and TCPthroughput _on wide area_ routes to tune here, but pushing it as far as storing in txqueuelen _multiple_ times any real-world latency (did I say "1.2s" already?) brings no benefit at all for throughput; it's just terribly harmful for perceived latency. No IP router does so much buffering. Besides linux :-> I don't think IP queues should be sized to cope with moon-earth latency by default. Conclusion ---------- (aka: let's harass the maintainers) Of course I just demonstrated here the worst case. In many other cases, TCP will throttle down for some reason (packet losses, too small socket buffers,...), it will not fill the pipe nor the txqueue, and this dreaded latency will not appear. You could argue that my test case is very seldom in the real world/not representative (and I would _not_ agree), so the txqueue will never be full in practice, since there will always be some other reason making TCP under-performing the sending wire. OK. Even then, why defining it uselessly so highfor every NIC? Why take this risk? Just as a small convenience for e1000 users? Mmmmm... So now every interface has this 1000-packet queue (and soon 10,000 because of these upcoming 10Gb/s interfaces). To ensure no one ever falls in this too big txqueue trap, I suggest the following user documentation: "if you have a 100Mb/s interface, be warned that your txqueuelen is too high (it was tuned for real, gigabit men). So please reduce it using ifconfig. Alternatively, if you are not root, please tune your socket buffers finely. Too small, you will under-perform. Too big, you will fill up your txqueue and create artificial latency. Good luck. Of course, you can forget all the above when your interface is not the bottleneck" On the other hand, having a default max txqueuelen defined in _milliseconds_ (just like most other routers do) is quite easy to implement and covers correctly allcases, without complex tuning instructions for the end user. The ideal implementation is that every driver defines txqueuelen by itself, depending on the actual link speed. It is unrealistic in the short-term, but the incremental implementation path is very easy: define a "sensible, generic default" of100-packet, perfect for the 100Mb/s masses, not too bad for 10Mb/s masses, and let the (only few until now, let's hurry up) gigabit drivers override/optimize this to 1000, or whatever else even more finely tuned, for the cheap price of a few lines of code per driver. Thanks in advance for agreeing OR proving that I am wrong. I mean: thanks in advance for anything besides remaining silent. And thanks for reading all this gossiping, an impressive effort indeed. From jgarzik@pobox.com Wed Jun 2 12:41:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 12:41:28 -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.9) with SMTP id i52JfIgi029056 for ; Wed, 2 Jun 2004 12:41:19 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1BVbbx-0002xj-GR; Wed, 02 Jun 2004 20:41:17 +0100 Message-ID: <40BE2D4F.3070005@pobox.com> Date: Wed, 02 Jun 2004 15:41:03 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Roger Luethi CC: Andrew Morton , netdev@oss.sgi.com Subject: Re: [9/9][PATCH 2.6] Restructure reset code References: <20040602115920.GA17634@k3.hellgate.ch> In-Reply-To: <20040602115920.GA17634@k3.hellgate.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5563 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: 51 Lines: 2 applied patches 1 through 8, rejected 9 (for now) From chengjin@cs.caltech.edu Wed Jun 2 12:49:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 12:49:33 -0700 (PDT) Received: from swordfish.cs.caltech.edu (swordfish.cs.caltech.edu [131.215.44.124]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i52JnSgi029520 for ; Wed, 2 Jun 2004 12:49:30 -0700 Received: from fast2.cs.caltech.edu (fast2.cs.caltech.edu [131.215.45.55]) by swordfish.cs.caltech.edu (Postfix) with ESMTP id 1C844DF267; Wed, 2 Jun 2004 12:49:28 -0700 (PDT) Received: by fast2.cs.caltech.edu (Postfix, from userid 20269) id 854331FF02; Wed, 2 Jun 2004 12:49:24 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by fast2.cs.caltech.edu (Postfix) with ESMTP id AA5FD1435EF; Wed, 2 Jun 2004 12:49:24 -0700 (PDT) Date: Wed, 2 Jun 2004 12:49:24 -0700 (PDT) From: Cheng Jin To: Marc Herbert Cc: "netdev@oss.sgi.com" Subject: RE: TxDescriptors -> 1024 default. Please not for every NIC! In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-archive-position: 5564 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chengjin@cs.caltech.edu Precedence: bulk X-list: netdev Content-Length: 2731 Lines: 52 Marc, In general, I very much agree with what you have stated about not having a large txqueuelen. Txqueuelen should be something that alleviates the mismatch between CPU speed and NIC transmission speed, temporarily. As long as the txqueuelne is greater than zero, say 10 just to be safe, NIC will be running at full speed (unless there were inefficiencies in scheduling) so there is no incentive in setting it to be an excessively large value like 1000. > > I'm not sure that you could actually get the problem to occur on 100 > > or 10Mb/s hardware however because of TCP window size limitation and With today's CPU, I think you will be able to fill up the txqueuelen on a 10 or 100 Mbps NIC, assuming there is a large file transfer and large window size and stuff. > If there is a real-world, distance-caused latency between S and R, > then having some equivalent amount of buffering in txqueuelen helps > average performance, because the interface has then a backlog of > packets to send while TCP takes time to ramp up its congestion window > again a decrease, the former compensating the latter. (This may be > what the e1000 guys observed in the first place, motivating the > increase to 1000? After all, 1.2ms of buffering was small) The > txqueue may smooth the sawtooth evolution of TCP congestion window, > minimizing the interface idle time. But increased perceived latency > is the price to pay for this nice damper. There is a tradeoff between > latency and TCPthroughput _on wide area_ routes to tune here, but > pushing it as far as storing in txqueuelen _multiple_ times any > real-world latency (did I say "1.2s" already?) brings no benefit at > all for throughput; it's just terribly harmful for perceived latency. > No IP router does so much buffering. Besides linux :-> I don't think > IP queues should be sized to cope with moon-earth latency by default. Very much agree with this paragraph. As long as the buffer is more than one bandwidth delay product, for a single TCP flow, window halving after each loss will still sustain a large enough window to maintain packets in the buffer to have full utilization. The downside is exactly what Marc said, very very large queueing delay for a long time. Going back to what Marc said in an earlier e-mail about having txqueuelen in the unit of bytes rather than packets to provide a fixed queueing delay in ms rather than packets. Maintaining txqueuelen in ms would be an ideal solution, but probably hard to achieve in practice. Keeping txqueuelen in bytes may be a problem for senders that wants to send many small pacekts. While the byte count may be small, the overhead of sending small packets may introduce large delays. Cheng From jgarzik@pobox.com Wed Jun 2 12:56:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 12:56:40 -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.9) with SMTP id i52Jubgi029933 for ; Wed, 2 Jun 2004 12:56:38 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1BVbqm-00036P-9T; Wed, 02 Jun 2004 20:56:36 +0100 Message-ID: <40BE30E8.3070002@pobox.com> Date: Wed, 02 Jun 2004 15:56:24 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Margit Schubert-While , Netdev Subject: Re: [PATCH 1/17 linux-2.6.7-rc2] prism54: delete cvs tags References: <200405310211.46049.margitsw@t-online.de> In-Reply-To: <200405310211.46049.margitsw@t-online.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5565 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: 21 Lines: 2 applied patches 1-5 From jgarzik@pobox.com Wed Jun 2 13:11:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 13:11: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.9) with SMTP id i52KBkgi030634 for ; Wed, 2 Jun 2004 13:11:49 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1BVc5R-0003GI-Ek; Wed, 02 Jun 2004 21:11:45 +0100 Message-ID: <40BE3475.10301@pobox.com> Date: Wed, 02 Jun 2004 16:11:33 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Margit Schubert-While CC: mcgrof@studorgs.rutgers.edu, Netdev Subject: Re: [2.6.7-rc2] prism54 patches References: <5.1.0.14.2.20040602095119.00aca6e0@pop.t-online.de> In-Reply-To: <5.1.0.14.2.20040602095119.00aca6e0@pop.t-online.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5566 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: 174 Lines: 12 Margit Schubert-While wrote: > Hi Jeff, > Couple of questions. please send all questions also to mailing list. private mail only is discouraged. spread knowledge! Jeff From jgarzik@pobox.com Wed Jun 2 13:21:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 13:21:24 -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.9) with SMTP id i52KLMgi031106 for ; Wed, 2 Jun 2004 13:21:22 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1BVcEh-0003M1-8X; Wed, 02 Jun 2004 21:21:19 +0100 Message-ID: <40BE36B3.5010907@pobox.com> Date: Wed, 02 Jun 2004 16:21:07 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Krzysztof Halasa CC: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6 Generic HDLC update References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5567 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: 9 Lines: 2 applied From jgarzik@pobox.com Wed Jun 2 13:24:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 13:24:40 -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.9) with SMTP id i52KOcgi031484 for ; Wed, 2 Jun 2004 13:24:38 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1BVcHt-0003OK-1y; Wed, 02 Jun 2004 21:24:37 +0100 Message-ID: <40BE3778.1020404@pobox.com> Date: Wed, 02 Jun 2004 16:24:24 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: netdev@oss.sgi.com Subject: Re: 3/x: [NETDRV] Add register_ei_netdev References: <20040313025859.GA8186@gondor.apana.org.au> <405C294D.5040508@pobox.com> <20040520111937.GA21804@gondor.apana.org.au> <20040522074435.GA9628@gondor.apana.org.au> <20040529084109.GA13032@gondor.apana.org.au> In-Reply-To: <20040529084109.GA13032@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5568 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: 301 Lines: 13 Herbert Xu wrote: > Hi Jeff: > > Here is the patch that adds register_ei_netdev which lets us get rid of > some of the duplicated printk's in the 8390 drivers. Patch looks OK, but I would prefer to reject it, and merge it later when an accompanying patch appears using this new function. Jeff From romieu@fr.zoreil.com Wed Jun 2 16:33:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 16:33:41 -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.9) with SMTP id i52NXXgi014144 for ; Wed, 2 Jun 2004 16:33:34 -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 i52NVSuX022271; Thu, 3 Jun 2004 01:31:28 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i52NVS2p022270; Thu, 3 Jun 2004 01:31:28 +0200 Date: Thu, 3 Jun 2004 01:31:28 +0200 From: Francois Romieu To: Jeff Garzik Cc: akpm@osdl.org, luto@myrealbox.com, netdev@oss.sgi.com Subject: [patch 2.6.7-rc2 + bk-netdev 1/4] r8169: link handling and phy reset rework Message-ID: <20040603013128.D18059@electric-eye.fr.zoreil.com> References: <200406010922.i519MIr27814@mail.osdl.org> <40BE2FAB.1040008@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <40BE2FAB.1040008@pobox.com>; from jgarzik@pobox.com on Wed, Jun 02, 2004 at 03:51:07PM -0400 X-Organisation: Land of Sunshine Inc. X-archive-position: 5570 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 8352 Lines: 283 Link handling changes (Andy Lutomirski ): - removed rtl8169_hw_phy_reset() and its busy loop; - RTL8169_PHY_TIMEOUT is x10 to account for the removal of the phy_link_down_cnt loop in rtl8169_phy_timer(); - added spinlocking in timer context for rtl8169_phy_timer to avoid messing with the {set/get}_settings commands issued via ethtool; - more TBI stuff. This patch differs from the former version on the following points: - the LinkChg irq does not enable the phy timer when the link goes down any more; - the phy timer is not enabled in rtl8169_set_speed(); - removal of the initial renegotiation hack. diff -puN drivers/net/r8169.c~r8169-link-00 drivers/net/r8169.c --- linux-2.6.7-rc2/drivers/net/r8169.c~r8169-link-00 2004-06-02 22:40:49.000000000 +0200 +++ linux-2.6.7-rc2-fr/drivers/net/r8169.c 2004-06-02 23:17:50.000000000 +0200 @@ -41,6 +41,7 @@ VERSION 1.2 <2002/11/30> #include #include #include +#include #include #include #include @@ -107,7 +108,7 @@ static int multicast_filter_limit = 32; #define RTL_MIN_IO_SIZE 0x80 #define RTL8169_TX_TIMEOUT (6*HZ) -#define RTL8169_PHY_TIMEOUT (HZ) +#define RTL8169_PHY_TIMEOUT (10*HZ) /* write/read MMIO register */ #define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg)) @@ -341,7 +342,6 @@ struct rtl8169_private { struct sk_buff *Rx_skbuff[NUM_RX_DESC]; /* Rx data buffers */ struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Tx data buffers */ struct timer_list timer; - unsigned long phy_link_down_cnt; u16 cp_cmd; u16 intr_mask; int phy_auto_nego_reg; @@ -349,6 +349,9 @@ struct rtl8169_private { int (*set_speed)(struct net_device *, u8 autoneg, u16 speed, u8 duplex); void (*get_settings)(struct net_device *, struct ethtool_cmd *); + void (*phy_reset_enable)(void *); + unsigned int (*phy_reset_pending)(void *); + unsigned int (*link_ok)(void *); }; MODULE_AUTHOR("Realtek"); @@ -374,7 +377,7 @@ static int rtl8169_poll(struct net_devic static const u16 rtl8169_intr_mask = LinkChg | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK; static const u16 rtl8169_napi_event = - RxOK | LinkChg | RxOverflow | RxFIFOOver | TxOK | TxErr; + RxOK | RxOverflow | RxFIFOOver | TxOK | TxErr; static const unsigned int rtl8169_rx_config = (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); @@ -416,6 +419,53 @@ static int mdio_read(void *ioaddr, int R return value; } +static unsigned int rtl8169_tbi_reset_pending(void *ioaddr) +{ + return RTL_R32(TBICSR) & TBIReset; +} + +static unsigned int rtl8169_xmii_reset_pending(void *ioaddr) +{ + return mdio_read(ioaddr, 0) & 0x8000; +} + +static unsigned int rtl8169_tbi_link_ok(void *ioaddr) +{ + return RTL_R32(TBICSR) & TBILinkOk; +} + +static unsigned int rtl8169_xmii_link_ok(void *ioaddr) +{ + return RTL_R8(PHYstatus) & LinkStatus; +} + +static void rtl8169_tbi_reset_enable(void *ioaddr) +{ + RTL_W32(TBICSR, RTL_R32(TBICSR) | TBIReset); +} + +static void rtl8169_xmii_reset_enable(void *ioaddr) +{ + unsigned int val; + + val = (mdio_read(ioaddr, PHY_CTRL_REG) | 0x8000) & 0xffff; + mdio_write(ioaddr, PHY_CTRL_REG, val); +} + +static void rtl8169_check_link_status(struct net_device *dev, + struct rtl8169_private *tp, void *ioaddr) +{ + unsigned long flags; + + spin_lock_irqsave(&tp->lock, flags); + if (tp->link_ok(ioaddr)) { + netif_carrier_on(dev); + printk(KERN_INFO PFX "%s: link up\n", dev->name); + } else + netif_carrier_off(dev); + spin_unlock_irqrestore(&tp->lock, flags); +} + static void rtl8169_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { @@ -493,8 +543,14 @@ static int rtl8169_set_speed(struct net_ u8 autoneg, u16 speed, u8 duplex) { struct rtl8169_private *tp = netdev_priv(dev); + int ret; + + ret = tp->set_speed(dev, autoneg, speed, duplex); + + if (tp->phy_1000_ctrl_reg & PHY_Cap_1000_Full) + mod_timer(&tp->timer, jiffies + RTL8169_PHY_TIMEOUT); - return tp->set_speed(dev, autoneg, speed, duplex); + return ret; } static int rtl8169_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) @@ -753,56 +809,42 @@ static void rtl8169_hw_phy_config(struct mdio_write(ioaddr, 31, 0x0000); //w 31 2 0 0 } -static void rtl8169_hw_phy_reset(struct net_device *dev) -{ - struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; - int i, val; - - printk(KERN_WARNING PFX "%s: Reset RTL8169s PHY\n", dev->name); - - val = (mdio_read(ioaddr, 0) | 0x8000) & 0xffff; - mdio_write(ioaddr, 0, val); - - for (i = 50; i >= 0; i--) { - if (!(mdio_read(ioaddr, 0) & 0x8000)) - break; - udelay(100); /* Gross */ - } - - if (i < 0) { - printk(KERN_WARNING PFX "%s: no PHY Reset ack. Giving up.\n", - dev->name); - } -} - static void rtl8169_phy_timer(unsigned long __opaque) { struct net_device *dev = (struct net_device *)__opaque; struct rtl8169_private *tp = netdev_priv(dev); struct timer_list *timer = &tp->timer; void *ioaddr = tp->mmio_addr; + unsigned long timeout = RTL8169_PHY_TIMEOUT; assert(tp->mac_version > RTL_GIGA_MAC_VER_B); assert(tp->phy_version < RTL_GIGA_PHY_VER_G); - if (RTL_R8(PHYstatus) & LinkStatus) - tp->phy_link_down_cnt = 0; - else { - tp->phy_link_down_cnt++; - if (tp->phy_link_down_cnt >= 12) { - int reg; - - // If link on 1000, perform phy reset. - reg = mdio_read(ioaddr, PHY_1000_CTRL_REG); - if (reg & PHY_Cap_1000_Full) - rtl8169_hw_phy_reset(dev); + if (!(tp->phy_1000_ctrl_reg & PHY_Cap_1000_Full)) + return; - tp->phy_link_down_cnt = 0; - } + spin_lock_irq(&tp->lock); + + if (tp->phy_reset_pending(ioaddr)) { + /* + * A busy loop could burn quite a few cycles on nowadays CPU. + * Let's delay the execution of the timer for a few ticks. + */ + timeout = HZ/10; + goto out_mod_timer; } - mod_timer(timer, jiffies + RTL8169_PHY_TIMEOUT); + if (tp->link_ok(ioaddr)) + goto out_unlock; + + printk(KERN_WARNING PFX "%s: PHY reset until link up\n", dev->name); + + tp->phy_reset_enable(ioaddr); + +out_mod_timer: + mod_timer(timer, jiffies + timeout); +out_unlock: + spin_unlock_irq(&tp->lock); } static inline void rtl8169_delete_timer(struct net_device *dev) @@ -815,8 +857,6 @@ static inline void rtl8169_delete_timer( return; del_timer_sync(timer); - - tp->phy_link_down_cnt = 0; } static inline void rtl8169_request_timer(struct net_device *dev) @@ -828,8 +868,6 @@ static inline void rtl8169_request_timer (tp->phy_version >= RTL_GIGA_PHY_VER_G)) return; - tp->phy_link_down_cnt = 0; - init_timer(timer); timer->expires = jiffies + RTL8169_PHY_TIMEOUT; timer->data = (unsigned long)(dev); @@ -1014,11 +1052,17 @@ rtl8169_init_one(struct pci_dev *pdev, c if (RTL_R8(PHYstatus) & TBI_Enable) { tp->set_speed = rtl8169_set_speed_tbi; tp->get_settings = rtl8169_gset_tbi; + tp->phy_reset_enable = rtl8169_tbi_reset_enable; + tp->phy_reset_pending = rtl8169_tbi_reset_pending; + tp->link_ok = rtl8169_tbi_link_ok; tp->phy_1000_ctrl_reg = PHY_Cap_1000_Full; /* Implied by TBI */ } else { tp->set_speed = rtl8169_set_speed_xmii; tp->get_settings = rtl8169_gset_xmii; + tp->phy_reset_enable = rtl8169_xmii_reset_enable; + tp->phy_reset_pending = rtl8169_xmii_reset_pending; + tp->link_ok = rtl8169_xmii_link_ok; } // Get MAC address. FIXME: read EEPROM @@ -1752,10 +1796,7 @@ rtl8169_interrupt(int irq, void *dev_ins break; handled = 1; -/* - if (status & LinkChg) - link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; -*/ + status &= tp->intr_mask; RTL_W16(IntrStatus, (status & RxFIFOOver) ? (status | RxOverflow) : status); @@ -1763,6 +1804,9 @@ rtl8169_interrupt(int irq, void *dev_ins if (!(status & rtl8169_intr_mask)) break; + if (status & LinkChg) + rtl8169_check_link_status(dev, tp, ioaddr); + #ifdef CONFIG_R8169_NAPI RTL_W16(IntrMask, rtl8169_intr_mask & ~rtl8169_napi_event); tp->intr_mask = ~rtl8169_napi_event; @@ -1776,7 +1820,7 @@ rtl8169_interrupt(int irq, void *dev_ins break; #else // Rx interrupt - if (status & (RxOK | LinkChg | RxOverflow | RxFIFOOver)) { + if (status & (RxOK | RxOverflow | RxFIFOOver)) { rtl8169_rx_interrupt(dev, tp, ioaddr); } // Tx interrupt _ From romieu@fr.zoreil.com Wed Jun 2 16:33:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 16:33:39 -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.9) with SMTP id i52NXWgi014142 for ; Wed, 2 Jun 2004 16:33:33 -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 i52NXJuX022291; Thu, 3 Jun 2004 01:33:19 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i52NXJ76022290; Thu, 3 Jun 2004 01:33:19 +0200 Date: Thu, 3 Jun 2004 01:33:19 +0200 From: Francois Romieu To: Jeff Garzik Cc: akpm@osdl.org, luto@myrealbox.com, netdev@oss.sgi.com Subject: [patch 2.6.7-rc2 + bk-netdev 2/4] r8169: initial link setup rework Message-ID: <20040603013319.A22272@electric-eye.fr.zoreil.com> References: <200406010922.i519MIr27814@mail.osdl.org> <40BE2FAB.1040008@pobox.com> <20040603013128.D18059@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040603013128.D18059@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Thu, Jun 03, 2004 at 01:31:28AM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 5569 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 5919 Lines: 193 Use rtl8169_set_speed() for link setup in rtl8169_init_one(): - the code which handles the option checking is isolated; - display (once) a notice message about the deprecated interface; - rtl8169_open() enables the phy timer if the link is not up; - rtl8169_set_speed() checks that the netdevice is actually ready in order to activate the timer. diff -puN drivers/net/r8169.c~r8169-link-10 drivers/net/r8169.c --- linux-2.6.7-rc2/drivers/net/r8169.c~r8169-link-10 2004-06-02 23:18:02.000000000 +0200 +++ linux-2.6.7-rc2-fr/drivers/net/r8169.c 2004-06-02 23:18:02.000000000 +0200 @@ -7,7 +7,7 @@ Feb 4 2002 - created initially by ShuChen . May 20 2002 - Add link status force-mode and TBI mode support. ========================================================================= - 1. The media can be forced in 5 modes. + 1. [DEPRECATED: use ethtool instead] The media can be forced in 5 modes. Command: 'insmod r8169 media = SET_MEDIA' Ex: 'insmod r8169 media = 0x04' will force PHY to operate in 100Mpbs Half-duplex. @@ -466,6 +466,38 @@ static void rtl8169_check_link_status(st spin_unlock_irqrestore(&tp->lock, flags); } +static void rtl8169_link_option(int idx, u8 *autoneg, u16 *speed, u8 *duplex) +{ + struct { + u16 speed; + u8 duplex; + u8 autoneg; + u8 media; + } link_settings[] = { + { SPEED_10, DUPLEX_HALF, AUTONEG_DISABLE, _10_Half }, + { SPEED_10, DUPLEX_FULL, AUTONEG_DISABLE, _10_Full }, + { SPEED_100, DUPLEX_HALF, AUTONEG_DISABLE, _100_Half }, + { SPEED_100, DUPLEX_FULL, AUTONEG_DISABLE, _100_Full }, + { SPEED_1000, DUPLEX_FULL, AUTONEG_DISABLE, _1000_Full }, + /* Make TBI happy */ + { SPEED_1000, DUPLEX_FULL, AUTONEG_ENABLE, 0xff } + }, *p; + unsigned char option; + + option = ((idx < MAX_UNITS) && (idx >= 0)) ? media[idx] : 0xff; + + if ((option != 0xff) && !idx) + printk(KERN_WARNING PFX "media option is deprecated.\n"); + + for (p = link_settings; p->media != 0xff; p++) { + if (p->media == option) + break; + } + *autoneg = p->autoneg; + *speed = p->speed; + *duplex = p->duplex; +} + static void rtl8169_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { @@ -547,7 +579,7 @@ static int rtl8169_set_speed(struct net_ ret = tp->set_speed(dev, autoneg, speed, duplex); - if (tp->phy_1000_ctrl_reg & PHY_Cap_1000_Full) + if (netif_running(dev) && (tp->phy_1000_ctrl_reg & PHY_Cap_1000_Full)) mod_timer(&tp->timer, jiffies + RTL8169_PHY_TIMEOUT); return ret; @@ -1027,8 +1059,9 @@ rtl8169_init_one(struct pci_dev *pdev, c void *ioaddr = NULL; static int board_idx = -1; static int printed_version = 0; + u8 autoneg, duplex; + u16 speed; int i, rc; - int option = -1, Cap10_100 = 0, Cap1000 = 0; assert(pdev != NULL); assert(ent != NULL); @@ -1131,97 +1164,12 @@ rtl8169_init_one(struct pci_dev *pdev, c mdio_write(ioaddr, 0x0b, 0x0000); //w 0x0b 15 0 0 } - // if TBI is not endbled - if (!(RTL_R8(PHYstatus) & TBI_Enable)) { - int val = mdio_read(ioaddr, PHY_AUTO_NEGO_REG); - - option = (board_idx >= MAX_UNITS) ? 0 : media[board_idx]; - // Force RTL8169 in 10/100/1000 Full/Half mode. - if (option > 0) { - printk(KERN_INFO "%s: Force-mode Enabled.\n", - dev->name); - Cap10_100 = 0, Cap1000 = 0; - switch (option) { - case _10_Half: - Cap10_100 = PHY_Cap_10_Half_Or_Less; - Cap1000 = PHY_Cap_Null; - break; - case _10_Full: - Cap10_100 = PHY_Cap_10_Full_Or_Less; - Cap1000 = PHY_Cap_Null; - break; - case _100_Half: - Cap10_100 = PHY_Cap_100_Half_Or_Less; - Cap1000 = PHY_Cap_Null; - break; - case _100_Full: - Cap10_100 = PHY_Cap_100_Full_Or_Less; - Cap1000 = PHY_Cap_Null; - break; - case _1000_Full: - Cap10_100 = PHY_Cap_100_Full_Or_Less; - Cap1000 = PHY_Cap_1000_Full; - break; - default: - break; - } - // leave PHY_AUTO_NEGO_REG bit4:0 unchanged - mdio_write(ioaddr, PHY_AUTO_NEGO_REG, - Cap10_100 | (val & 0x1F)); - mdio_write(ioaddr, PHY_1000_CTRL_REG, Cap1000); - } else { - printk(KERN_INFO "%s: Auto-negotiation Enabled.\n", - dev->name); + rtl8169_link_option(board_idx, &autoneg, &speed, &duplex); - // enable 10/100 Full/Half Mode - // leave PHY_AUTO_NEGO_REG bit4:0 unchanged - mdio_write(ioaddr, PHY_AUTO_NEGO_REG, - PHY_Cap_100_Full_Or_Less | (val & 0x1f)); - - // enable 1000 Full Mode - mdio_write(ioaddr, PHY_1000_CTRL_REG, - PHY_Cap_1000_Full); - - } - - // Enable auto-negotiation and restart auto-nigotiation - mdio_write(ioaddr, PHY_CTRL_REG, - PHY_Enable_Auto_Nego | PHY_Restart_Auto_Nego); - udelay(100); - - // wait for auto-negotiation process - for (i = 10000; i > 0; i--) { - //check if auto-negotiation complete - if (mdio_read(ioaddr, PHY_STAT_REG) & - PHY_Auto_Neco_Comp) { - udelay(100); - option = RTL_R8(PHYstatus); - if (option & _1000bpsF) { - printk(KERN_INFO - "%s: 1000Mbps Full-duplex operation.\n", - dev->name); - } else { - printk(KERN_INFO - "%s: %sMbps %s-duplex operation.\n", - dev->name, - (option & _100bps) ? "100" : - "10", - (option & FullDup) ? "Full" : - "Half"); - } - break; - } else { - udelay(100); - } - } // end for-loop to wait for auto-negotiation process - - } else { - udelay(100); - printk(KERN_INFO - "%s: 1000Mbps Full-duplex operation, TBI Link %s!\n", - dev->name, - (RTL_R32(TBICSR) & TBILinkOK) ? "OK" : "Failed"); - } + rtl8169_set_speed(dev, autoneg, speed, duplex); + + if (RTL_R8(PHYstatus) & TBI_Enable) + printk(KERN_INFO PFX "%s: TBI auto-negotiating\n", dev->name); return 0; } @@ -1322,6 +1270,8 @@ rtl8169_open(struct net_device *dev) rtl8169_hw_start(dev); rtl8169_request_timer(dev); + + rtl8169_check_link_status(dev, tp, tp->mmio_addr); out: return retval; _ From romieu@fr.zoreil.com Wed Jun 2 16:37:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 16:37:36 -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.9) with SMTP id i52NbWgi014813 for ; Wed, 2 Jun 2004 16:37:33 -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 i52NZBuX022375; Thu, 3 Jun 2004 01:35:11 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i52NZBcA022374; Thu, 3 Jun 2004 01:35:11 +0200 Date: Thu, 3 Jun 2004 01:35:11 +0200 From: Francois Romieu To: Jeff Garzik Cc: akpm@osdl.org, luto@myrealbox.com, netdev@oss.sgi.com Subject: [patch 2.6.7-rc2 + bk-netdev 3/4] r8169: gcc bug workaround Message-ID: <20040603013511.B22272@electric-eye.fr.zoreil.com> References: <200406010922.i519MIr27814@mail.osdl.org> <40BE2FAB.1040008@pobox.com> <20040603013128.D18059@electric-eye.fr.zoreil.com> <20040603013319.A22272@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040603013319.A22272@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Thu, Jun 03, 2004 at 01:33:19AM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 5572 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 1061 Lines: 29 Add a temporary variable to workaround gcc 2.95.3 bug. diff -puN drivers/net/r8169.c~r8169-gcc-killed-me drivers/net/r8169.c --- linux-2.6.7-rc2/drivers/net/r8169.c~r8169-gcc-killed-me 2004-06-03 00:15:34.000000000 +0200 +++ linux-2.6.7-rc2-fr/drivers/net/r8169.c 2004-06-03 00:15:34.000000000 +0200 @@ -1542,6 +1542,7 @@ rtl8169_start_xmit(struct sk_buff *skb, if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) { dma_addr_t mapping; + u32 status; mapping = pci_map_single(tp->pci_dev, skb->data, len, PCI_DMA_TODEVICE); @@ -1549,8 +1550,10 @@ rtl8169_start_xmit(struct sk_buff *skb, tp->Tx_skbuff[entry] = skb; tp->TxDescArray[entry].addr = cpu_to_le64(mapping); - tp->TxDescArray[entry].status = cpu_to_le32(OWNbit | FSbit | - LSbit | len | (EORbit * !((entry + 1) % NUM_TX_DESC))); + /* anti gcc 2.95.3 bugware */ + status = OWNbit | FSbit | LSbit | len | + (EORbit * !((entry + 1) % NUM_TX_DESC)); + tp->TxDescArray[entry].status = cpu_to_le32(status); RTL_W8(TxPoll, 0x40); //set polling bit _ From romieu@fr.zoreil.com Wed Jun 2 16:37:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 16:37:35 -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.9) with SMTP id i52NbWgi014814 for ; Wed, 2 Jun 2004 16:37:33 -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 i52NaauX022398; Thu, 3 Jun 2004 01:36:36 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i52NaaTu022397; Thu, 3 Jun 2004 01:36:36 +0200 Date: Thu, 3 Jun 2004 01:36:36 +0200 From: Francois Romieu To: Jeff Garzik Cc: akpm@osdl.org, luto@myrealbox.com, netdev@oss.sgi.com Subject: [patch 2.6.7-rc2 + bk-netdev 4/4] r8169: tx lock removal Message-ID: <20040603013636.C22272@electric-eye.fr.zoreil.com> References: <200406010922.i519MIr27814@mail.osdl.org> <40BE2FAB.1040008@pobox.com> <20040603013128.D18059@electric-eye.fr.zoreil.com> <20040603013319.A22272@electric-eye.fr.zoreil.com> <20040603013511.B22272@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040603013511.B22272@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Thu, Jun 03, 2004 at 01:35:11AM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 5571 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 1779 Lines: 73 spinlock removal crusade. The patch rephrases the spinlock_irq() in rtl8169_start_xmit() and its companion in the Tx irq handling patch in terms of ordered operations. diff -puN drivers/net/r8169.c~r8169-tx-lock-removal drivers/net/r8169.c --- linux-2.6.7-rc2/drivers/net/r8169.c~r8169-tx-lock-removal 2004-06-03 00:15:37.000000000 +0200 +++ linux-2.6.7-rc2-fr/drivers/net/r8169.c 2004-06-03 00:15:37.000000000 +0200 @@ -1538,8 +1538,6 @@ rtl8169_start_xmit(struct sk_buff *skb, len = ETH_ZLEN; } - spin_lock_irq(&tp->lock); - if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) { dma_addr_t mapping; u32 status; @@ -1560,16 +1558,20 @@ rtl8169_start_xmit(struct sk_buff *skb, dev->trans_start = jiffies; tp->cur_tx++; + smp_wmb(); } else goto err_drop; - if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) { + u32 dirty = tp->dirty_tx; + netif_stop_queue(dev); + smp_rmb(); + if (dirty != tp->dirty_tx) + netif_wake_queue(dev); } -out: - spin_unlock_irq(&tp->lock); +out: return 0; err_drop: @@ -1590,6 +1592,7 @@ rtl8169_tx_interrupt(struct net_device * assert(ioaddr != NULL); dirty_tx = tp->dirty_tx; + smp_rmb(); tx_left = tp->cur_tx - dirty_tx; while (tx_left > 0) { @@ -1616,6 +1619,7 @@ rtl8169_tx_interrupt(struct net_device * if (tp->dirty_tx != dirty_tx) { tp->dirty_tx = dirty_tx; + smp_wmb(); if (netif_queue_stopped(dev)) netif_wake_queue(dev); } @@ -1777,11 +1781,8 @@ rtl8169_interrupt(int irq, void *dev_ins rtl8169_rx_interrupt(dev, tp, ioaddr); } // Tx interrupt - if (status & (TxOK | TxErr)) { - spin_lock(&tp->lock); + if (status & (TxOK | TxErr)) rtl8169_tx_interrupt(dev, tp, ioaddr); - spin_unlock(&tp->lock); - } #endif boguscnt--; _ From jm@jm.kir.nu Wed Jun 2 18:41:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 18:41:28 -0700 (PDT) Received: from jm.kir.nu (dsl017-049-110.sfo4.dsl.speakeasy.net [69.17.49.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i531fOgi019142 for ; Wed, 2 Jun 2004 18:41:25 -0700 Received: from jm by jm.kir.nu with local (Exim 4.34) id 1BVhD6-00023L-Bx; Wed, 02 Jun 2004 18:40:00 -0700 Date: Wed, 2 Jun 2004 18:40:00 -0700 From: Jouni Malinen To: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support Message-ID: <20040603014000.GA7548@jm.kir.nu> Mail-Followup-To: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel References: <20040602071449.GJ10723@ruslug.rutgers.edu> <20040602132313.GB7341@jm.kir.nu> <20040602155542.GC24822@ruslug.rutgers.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602155542.GC24822@ruslug.rutgers.edu> User-Agent: Mutt/1.5.6i X-archive-position: 5573 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jkmaline@cc.hut.fi Precedence: bulk X-list: netdev Content-Length: 1307 Lines: 27 On Wed, Jun 02, 2004 at 11:55:42AM -0400, Luis R. Rodriguez wrote: > If you find the patches that'd be great :). I'll see what I can do about > fixing up extended MLME. I'll keep you posted. I now know where the wpa_supplicant part is and once I find the matching patch for Prism54 driver, I'll send them both to you. > I have yet to review most of the wpa_supplicant code so I cannot say for > sure yet what I think should go into the kernel. I e-mailed most lists > mainly to get comments from others who have poked at wpa_supplicant > and/or are looking into adding WPA client support into their drivers. > I just wanted to make sure we were heading in the right direction since > I only see 2 drivers that are currently using wpa_supplicant. You may have seen only two drivers, but actually I'm already aware of at least seven drivers that work with wpa_supplicant.. All of these are not yet available publicly, though. I believe that the current design for wpa_supplicant is quite alright for most cases. I would like to give some more thought for the roaming part (i.e., consider giving more control for the driver), but this should be doable in a backward compatible way without breaking support with existing code. -- Jouni Malinen PGP id EFC895FA From ramalhais@serrado.net Wed Jun 2 19:38:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 19:38:26 -0700 (PDT) Received: from smtp.netcabo.pt (smtp.netcabo.pt [212.113.174.9]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i532cMgi020547 for ; Wed, 2 Jun 2004 19:38:23 -0700 Received: from mail.serrado.net ([81.84.124.62]) by smtp.netcabo.pt with Microsoft SMTPSVC(5.0.2195.6713); Thu, 3 Jun 2004 03:38:12 +0100 Received: (qmail 15554 invoked from network); 3 Jun 2004 02:38:10 -0000 Received: from rootix-w.resnet.serrado.net ([192.168.1.77]) (envelope-sender ) by mail.serrado.net (qmail-ldap-1.03) with SMTP for ; 3 Jun 2004 02:38:10 -0000 Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support From: Pedro Ramalhais To: Jouni Malinen Cc: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel In-Reply-To: <20040603014000.GA7548@jm.kir.nu> References: <20040602071449.GJ10723@ruslug.rutgers.edu> <20040602132313.GB7341@jm.kir.nu> <20040602155542.GC24822@ruslug.rutgers.edu> <20040603014000.GA7548@jm.kir.nu> Content-Type: text/plain Message-Id: <1086230284.7604.38.camel@rootix> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Thu, 03 Jun 2004 03:38:05 +0100 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Jun 2004 02:38:12.0933 (UTC) FILETIME=[D0CA1F50:01C44913] X-archive-position: 5574 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ramalhais@serrado.net Precedence: bulk X-list: netdev Content-Length: 3771 Lines: 70 Pre-Scriptum: Please excuse me for cross posting and/or if this mail is not relevant for the recipient mailing list/people. Hi Jouni (and other interest wireless driver developers)! As you may know (or not), the ipw2100 driver is somewhat based on hostap code. We use some code from hostap in the ipw2100 driver, and use the hostap driver externally as a way to provide WEP. I'm currently working on turning hostap_crypt* into ieee80211_crypt* in such a way that could be used in a generic way by all drivers that need host based WEP (and TKIP/CCMP). I basically renamed the hostap_crypt* to ieee80211_crypt* and search&replaced hostap with ieee80211. Also made hostap_crypt.c into a module (instead of having to rely on hostap.o). I have WEP working and a Makefile that can be used in the kernel or externally. I took a look at the TKIP and CCMP source files and it is somewhat tied up to ioctls and headers (just took a quick look correct me if i'm wrong) from hostap. This makes it somewhat difficult to turn them into code that compiles without hostap code. Besides this, the ipw2100 code also has an attempt at a somewhat generic ieee80211 interface for drivers. ieee80211_rx.c is mostly based on hostap_hw.c code (which looks like is now in CVS as hostap_80211_rx.c ) and there's also ieee80211_tx.c which i think was created from scratch by James Ketrenos (ipw2100 main developer @intel). My question is: would it be interesting to try and merge code from hostap, ipw2100 and possibly other drivers to try to create generic code for 80211 and 80211_crypt? How much interest is there on the part of the developers (hostap, prism54, atmel, etc...). I'm asking this because AFAICS, the hostap driver always had an history of more focus on new features, functionality, bug fixes, than "standard" APIs, etc... and i completely understand that and thank god it has been like this because the final result was a really nice driver. Would you accept patches at least for now to make hostap_crypt* into ieee80211_crypt*? Sorry, i have so many questions and ideas, that i cannot express myself very well =:-). This is getting lengthy, so, hope you got the idea at least of some of my questions/ideas/worries, etc.... Thank you! PS: Comments, ideas, proposals, etc are welcome for discussion.(What is the best way to discuss this matter? There's a large number of developers involved. Maybe netdev?) On Thu, 2004-06-03 at 02:40, Jouni Malinen wrote: > On Wed, Jun 02, 2004 at 11:55:42AM -0400, Luis R. Rodriguez wrote: > > > If you find the patches that'd be great :). I'll see what I can do about > > fixing up extended MLME. I'll keep you posted. > > I now know where the wpa_supplicant part is and once I find the matching > patch for Prism54 driver, I'll send them both to you. > > > I have yet to review most of the wpa_supplicant code so I cannot say for > > sure yet what I think should go into the kernel. I e-mailed most lists > > mainly to get comments from others who have poked at wpa_supplicant > > and/or are looking into adding WPA client support into their drivers. > > I just wanted to make sure we were heading in the right direction since > > I only see 2 drivers that are currently using wpa_supplicant. > > You may have seen only two drivers, but actually I'm already aware of at > least seven drivers that work with wpa_supplicant.. All of these are not > yet available publicly, though. > > I believe that the current design for wpa_supplicant is quite alright > for most cases. I would like to give some more thought for the roaming > part (i.e., consider giving more control for the driver), but this > should be doable in a backward compatible way without breaking support > with existing code. -- Pedro Ramalhais From jgarzik@pobox.com Wed Jun 2 20:45:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 20:45: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.9) with SMTP id i533jhgi025220 for ; Wed, 2 Jun 2004 20:45:43 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1BVjAj-0000DF-TH; Thu, 03 Jun 2004 04:45:42 +0100 Message-ID: <40BE9ED8.9020505@pobox.com> Date: Wed, 02 Jun 2004 23:45:28 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Netdev CC: Linux Kernel , jkmaline@cc.hut.fi, James P Ketrenos Subject: wireless-2.6 queue opened Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5575 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: 2761 Lines: 62 It's high time that Linux get a serious effort going on a generic 802.11 stack, as it seems we are in danger of having every new wireless driver invent one if we do not. Given that there are at least 3 complete wireless stacks (or thereabouts) floating about for Linux, I picked one that I felt had the best chance of being _evolved_ into a nice, clean, generic wireless stack: HostAP. My general hope (plan?) is that generic wireless code can be arrived at without horribly intrusive changes that require a 2.7 kernel. wireless-2.6 is targetted for eventual merging, but it won't be submitted anytime soon. Now it's time for open source to kick into action :) wireless-2.6 queue is available in patch form or BitKeeper for review. Or, if you object to my selection of wireless code, now's the time to speak up. BTW to Intel Centrino folks -- I would like to merge the current (open source) Centrino driver into wireless-2.6 as well, to get it more exposure, and also to ensure that it uses whatever generic 802.11 code happens to appear... Oh, and please speak up on netdev@oss.sgi.com, or at least CC there. Patch: http://www.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.7-rc2-bk3-wireless1.patch.bz2 BitKeeper (all of these are equivalent): bk://kernel.bkbits.net/jgarzik/wireless-2.6 bk://gkernel.bkbits.net/wireless-2.6 http://gkernel.bkbits.net/wireless-2.6 (note: _not_ a Web URL) Finally, here is Jouni's patch submission message, elaborating on the driver-specific details: > Finally, here's the first attempt at submitting Host AP code for > wireless-2.6 tree. In addition, this could be considered for merging > into linus-2.5 tree, so review and comments are very much welcome. Host > AP code has lived in an external CVS repository for three years and is > widely used. > > The included patch has minimal changes to the current tree (against > 2.6.6, but should apply to different versions with some differences in > line numbers) for including a new directory drivers/net/wireless/hostap. > The contents of that new directory is a bit large for a patch file and > since all the files are new, I made it available as a compressed tarball > at http://hostap.epitest.fi/hostap-linux.tgz. This should be untarred in > the root of the kernel tree (i.e., the file paths in the tarball start > with drivers/net/wirelss/hostap/...). > > I removed most of the backwards (for Linux 2.4, pcmcia-cs modules, > different wireless extensions versions) compatibility code. In addition, > I replaced integrated implementations of ARC4, Michael MIC, and AES with > crypto API. AES-CCM mode is still implemented in hostap_crypt_ccmp.c, > but it could be moved at some point to crypto API as a new encryption > mode. From jm@jm.kir.nu Wed Jun 2 20:46:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 20:46:30 -0700 (PDT) Received: from jm.kir.nu (dsl017-049-110.sfo4.dsl.speakeasy.net [69.17.49.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i533kPgi025328 for ; Wed, 2 Jun 2004 20:46:25 -0700 Received: from jm by jm.kir.nu with local (Exim 4.34) id 1BVjA3-0002AP-Dk; Wed, 02 Jun 2004 20:44:59 -0700 Date: Wed, 2 Jun 2004 20:44:59 -0700 From: Jouni Malinen To: Pedro Ramalhais Cc: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support Message-ID: <20040603034458.GD7548@jm.kir.nu> Mail-Followup-To: Pedro Ramalhais , Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Jean Tourrilhes , Linux Kernel References: <20040602071449.GJ10723@ruslug.rutgers.edu> <20040602132313.GB7341@jm.kir.nu> <20040602155542.GC24822@ruslug.rutgers.edu> <20040603014000.GA7548@jm.kir.nu> <1086230284.7604.38.camel@rootix> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1086230284.7604.38.camel@rootix> User-Agent: Mutt/1.5.6i X-archive-position: 5576 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jkmaline@cc.hut.fi Precedence: bulk X-list: netdev Content-Length: 4459 Lines: 89 On Thu, Jun 03, 2004 at 03:38:05AM +0100, Pedro Ramalhais wrote: > As you may know (or not), the ipw2100 driver is somewhat based on hostap > code. We use some code from hostap in the ipw2100 driver, and use the > hostap driver externally as a way to provide WEP. > I'm currently working on turning hostap_crypt* into ieee80211_crypt* in > such a way that could be used in a generic way by all drivers that need > host based WEP (and TKIP/CCMP). I basically renamed the hostap_crypt* to > ieee80211_crypt* and search&replaced hostap with ieee80211. Also made > hostap_crypt.c into a module (instead of having to rely on hostap.o). I do not understand what kind of changes you think are required. Renaming the functions/structures is not really changing anything and hostap_crypt.o used to be a separate module (and it should still be possible to compile it as such by defining HOSTAP_CRYPT_MODULE when compiling the Host AP code). It sounds like your changes are just making it more difficult to maintain generic code because of making it require more work to merge changes back. With the changes to use crypto API, there's already couple of different versions of the crypto code for Host AP. I would rather not bring in more versions. The improvements should go to the wireless-2.6 tree. As far as I can tell, the version that I submitted couple of days ago for wireless-2.6 (and potentially linus-2.5) trees, should be usable as is from other drivers. Yes, hostap module will include some extra functionality that is not needed, but it does not make it any more difficult to use the encryption part which should be fully hardware independent. This can be easily (again) extracted, if it looks like this code will be used from multiple drivers. > I have WEP working and a Makefile that can be used in the kernel or > externally. I took a look at the TKIP and CCMP source files and it is > somewhat tied up to ioctls and headers (just took a quick look correct > me if i'm wrong) from hostap. This makes it somewhat difficult to turn > them into code that compiles without hostap code. Tied to ioctls?? There is no ioctl processing in the Host AP crypto code. The header files are mainly for defining the IEEE 802.11 header. In addition, Host AP code can already be used in the kernel and externally.. > Besides this, the ipw2100 code also has an attempt at a somewhat generic > ieee80211 interface for drivers. ieee80211_rx.c is mostly based on > hostap_hw.c code (which looks like is now in CVS as hostap_80211_rx.c ) > and there's also ieee80211_tx.c which i think was created from scratch > by James Ketrenos (ipw2100 main developer @intel). This sounds similar to what the current Host AP driver uses hostap_80211_{rx,tx}.c. > My question is: would it be interesting to try and merge code from > hostap, ipw2100 and possibly other drivers to try to create generic code > for 80211 and 80211_crypt? Yes and this is what has been discussed on netdev and (admittedly, slowly so far) started with wireless-2.6. > developers (hostap, prism54, atmel, etc...). I'm asking this because > AFAICS, the hostap driver always had an history of more focus on new > features, functionality, bug fixes, than "standard" APIs, etc... and i > completely understand that and thank god it has been like this because > the final result was a really nice driver. I believe that one needs to first experiment with the features/design before being able to design a standard API. There has already been quite many versions of Linux wireless extensions and I would rather first see what would be a common design that could work with most wireless cards and then design an API for this. For many functions, we are starting to have all the needed information to actually to this successfully. > Would you accept patches at least for now to make hostap_crypt* into > ieee80211_crypt*? Sure, if there is something that really improves the current situation in some way. I don't think that just renaming the functions would be very useful at that point. Of course it can be done, but I would prefer to see a bit more design on the other parts of the IEEE 802.11 support and its place in the Linux net stack. > PS: Comments, ideas, proposals, etc are welcome for discussion.(What is > the best way to discuss this matter? There's a large number of > developers involved. Maybe netdev?) netdev -- Jouni Malinen PGP id EFC895FA From jgarzik@pobox.com Wed Jun 2 21:06:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 21:06:53 -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.9) with SMTP id i5346ogi026326 for ; Wed, 2 Jun 2004 21:06:51 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1BVjVA-0000OZ-Pm; Thu, 03 Jun 2004 05:06:48 +0100 Message-ID: <40BEA3CB.60908@pobox.com> Date: Thu, 03 Jun 2004 00:06:35 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jouni Malinen CC: "Luis R. Rodriguez" , Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jean Tourrilhes , Linux Kernel Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support References: <20040602071449.GJ10723@ruslug.rutgers.edu> <20040602132313.GB7341@jm.kir.nu> In-Reply-To: <20040602132313.GB7341@jm.kir.nu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5577 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: 1307 Lines: 32 Jouni Malinen wrote: > The first thing I would like to see is an addition to Linux wireless > extensions for WPA/WPA2 so that we can get rid of the private ioctls in > the drivers. Even though these can often be similar, it would be nice to > just write one driver interface code in wpa_supplicant and have it > working with all Linu drivers.. I hope to find some time to write a > proposal for this. One of the things that is nice about wireless-2.6 is that is affords the opportunity to totally rethink the wireless extensions. Although a lot of people would howl, since HostAP is essentially new code from the mainline kernel perspective, a new userland API (and new or updated tools) could come along with it. I have mentioned in the past (no offense Jean!) that I do not like the overly-generic wireless handler structure. It is less type-safe than is generally preferred in Linux, IMO. A low-level wireless driver should not implement ioctls, it should implement callbacks in some sort of 'struct wireless_operations' as is done in other kernel subsystems. ioctl details should be hidden from low-level drivers as much as possible, through type-safe interfaces. Strive to make both the wireless driver API and the wireless userland API easy to change and evolve over time. Jeff From davem@redhat.com Wed Jun 2 21:12:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 21:12:15 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i534CCgi026826 for ; Wed, 2 Jun 2004 21:12:12 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i534C2i5019106; Thu, 3 Jun 2004 00:12:02 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i534C2002353; Thu, 3 Jun 2004 00:12:02 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i534BrVL027965; Thu, 3 Jun 2004 00:11:53 -0400 Date: Wed, 2 Jun 2004 21:10:38 -0700 From: "David S. Miller" To: Jeff Garzik Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, jkmaline@cc.hut.fi, james.p.ketrenos@intel.com Subject: Re: wireless-2.6 queue opened Message-Id: <20040602211038.287628ac.davem@redhat.com> In-Reply-To: <40BE9ED8.9020505@pobox.com> References: <40BE9ED8.9020505@pobox.com> X-Mailer: Sylpheed version 0.9.11 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5578 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: 485 Lines: 11 On Wed, 02 Jun 2004 23:45:28 -0400 Jeff Garzik wrote: > Given that there are at least 3 complete wireless stacks (or > thereabouts) floating about for Linux, I picked one that I felt had the > best chance of being _evolved_ into a nice, clean, generic wireless > stack: HostAP. Even though I authored one of the "other" stacks, I'm totally fine with this choice. Mainly because I simply lack the time or resources to continue working on the stack I started. From davem@redhat.com Wed Jun 2 21:38:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 21:38:06 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i534c2gi027678 for ; Wed, 2 Jun 2004 21:38:02 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i534bxi5025457; Thu, 3 Jun 2004 00:37:59 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i534bx006838; Thu, 3 Jun 2004 00:37:59 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i534boOB032603; Thu, 3 Jun 2004 00:37:50 -0400 Date: Wed, 2 Jun 2004 21:36:34 -0700 From: "David S. Miller" To: jkmaline@cc.hut.fi Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: hostap crypto bugs Message-Id: <20040602213634.11ec61bf.davem@redhat.com> X-Mailer: Sylpheed version 0.9.11 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5579 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: 314 Lines: 9 You cannot invoke virt_to_page() on addresses on the kernel stack, and that is what the various HostAP crypto modules are doing. This happens to work on some platforms, but it is going to explode on others. Allocate these little header scratch area blobs in the per-crypto-instance structs you kmalloc instead. From jm@jm.kir.nu Wed Jun 2 23:35:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 23:36:02 -0700 (PDT) Received: from jm.kir.nu (dsl017-049-110.sfo4.dsl.speakeasy.net [69.17.49.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i536Zwgi002991 for ; Wed, 2 Jun 2004 23:35:59 -0700 Received: from jm by jm.kir.nu with local (Exim 4.34) id 1BVlo9-000200-1j; Wed, 02 Jun 2004 23:34:33 -0700 Date: Wed, 2 Jun 2004 23:34:33 -0700 From: Jouni Malinen To: "David S. Miller" Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: [PATCH wireless-2.6] Re: hostap crypto bugs Message-ID: <20040603063432.GA7600@jm.kir.nu> References: <20040602213634.11ec61bf.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602213634.11ec61bf.davem@redhat.com> User-Agent: Mutt/1.5.6i X-archive-position: 5580 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jkmaline@cc.hut.fi Precedence: bulk X-list: netdev Content-Length: 4846 Lines: 151 On Wed, Jun 02, 2004 at 09:36:34PM -0700, David S. Miller wrote: > You cannot invoke virt_to_page() on addresses on the kernel stack, > and that is what the various HostAP crypto modules are doing. > > This happens to work on some platforms, but it is going to explode > on others. Thanks! I have not updated my non-x86 platforms to 2.6 kernels, so I had not yet had a change to explode anything with this.. > Allocate these little header scratch area blobs in the per-crypto-instance > structs you kmalloc instead. This patch (for wireless-2.6) should do this. I used separate buffers for RX and TX because they could be in theory called concurrently. Better to get this first working, but it might be worthwhile to consider the memory use at some point. This version uses 112 bytes of additional scratch buffers per key for CCMP. diff -u wireless-2.6/drivers/net/wireless/hostap/hostap_crypt_ccmp.c jm-wireless-2.6/drivers/net/wireless/hostap/hostap_crypt_ccmp.c --- wireless-2.6/drivers/net/wireless/hostap/hostap_crypt_ccmp.c 2004-06-02 23:16:06.430130552 -0700 +++ jm-wireless-2.6/drivers/net/wireless/hostap/hostap_crypt_ccmp.c 2004-06-02 22:51:28.000000000 -0700 @@ -59,6 +59,11 @@ int key_idx; struct crypto_tfm *tfm; + + /* scratch buffers for virt_to_page() (crypto API) */ + u8 tx_b0[AES_BLOCK_LEN], tx_b[AES_BLOCK_LEN], + tx_e[AES_BLOCK_LEN], tx_s0[AES_BLOCK_LEN]; + u8 rx_b0[AES_BLOCK_LEN], rx_b[AES_BLOCK_LEN], rx_a[AES_BLOCK_LEN]; }; @@ -133,13 +138,14 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm, struct hostap_ieee80211_hdr *hdr, - u8 *pn, size_t dlen, u8 *b0, u8 *aad, u8 *auth, + u8 *pn, size_t dlen, u8 *b0, u8 *auth, u8 *s0) { u8 *pos, qc = 0; size_t aad_len; u16 fc; int a4_included, qc_included; + u8 aad[2 * AES_BLOCK_LEN]; fc = le16_to_cpu(hdr->frame_control); a4_included = ((fc & (WLAN_FC_TODS | WLAN_FC_FROMDS)) == @@ -211,8 +217,10 @@ int data_len, i, blocks, last, len; u8 *pos, *mic; struct hostap_ieee80211_hdr *hdr; - u8 aad[2 * AES_BLOCK_LEN], b0[AES_BLOCK_LEN], b[AES_BLOCK_LEN], - e[AES_BLOCK_LEN], s0[AES_BLOCK_LEN]; + u8 *b0 = key->tx_b0; + u8 *b = key->tx_b; + u8 *e = key->tx_e; + u8 *s0 = key->tx_s0; if (skb_headroom(skb) < CCMP_HDR_LEN || skb_tailroom(skb) < CCMP_MIC_LEN || @@ -243,7 +251,7 @@ *pos++ = key->tx_pn[0]; hdr = (struct hostap_ieee80211_hdr *) skb->data; - ccmp_init_blocks(key->tfm, hdr, key->tx_pn, data_len, b0, aad, b, s0); + ccmp_init_blocks(key->tfm, hdr, key->tx_pn, data_len, b0, b, s0); blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; last = data_len % AES_BLOCK_LEN; @@ -273,8 +281,9 @@ struct hostap_ccmp_data *key = priv; u8 keyidx, *pos; struct hostap_ieee80211_hdr *hdr; - u8 aad[2 * AES_BLOCK_LEN], b0[AES_BLOCK_LEN], b[AES_BLOCK_LEN], - a[AES_BLOCK_LEN]; + u8 *b0 = key->rx_b0; + u8 *b = key->rx_b; + u8 *a = key->rx_a; u8 pn[6]; int i, blocks, last, len; size_t data_len = skb->len - hdr_len - CCMP_HDR_LEN - CCMP_MIC_LEN; @@ -331,7 +340,7 @@ return -4; } - ccmp_init_blocks(key->tfm, hdr, pn, data_len, b0, aad, a, b); + ccmp_init_blocks(key->tfm, hdr, pn, data_len, b0, a, b); xor_block(mic, b, CCMP_MIC_LEN); blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; diff -u wireless-2.6/drivers/net/wireless/hostap/hostap_crypt_tkip.c jm-wireless-2.6/drivers/net/wireless/hostap/hostap_crypt_tkip.c --- wireless-2.6/drivers/net/wireless/hostap/hostap_crypt_tkip.c 2004-06-02 23:16:06.441128880 -0700 +++ jm-wireless-2.6/drivers/net/wireless/hostap/hostap_crypt_tkip.c 2004-06-02 23:01:06.000000000 -0700 @@ -65,6 +65,9 @@ struct crypto_tfm *tfm_arc4; struct crypto_tfm *tfm_michael; + + /* scratch buffers for virt_to_page() (crypto API) */ + u8 rx_hdr[16], tx_hdr[16]; }; @@ -499,7 +502,6 @@ { struct hostap_tkip_data *tkey = priv; u8 *pos; - u8 hdr[16]; if (skb_tailroom(skb) < 8 || skb->len < hdr_len) { printk(KERN_DEBUG "Invalid packet for Michael MIC add " @@ -508,9 +510,9 @@ return -1; } - michael_mic_hdr(skb, hdr); + michael_mic_hdr(skb, tkey->tx_hdr); pos = skb_put(skb, 8); - if (michael_mic(tkey, &tkey->key[16], hdr, + if (michael_mic(tkey, &tkey->key[16], tkey->tx_hdr, skb->data + hdr_len, skb->len - 8 - hdr_len, pos)) return -1; @@ -539,14 +541,13 @@ int hdr_len, void *priv) { struct hostap_tkip_data *tkey = priv; - u8 hdr[16]; u8 mic[8]; if (!tkey->key_set) return -1; - michael_mic_hdr(skb, hdr); - if (michael_mic(tkey, &tkey->key[24], hdr, + michael_mic_hdr(skb, tkey->rx_hdr); + if (michael_mic(tkey, &tkey->key[24], tkey->rx_hdr, skb->data + hdr_len, skb->len - 8 - hdr_len, mic)) return -1; if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) { -- Jouni Malinen PGP id EFC895FA From jgarzik@pobox.com Wed Jun 2 23:50:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 23:50:13 -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.9) with SMTP id i536oAgi003601 for ; Wed, 2 Jun 2004 23:50:11 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1BVm3F-0002QU-9n; Thu, 03 Jun 2004 07:50:09 +0100 Message-ID: <40BECA14.8020800@pobox.com> Date: Thu, 03 Jun 2004 02:49:56 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jouni Malinen CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH wireless-2.6] Re: hostap crypto bugs References: <20040602213634.11ec61bf.davem@redhat.com> <20040603063432.GA7600@jm.kir.nu> In-Reply-To: <20040603063432.GA7600@jm.kir.nu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5581 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: 9 Lines: 2 applied From arthur@it.usyd.edu.au Wed Jun 2 23:52:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 23:52:18 -0700 (PDT) Received: from staff.cs.usyd.edu.au (staff.cs.usyd.edu.au [129.78.8.1]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i536qBgi003971 for ; Wed, 2 Jun 2004 23:52:12 -0700 Message-Id: <200406030652.i536qBgi003971@oss.sgi.com> Received: from staff.cs.usyd.edu.au. by staff.cs.usyd.edu.au.; Thu, 03 Jun 2004 16:52:03 +1000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Date: Thu, 03 Jun 2004 16:52:02 +1000 From: Arthur Scott To: netdev@oss.sgi.com Subject: Verify IQvlWvSs for REMOVETHISWORD netdev@oss.sgi.com X-Loop: arthur@it.usyd.edu.au X-archive-position: 5582 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: arthur@it.usyd.edu.au Precedence: bulk X-list: netdev Content-Length: 8857 Lines: 157 Hi! Your message has been received, but it hasn't been delivered to me yet. As I don't have any record of you sending me mail from this address before, I need to verify that you're not a spammer. Please reply and alter the Subject line to remove the word REMOVETHISWORD, and your previous message will be delivered, as will all your future messages. Thanks, and apologies for the inconvenience. Arthur Scott. Note: your original message is appended below. Please check it carefully. If it didn't originate from you, then a spammer is probably impersonating your address. In which case please ignore this message. ==== Original Message ==== Received: by staff.cs.usyd.edu.au with postie; Thu, 03 Jun 2004 16:51:54 +1000 Received: from 218.18.134.236 by staff.cs.usyd.edu.au.; Thu, 03 Jun 2004 16:51:40 +1000 X-Claimed-Received: from cs.su.oz.au From: netdev@oss.sgi.com To: arthur@cs.su.oz.au Subject: what do you think about it? Date: Thu, 3 Jun 2004 15:17:13 +0800 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0004_000046F7.00001905" X-Priority: 3 X-MSMail-Priority: Normal This is a multi-part message in MIME format. ------=_NextPart_000_0004_000046F7.00001905 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit here is the next one! ------=_NextPart_000_0004_000046F7.00001905 Content-Type: application/x-zip-compressed; name="bill.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bill.zip" UEsDBAoAAAAAACY6wzBiZMYWCWMAAAljAAAMAAAAYmlsbC5ydGYuc2NyTVqQAAMAAAAEAAAA //8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAuAAAAGsi X1YvQzEFL0MxBS9DMQWsXz8FI0MxBcdcOwU0QzEFL0MwBXBDMQWsS2wFIkMxBcdcOgUqQzEF l0U3BS5DMQVSaWNoL0MxBQAAAAAAAAAAQ29tcHJlc3NlZCBieSBQZXRpdGUgKGMpMTk5OSBJ YW4gTHVjay4AAFBFAABMAQMA7Kc7QAAAAAAAAAAA4AAPAQsBBgAAUAAAABwBAAAAAABCoAEA ABAAAABgAAAAAEAAABAAAAACAAAEAAAAAAAAAAQAAAAAAAAAALABAAAEAAAAAAAAAgAAAAAA EAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA/KEBAK8BAAAAkAEACAUAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAEA ABAAAABWAAAACAAAAAAAAAAAAAAAAAAAYAAA4C5wZXRpdGUAABAAAACQAQAIBQAAAF4AAAAA AAAAAAAAAAAAAEAAAEAAAAAAAAAAAKsDAAAAoAEAAAQAAAAEAAAAAAAAAAAAAAAAAABgAADi AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgCAACGAaK6i0QkBIPE Ko2QNAAAAIPECGoQi9hmBS0AUFJqAIsb/xNq//9TDEVSUk9SIQBDb3JydXB0IERhdGEhALgA oEEAaItwQABk/zUAAAAAZIklAAAAAGacYFBoAABAAIs8JIswZoHHgAeNdAYIiTiLXhBQVmoC aIAIAABXahNqBlZqBGiACAAAV//Tg+4IWfOlWWaDx2iBxsIAAADzpf/TWI2QuAEAAIsKD7rx H3MWiwQk/Yvwi/gDcgQDegjzpYPCDPzr4oPCEIta9IXbdNiLBCSLevgD+FKNNAHrF1hYWFp0 xOkc////AtJ1B4oWg+7/EtLDgfsAAAEAcw5oYMD//2hg/P//tgXrIoH7AAAEAHMOaICB//9o gPn//7YH6wxoAIP//2gA+///tghqADLSS6QzyYP7AH6k6Kr///9yF6QwX/9L6+1B6Jv///8T yeiU////cvLDM+3o6f///4PpA3MGiwQkQesji8EPts7odf///xPASXX2g/D/O0QkBIPVATtE JAiD1QCJBCToV////xPJ6FD///8TyXUI6Kb///+DwQIDzVYr2Y00OPOkXuuDLovAKRUAgKBk AAD8jwEAXDsBAAlOAAAAEAAA7wMAAD1qAQDgEwAAAGAAAEAYAACwdgEAvDUAAACAAACItAEA AAAAANEUAAAAAAAAAAAAAAAAAABiowEAiKIBAAAAAAAAAAAAAAAAAG2jAQCUogEAAAAAAAAA AAAAAAAAeqMBAKiiAQAAAAAAAAAAAAAAAACGowEAsKIBAAAAAAAAAAAAAAAAAJGjAQC4ogEA AAAAAAAAAAAAAAAAnqMBAMCiAQAAAAAAAAAAAAAAAAAAAAAAAAAAAMiiAQDWogEAAAAAAOKi AQDwogEAAKMBABKjAQAAAAAAJKMBAAAAAAALAACAAAAAAECjAQAAAAAAVKMBAAAAAAAAAE1l c3NhZ2VCb3hBAAAAd3NwcmludGZBAAAARXhpdFByb2Nlc3MAAABMb2FkTGlicmFyeUEAAAAA R2V0UHJvY0FkZHJlc3MAAAAAVmlydHVhbFByb3RlY3QAAAAASW50ZXJuZXRHZXRDb25uZWN0 ZWRTdGF0ZQAAAEdldE5ldHdvcmtQYXJhbXMAAAAAUmVnT3BlbktleUEAVVNFUjMyLmRsbABL RVJORUwzMi5kbGwAV0lOSU5FVC5kbGwAV1MyXzMyLmRsbABpcGhscGFwaS5kbGwAQURWQVBJ MzIuZGxsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVAIPrjUAIVVWKAH33zS/P MskPAHjI9oHdoJjwAKvEMWSx42D2AGgcyJDoa+7jG2uK1sjYDTIA3V+K09WSlJah4bgtkLEZ R6Low0+HAMHg4OB/MP6dLLDkyM+WWaGoL1esAKOqqdWdqROsFiZr1cpfFl3pv7rGAKxY6Z8Z jpcYAJDJy7d69HwIKfuH6caIgAt6u3tVPTsok7/0NHJZcQh3hdEW7ExqqjyNQcLjjXjLg9z+ sv8VcFcI6q1Qx0B9jcH2o/+Qsu4iOOgo9MlkAJdutn/Vbme/BmDcjpQQuqUAEHRKaimr4yoD Qx1WMkfnaQYfHG0f5lL9DQl8C7mEZwLEhfUcVAcAP8V2B2Z0vgH1F/+QzAcgQTSKeza0HpRt xmoQGFoUNZb1LQW4RZLwikbeWtALsQyco8oXYVGrIyiqZN1LHO1d7FKwAMVQRlr4wna5yW0k Iy8VS1dgJtzrbCIdf/+m5kVEYtKGBwx8LNTNSTRu8ItyJk+GGkydg5HUgD/ulDrhp25sIEnc /2+xU/+pVBJotlbJzVb/WWS2/3IKV3eGg8leN2KKOdlGRC06InS5KeSmnoAQR7hGfBa+hUVQ WKOi6hSNvpQFlcvtqv+YRaCmpmgogiOeVQoUuQ3QDRQKlm86jaCVslpessugpLsZ0pSmvP02 85lXz2AjQ1x48pJYsKTaCkzQI2FV/YaiaveK672nLQDN8FiHhpGUwxV6QrJAQHTSD3b8aqC6 i4akK3oaLJIC9VJQ94cOBWDlDOKlbSZYYt4rCxSV1JkdryiaWRdSjfEZRP3hQEQ5Ls4KKL7+ bLJ3DMHTNL1G91vkUXdQftSdoo3bq5+urfSR43bhxCMBWBRjO56N7Zc+W3bGnlVq6J2asa7D UJGn8tQGJcPw6OcdHbGQqmNYHC+vec+XH+gIzIT2S8TJiqv/GV/knxP0uy4/xikurc9yv2EH Ks1bpg82iOSn8KpNNV1bArNgJJwsnYALgFRF0pdJ9n+80gqCIP0OmlE5fYOmh2DhYu3TL9gI 2qoirHWv9iS0O9GIYXeXKICl99qazK9OFL/vwUoLA4hECbdBuJOPPv2wYrhQvSRzzCx3xTjr 6KtGWvaodMw4/bma76ZoDoT4hl2aiwns9KGrt9o1D499MOw5Yrg+fJAFyPHzh+PIohaZ4a3V ESS+/x2sFrFEXrE0w9iFJ63PqBWki82xxJxGKd27cjgBx1W4uDLgsXsg+Uqpk1evAk3pZGeZ ljShofB66+jhxFEKf4atdYUNg2u2WPA7fHezUDHlcDY5e15HaKmf0n1CqqG2VVLRRXEo3N2n UPnLwfwVy6CqFMBKaWfgcHsxY2Djqhkow83GsCqVQ2srXX7wssly3FAUkPZY5zakqqxX985S w+mK3luKA+VUpNy8ncgXMwVSWtXYRVxZW/cU8CgnvtPlZc02XYaXhLd6rUar54iF9ltbVmpD dQAUS/qljiCQnx9qZjEu3rIOaHhFwzQbLouzUN74T5VzEMg7Biv/fT/jv51fnOkv6JCXLOfh oDgjRfbUuT9ICceUswim8H56TVxmI27/ZqEhoHI9bsNNE3XJyb8fruNRMwySUHyYoR3Zv4R/ nGjDirH0JFREq94MXT61V2An716i0aJetUg30Ur8jjY2qTlQszfISFEncdN8/lW+8JGi8lHy aEYYR1LKmkZrbtGc86KIWXb4bLOBsNcmQDeQ9CAA/iF/96MFa817tBq4asVAc+GfaAipdI1r xcRY2lxTjK4tjqHklL0GksVzmMz6TTv3WthCHs0IyfMT9t35xDeHVaE9DR7vaUdm1/GQRR+W KNYA1/3oKo7KySgtzAdYCAGBQRD1zz1IVGnhzN8HceAPygko7gbC0oHFhg1GgFm1YL0PK2QX RYCPFY8Gou5TQtNErygQdINjc4kEA3YBEiNSumYLY7nxzc2vcS5aaoqRFTBDaZZUhLj9Ovzn vzNf0ZSS8CAxHePJSEIoGTJTSRxVKyj1ZHoKktYDAByLneizlzPRTf5OgWXEqHdiyEg7Nkod UBeInYfIMs6ZkwyV+3EjBcqLJy35q3MOTSllMDNARK//a6FeSX9haywFqVmPBg9454S7U4qh d02tswVOhJTdKh3rLCCVoZFirMm36m2g1EHzVokS9NBpqYyHOf5lR+W1EVRqF30RGqdjxkzg OZaEu4/Td4KcqQcULjZm94BMT5sW1whD6F1sqhBasgiHjf+Jb2Xtqai59hTlbvdXcUnJ3piU kP8qbIZ2/IS0Av25ymKmI3k6PKkpMGRehCnpJ3dkdTe6l6yupRA8sxkWCSm+8xeyP31KqisR UpqpcnBHypbvRWNAxYxCsNiQi8VoxYu3XStxo2q4CK39J8ksTFW/qPqm7IK/Be8VrjUCcsDE Qyl/vmxEnVQMmulQSAolYHeRcv7CGAt5AvrfJXUEvQgOKfuDeYQK9oQYGvxhmrPoJhKZECvD iyDfeaMaj108lICPCynBBifAM88CU8y0Yfde5B+4CPlP11m26lchekOJQ7oNqqrvAE6nw6nk 2NjAey78UqsJ+O6v3W9tfswv8UqIaj/8+u5lwmtZfrdcbpKlK3qEt4t2DrKhxEGsrqz6naiK wGmxQ8DihByg28sL6hUuFkf9VMzlBvSemJxixE8FJg2I7nR2KooA+HsV9TQW9zMFH/TkOG71 jIroYnUHAGqw4aHEV4zamtVJ2yTTyJbhBS7Gcf8XqL9X5JDGuTz1oJBSjjov2iQYRS7kp8yI nZfg3YKOQAc57ccdJ1QbjJBZCIie9UST8iGYdtkAhRTNA8YZGAjzLkT4IyL9IBHyLQiHWoSE Qlch8WwQ7nGI63ZE0EsixVh3pKY2iUasq8K6Ssar2pPOM314OvtdOpjpRQdJ6y8RPFWighCZ 3SkDvDgt3oWMrtCEyMu/KXSIyLuHMH0K+gMG06gV7zV+Us8GmDr9Vl86z0XLxBBmx8eaVSMS scEkdwRwBHMAjIII/mPazIDNhTG5BHdP1U8BUgBdDdU89ZIgRtI1X7dYKVYar3uqd+sVB7Sy SgDAca1xpA+d0e/6kV4sXeUgziejBCECZ5zhHmDAiVIhKGEgRo5vrPWB48Lg6AzsAL9C/k0s zhYX7SAFIco3m7z2Ip4BpK5kGOGYB2KrGMtAzbbfQ4AvMi7v0q7VxkU/u0WbojDQvtdKqlmJ CmCQrBSkDCXdQqYtGKrff8UYGFIAZnNhN0Xq0pIE+FByzY5HjkkXsrMl8EBo5kwoggOW/cDR C6TLvM+212tcjCovdjYzuqb3C/4aQriteXGN4fcY1/LKM6vemccFyLVppC3QgXYb/KuQkasL AkcQXlJBel4ScNNAG4IBRUM4AQl2C437ycDGYIovdlHppD30NpIZ12dkWNcjaA7wYCX+zHEQ 0K3UlzM+JbH/st8g87bFyCl4F7RCgOnE/G0AV1w6gJXCv15cNj6tpVr5kQUcb7GwlXdVLwsa PMzj/r5tDpjZBbitiN/UaLUvVS0D/l3+QWM7x0wrMNRPiwsOg5t9RSpzarMaQ79mSjCdUOau BSUsRbIhoCB17cGyGMXJrCFxMkpEBsw4cc505YemZ9WJUe0cMmPvTV7Zs/WsB3e9QKv83m+2 V6JXOE7ytGI654VX+94wHbHcPtcY98+vDK5MKwnv5HKJM0SRADji5P+bb7PTNZauQUl+Vd/J CMu6mnQ+QUeCqit3z9hkhL51PGkM2JMUenRSVPhc85UZexN64P8r3GKmHRTVWRTJk9h7ew0K SXzp5LvHuPW1RRDNBOC6autfe1qIGbnrbffEU8lTtRek1h2NASLbThmZRcVFLZ+pGQSHXe0u 38m/jFFTvrdLtoTXLSXeN15wHoE0gUr+OaBMt/6MVp3ixha+hZy8zVrlYiG+uWcf1RQiTwLQ CyBXtoYVsMiCOzSUeUetUdwhCVGfbNUeoDIFAdPB5qR6iEZ1LHyehyEL1eAOA2Jj9C+SRJAG OsKSr1WorJa01ajFExAiOCMoRAtCClrZtX0KShDSEsAVt38aH4Z4/2lEDuyfQvNAwUkNpyD7 oYyrzRGz90gCYCzpyIqMNaDAiKQvWGfjeQ24X83pRfuispcsu/J5kIIhfBAGDco8bfHkFjq2 xDSJ+QeeFWlpFVSbnSveB31Hwilh+kJQom6VGJSnCf4RqhdDoLusZByB8QniUoTuh4gieyFC s/6XJfnduh6Z3Mgh+tYzdJCIH3X4q4fo4fqMJConf1JDtRg8SYLI5TlyqkKPFZCh6sKSFMtI udF3GHzWUYnmWgqVCXHN00T7PiqVoapUa7x/pYHZiigXdnMREsGJUyMpBn1n9VzYXxKlzMkN e30KXiis16JtAcT2PE6l5g0Nan0zPxxFqU0ZUoOZakOO0qqvwBvIESsFsvb4YLVEGLKCiK53 jKCqnJi914pzMK8eQmlRGCJ3ahWmTyJc [TRUNCATED] From jgarzik@pobox.com Wed Jun 2 23:54:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 02 Jun 2004 23:54:04 -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.9) with SMTP id i536s0gi004360 for ; Wed, 2 Jun 2004 23:54:01 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1BVm6y-0002Sj-5D for netdev@oss.sgi.com; Thu, 03 Jun 2004 07:54:00 +0100 Message-ID: <40BECAFC.7040405@pobox.com> Date: Thu, 03 Jun 2004 02:53:48 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Netdev Subject: Additional 802.11 net stack code posted Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5583 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: 469 Lines: 12 One of things that a proper "802.11 stack" should be is tie closely into the core net stack, so that translation to/from 802.3 isn't going on all the time. One wants to create, receive, and "understand" native 802.11 frames, and provide a sane management infrastructure. To that end, I ask that wireless hackers please study stub 802.11 code that DaveM wrote, posted at http://www.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/davem-p80211.tar.bz2 From rl@hellgate.ch Thu Jun 3 03:35:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 03:35:38 -0700 (PDT) Received: from mail2.bluewin.ch (mail2.bluewin.ch [195.186.4.73]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i53AZYgi016589 for ; Thu, 3 Jun 2004 03:35:35 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail2.bluewin.ch (Bluewin AG 7.0.028) id 40A468960022E376; Wed, 2 Jun 2004 11:58:31 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id 1D7F98CA75E; Wed, 2 Jun 2004 13:58:32 +0200 (CEST) Date: Wed, 2 Jun 2004 13:58:32 +0200 From: Roger Luethi To: Jeff Garzik , Andrew Morton Cc: netdev@oss.sgi.com Subject: [4/9][PATCH 2.6] Nuke default_port, references to if_port, medialock Message-ID: <20040602115832.GA17509@k3.hellgate.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602115703.GA16079@k3.hellgate.ch> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5584 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 1507 Lines: 52 As is, code doesn't do anything useful. Signed-off-by: Roger Luethi --- orig/drivers/net/via-rhine.c +++ mod/drivers/net/via-rhine.c @@ -522,7 +522,6 @@ u16 chip_cmd; /* Current setting for ChipCmd */ /* These values are keep track of the transceiver/media in use. */ - unsigned int default_port:4; /* Last dev->if_port value. */ u8 tx_thresh, rx_thresh; /* MII transceiver section. */ @@ -810,7 +809,6 @@ if (option > 0) { if (option & 0x220) rp->mii_if.full_duplex = 1; - rp->default_port = option & 15; } if (card_idx < MAX_UNITS && full_duplex[card_idx] > 0) rp->mii_if.full_duplex = 1; @@ -859,10 +857,7 @@ if (option > 0) { if (option & 0x220) rp->mii_if.full_duplex = 1; - rp->default_port = option & 0x3ff; if (option & 0x330) { - /* FIXME: shouldn't someone check this variable? */ - /* rp->medialock = 1; */ printk(KERN_INFO " Forcing %dMbs %s-duplex " "operation.\n", (option & 0x300 ? 100 : 10), @@ -1061,9 +1056,6 @@ rp->rx_thresh = 0x60; /* Written in rhine_set_rx_mod/drivers/nete(). */ rp->mii_if.full_duplex = 0; - if (dev->if_port == 0) - dev->if_port = rp->default_port; - writel(rp->rx_ring_dma, ioaddr + RxRingPtr); writel(rp->tx_ring_dma, ioaddr + TxRingPtr); @@ -1254,8 +1246,6 @@ dev->name, readw(ioaddr + IntrStatus), mdio_read(dev, rp->phys[0], MII_BMSR)); - dev->if_port = 0; - /* protect against concurrent rx interrupts */ disable_irq(rp->pdev->irq); From kakadu_croc@yahoo.com Thu Jun 3 04:05:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 04:05:17 -0700 (PDT) Received: from web40904.mail.yahoo.com (web40904.mail.yahoo.com [66.218.78.201]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i53B5Bgi017840 for ; Thu, 3 Jun 2004 04:05:11 -0700 Message-ID: <20040603110506.3996.qmail@web40904.mail.yahoo.com> Received: from [81.154.222.203] by web40904.mail.yahoo.com via HTTP; Thu, 03 Jun 2004 04:05:06 PDT Date: Thu, 3 Jun 2004 04:05:06 -0700 (PDT) From: Bradley Chapman Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support To: Jouni Malinen Cc: Netdev , Jean Tourrilhes , Jeff Garzik , Linux Kernel , hostap@shmoo.com, prism54-devel@prism54.org In-Reply-To: <20040603034458.GD7548@jm.kir.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 5585 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kakadu_croc@yahoo.com Precedence: bulk X-list: netdev Content-Length: 732 Lines: 26 To all, I'm sorry to break into this thread, but I was just curious as to what will eventually happen to wpa_supplicant. Based upon Mr. Malinen's words, as well as what a few others in this thread have been saying, will WPA and 802.1x eventually become generalized driver frameworks in the kernel (like MII), using the current Crypto API and crypto drivers? I'm just asking from an enduser perspective here, because eventually I will be purchasing an 802.11g Prism54 device and would like to have an idea of the relative ease of configuring 802.1x and WPA in the future. Thanks, Brad ===== __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ From rl@hellgate.ch Thu Jun 3 07:56:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 07:56:26 -0700 (PDT) Received: from mail5.bluewin.ch (mail5.bluewin.ch [195.186.1.207]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i53EuNgi026753 for ; Thu, 3 Jun 2004 07:56:24 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail5.bluewin.ch (Bluewin AG 7.0.028) id 40A46B21002686CB; Wed, 2 Jun 2004 19:53:15 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id 5A5958DFAE9; Wed, 2 Jun 2004 21:53:16 +0200 (CEST) Date: Wed, 2 Jun 2004 21:53:16 +0200 From: Roger Luethi To: Jeff Garzik Cc: Andrew Morton , netdev@oss.sgi.com Subject: Re: [0/9][2.6] via-rhine patches Message-ID: <20040602195316.GA31791@k3.hellgate.ch> References: <20040602115703.GA16079@k3.hellgate.ch> <40BE2A90.7020508@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40BE2A90.7020508@pobox.com> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5586 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 619 Lines: 16 On Wed, 02 Jun 2004 15:29:20 -0400, Jeff Garzik wrote: > Question -- are any of these needed for the 2.6.7 Release Candidate? No. Any significant change in driver behavior would be a bug. Patches submitted so far are clean-up in preparation for functional changes to come. > I prefer to defer these to post-2.6.7 as cleanup patches, since they are > not bug fixes. ACK. Please note, though, that I have another set of patches coming up which will be quite a bit more intrusive and will need review and wider testing. I plan to submit in time for 2.6.8-pre, even though some of it may not make it into 2.6.8. Roger From margitsw@t-online.de Thu Jun 3 08:32:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 08:32:11 -0700 (PDT) Received: from mailout03.sul.t-online.com (mailout03.sul.t-online.com [194.25.134.81]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i53FW4gi031141 for ; Thu, 3 Jun 2004 08:32:07 -0700 Received: from fwd06.aul.t-online.de by mailout03.sul.t-online.com with smtp id 1BVuBG-0007Ze-00; Thu, 03 Jun 2004 17:30:58 +0200 Received: from margit.t-online.de (GuZH52Zb8ebnS6Uzf9KgukCl3EHEcTsVFq1Z+VhdBNM9YgYR3cHZ67@[80.128.220.230]) by fwd06.sul.t-online.com with esmtp id 1BVuAw-0LNgmW0; Thu, 3 Jun 2004 17:30:38 +0200 Message-Id: <5.1.0.14.2.20040603172343.00acf4a8@pop.t-online.de> X-Sender: margitsw@pop.t-online.de X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 03 Jun 2004 17:31:43 +0200 To: Jeff Garzik From: margitsw@t-online.de (Margit Schubert-While) Subject: Re: [PATCH 6/17 linux-2.6.7-rc2] prism54: Kernel compatibility Cc: netdev@oss.sgi.com In-Reply-To: <40BE386A.1080201@pobox.com> References: <5.1.0.14.2.20040602221238.00adfbf8@pop.t-online.de> <200405310213.53280.margitsw@t-online.de> <200405310213.53280.margitsw@t-online.de> <5.1.0.14.2.20040602221238.00adfbf8@pop.t-online.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Seen: false X-ID: GuZH52Zb8ebnS6Uzf9KgukCl3EHEcTsVFq1Z+VhdBNM9YgYR3cHZ67 X-archive-position: 5587 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 1585 Lines: 50 At 16:28 02.06.2004 -0400, you wrote: >Margit Schubert-While wrote: >>At 16:03 02.06.2004 -0400, you wrote: >> >>>Margit Schubert-While wrote: >>> >>>>2004-03-20 Margit Schubert-While >>>>* isl_38xx.[ch], isl_ioctl.c, islpci_dev.[ch], islpci_eth.c >>>> islpci_hotplug.c, islpci_mgt.[ch], oid_mgt.c, prismcompat.h: >>>> Adopt new prism54 kernel compatibility. >>>> Remove remaining kernel version ifdefs. >>> >>> >>> >>>>@@ -325,11 +320,7 @@ >>>> printk(KERN_DEBUG "%s: uploading firmware...\n", >>>> priv->ndev->name); >>>> >>>> rc = isl38xx_upload_firmware(priv->firmware, >>>>-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,75)) >>>>- &priv->pdev->dev, >>>>-#else >>>>- pci_name(priv->pdev), >>>>-#endif >>> >>> >>>Rejected, both 2.4 and 2.6 should use pci_name() directly in the code >>> >>>Please resend patches 6 through 17, after fixing patches 6, 12, and 14. >>> >>> Jeff >>Absolutely not ! >>Parameter for 2.4 = char *, param for for 2.6 = struct dev * >>LOL >>Margit > >[jgarzik@sata repo]$ grep -w pci_name linux-2.[46]/include/linux/pci.h >linux-2.4/include/linux/pci.h:static inline char *pci_name(struct pci_dev >*pdev) >linux-2.6/include/linux/pci.h:static inline char *pci_name(struct pci_dev >*pdev) I was not talking about pci_name, I was talking about the 3rd param to request_firmware which is char * in 2.4, struct dev * in 2.6. Patch 16 cleans this area up. If it makes it easier, I can put together patches 5 and 16. Your call. Errm, what's wrong with patches 12 and 14 ? From jt@bougret.hpl.hp.com Thu Jun 3 09:52:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 09:52:44 -0700 (PDT) Received: from palrel12.hp.com (palrel12.hp.com [156.153.255.237]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i53Gqfgi001065 for ; Thu, 3 Jun 2004 09:52:41 -0700 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel12.hp.com (Postfix) with ESMTP id 60F794103C0; Thu, 3 Jun 2004 09:52:41 -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_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id JAA07261; Thu, 3 Jun 2004 09:53:33 -0700 (PDT) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1BVvSD-0002Ot-00; Thu, 03 Jun 2004 09:52:33 -0700 Date: Thu, 3 Jun 2004 09:52:33 -0700 To: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Linux Kernel Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support Message-ID: <20040603165233.GC8770@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20040602071449.GJ10723@ruslug.rutgers.edu> <20040602132313.GB7341@jm.kir.nu> <20040602155542.GC24822@ruslug.rutgers.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602155542.GC24822@ruslug.rutgers.edu> 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: 5588 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 Content-Length: 1421 Lines: 32 On Wed, Jun 02, 2004 at 11:55:42AM -0400, Luis R. Rodriguez wrote: > On Wed, Jun 02, 2004 at 06:23:14AM -0700, Jouni Malinen wrote: > > > > The first thing I would like to see is an addition to Linux wireless > > extensions for WPA/WPA2 so that we can get rid of the private ioctls in > > the drivers. Even though these can often be similar, it would be nice to > > just write one driver interface code in wpa_supplicant and have it > > working with all Linu drivers.. I hope to find some time to write a > > proposal for this. > > I agree :). Jean? *poke* > > Luis The initial plan was for me to get more familiar with WPA, but this keep slipping (partly due to family matters). HP did follow my suggestions and use IPsec internally, which also explain why I'm in no hurry. There was some stuff I wanted to "improve" in the API design, but I guess that if I can't deliver a patch, I'd better shut up and try to avoid being a bottleneck. At this point, I think that Jouni is our best expert on the subject, and the fact that many driver has reused his API means that his API is sensible and flexible enough. So, the plan would be to take Jouni's API as is (or with minor modifications) and stuff that in wireless.h. I don't believe that the tools themselves need to be modified, because wpa_supplicant is the sole user of those ioctls. If you are all happy with that, then I'll just do it. Have fun... Jean From jt@bougret.hpl.hp.com Thu Jun 3 10:07:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 10:07:48 -0700 (PDT) Received: from palrel12.hp.com (palrel12.hp.com [156.153.255.237]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i53H7kgi001730 for ; Thu, 3 Jun 2004 10:07:46 -0700 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel12.hp.com (Postfix) with ESMTP id 45D7541442C; Thu, 3 Jun 2004 10:07:46 -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_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id KAA07841; Thu, 3 Jun 2004 10:08:45 -0700 (PDT) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1BVvgv-0002Vd-00; Thu, 03 Jun 2004 10:07:45 -0700 Date: Thu, 3 Jun 2004 10:07:45 -0700 To: Jeff Garzik Cc: Jouni Malinen , "Luis R. Rodriguez" , Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Linux Kernel Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support Message-ID: <20040603170745.GD8770@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20040602071449.GJ10723@ruslug.rutgers.edu> <20040602132313.GB7341@jm.kir.nu> <40BEA3CB.60908@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40BEA3CB.60908@pobox.com> 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: 5589 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 Content-Length: 2107 Lines: 50 On Thu, Jun 03, 2004 at 12:06:35AM -0400, Jeff Garzik wrote: > > One of the things that is nice about wireless-2.6 is that is affords the > opportunity to totally rethink the wireless extensions. > > Although a lot of people would howl, since HostAP is essentially new > code from the mainline kernel perspective, a new userland API (and new > or updated tools) could come along with it. > > I have mentioned in the past (no offense Jean!) that I do not like the > overly-generic wireless handler structure. It is less type-safe than is > generally preferred in Linux, IMO. > > A low-level wireless driver should not implement ioctls, it should > implement callbacks in some sort of 'struct wireless_operations' as is > done in other kernel subsystems. > > ioctl details should be hidden from low-level drivers as much as > possible, through type-safe interfaces. Strive to make both the > wireless driver API and the wireless userland API easy to change and > evolve over time. > > Jeff Jeff, I'm amazed that you are so obsessed with this. Yes, Wireless Extension could be improved in millions ways, but at least it's working, whereas there are so many other areas where we have nothing at all. If you talk with most people developping wireless drivers, this doesn't even make their list. But I guess every one of us need to have his hot topic ;-) I believe most people are concerned about : o WPA support (and security API in general) o SNAP encapsulation/decapsualtion in kernel o handling 802.11 frames natively in kernel o handling 802.11 management in kernel (association/deassociation, ...) Personally, those are my priorities : o getting more wireless drivers in the kernel o RtNetlink API for Wireless Extensions I also explained you how you could wrap around Wireless Extension trivially to introduce a new driver API without breaking the many user space tools, so that you can implement your proposal with maximum backward compatibility. Just because there is one aspect of the API you don't like, we don't need to throw away the good parts. Have fun... Jean From rl@hellgate.ch Thu Jun 3 13:09:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 13:09:47 -0700 (PDT) Received: from mail6.bluewin.ch (mail6.bluewin.ch [195.186.4.229]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i53K9fgi013593 for ; Thu, 3 Jun 2004 13:09:42 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail6.bluewin.ch (Bluewin AG 7.0.028) id 40A46BD30023F73F; Wed, 2 Jun 2004 20:30:26 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id 5575E8DFAE9; Wed, 2 Jun 2004 22:30:26 +0200 (CEST) Date: Wed, 2 Jun 2004 22:30:26 +0200 From: Roger Luethi To: Jeff Garzik Cc: Andrew Morton , netdev@oss.sgi.com Subject: Re: [9/9][PATCH 2.6] Restructure reset code Message-ID: <20040602203026.GB31791@k3.hellgate.ch> References: <20040602115920.GA17634@k3.hellgate.ch> <40BE2DE0.4040102@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40BE2DE0.4040102@pobox.com> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5590 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 1915 Lines: 47 On Wed, 02 Jun 2004 15:43:28 -0400, Jeff Garzik wrote: > Roger Luethi wrote: > >Restructure code to make it easier to maintain. > > > >rhine_hw_init: resets chip, reloads eeprom > >rhine_chip_reset: chip reset + what used to be wait_for_reset > >rhine_reload_eeprom: reload eeprom, re-enable MMIO, disable > >EEPROM-controlled > > WOL > > > >Note: Chip reset clears a bunch of registers that should be reloaded > >from EEPROM (which turns off MMIO). Deal with that later. > > > Rejected, two reasons: > > 1) dev->dev_addr[] should be loaded from eeprom only once, at probe > time, not once for each hw init. [this value should be written to the > chip's MAC address registers upon each dev->open() call] We are in violent agreement, you are describing what the driver does with and without patch 9 (unless I seriously botched the splitting). Incidentally, rhine_hw_init gets called only once, at probe time (further calls are to rhine_chip_reset). The remaining problem with the reset stuff is this: Years ago, soft resets were added to via-rhine in the vain hope it would fix something, but soft resets overwrite some registers that need to be reloaded from somewhere (it's more than just the MAC address). The proper fix for this is to remove unnecessary soft resets (i.e. all but the one at probe time) and/or restore the registers affected by a soft reset. But that would go beyond a simple clean-up patch. > 2) Your "Note:" worries me... why not deal with this now? :) Mainly because I don't have all the information needed to positively determine the proper solution -- not yet. "Dealing with it" will likely mean removing two soft reset calls and documenting registers that are clobbered by soft reset (just in case), but that doesn't fit into a clean-up patch anyway. In summary, patch 9 is simply what all conceivable solutions have in common -- code clean-up. Thanks for the review. Roger From scott.feldman@intel.com Thu Jun 3 18:32:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 18:32:34 -0700 (PDT) Received: from hermes.jf.intel.com (fmr05.intel.com [134.134.136.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i541WVgi026976 for ; Thu, 3 Jun 2004 18:32:31 -0700 Received: from talaria.jf.intel.com (talaria.jf.intel.com [10.7.209.7]) by hermes.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.15 2004/01/30 18:16:28 root Exp $) with ESMTP id i541XjM9004335; Fri, 4 Jun 2004 01:33:45 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by talaria.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.10 2004/03/01 19:21:36 root Exp $) with SMTP id i541Sbe5030438; Fri, 4 Jun 2004 01:28:45 GMT Received: from [134.134.177.235] ([134.134.177.235]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004060318322212780 ; Thu, 03 Jun 2004 18:32:22 -0700 Date: Thu, 3 Jun 2004 18:18:35 -0700 (PDT) From: Scott Feldman To: jgarzik@pobox.com cc: netdev@oss.sgi.com, Subject: [PATCH 2.4] e1000: fix napi crash on ifdown during traffic Message-ID: ReplyTo: "Scott Feldman" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 5591 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 Content-Length: 860 Lines: 25 Signed off by: Jesse Brandeburg diff -Naurp linux-2.4/drivers/net/e1000/e1000_main.c linux-2.4/drivers/net/e1000.mod/e1000_main.c --- linux-2.4/drivers/net/e1000/e1000_main.c 2004-06-03 18:00:32.000000000 -0700 +++ linux-2.4/drivers/net/e1000.mod/e1000_main.c 2004-06-03 18:01:11.000000000 -0700 @@ -52,7 +52,7 @@ char e1000_driver_name[] = "e1000"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; -char e1000_driver_version[] = "5.2.52-k1"; +char e1000_driver_version[] = "5.2.52-k3"; char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -2143,6 +2143,7 @@ e1000_clean(struct net_device *netdev, i if(work_done < work_to_do || !netif_running(netdev)) { netif_rx_complete(netdev); e1000_irq_enable(adapter); + return 0; } return (work_done >= work_to_do); From jesse.brandeburg@intel.com Thu Jun 3 18:42:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 18:43:08 -0700 (PDT) Received: from fmsfmr004.fm.intel.com (fmr11.intel.com [192.55.52.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i541gugi027421 for ; Thu, 3 Jun 2004 18:42:57 -0700 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by fmsfmr004.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.15 2004/01/30 18:16:28 root Exp $) with ESMTP id i541hinD014545; Fri, 4 Jun 2004 01:43:44 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by talaria.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.10 2004/03/01 19:21:36 root Exp $) with SMTP id i541hbho002321; Fri, 4 Jun 2004 01:43:46 GMT Received: from [134.134.177.235] ([134.134.177.235]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004060318424924245 ; Thu, 03 Jun 2004 18:42:49 -0700 Date: Thu, 3 Jun 2004 18:29:04 -0700 (PDT) From: Jesse Brandeburg To: jgarzik@pobox.com cc: netdev@oss.sgi.com, Subject: [PATCH 2.5] e1000: fix napi crash on ifdown during traffic In-Reply-To: Message-ID: ReplyTo: "Jesse Brandeburg" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 5592 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jesse.brandeburg@intel.com Precedence: bulk X-list: netdev Content-Length: 859 Lines: 24 Signed off by: Jesse Brandeburg diff -Naurp linux-2.5/drivers/net/e1000/e1000_main.c linux-2.5/drivers/net/e1000.mod/e1000_main.c --- linux-2.5/drivers/net/e1000/e1000_main.c 2004-06-03 17:57:55.000000000 -0700 +++ linux-2.5/drivers/net/e1000.mod/e1000_main.c 2004-06-03 17:59:04.000000000 -0700 @@ -52,7 +52,7 @@ char e1000_driver_name[] = "e1000"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; -char e1000_driver_version[] = "5.2.52-k2"; +char e1000_driver_version[] = "5.2.52-k4"; char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -2143,6 +2143,7 @@ e1000_clean(struct net_device *netdev, i if(work_done < work_to_do || !netif_running(netdev)) { netif_rx_complete(netdev); e1000_irq_enable(adapter); + return 0; } return (work_done >= work_to_do); From jm@jm.kir.nu Thu Jun 3 19:34:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 19:34:41 -0700 (PDT) Received: from jm.kir.nu (dsl017-049-110.sfo4.dsl.speakeasy.net [69.17.49.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i542Yagi002575 for ; Thu, 3 Jun 2004 19:34:36 -0700 Received: from jm by jm.kir.nu with local (Exim 4.34) id 1BW4Vz-0001zQ-G0; Thu, 03 Jun 2004 19:33:03 -0700 Date: Thu, 3 Jun 2004 19:33:03 -0700 From: Jouni Malinen To: jt@hpl.hp.com Cc: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Linux Kernel Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support Message-ID: <20040604023303.GB7537@jm.kir.nu> Mail-Followup-To: jt@hpl.hp.com, Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Linux Kernel References: <20040602071449.GJ10723@ruslug.rutgers.edu> <20040602132313.GB7341@jm.kir.nu> <20040602155542.GC24822@ruslug.rutgers.edu> <20040603165233.GC8770@bougret.hpl.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040603165233.GC8770@bougret.hpl.hp.com> User-Agent: Mutt/1.5.6i X-archive-position: 5594 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jkmaline@cc.hut.fi Precedence: bulk X-list: netdev Content-Length: 2505 Lines: 46 On Thu, Jun 03, 2004 at 09:52:33AM -0700, Jean Tourrilhes wrote: > So, the plan would be to take Jouni's API as is (or with minor > modifications) and stuff that in wireless.h. I don't believe that the > tools themselves need to be modified, because wpa_supplicant is the > sole user of those ioctls. > If you are all happy with that, then I'll just do it. I'm mostly happy with this, but this should also include something from the private ioctls hostapd uses for AP functionality. In addition, I would consider changing couple of text based elements (e.g., WPA IE as hex string) to binary in order to remove extra parsing code and make the data contents smaller. I'm having quite a bit of problems with scan results getting too large for the current limit of 4 kB.. Admittedly, this is in a test lab environment, but still, it is annoying and requires workarounds like driver side filtering of the scan results. I could try to make a list of all private ioctls currently used in wpa_supplicant and hostapd, including some comments on what I would consider changing at this point (mostly, changing text binary for couple of cases and removing some fields that are not really going to be used). Main categories for new functionality would be: - key configuration (multiple algorithms, individual/unicast keys, packet number set/get), - WPA (or actually, generic) information element (get from scan results, set for (Re)AssocReq/Beacon/ProbeResp) - MLME requests (deauth/disassoc; maybe associate, too; I'm currently using SIOCSIWAP for this; scan request with SSID (and maybe also channel list) for active scanning - authentication mode/encryption algorithm parameters (Host AP driver does not current use this, but this is the way WPA drivers are used in Windows NDIS and some Linux driver authors prefered this option and wpa_supplicant supports it as an optional mechanism) - some encryption related events/parameters (reporting Michael MIC errors, TKIP countermeasures, configuration of "drop unencrypted" and "privacy invoked"). Once we get some kind of testing version done, I will add a new driver interface code for wpa_supplicant for the generic Linux wireless extensions case and modify Host AP driver to use this. I hope that other drivers would also start to use the new API at some point, although wpa_supplicant is likely to maintain the backwards compatible interface code for some time. -- Jouni Malinen PGP id EFC895FA From jm@jm.kir.nu Thu Jun 3 20:46:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 20:46:42 -0700 (PDT) Received: from jm.kir.nu (dsl017-049-110.sfo4.dsl.speakeasy.net [69.17.49.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i543kdgi007217 for ; Thu, 3 Jun 2004 20:46:39 -0700 Received: from jm by jm.kir.nu with local (Exim 4.34) id 1BW5dp-00028O-UF; Thu, 03 Jun 2004 20:45:13 -0700 Date: Thu, 3 Jun 2004 20:45:13 -0700 From: Jouni Malinen To: Jeff Garzik Cc: Netdev Subject: Re: Additional 802.11 net stack code posted Message-ID: <20040604034513.GD7537@jm.kir.nu> References: <40BECAFC.7040405@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40BECAFC.7040405@pobox.com> User-Agent: Mutt/1.5.6i X-archive-position: 5595 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jkmaline@cc.hut.fi Precedence: bulk X-list: netdev Content-Length: 924 Lines: 21 On Thu, Jun 03, 2004 at 02:53:48AM -0400, Jeff Garzik wrote: > One of things that a proper "802.11 stack" should be is tie closely into > the core net stack, so that translation to/from 802.3 isn't going on all > the time. One wants to create, receive, and "understand" native 802.11 > frames, and provide a sane management infrastructure. Yes, indeed. When working outside the kernel tree, it was somewhat difficult to do this kind of changes, but this is certainly one of my goals, too, and now would be a good time to get the implementation together. > To that end, I ask that wireless hackers please study stub 802.11 code > that DaveM wrote Thanks! I will need to do some experimenting with this code, so this will take some time. Based on the quick browse through the files, there are number of things I have been missing before.. -- Jouni Malinen PGP id EFC895FA From russ@elegant-software.com Thu Jun 3 21:25:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 03 Jun 2004 21:25:48 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i544Pigi008219 for ; Thu, 3 Jun 2004 21:25:44 -0700 Received: from michael.elegant-software.com (pcp04414833pcs.nrockv01.md.comcast.net[69.140.188.59]) by comcast.net (rwcrmhc11) with ESMTP id <2004060402204101300cks3ie>; Fri, 4 Jun 2004 02:20:41 +0000 Received: from elegant-software.com (unknown [192.168.2.4]) by michael.elegant-software.com (Postfix) with ESMTP id 4B42E4781E; Thu, 3 Jun 2004 22:24:16 -0400 (EDT) Message-ID: <40BFDD4F.5080408@elegant-software.com> Date: Thu, 03 Jun 2004 22:24:15 -0400 From: Russell Leighton User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Cc: Andrew Morton Subject: Re: Fw: F_SETSIG broken/changed in 2.6 for UDP and TCP sockets? References: <20040531151843.7144dfce.akpm@osdl.org> In-Reply-To: <20040531151843.7144dfce.akpm@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5596 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: russ@elegant-software.com Precedence: bulk X-list: netdev Content-Length: 2276 Lines: 78 Thanks to all that helped me troubleshoot. Of the 2 issues I had with FedoraCore2, one problem is solved: * Multicast issues were solved by using another NIC. It seems that the driver for the NatSemi DP8381[56] does not receive mutlicast properly. * F_SETSIG still seems broken for TCP for me when my process sets up more than a few fd's...I will try the latest kernel to see if this goes away Russ Andrew Morton wrote: >Begin forwarded message: > >Date: Mon, 31 May 2004 14:45:08 -0400 >From: Russell Leighton >To: linux-kernel@vger.kernel.org >Subject: F_SETSIG broken/changed in 2.6 for UDP and TCP sockets? > > > >I have a program that works fine under stock rh9 (2.4.2-8) but has >issues getting signaled under FedoraCore2 (2.6.5-1.358) >using SETSIG to a Posix RT signal. > >The program does the standard: > > /* hook to process */ > if ( fcntl(fdcallback->fd, F_SETOWN, mon->handler_q.thread->pid) == -1 ) { > aw_log(fdcallback->handler->logger, AW_ERROR_LOG_LEVEL, > "cannot set owner on fd (%s)", > strerror(errno)); > }/* end if */ > > /* make async */ > if ( fcntl(fdcallback->fd, F_SETFL, (O_NONBLOCK | O_ASYNC) ) == -1 ) { > aw_log(fdcallback->handler->logger, AW_ERROR_LOG_LEVEL, > "cannot set async on fd (%s)", > strerror(errno)); > }/* end if */ > > /* hook to signal */ > if ( fcntl(fdcallback->fd, F_SETSIG, AW_SIG_FD) == -1 ) { > aw_log(fdcallback->handler->logger, AW_ERROR_LOG_LEVEL, > "cannot set signal on fd (%s)", > strerror(errno)); > }/* end if */ > >Under Fedora things work well for raw sockets (much lower latency than >in 2.4!) but are inconsistent with udp or tcp sockets. > >In the udp case, I when I listen for multicast packets my app only >receives them when I am running a tcpdump (bizarre!). > >In the tcp case, I don't get signaled if I do the F_SETSIG on more than >1 fd. > >Any tips on tracking this down would be much appreciated. > >Thx > >Russ > >- >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 colin@colino.net Fri Jun 4 02:13:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 02:13:42 -0700 (PDT) Received: from srvsec1.girce.epro.fr (smtp-out.girce.epro.fr [195.6.195.146]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i549Dbgi019881 for ; Fri, 4 Jun 2004 02:13:38 -0700 Received: from ANOSP (unverified) by srvsec1.girce.epro.fr (Content Technologies SMTPRS 4.3.12) with SMTP id ; Fri, 4 Jun 2004 11:13:26 +0200 Message-ID: <026001c44a14$30cd9fc0$3cc8a8c0@epro.dom> From: "Colin LEROY" To: Cc: Subject: Re: wireless-2.6 queue opened Date: Fri, 4 Jun 2004 11:13:24 +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.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-archive-position: 5598 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: colin@colino.net Precedence: bulk X-list: netdev Content-Length: 341 Lines: 14 Hi, Just a quick question about the generic 802.11 stack. Is USB support planned for this? I'm asking, because I read on the web that adding USB support to hostap would be a lot of work: http://sisyphus.iocaine.com/pipermail/hostap/2004-March/006076.html -- Colin This message represents the official view of the voices in my head. From pp@ee.oulu.fi Fri Jun 4 02:48:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 02:48:02 -0700 (PDT) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i549lxgi022575 for ; Fri, 4 Jun 2004 02:47:59 -0700 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.12.10/8.12.10) with ESMTP id i4JAR1Rp003316; Wed, 19 May 2004 13:27:01 +0300 (EEST) Received: (from pp@localhost) by tk28.oulu.fi (8.12.11/8.12.11/Submit) id i4JAR0Zb017541; Wed, 19 May 2004 13:27:00 +0300 (EEST) Date: Wed, 19 May 2004 13:27:00 +0300 From: Pekka Pietikainen To: Marc Herbert Cc: netdev@oss.sgi.com, prism54-devel@prism54.org Subject: Re: TxDescriptors -> 1024 default. Please not for every NIC! Message-ID: <20040519102700.GA16465@ee.oulu.fi> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i X-MIME-Autoconverted: from 8bit to quoted-printable by ee.oulu.fi id i4JAR1Rp003316 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i549lxgi022575 X-archive-position: 5599 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev Content-Length: 1391 Lines: 27 On Wed, May 19, 2004 at 11:30:28AM +0200, Marc Herbert wrote: > - Me argues that we all lived happy for ages with this default > setting of 100packets @100Mb/s (and lived approximately happy @ > 10 Mb/s), but we'll soon see doom and gloom with this new and > brutal change to 1000packets for all this _legacy_ 10-100 Mb/s > hardware. e1000 data only is not enough to justify this radical > shift. > > If you are convinced by _both_ items above, then the patch below > content _both_, and we're done. > > If you are not, then... wait for further discussion, including answers > to latest Ricardo's post. Not to mention that not all modern hardware is gigabit, current 2.6 seems to be setting txqueuelen of 1000 for 802.11 devices too (at least my prism54), which might be causing major problems for me. Well, I'm still trying to figure out whether it's txqueue or WEP that causes all traffic to stop (with rx invalid crypt packets showing up in iwconfig afterwards, AP is a linksys wrt54g in case it makes a difference) every now and then until a ifdown / ifup. Tried both vanilla 2.6 prism54 and CVS (which seems to have a reset on tx timeout thing added), but if txqueue is 1000 that won't easily get triggered will it? It's been running for a few days just fine with txqueue = 100 and no WEP, if it stays like that i'll start tweaking to find what exactly triggers it. From jheffner@psc.edu Fri Jun 4 06:04:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 06:04:44 -0700 (PDT) Received: from mailer1.psc.edu (mailer1.psc.edu [128.182.58.100]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54D4ggi003480 for ; Fri, 4 Jun 2004 06:04:42 -0700 Received: from dexter.psc.edu (dexter.psc.edu [128.182.61.232]) by mailer1.psc.edu (8.12.10/8.12.5) with ESMTP id i54D4ef0004219 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 4 Jun 2004 09:04:40 -0400 (EDT) Received: from dexter.psc.edu (dexter.psc.edu [128.182.61.232]) by dexter.psc.edu (8.12.10/8.12.5) with ESMTP id i54D4ew0004483 for ; Fri, 4 Jun 2004 09:04:40 -0400 (EDT) Date: Fri, 4 Jun 2004 09:04:40 -0400 (EDT) From: John Heffner To: Subject: OT: randomly unsubscribed Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: clamd / ClamAV version 0.70, clamav-milter version 0.70j X-archive-position: 5600 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jheffner@psc.edu Precedence: bulk X-list: netdev Content-Length: 261 Lines: 10 I can't find an admin address for this list, sorry about the off-topic post. I'm getting randomly and silently unsubscribed from this list. It's happened three or four times now in the past few months. Could the list admin look in to this? Thanks, -John From c-d.hailfinger.kernel.2004@gmx.net Fri Jun 4 07:25:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 07:25:34 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54EPSgi013727 for ; Fri, 4 Jun 2004 07:25:28 -0700 Received: (qmail 2784 invoked by uid 65534); 4 Jun 2004 14:25:22 -0000 Received: from stud212245.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.212.245) by mail.gmx.net (mp017) with SMTP; 04 Jun 2004 16:25:22 +0200 X-Authenticated: #21910825 Message-ID: <40C0863E.9070508@gmx.net> Date: Fri, 04 Jun 2004 16:25:02 +0200 From: Carl-Daniel Hailfinger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114 X-Accept-Language: de, en MIME-Version: 1.0 To: smolny@o2.pl CC: foner+x-forcedeth@media.mit.edu, Manfred Spraul , Linux Kernel Mailing List , Andrew de Quincey , Netdev Subject: Re: Forcedeth and vesa References: <20040604135640.C218BD0B60@rekin6.o2.pl> In-Reply-To: <20040604135640.C218BD0B60@rekin6.o2.pl> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5601 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: c-d.hailfinger.kernel.2004@gmx.net Precedence: bulk X-list: netdev Content-Length: 1083 Lines: 36 Hi, [foner: I included you in the CC because your problem seems similar.] smolny@o2.pl wrote: > Hi, > Sorry if you get this post by mistake. I found your address googling > for "forcedeth vesa". Well, you reached the right person. > When i use forcedeth module, both with 2.4.26 and 2.6.6 kernels, i > can't access vesa with mplayer. Just loading the module doesn't > cause the problem, only after i configure the net with ifconfig i > can't use vesa. This is interesting. Does the problem persist if you ifdown the interface? > If i use nvnet NVidia driver with 2.4.26, everything goes fine (no > nvnet for 2.6.x kernels). That is even more interesting. So the bug affects forcedeth, but not nvnet. Hmmm. We'll have to review the code again. > It's an EPOX 8RDA+ motherboard. Foner: Do you see similarities between your problem and this one? Janusz, Foner: Are you willing to test forcedeth with a few dozen iterations of patch, recompile, install, power down, power up and test again? I would send you patches to binary search the offending code. Regards, Carl-Daniel From tharbaugh@lnxi.com Fri Jun 4 07:31:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 07:31:27 -0700 (PDT) Received: from ash.lnxi.com (208.177.141.226.ptr.us.xo.net [208.177.141.226]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54EVHgi014130 for ; Fri, 4 Jun 2004 07:31:17 -0700 Received: (qmail 23667 invoked from network); 4 Jun 2004 14:31:32 -0000 Received: from tubarao.lnxi.com (HELO ?192.168.15.106?) (192.168.15.106) by ash.lnxi.com with SMTP; 4 Jun 2004 14:31:32 -0000 Subject: Re: [PATCH] abysmal e1000 performance (DITR) From: Thayne Harbaugh Reply-To: tharbaugh@lnxi.com To: netdev@oss.sgi.com Cc: ganesh.venkatesan@intel.com, Scott Feldman , Jesse Brandeburg In-Reply-To: <1086131111.20113.22.camel@tubarao> References: <1086131111.20113.22.camel@tubarao> Content-Type: text/plain Organization: Linux Networx Message-Id: <1086358801.23135.30.camel@tubarao> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Fri, 04 Jun 2004 08:20:02 -0600 Content-Transfer-Encoding: 7bit X-archive-position: 5602 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tharbaugh@lnxi.com Precedence: bulk X-list: netdev Content-Length: 335 Lines: 10 I have documented a serious performance problem with DITR in the e1000 driver. I have sent a patch to the netdev list as well as CC'ed various people at Intel. There has been very little response. I am wondering who has reviewed the DITR performance problem and what the plans are for fixing it. -- Thayne Harbaugh Linux Networx From adq_dvb@lidskialf.net Fri Jun 4 07:41:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 07:41:38 -0700 (PDT) Received: from beyond.lidskialf.net (lidskialf.net [62.3.233.115]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54EfWgi014758 for ; Fri, 4 Jun 2004 07:41:32 -0700 Received: from monstrousfish (monstrousfish [172.16.1.2]) by beyond.lidskialf.net (Postfix) with ESMTP id 6490F100977; Fri, 4 Jun 2004 15:41:26 +0100 (BST) From: Andrew de Quincey To: Carl-Daniel Hailfinger Subject: Re: Forcedeth and vesa Date: Fri, 4 Jun 2004 15:41:29 +0100 User-Agent: KMail/1.6.2 Cc: smolny@o2.pl, foner+x-forcedeth@media.mit.edu, Manfred Spraul , Linux Kernel Mailing List , Netdev References: <20040604135640.C218BD0B60@rekin6.o2.pl> <40C0863E.9070508@gmx.net> In-Reply-To: <40C0863E.9070508@gmx.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406041541.29594.adq_dvb@lidskialf.net> X-archive-position: 5603 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: adq_dvb@lidskialf.net Precedence: bulk X-list: netdev Content-Length: 1513 Lines: 43 On Friday 04 Jun 2004 15:25, Carl-Daniel Hailfinger wrote: > Hi, > > [foner: I included you in the CC because your problem seems similar.] > > smolny@o2.pl wrote: > > Hi, > > Sorry if you get this post by mistake. I found your address googling > > for "forcedeth vesa". > > Well, you reached the right person. > > > When i use forcedeth module, both with 2.4.26 and 2.6.6 kernels, i > > can't access vesa with mplayer. Just loading the module doesn't > > cause the problem, only after i configure the net with ifconfig i > > can't use vesa. > > This is interesting. Does the problem persist if you ifdown the interface? > > > If i use nvnet NVidia driver with 2.4.26, everything goes fine (no > > nvnet for 2.6.x kernels). > > That is even more interesting. So the bug affects forcedeth, but not > nvnet. Hmmm. We'll have to review the code again. > > > It's an EPOX 8RDA+ motherboard. > > Foner: Do you see similarities between your problem and this one? > > Janusz, Foner: Are you willing to test forcedeth with a few dozen > iterations of > patch, recompile, install, power down, power up and test again? > > I would send you patches to binary search the offending code. This is rather convenient. I have an Epox 8RDA+ as well. What video card are you using in that box? I'll install mplayer and see if I can replicate (I have an ATI 9800 Pro, but I can easily stuff a number of nvidia cards in there to check). If you're using an ATI or Nvidia card, are you using the proprietary or opensource drivers? From ganesh.venkatesan@intel.com Fri Jun 4 08:44:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 08:44:22 -0700 (PDT) Received: from caduceus.jf.intel.com (fmr06.intel.com [134.134.136.7]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54FiIgi019615 for ; Fri, 4 Jun 2004 08:44:18 -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: major-outer.mc,v 1.15 2004/01/30 18:16:28 root Exp $) with ESMTP id i54Fhg8J004179; Fri, 4 Jun 2004 15:43:42 GMT Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com [192.168.65.54]) by petasus.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.10 2004/03/01 19:21:36 root Exp $) with SMTP id i54FiuSR028230; Fri, 4 Jun 2004 15:45:13 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs041.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004060408441008809 ; Fri, 04 Jun 2004 08:44:10 -0700 Received: from orsmsx408.amr.corp.intel.com ([192.168.65.52]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 4 Jun 2004 08:44:10 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: [PATCH] abysmal e1000 performance (DITR) Date: Fri, 4 Jun 2004 08:44:08 -0700 Message-ID: <468F3FDA28AA87429AD807992E22D07E014CEF36@orsmsx408> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] abysmal e1000 performance (DITR) Thread-Index: AcRKQJhjQz7RypWwTTK+D7vFFxAXcwACfwgQ From: "Venkatesan, Ganesh" To: , Cc: "Feldman, Scott" , "Brandeburg, Jesse" X-OriginalArrivalTime: 04 Jun 2004 15:44:10.0345 (UTC) FILETIME=[C735E590:01C44A4A] 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 i54FiIgi019615 X-archive-position: 5604 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Content-Length: 829 Lines: 32 Thayne: We are studying the patch and will get back to you once we have a plan to integrate it into the driver. Thanks, ganesh ------------------------------------------------- Ganesh Venkatesan Network/Storage Division, Hillsboro, OR -----Original Message----- From: Thayne Harbaugh [mailto:tharbaugh@lnxi.com] Sent: Friday, June 04, 2004 7:20 AM To: netdev@oss.sgi.com Cc: Venkatesan, Ganesh; Feldman, Scott; Brandeburg, Jesse Subject: Re: [PATCH] abysmal e1000 performance (DITR) I have documented a serious performance problem with DITR in the e1000 driver. I have sent a patch to the netdev list as well as CC'ed various people at Intel. There has been very little response. I am wondering who has reviewed the DITR performance problem and what the plans are for fixing it. -- Thayne Harbaugh Linux Networx From yoshfuji@linux-ipv6.org Fri Jun 4 09:52:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 09:52:49 -0700 (PDT) Received: from yue.st-paulia.net ([203.178.140.15]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54Gqigi021447 for ; Fri, 4 Jun 2004 09:52:44 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 114BF33CE5 for ; Sat, 5 Jun 2004 01:53:28 +0900 (JST) Resent-Date: Sat, 05 Jun 2004 01:53:27 +0900 (JST) Resent-Message-Id: <20040605.015327.131480818.yoshfuji@linux-ipv6.org> Resent-To: netdev@oss.sgi.com Resent-From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Date: Fri, 4 Jun 2004 17:54:23 +0200 From: "Wesley W. Terpstra" To: linux-kernel@vger.kernel.org Subject: Broken? 2.6.6 + IP_ADD_SOURCE_MEMBERSHIP + SO_REUSEADDR Message-ID: <20040604155423.GA5656@muffin> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-archive-position: 5605 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: 1410 Lines: 37 Hi! I am using the new IGMPv3 support in the 2.6.* series for Single Source Multicast (SSM). However, the kernel appears to (incorrectly) drop packets in some situations. What I do is this: open a UDP port, set it SO_REUSEADDR, bind it to port 6767, and then use IP_ADD_SOURCE_MEMBERSHIP to listen to multicast group 232.65.43.21 and with a command-line controlled sender. If I launch the same program twice with different senders, the first program ceases to receive multicast packets. (Neither from its own sender, nor the second program's sender) The second program receives packets from its designated sender only (as expected). I know from tcpdump that the switch is delivering messages from the first designated sender. The kernel is simply not giving them to the application. Some more observations: If both programs specify the same sender, then both programs receive the message (as expected). This is not an issue with subscribing to multiple senders in general. A single program listening to two senders does receive messages from both. This seems like a bug to me. PS. I am not subscribed to this list, so please CC me. -- Wesley W. Terpstra - 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 yoshfuji@linux-ipv6.org Fri Jun 4 09:55:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 09:55:04 -0700 (PDT) Received: from yue.st-paulia.net ([203.178.140.15]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54Gt0gi021776 for ; Fri, 4 Jun 2004 09:55:00 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 9901D33CE5; Sat, 5 Jun 2004 01:55:44 +0900 (JST) Date: Sat, 05 Jun 2004 01:55:44 +0900 (JST) Message-Id: <20040605.015544.102223977.yoshfuji@linux-ipv6.org> To: terpstra@gkec.tu-darmstadt.de Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, davem@redhat.com, yoshfuji@linux-ipv6.org Subject: Re: Broken? 2.6.6 + IP_ADD_SOURCE_MEMBERSHIP + SO_REUSEADDR From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040604155423.GA5656@muffin> References: <20040604155423.GA5656@muffin> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5606 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: 1136 Lines: 30 In article <20040604155423.GA5656@muffin> (at Fri, 4 Jun 2004 17:54:23 +0200), "Wesley W. Terpstra" says: > If I launch the same program twice with different senders, the first program > ceases to receive multicast packets. (Neither from its own sender, nor the > second program's sender) The second program receives packets from its > designated sender only (as expected). : > If both programs specify the same sender, then both programs receive the > message (as expected). Thanks for the report. The following patch should fix the issue. Please try. Thanks again. ===== net/ipv4/udp.c 1.60 vs edited ===== --- 1.60/net/ipv4/udp.c 2004-05-31 03:57:26 +09:00 +++ edited/net/ipv4/udp.c 2004-06-05 01:47:07 +09:00 @@ -294,7 +294,7 @@ ipv6_only_sock(s) || (s->sk_bound_dev_if && s->sk_bound_dev_if != dif)) continue; - if (!ip_mc_sf_allow(sk, loc_addr, rmt_addr, dif)) + if (!ip_mc_sf_allow(s, loc_addr, rmt_addr, dif)) continue; goto found; } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From ralf@linux-mips.org Fri Jun 4 10:12:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 10:12:32 -0700 (PDT) Received: from mail.linux-mips.net (p508B7FF6.dip.t-dialin.net [80.139.127.246]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54HCTgi028611 for ; Fri, 4 Jun 2004 10:12:30 -0700 Received: from fluff.linux-mips.net (fluff.linux-mips.net [127.0.0.1]) by mail.linux-mips.net (8.12.11/8.12.8) with ESMTP id i54HCP21021803; Fri, 4 Jun 2004 19:12:25 +0200 Received: (from ralf@localhost) by fluff.linux-mips.net (8.12.11/8.12.11/Submit) id i54HCPMv021802; Fri, 4 Jun 2004 19:12:25 +0200 Date: Fri, 4 Jun 2004 19:12:25 +0200 From: Ralf Baechle To: John Heffner Cc: netdev@oss.sgi.com Subject: Re: OT: randomly unsubscribed Message-ID: <20040604171225.GB15486@linux-mips.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-archive-position: 5607 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ralf@linux-mips.org Precedence: bulk X-list: netdev Content-Length: 780 Lines: 19 On Fri, Jun 04, 2004 at 09:04:40AM -0400, John Heffner wrote: > I can't find an admin address for this list, sorry about the off-topic > post. Ever heared about postmaster? > I'm getting randomly and silently unsubscribed from this list. It's > happened three or four times now in the past few months. Could the list > admin look in to this? Subscribers will be unsubscribed if a there the number of bounces exceeds a certain threshold. The bounce filter is not able to distinguish between "real" bounces and false bounces such caused by sender address forgery by viruses and spam. As you can imagine due the massive abuse of email by spam and viruses this is going to cause problems ... For now I've double the number of bounces before a user gets unsubscribed. Ralf From yoshfuji@linux-ipv6.org Fri Jun 4 10:13:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 10:13:32 -0700 (PDT) Received: from yue.st-paulia.net ([203.178.140.15]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54HDRgi028970 for ; Fri, 4 Jun 2004 10:13:28 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 9E90B33CE5; Sat, 5 Jun 2004 02:14:11 +0900 (JST) Date: Sat, 05 Jun 2004 02:14:11 +0900 (JST) Message-Id: <20040605.021411.55160771.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Broken? 2.6.6 + IP_ADD_SOURCE_MEMBERSHIP + SO_REUSEADDR From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040605.015544.102223977.yoshfuji@linux-ipv6.org> References: <20040604155423.GA5656@muffin> <20040605.015544.102223977.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-archive-position: 5608 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: 695 Lines: 20 In article <20040605.015544.102223977.yoshfuji@linux-ipv6.org> (at Sat, 05 Jun 2004 01:55:44 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > The following patch should fix the issue. Please try. And, here's a variant for 2.4. ===== net/ipv4/udp.c 1.13 vs edited ===== --- 1.13/net/ipv4/udp.c 2004-02-22 06:12:49 +09:00 +++ edited/net/ipv4/udp.c 2004-06-05 01:56:50 +09:00 @@ -290,7 +290,7 @@ ipv6_only_sock(s) || (s->bound_dev_if && s->bound_dev_if != dif)) continue; - if (!ip_mc_sf_allow(sk, loc_addr, rmt_addr, dif)) + if (!ip_mc_sf_allow(s, loc_addr, rmt_addr, dif)) continue; break; } -- yoshfuji @ time to sleep... From jt@bougret.hpl.hp.com Fri Jun 4 11:01:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 11:01:58 -0700 (PDT) Received: from palrel12.hp.com (palrel12.hp.com [156.153.255.237]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54I1lgi030964 for ; Fri, 4 Jun 2004 11:01:48 -0700 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel12.hp.com (Postfix) with ESMTP id 6253240FBCD; Fri, 4 Jun 2004 11:01:07 -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_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id LAA23199; Fri, 4 Jun 2004 11:02:08 -0700 (PDT) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1BWJ06-00055v-00; Fri, 04 Jun 2004 11:01:06 -0700 Date: Fri, 4 Jun 2004 11:01:06 -0700 To: Netdev , hostap@shmoo.com, prism54-devel@prism54.org, Jeff Garzik , Linux Kernel Subject: Re: Prism54 WPA Support - wpa_supplicant - Linux general wpa support Message-ID: <20040604180106.GA19181@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20040602071449.GJ10723@ruslug.rutgers.edu> <20040602132313.GB7341@jm.kir.nu> <20040602155542.GC24822@ruslug.rutgers.edu> <20040603165233.GC8770@bougret.hpl.hp.com> <20040604023303.GB7537@jm.kir.nu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040604023303.GB7537@jm.kir.nu> 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: 5609 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 Content-Length: 2074 Lines: 48 On Thu, Jun 03, 2004 at 07:33:03PM -0700, Jouni Malinen wrote: > On Thu, Jun 03, 2004 at 09:52:33AM -0700, Jean Tourrilhes wrote: > > > So, the plan would be to take Jouni's API as is (or with minor > > modifications) and stuff that in wireless.h. I don't believe that the > > tools themselves need to be modified, because wpa_supplicant is the > > sole user of those ioctls. > > If you are all happy with that, then I'll just do it. > > I'm mostly happy with this, but this should also include something from > the private ioctls hostapd uses for AP functionality. Obviously we need the full functionality, not just some part of it. > In addition, I would consider changing couple of text based elements > (e.g., WPA IE as hex string) to binary in order to remove extra > parsing code and make the data contents smaller. The downside of that is that things need to be predefined. As we are doing a "WPA API" and not a "generic link layer security API", that's OK. The other thing you may want to think about is miving all string/arrays at the end of the definition so that we can grow them easily if needed, and so that the first part can be fixed. > I'm having quite a bit of problems with scan > results getting too large for the current limit of 4 kB.. Admittedly, > this is in a test lab environment, but still, it is annoying and > requires workarounds like driver side filtering of the scan results. That's easy to fix. I did the same with "iwpriv" definitions a couple of weeks ago. Basically, you return -E2BIG to user space until userspace give you a big enough buffer. I'll try to fix that. > I could try to make a list of all private ioctls currently used in > wpa_supplicant and hostapd, including some comments on what I would > consider changing at this point (mostly, changing text binary for couple > of cases and removing some fields that are not really going to be used). You currently have your plate pretty full. I'll try to help, but my first son was born one month ago and things are not as smooth as planned. > Jouni Malinen Jean From sri@us.ibm.com Fri Jun 4 11:44:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 11:45:05 -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.9) with SMTP id i54Iiogi004617 for ; Fri, 4 Jun 2004 11:44:56 -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 i54IiNwc704198; Fri, 4 Jun 2004 14:44:23 -0400 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i54IiCir224732; Fri, 4 Jun 2004 12:44:23 -0600 Date: Fri, 4 Jun 2004 11:44:12 -0700 (PDT) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: [BK PATCH] 2.6 and 2.4 SCTP updates. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5610 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 Content-Length: 14514 Lines: 437 Dave, Please do a bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work & bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work to get the following bugfix csets to 2.6 and 2.4 SCTP. Thanks Sridhar # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/06/03 17:46:29-07:00 sri@us.ibm.com # [SCTP] Fix poll() on a 1-1 style socket so that it returns when the # association is aborted by peer. # # net/sctp/sm_sideeffect.c # # ChangeSet # 2004/06/03 17:40:49-07:00 sri@us.ibm.com # [SCTP] Fix to wakeup blocking connect() after max INIT retries failed. # # net/sctp/socket.c # net/sctp/sm_sideeffect.c # # ChangeSet # 2004/06/03 17:33:41-07:00 sri@us.ibm.com # [SCTP] Fix missing VTAG validation on certain incoming packets. # # net/sctp/sm_statefuns.c # include/net/sctp/sm.h # # ChangeSet # 2004/06/03 17:26:13-07:00 sri@us.ibm.com # [SCTP] Fix the use of cached non-zero vtag in an INIT that is resent # after a stale cookie error. # # net/sctp/sm_statefuns.c # net/sctp/sm_sideeffect.c # include/net/sctp/command.h # # ChangeSet # 2004/06/03 17:19:57-07:00 jhh@lucent.com # [SCTP] Fix to not start a new association on a 1-many style sendmsg() # with MSG_EOF/MSG_ABORT flag and no data. # # net/sctp/socket.c # # ChangeSet # 2004/06/03 17:16:07-07:00 jhh@lucent.com # [SCTP] Fix to not setup a new association if the endpoint is in # SHUTDOWN_ACK_SENT state and recognizes that the peer has restarted. # # net/sctp/sm_statefuns.c # diff -Nru a/include/net/sctp/command.h b/include/net/sctp/command.h --- a/include/net/sctp/command.h Fri Jun 4 11:08:18 2004 +++ b/include/net/sctp/command.h Fri Jun 4 11:08:18 2004 @@ -93,6 +93,7 @@ SCTP_CMD_PROCESS_OPERR, /* Process an ERROR chunk. */ SCTP_CMD_REPORT_FWDTSN, /* Report new cumulative TSN Ack. */ SCTP_CMD_PROCESS_FWDTSN, /* Skips were reported, so process further. */ + SCTP_CMD_CLEAR_INIT_TAG, /* Clears association peer's inittag. */ SCTP_CMD_LAST } sctp_verb_t; diff -Nru a/include/net/sctp/sm.h b/include/net/sctp/sm.h --- a/include/net/sctp/sm.h Fri Jun 4 11:08:18 2004 +++ b/include/net/sctp/sm.h Fri Jun 4 11:08:18 2004 @@ -440,6 +440,23 @@ BUG(); } +/* Check VTAG of the packet matches the sender's own tag. */ +static inline int +sctp_vtag_verify(const struct sctp_chunk *chunk, + const struct sctp_association *asoc) +{ + /* RFC 2960 Sec 8.5 When receiving an SCTP packet, the endpoint + * MUST ensure that the value in the Verification Tag field of + * the received SCTP packet matches its own Tag. If the received + * Verification Tag value does not match the receiver's own + * tag value, the receiver shall silently discard the packet... + */ + if (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag) + return 1; + + return 0; +} + /* Check VTAG of the packet matches the sender's own tag OR its peer's * tag and the T bit is set in the Chunk Flags. */ diff -Nru a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c --- a/net/sctp/sm_sideeffect.c Fri Jun 4 11:08:18 2004 +++ b/net/sctp/sm_sideeffect.c Fri Jun 4 11:08:18 2004 @@ -429,6 +429,9 @@ sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(event)); + sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, + SCTP_STATE(SCTP_STATE_CLOSED)); + /* SEND_FAILED sent later when cleaning up the association. */ asoc->outqueue.error = error; sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL()); @@ -457,6 +460,10 @@ sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, SCTP_STATE(SCTP_STATE_CLOSED)); + /* Set sk_err to ECONNRESET on a 1-1 style socket. */ + if (!sctp_style(asoc->base.sk, UDP)) + asoc->base.sk->sk_err = ECONNRESET; + /* SEND_FAILED sent later when cleaning up the association. */ asoc->outqueue.error = error; sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL()); @@ -1271,6 +1278,9 @@ case SCTP_CMD_PROCESS_OPERR: sctp_cmd_process_operr(commands, asoc, chunk); + break; + case SCTP_CMD_CLEAR_INIT_TAG: + asoc->peer.i.init_tag = 0; break; default: printk(KERN_WARNING "Impossible command: %u, %p\n", diff -Nru a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c --- a/net/sctp/sm_statefuns.c Fri Jun 4 11:08:18 2004 +++ b/net/sctp/sm_statefuns.c Fri Jun 4 11:08:18 2004 @@ -171,7 +171,7 @@ * Verification Tag field to Tag_A, and also provide its own * Verification Tag (Tag_Z) in the Initiate Tag field. * - * Verification Tag: No checking. + * Verification Tag: Must be 0. * * Inputs * (endpoint, asoc, chunk) @@ -219,6 +219,12 @@ (sk->sk_ack_backlog >= sk->sk_max_ack_backlog))) return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); + /* 3.1 A packet containing an INIT chunk MUST have a zero Verification + * Tag. + */ + if (chunk->sctp_hdr->vtag != 0) + return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); + /* Verify the INIT chunk before processing it. */ err_chunk = NULL; if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, @@ -377,6 +383,9 @@ if (!chunk->singleton) return SCTP_DISPOSITION_VIOLATION; + if (!sctp_vtag_verify(chunk, asoc)) + return sctp_sf_pdiscard(ep, asoc, type, arg, commands); + /* Grab the INIT header. */ chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data; @@ -659,8 +668,12 @@ const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { + struct sctp_chunk *chunk = arg; struct sctp_ulpevent *ev; + if (!sctp_vtag_verify(chunk, asoc)) + return sctp_sf_pdiscard(ep, asoc, type, arg, commands); + /* RFC 2960 5.1 Normal Establishment of an Association * * E) Upon reception of the COOKIE ACK, endpoint "A" will move @@ -807,13 +820,7 @@ struct sctp_chunk *reply; size_t paylen = 0; - /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. If the received - * Verification Tag value does not match the receiver's own - * tag value, the receiver shall silently discard the packet... - */ - if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) + if (!sctp_vtag_verify(chunk, asoc)) return sctp_sf_pdiscard(ep, asoc, type, arg, commands); /* 8.3 The receiver of the HEARTBEAT should immediately @@ -876,11 +883,7 @@ sctp_sender_hb_info_t *hbinfo; unsigned long max_interval; - /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. ... - */ - if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) + if (!sctp_vtag_verify(chunk, asoc)) return sctp_sf_pdiscard(ep, asoc, type, arg, commands); hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data; @@ -1130,6 +1133,12 @@ if (!chunk->singleton) return SCTP_DISPOSITION_VIOLATION; + /* 3.1 A packet containing an INIT chunk MUST have a zero Verification + * Tag. + */ + if (chunk->sctp_hdr->vtag != 0) + return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); + /* Grab the INIT header. */ chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data; @@ -1386,6 +1395,8 @@ sctp_init_chunk_t *peer_init; struct sctp_ulpevent *ev; struct sctp_chunk *repl; + struct sctp_chunk *err; + sctp_disposition_t disposition; /* new_asoc is a brand-new association, so these are not yet * side effects--it is safe to run them here. @@ -1405,6 +1416,29 @@ return SCTP_DISPOSITION_CONSUME; } + /* If the endpoint is in the SHUTDOWN-ACK-SENT state and recognizes + * the peer has restarted (Action A), it MUST NOT setup a new + * association but instead resend the SHUTDOWN ACK and send an ERROR + * chunk with a "Cookie Received while Shutting Down" error cause to + * its peer. + */ + if (sctp_state(asoc, SHUTDOWN_ACK_SENT)) { + disposition = sctp_sf_do_9_2_reshutack(ep, asoc, + SCTP_ST_CHUNK(chunk->chunk_hdr->type), + chunk, commands); + if (SCTP_DISPOSITION_NOMEM == disposition) + goto nomem; + + err = sctp_make_op_error(asoc, chunk, + SCTP_ERROR_COOKIE_IN_SHUTDOWN, + NULL, 0); + if (err) + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, + SCTP_CHUNK(err)); + + return SCTP_DISPOSITION_CONSUME; + } + /* For now, fail any unsent/unacked data. Consider the optional * choice of resending of this data. */ @@ -1883,6 +1917,9 @@ sctp_addto_chunk(reply, sizeof(bht), &bht); + /* Clear peer's init_tag cached in assoc as we are sending a new INIT */ + sctp_add_cmd_sf(commands, SCTP_CMD_CLEAR_INIT_TAG, SCTP_NULL()); + /* Cast away the const modifier, as we want to just * rerun it through as a sideffect. */ @@ -2071,13 +2108,7 @@ skb_pull(chunk->skb, sizeof(sctp_shutdownhdr_t)); chunk->subh.shutdown_hdr = sdh; - /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. If the received - * Verification Tag value does not match the receiver's own - * tag value, the receiver shall silently discard the packet... - */ - if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) + if (!sctp_vtag_verify(chunk, asoc)) return sctp_sf_pdiscard(ep, asoc, type, arg, commands); /* Upon the reception of the SHUTDOWN, the peer endpoint shall @@ -2190,13 +2221,7 @@ sctp_cwrhdr_t *cwr; struct sctp_chunk *chunk = arg; - /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. If the received - * Verification Tag value does not match the receiver's own - * tag value, the receiver shall silently discard the packet... - */ - if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) + if (!sctp_vtag_verify(chunk, asoc)) return sctp_sf_pdiscard(ep, asoc, type, arg, commands); cwr = (sctp_cwrhdr_t *) chunk->skb->data; @@ -2246,13 +2271,7 @@ sctp_ecnehdr_t *ecne; struct sctp_chunk *chunk = arg; - /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. If the received - * Verification Tag value does not match the receiver's own - * tag value, the receiver shall silently discard the packet... - */ - if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) + if (!sctp_vtag_verify(chunk, asoc)) return sctp_sf_pdiscard(ep, asoc, type, arg, commands); ecne = (sctp_ecnehdr_t *) chunk->skb->data; @@ -2309,13 +2328,7 @@ int tmp; __u32 tsn; - /* RFC 2960 8.5 Verification Tag - * - * When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. - */ - if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) { + if (!sctp_vtag_verify(chunk, asoc)) { sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG, SCTP_NULL()); return sctp_sf_pdiscard(ep, asoc, type, arg, commands); @@ -2569,13 +2582,7 @@ int tmp; __u32 tsn; - /* RFC 2960 8.5 Verification Tag - * - * When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. - */ - if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) { + if (!sctp_vtag_verify(chunk, asoc)) { sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG, SCTP_NULL()); return sctp_sf_pdiscard(ep, asoc, type, arg, commands); @@ -2745,11 +2752,7 @@ sctp_sackhdr_t *sackh; __u32 ctsn; - /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. ... - */ - if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) + if (!sctp_vtag_verify(chunk, asoc)) return sctp_sf_pdiscard(ep, asoc, type, arg, commands); /* Pull the SACK chunk from the data buffer */ @@ -2895,6 +2898,9 @@ struct sctp_chunk *reply; struct sctp_ulpevent *ev; + if (!sctp_vtag_verify(chunk, asoc)) + return sctp_sf_pdiscard(ep, asoc, type, arg, commands); + /* 10.2 H) SHUTDOWN COMPLETE notification * * When SCTP completes the shutdown procedures (section 9.2) this @@ -3229,13 +3235,7 @@ __u16 len; __u32 tsn; - /* RFC 2960 8.5 Verification Tag - * - * When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. - */ - if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) { + if (!sctp_vtag_verify(chunk, asoc)) { sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG, SCTP_NULL()); return sctp_sf_pdiscard(ep, asoc, type, arg, commands); @@ -3293,13 +3293,7 @@ __u16 len; __u32 tsn; - /* RFC 2960 8.5 Verification Tag - * - * When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. - */ - if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) { + if (!sctp_vtag_verify(chunk, asoc)) { sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG, SCTP_NULL()); return sctp_sf_pdiscard(ep, asoc, type, arg, commands); @@ -3376,13 +3370,7 @@ SCTP_DEBUG_PRINTK("Processing the unknown chunk id %d.\n", type.chunk); - /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure - * that the value in the Verification Tag field of the - * received SCTP packet matches its own Tag. If the received - * Verification Tag value does not match the receiver's own - * tag value, the receiver shall silently discard the packet. - */ - if (ntohl(unk_chunk->sctp_hdr->vtag) != asoc->c.my_vtag) + if (!sctp_vtag_verify(unk_chunk, asoc)) return sctp_sf_pdiscard(ep, asoc, type, arg, commands); switch (type.chunk & SCTP_CID_ACTION_MASK) { diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c --- a/net/sctp/socket.c Fri Jun 4 11:08:18 2004 +++ b/net/sctp/socket.c Fri Jun 4 11:08:18 2004 @@ -1164,6 +1164,11 @@ if (!asoc) { SCTP_DEBUG_PRINTK("There is no association yet.\n"); + if (sinfo_flags & (MSG_EOF | MSG_ABORT)) { + err = -EINVAL; + goto out_unlock; + } + /* Check for invalid stream against the stream counts, * either the default or the user specified stream counts. */ @@ -4388,7 +4393,11 @@ return err; do_error: - err = -ECONNREFUSED; + if (asoc->counters[SCTP_COUNTER_INIT_ERROR] + 1 >= + asoc->max_init_attempts) + err = -ETIMEDOUT; + else + err = -ECONNREFUSED; goto out; do_interrupted: From Gary.Spiess@Intermec.com Fri Jun 4 12:53:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 12:53:20 -0700 (PDT) Received: from cesium.norand.com (cesium.norand.com [136.179.160.16]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54JrGgi016728 for ; Fri, 4 Jun 2004 12:53:16 -0700 Received: from spiess2.norand.com (IDENT:0@spiess2.norand.com [136.179.85.112]) by cesium.norand.com (8.9.3 (PHNE_28809+JAGae91741)/8.9.3) with ESMTP id OAA00336; Fri, 4 Jun 2004 14:53:03 -0500 (CDT) Received: from SPIESS (spiess.norand.com [136.179.85.111]) by spiess2.norand.com (8.12.10/8.12.10) with ESMTP id i54MsFKJ023538; Fri, 4 Jun 2004 17:54:15 -0500 Message-ID: <200406041453030734.0BC334E5@136.179.85.112> In-Reply-To: <40B786A5.80506@colorfullife.com> References: <200405280142110234.0D95EB69@136.179.85.112> <40B786A5.80506@colorfullife.com> X-Mailer: Calypso Version 3.30.00.00 (4) Date: Fri, 04 Jun 2004 14:53:03 -0500 From: "Gary N Spiess" To: netdev@oss.sgi.com Cc: manfred@colorfullife.com Subject: [PATCH] natsemi update 2/4 Ethtool ioctl fixes & enhancements Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====_1086378783491=_" X-archive-position: 5611 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Gary.Spiess@Intermec.com Precedence: bulk X-list: netdev Content-Length: 9698 Lines: 172 --=====_1086378783491=_ Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Jeff, This is the second of a series of patches needed to support our product= using the DP83815. This patch fixes some of the ethtool ioctl support. It does a better job= of switching autonegotiation/speed/duplex parameters. It no longer= reports failure to complete negotiation when auto negotiation was= disabled. Attempts to return the MII registers from the MII interface,= rather than always using the internal registers. Formally set PORT_MII as= XCVR_EXTERNAL and PORT_TP as XCVR_INTERNAL. Gary oooooooooooooooooooooooooooooooooooooooooooooooooo Gary Spiess (Gary.Spiess@Intermec.com) MobileLan Wireless Products Group, Intermec Technology Corp voice: 319 369-3580 fax: 319 369-3804 --=====_1086378783491=_ Content-Type: application/octet-stream; name="natsemi-2.6.6-2.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="natsemi-2.6.6-2.patch" LS0tIGxpbnV4LTIuNi42L2RyaXZlcnMvbmV0L25hdHNlbWkuYwkyMDA0LTA2 LTAzIDE0OjIwOjI4LjAwMDAwMDAwMCAtMDUwMAorKysgbGludXgvZHJpdmVy cy9uZXQvbmF0c2VtaS5jCTIwMDQtMDYtMDMgMTQ6MjY6MzkuMDAwMDAwMDAw IC0wNTAwCkBAIC01OTksNyArNTk5LDcgQEAKIH07CiAKIGVudW0gUGh5Q3Ry bF9iaXRzIHsKLQlQaHlBZGRyTWFzawkJPSAweGYsCisJUGh5QWRkck1hc2sJ CT0gMHgxZiwKIH07CiAKIC8qIHZhbHVlcyB3ZSBtaWdodCBmaW5kIGluIHRo ZSBzaWxpY29uIHJldmlzaW9uIHJlZ2lzdGVyICovCkBAIC02NjIsNiArNjYy LDcgQEAKIAkvKiBEbyBub3QgdG91Y2ggdGhlIG5pYyByZWdpc3RlcnMgKi8K IAlpbnQgaGFuZHNfb2ZmOwogCS8qIFRoZXNlIHZhbHVlcyBhcmUga2VlcCB0 cmFjayBvZiB0aGUgdHJhbnNjZWl2ZXIvbWVkaWEgaW4gdXNlICovCisJaW50 IHBoeV9hZGRyX2V4dGVybmFsOwogCXVuc2lnbmVkIGludCBmdWxsX2R1cGxl eDsKIAkvKiBSeCBmaWx0ZXIgKi8KIAl1MzIgY3VyX3J4X21vZGU7CkBAIC0x MjQ5LDE1ICsxMjUwLDE3IEBACiAJbG9uZyBpb2FkZHIgPSBkZXYtPmJhc2Vf YWRkcjsKIAlpbnQgaTsKIAotCWZvciAoaT0wO2k8TkFUU0VNSV9IV19USU1F T1VUO2krKykgewotCQlpZiAocmVhZGwoZGV2LT5iYXNlX2FkZHIgKyBDaGlw Q29uZmlnKSAmIENmZ0FuZWdEb25lKQotCQkJYnJlYWs7Ci0JCXVkZWxheSgx MCk7Ci0JfQotCWlmIChpPT1OQVRTRU1JX0hXX1RJTUVPVVQgJiYgbmV0aWZf bXNnX2xpbmsobnApKSB7Ci0JCXByaW50ayhLRVJOX0lORk8KLQkJCSIlczog YXV0b25lZ290aWF0aW9uIGRpZCBub3QgY29tcGxldGUgaW4gJWQgdXNlYy5c biIsCi0JCQlkZXYtPm5hbWUsIGkqMTApOworCWlmIChtZGlvX3JlYWQoZGV2 LCAxLCBNSUlfQk1DUikgJiBCTUNSX0FORU5BQkxFKSB7CisJCWZvciAoaT0w O2k8TkFUU0VNSV9IV19USU1FT1VUO2krKykgeworCQkJaWYgKG1kaW9fcmVh ZChkZXYsIDEsIE1JSV9CTVNSKSAmIEJNU1JfQU5FR0NPTVBMRVRFKQorCQkJ CWJyZWFrOworCQkJdWRlbGF5KDEwKTsKKwkJfQorCQlpZiAoaT09TkFUU0VN SV9IV19USU1FT1VUICYmIG5ldGlmX21zZ19saW5rKG5wKSkgeworCQkJcHJp bnRrKEtFUk5fSU5GTworCQkJCSIlczogYXV0b25lZ290aWF0aW9uIGRpZCBu b3QgY29tcGxldGUgaW4gJWQgdXNlYy5cbiIsCisJCQkJZGV2LT5uYW1lLCBp KjEwKTsKKwkJfQogCX0KIAogCS8qIE9uIHBhZ2UgNzggb2YgdGhlIHNwZWMs IHRoZXkgcmVjb21tZW5kIHNvbWUgc2V0dGluZ3MgZm9yICJvcHRpbXVtCkBA IC0yMjcxLDYgKzIyNzQsNyBAQAogCiBzdGF0aWMgaW50IG5ldGRldl9nZXRf ZWNtZChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgZXRodG9vbF9j bWQgKmVjbWQpCiB7CisJc3RydWN0IG5ldGRldl9wcml2YXRlICpucCA9IGRl di0+cHJpdjsKIAl1MzIgdG1wOwogCiAJZWNtZC0+c3VwcG9ydGVkID0KQEAg LTIyNzgsMjAgKzIyODIsMjEgQEAKIAkJU1VQUE9SVEVEXzEwMGJhc2VUX0hh bGYgfCBTVVBQT1JURURfMTAwYmFzZVRfRnVsbCB8CiAJCVNVUFBPUlRFRF9B dXRvbmVnIHwgU1VQUE9SVEVEX1RQIHwgU1VQUE9SVEVEX01JSSk7CiAKLQkv KiBvbmx5IHN1cHBvcnRzIHR3aXN0ZWQtcGFpciBvciBNSUkgKi8KLQl0bXAg PSByZWFkbChkZXYtPmJhc2VfYWRkciArIENoaXBDb25maWcpOwotCWlmICh0 bXAgJiBDZmdFeHRQaHkpCi0JCWVjbWQtPnBvcnQgPSBQT1JUX01JSTsKLQll bHNlCi0JCWVjbWQtPnBvcnQgPSBQT1JUX1RQOwotCi0JLyogb25seSBzdXBw b3J0cyBpbnRlcm5hbCB0cmFuc2NlaXZlciAqLwotCWVjbWQtPnRyYW5zY2Vp dmVyID0gWENWUl9JTlRFUk5BTDsKLQotCS8qIG5vdCBzdXJlIHdoYXQgdGhp cyBpcyBmb3IgKi8KLQllY21kLT5waHlfYWRkcmVzcyA9IHJlYWR3KGRldi0+ YmFzZV9hZGRyICsgUGh5Q3RybCkgJiBQaHlBZGRyTWFzazsKKwkvKiBSZXR1 cm4gdGhlIHRyYW5zY2VpdmVyIHR5cGUgKi8KKwlzd2l0Y2ggKGRldi0+aWZf cG9ydCkgeworCWRlZmF1bHQ6CisJY2FzZSBQT1JUX1RQOgorCQllY21kLT5h ZHZlcnRpc2luZyA9IEFEVkVSVElTRURfVFA7CisJCWVjbWQtPnRyYW5zY2Vp dmVyID0gWENWUl9JTlRFUk5BTDsKKwkJYnJlYWs7CisJY2FzZSBQT1JUX01J SToKKwkJZWNtZC0+YWR2ZXJ0aXNpbmcgPSBBRFZFUlRJU0VEX01JSTsKKwkJ ZWNtZC0+dHJhbnNjZWl2ZXIgPSBYQ1ZSX0VYVEVSTkFMOworCQlicmVhazsK Kwl9CisJZWNtZC0+cG9ydCA9IGRldi0+aWZfcG9ydDsKKwllY21kLT5waHlf YWRkcmVzcyA9IG5wLT5waHlfYWRkcl9leHRlcm5hbDsKIAotCWVjbWQtPmFk dmVydGlzaW5nID0gQURWRVJUSVNFRF9UUCB8IEFEVkVSVElTRURfTUlJOwog CXRtcCA9IG1kaW9fcmVhZChkZXYsIDEsIE1JSV9BRFZFUlRJU0UpOwogCWlm ICh0bXAgJiBBRFZFUlRJU0VfMTBIQUxGKQogCQllY21kLT5hZHZlcnRpc2lu ZyB8PSBBRFZFUlRJU0VEXzEwYmFzZVRfSGFsZjsKQEAgLTIzMDYsMjEgKzIz MDksMjEgQEAKIAlpZiAodG1wICYgQk1DUl9BTkVOQUJMRSkgewogCQllY21k LT5hZHZlcnRpc2luZyB8PSBBRFZFUlRJU0VEX0F1dG9uZWc7CiAJCWVjbWQt PmF1dG9uZWcgPSBBVVRPTkVHX0VOQUJMRTsKKwkJCisJCXRtcCA9IG1paV9u d2F5X3Jlc3VsdCgKKwkJCW5wLT5hZHZlcnRpc2luZyAmIG1kaW9fcmVhZChk ZXYsIDEsIE1JSV9MUEEpKTsKKwkJaWYgKHRtcCA9PSBMUEFfMTAwRlVMTCB8 fCB0bXAgPT0gTFBBXzEwMEhBTEYpCisJCQllY21kLT5zcGVlZCAgPSBTUEVF RF8xMDA7CisJCWVsc2UKKwkJCWVjbWQtPnNwZWVkICA9IFNQRUVEXzEwOwor CQlpZiAodG1wID09IExQQV8xMDBGVUxMIHx8IHRtcCA9PSBMUEFfMTBGVUxM KQorCQkJZWNtZC0+ZHVwbGV4ID0gRFVQTEVYX0ZVTEw7CisJCWVsc2UKKwkJ CWVjbWQtPmR1cGxleCA9IERVUExFWF9IQUxGOwogCX0gZWxzZSB7CiAJCWVj bWQtPmF1dG9uZWcgPSBBVVRPTkVHX0RJU0FCTEU7Ci0JfQotCi0JdG1wID0g cmVhZGwoZGV2LT5iYXNlX2FkZHIgKyBDaGlwQ29uZmlnKTsKLQlpZiAodG1w ICYgQ2ZnU3BlZWQxMDApIHsKLQkJZWNtZC0+c3BlZWQgPSBTUEVFRF8xMDA7 Ci0JfSBlbHNlIHsKLQkJZWNtZC0+c3BlZWQgPSBTUEVFRF8xMDsKLQl9Ci0K LQlpZiAodG1wICYgQ2ZnRnVsbER1cGxleCkgewotCQllY21kLT5kdXBsZXgg PSBEVVBMRVhfRlVMTDsKLQl9IGVsc2UgewotCQllY21kLT5kdXBsZXggPSBE VVBMRVhfSEFMRjsKKwkJZWNtZC0+c3BlZWQgICA9ICh0bXAgJiBCTUNSX1NQ RUVEMTAwKSA/IFNQRUVEXzEwMCAgIDogU1BFRURfMTA7CisJCWVjbWQtPmR1 cGxleCAgPSAodG1wICYgQk1DUl9GVUxMRFBMWCkgPyBEVVBMRVhfRlVMTCA6 IERVUExFWF9IQUxGOwogCX0KIAogCS8qIGlnbm9yZSBtYXh0eHBrdCwgbWF4 cnhwa3QgZm9yIG5vdyAqLwpAQCAtMjMzNywyMSArMjM0MCw2NCBAQAogCQly ZXR1cm4gLUVJTlZBTDsKIAlpZiAoZWNtZC0+ZHVwbGV4ICE9IERVUExFWF9I QUxGICYmIGVjbWQtPmR1cGxleCAhPSBEVVBMRVhfRlVMTCkKIAkJcmV0dXJu IC1FSU5WQUw7Ci0JaWYgKGVjbWQtPnBvcnQgIT0gUE9SVF9UUCAmJiBlY21k LT5wb3J0ICE9IFBPUlRfTUlJKQorCXN3aXRjaCAoZWNtZC0+cG9ydCkgewor CWNhc2UgUE9SVF9UUDoKKwkJaWYgKGRldi0+aWZfcG9ydCAhPSBQT1JUX1RQ KQorCQkJZWNtZC0+dHJhbnNjZWl2ZXIgPSBYQ1ZSX0lOVEVSTkFMOworCQll bHNlIGlmIChlY21kLT50cmFuc2NlaXZlciA9PSBYQ1ZSX0VYVEVSTkFMKQor CQkJZWNtZC0+cG9ydCA9IFBPUlRfTUlJOworCQlicmVhazsKKwljYXNlIFBP UlRfTUlJOgorCQlpZiAoZGV2LT5pZl9wb3J0ID09IFBPUlRfVFApCisJCQll Y21kLT50cmFuc2NlaXZlciA9IFhDVlJfRVhURVJOQUw7CisJCWVsc2UgaWYg KGVjbWQtPnRyYW5zY2VpdmVyID09IFhDVlJfSU5URVJOQUwpCisJCQllY21k LT5wb3J0ID0gUE9SVF9UUDsKKwkJYnJlYWs7CisJZGVmYXVsdDoKIAkJcmV0 dXJuIC1FSU5WQUw7Ci0JaWYgKGVjbWQtPnRyYW5zY2VpdmVyICE9IFhDVlJf SU5URVJOQUwpCisJfQorCXRtcCA9IHJlYWRsKGRldi0+YmFzZV9hZGRyICsg Q2hpcENvbmZpZyk7CisJc3dpdGNoIChlY21kLT50cmFuc2NlaXZlcikgewor CWNhc2UgWENWUl9JTlRFUk5BTDoKKwkJdG1wICY9IH4oQ2ZnRXh0UGh5IHwg Q2ZnUGh5RGlzKTsKKwkJYnJlYWs7CisJY2FzZSBYQ1ZSX0VYVEVSTkFMOgor CQl0bXAgfD0gKENmZ0V4dFBoeSB8IENmZ1BoeURpcyk7CisJCWJyZWFrOwor CWRlZmF1bHQ6CiAJCXJldHVybiAtRUlOVkFMOworCX0KIAlpZiAoZWNtZC0+ YXV0b25lZyAhPSBBVVRPTkVHX0RJU0FCTEUgJiYgZWNtZC0+YXV0b25lZyAh PSBBVVRPTkVHX0VOQUJMRSkKIAkJcmV0dXJuIC1FSU5WQUw7Ci0JLyogaWdu b3JlIHBoeV9hZGRyZXNzLCBtYXh0eHBrdCwgbWF4cnhwa3QgZm9yIG5vdyAq LworCS8qIGlnbm9yZSBtYXh0eHBrdCwgbWF4cnhwa3QgZm9yIG5vdyAqLwog CiAJLyogV0hFVyEgbm93IGxldHMgYmFuZyBzb21lIGJpdHMgKi8KIAorCXdy aXRlbCh0bXAsIGRldi0+YmFzZV9hZGRyICsgQ2hpcENvbmZpZyk7CisJbnAt PnBoeV9hZGRyX2V4dGVybmFsID0gZWNtZC0+cGh5X2FkZHJlc3MgJiBQaHlB ZGRyTWFzazsKKwlkZXYtPmlmX3BvcnQgPSBlY21kLT5wb3J0OworCiAJdG1w ID0gbWRpb19yZWFkKGRldiwgMSwgTUlJX0JNQ1IpOwogCWlmIChlY21kLT5h dXRvbmVnID09IEFVVE9ORUdfRU5BQkxFKSB7Ci0JCS8qIHR1cm4gb24gYXV0 b25lZ290aWF0aW9uICovCi0JCXRtcCB8PSBCTUNSX0FORU5BQkxFOworCQkv KiB0dXJuIG9uIGF1dG9uZWdvdGlhdGlvbiwgYW5kIGZvcmNlIGEgcmVuZWdv dGlhdGUgKi8KKwkJdG1wIHw9IChCTUNSX0FORU5BQkxFIHwgQk1DUl9BTlJF U1RBUlQpOworCQlpZiAoKGVjbWQtPmFkdmVydGlzaW5nICYgKEFEVkVSVElT RURfMTBiYXNlVF9IYWxmIHwKKwkJCQkJICBBRFZFUlRJU0VEXzEwYmFzZVRf RnVsbCB8CisJCQkJCSAgQURWRVJUSVNFRF8xMDBiYXNlVF9IYWxmIHwKKwkJ CQkJICBBRFZFUlRJU0VEXzEwMGJhc2VUX0Z1bGwpKSA9PSAwKQorCQkJcmV0 dXJuIC1FSU5WQUw7CisJCS8qIGFkdmVydGlzZSBvbmx5IHdoYXQgaGFzIGJl ZW4gcmVxdWVzdGVkICovCiAJCW5wLT5hZHZlcnRpc2luZyA9IG1kaW9fcmVh ZChkZXYsIDEsIE1JSV9BRFZFUlRJU0UpOworCQlucC0+YWR2ZXJ0aXNpbmcg Jj0gfihBRFZFUlRJU0VfQUxMIHwgQURWRVJUSVNFXzEwMEJBU0U0KTsKKwkJ aWYgKGVjbWQtPmFkdmVydGlzaW5nICYgQURWRVJUSVNFRF8xMGJhc2VUX0hh bGYpCisJCQlucC0+YWR2ZXJ0aXNpbmcgfD0gQURWRVJUSVNFXzEwSEFMRjsK KwkJaWYgKGVjbWQtPmFkdmVydGlzaW5nICYgQURWRVJUSVNFRF8xMGJhc2VU X0Z1bGwpCisJCQlucC0+YWR2ZXJ0aXNpbmcgfD0gQURWRVJUSVNFXzEwRlVM TDsKKwkJaWYgKGVjbWQtPmFkdmVydGlzaW5nICYgQURWRVJUSVNFRF8xMDBi YXNlVF9IYWxmKQorCQkJbnAtPmFkdmVydGlzaW5nIHw9IEFEVkVSVElTRV8x MDBIQUxGOworCQlpZiAoZWNtZC0+YWR2ZXJ0aXNpbmcgJiBBRFZFUlRJU0VE XzEwMGJhc2VUX0Z1bGwpCisJCQlucC0+YWR2ZXJ0aXNpbmcgfD0gQURWRVJU SVNFXzEwMEZVTEw7CisJCW1kaW9fd3JpdGUoZGV2LCAxLCBNSUlfQURWRVJU SVNFLCBucC0+YWR2ZXJ0aXNpbmcpOwogCX0gZWxzZSB7CiAJCS8qIHR1cm4g b2ZmIGF1dG8gbmVnb3RpYXRpb24sIHNldCBzcGVlZCBhbmQgZHVwbGV4aXR5 ICovCiAJCXRtcCAmPSB+KEJNQ1JfQU5FTkFCTEUgfCBCTUNSX1NQRUVEMTAw IHwgQk1DUl9GVUxMRFBMWCk7CkBAIC0yMzczLDExICsyNDE4LDE1IEBACiAJ dTMyIHJmY3I7CiAJdTMyICpyYnVmID0gKHUzMiAqKWJ1ZjsKIAotCS8qIHJl YWQgYWxsIG9mIHBhZ2UgMCBvZiByZWdpc3RlcnMgKi8KLQlmb3IgKGkgPSAw OyBpIDwgTkFUU0VNSV9QRzBfTlJFR1M7IGkrKykgeworCS8qIHJlYWQgbm9u LW1paSBwYWdlIDAgb2YgcmVnaXN0ZXJzICovCisJZm9yIChpID0gMDsgaSA8 IE5BVFNFTUlfUEcwX05SRUdTLzI7IGkrKykgewogCQlyYnVmW2ldID0gcmVh ZGwoZGV2LT5iYXNlX2FkZHIgKyBpKjQpOwogCX0KIAorCS8qIHJlYWQgY3Vy cmVudCBtaWkgcmVnaXN0ZXJzICovCisJZm9yIChpID0gTkFUU0VNSV9QRzBf TlJFR1MvMjsgaSA8IE5BVFNFTUlfUEcwX05SRUdTOyBpKyspCisJCXJidWZb aV0gPSBtZGlvX3JlYWQoZGV2LCAxLCBpICYgMHgxZik7CisKIAkvKiByZWFk IG9ubHkgdGhlICdtYWdpYycgcmVnaXN0ZXJzIGZyb20gcGFnZSAxICovCiAJ d3JpdGV3KDEsIGRldi0+YmFzZV9hZGRyICsgUEdTRUwpOwogCXJidWZbaSsr XSA9IHJlYWR3KGRldi0+YmFzZV9hZGRyICsgUE1EQ1NSKTsK --=====_1086378783491=_-- From Gary.Spiess@Intermec.com Fri Jun 4 12:56:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 12:56:48 -0700 (PDT) Received: from cesium.norand.com (cesium.norand.com [136.179.160.16]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54Jujgi017083 for ; Fri, 4 Jun 2004 12:56:45 -0700 Received: from spiess2.norand.com (IDENT:0@spiess2.norand.com [136.179.85.112]) by cesium.norand.com (8.9.3 (PHNE_28809+JAGae91741)/8.9.3) with ESMTP id OAA00423; Fri, 4 Jun 2004 14:56:33 -0500 (CDT) Received: from SPIESS (spiess.norand.com [136.179.85.111]) by spiess2.norand.com (8.12.10/8.12.10) with ESMTP id i54MvuKJ023548; Fri, 4 Jun 2004 17:57:56 -0500 Message-ID: <200406041456330453.0BC6681C@136.179.85.112> X-Mailer: Calypso Version 3.30.00.00 (4) Date: Fri, 04 Jun 2004 14:56:33 -0500 From: "Gary N Spiess" To: netdev@oss.sgi.com Cc: manfred@colorfullife.com Subject: [PATCH] natsemi update 4/4 External Fibre phy Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====_10863789934827=_" X-archive-position: 5612 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Gary.Spiess@Intermec.com Precedence: bulk X-list: netdev Content-Length: 4160 Lines: 91 --=====_10863789934827=_ Content-Type: multipart/alternative; boundary="=====_10863789935436=_" --=====_10863789935436=_ Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Jeff, This is the fourth of a series of patches needed to support our product= using the DP83815. This patch adds support for our Fibre phy. Sorry, I don't know anything= about the phy hardware. I know the couple of phy bits that need to be= twiddled. Gary oooooooooooooooooooooooooooooooooooooooooooooooooo Gary Spiess (Gary.Spiess@Intermec.com) MobileLan Wireless Products Group, Intermec Technology Corp voice: 319 369-3580 fax: 319 369-3804 --=====_10863789935436=_ Content-Type: text/html; charset="us-ascii" Jeff,

This is the fourth of a series of patches needed to support our product using the DP83815.

This patch adds support for our Fibre phy.  Sorry, I don't know anything about the phy hardware.  I know the couple of phy bits that need to be twiddled.

Gary

 oooooooooooooooooooooooooooooooooooooooooooooooooo
 Gary Spiess (Gary.Spiess@Intermec.com)
 MobileLan Wireless Products Group, Intermec Technology Corp
 voice: 319 369-3580  fax: 319 369-3804
--=====_10863789935436=_-- --=====_10863789934827=_ Content-Type: application/octet-stream; name="natsemi-2.6.6-4.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="natsemi-2.6.6-4.patch" LS0tIGxpbnV4LTIuNi42L2RyaXZlcnMvbmV0L25hdHNlbWkuYwkyMDA0LTA2 LTAzIDE1OjEwOjAwLjAwMDAwMDAwMCAtMDUwMAorKysgbGludXgvZHJpdmVy cy9uZXQvbmF0c2VtaS5jCTIwMDQtMDYtMDMgMTU6MTA6MTYuMDAwMDAwMDAw IC0wNTAwCkBAIC0zNTEsNiArMzUxLDEwIEBACiBOb25lIGNoYXJhY3Rlcmlz ZWQuCiAqLwogCisvKiBhZGQgYSBjb3VwbGUgb2YgTUlJIGRlZmluaXRpb25z IHNwZWNpZmljIHRvIGEgUE9SVF9GSUJSRSBpbXBsZW1lbnRhdGlvbiAqLwor I2RlZmluZSBNSUlfTUNUUkwJMHgxNQkvKiBtb2RlIGNvbnRyb2wgcmVnaXN0 ZXIgKi8KKyNkZWZpbmUgTUlJX0lOX0ZYX01PREUJMHgwMDAxCS8qIGZ1bGwg ZHVwbGV4ICovCisjZGVmaW5lIE1JSV9ESVNfU0NSTQkweDAwMDQJLyogZGlz YWJsZSBzY3JhbWJsZXIgKi8KIAogCiBlbnVtIHBjaXN0dWZmIHsKQEAgLTI0 MDMsNyArMjQwNyw3IEBACiAJZWNtZC0+c3VwcG9ydGVkID0KIAkJKFNVUFBP UlRFRF8xMGJhc2VUX0hhbGYgfCBTVVBQT1JURURfMTBiYXNlVF9GdWxsIHwK IAkJU1VQUE9SVEVEXzEwMGJhc2VUX0hhbGYgfCBTVVBQT1JURURfMTAwYmFz ZVRfRnVsbCB8Ci0JCVNVUFBPUlRFRF9BdXRvbmVnIHwgU1VQUE9SVEVEX1RQ IHwgU1VQUE9SVEVEX01JSSk7CisJCVNVUFBPUlRFRF9BdXRvbmVnIHwgU1VQ UE9SVEVEX1RQIHwgU1VQUE9SVEVEX01JSSB8IFNVUFBPUlRFRF9GSUJSRSk7 CiAKIAkvKiBSZXR1cm4gdGhlIHRyYW5zY2VpdmVyIHR5cGUgKi8KIAllY21k LT5wb3J0ID0gZGV2LT5pZl9wb3J0OwpAQCAtMjQxNyw2ICsyNDIxLDEwIEBA CiAJCWVjbWQtPmFkdmVydGlzaW5nID0gQURWRVJUSVNFRF9NSUk7CiAJCWVj bWQtPnRyYW5zY2VpdmVyID0gWENWUl9FWFRFUk5BTDsKIAkJYnJlYWs7CisJ Y2FzZSBQT1JUX0ZJQlJFOgorCQllY21kLT5hZHZlcnRpc2luZyA9IEFEVkVS VElTRURfRklCUkU7CisJCWVjbWQtPnRyYW5zY2VpdmVyID0gWENWUl9FWFRF Uk5BTDsKKwkJYnJlYWs7CiAJfQogCWVjbWQtPnBvcnQgPSBkZXYtPmlmX3Bv cnQ7CiAJZWNtZC0+cGh5X2FkZHJlc3MgPSBucC0+cGh5X2FkZHJfZXh0ZXJu YWw7CkBAIC0yNDczLDYgKzI0ODEsNyBAQAogCQllbHNlIGlmIChlY21kLT50 cmFuc2NlaXZlciA9PSBYQ1ZSX0VYVEVSTkFMKQogCQkJZWNtZC0+cG9ydCA9 IFBPUlRfVFA7CiAJCWJyZWFrOworCWNhc2UgUE9SVF9GSUJSRToKIAljYXNl IFBPUlRfTUlJOgogCQlpZiAoZGV2LT5pZl9wb3J0ID09IFBPUlRfVFApCiAJ CQllY21kLT50cmFuc2NlaXZlciA9IFhDVlJfRVhURVJOQUw7CkBAIC0yNTAz LDYgKzI1MTIsMTUgQEAKIAlucC0+cGh5X2FkZHJfZXh0ZXJuYWwgPSBlY21k LT5waHlfYWRkcmVzcyAmIFBoeUFkZHJNYXNrOwogCWRldi0+aWZfcG9ydCA9 IGVjbWQtPnBvcnQ7CiAKKwkvKiBmaWJyZSBtb2RlPyAqLworCXRtcCA9IDA7 CisJaWYgKGRldi0+aWZfcG9ydCA9PSBQT1JUX0ZJQlJFKSB7CisJCXRtcCB8 PSBNSUlfRElTX1NDUk07CisJCWlmIChlY21kLT5kdXBsZXggPT0gRFVQTEVY X0ZVTEwpCisJCQl0bXAgfD0gTUlJX0lOX0ZYX01PREU7CisJfQorCW1kaW9f d3JpdGUoZGV2LCAxLCBNSUlfTUNUUkwsIHRtcCk7CisKIAl0bXAgPSBtZGlv X3JlYWQoZGV2LCAxLCBNSUlfQk1DUik7CiAJaWYgKGVjbWQtPmF1dG9uZWcg PT0gQVVUT05FR19FTkFCTEUpIHsKIAkJLyogdHVybiBvbiBhdXRvbmVnb3Rp YXRpb24sIGFuZCBmb3JjZSBhIHJlbmVnb3RpYXRlICovCg== --=====_10863789934827=_-- From davem@redhat.com Fri Jun 4 14:02:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 14:02:28 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54L2Pgi022219 for ; Fri, 4 Jun 2004 14:02:25 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i54L2Li5009011; Fri, 4 Jun 2004 17:02:21 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i54L2L031420; Fri, 4 Jun 2004 17:02:21 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i54L2A5j019723; Fri, 4 Jun 2004 17:02:11 -0400 Date: Fri, 4 Jun 2004 14:00:20 -0700 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: Broken? 2.6.6 + IP_ADD_SOURCE_MEMBERSHIP + SO_REUSEADDR Message-Id: <20040604140020.1f30bc7b.davem@redhat.com> In-Reply-To: <20040605.021411.55160771.yoshfuji@linux-ipv6.org> References: <20040604155423.GA5656@muffin> <20040605.015544.102223977.yoshfuji@linux-ipv6.org> <20040605.021411.55160771.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.11 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i54L2Pgi022219 X-archive-position: 5613 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: 11 On Sat, 05 Jun 2004 02:14:11 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > In article <20040605.015544.102223977.yoshfuji@linux-ipv6.org> (at Sat, 05 Jun 2004 01:55:44 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > > > The following patch should fix the issue. Please try. > > And, here's a variant for 2.4. Both patches applied, thanks. From davem@redhat.com Fri Jun 4 14:16:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 14:16:18 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54LG7gi022917 for ; Fri, 4 Jun 2004 14:16:07 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i54LFxi5011790; Fri, 4 Jun 2004 17:15:59 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i54LFx002366; Fri, 4 Jun 2004 17:15:59 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i54LFnBl024562; Fri, 4 Jun 2004 17:15:49 -0400 Date: Fri, 4 Jun 2004 14:13:59 -0700 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: Re: [BK PATCH] 2.6 and 2.4 SCTP updates. Message-Id: <20040604141359.19511d4a.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.11 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5614 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: 311 Lines: 9 On Fri, 4 Jun 2004 11:44:12 -0700 (PDT) Sridhar Samudrala wrote: > Please do a > bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work & > bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work > to get the following bugfix csets to 2.6 and 2.4 SCTP. Pulled, thanks Sridhar. From davem@redhat.com Fri Jun 4 14:31:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 14:31:43 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54LVdgi023523 for ; Fri, 4 Jun 2004 14:31:39 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i54LVTi5014583; Fri, 4 Jun 2004 17:31:29 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i54LVT005708; Fri, 4 Jun 2004 17:31:29 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i54LVInv029070; Fri, 4 Jun 2004 17:31:19 -0400 Date: Fri, 4 Jun 2004 14:29:28 -0700 From: "David S. Miller" To: "Wesley W. Terpstra" Cc: yoshfuji@linux-ipv6.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Broken? 2.6.6 + IP_ADD_SOURCE_MEMBERSHIP + SO_REUSEADDR Message-Id: <20040604142928.0d9045ce.davem@redhat.com> In-Reply-To: <20040604212916.GA6683@muffin> References: <20040604155423.GA5656@muffin> <20040605.015544.102223977.yoshfuji@linux-ipv6.org> <20040604212916.GA6683@muffin> X-Mailer: Sylpheed version 0.9.11 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5615 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: 200 Lines: 8 On Fri, 4 Jun 2004 23:29:16 +0200 "Wesley W. Terpstra" wrote: > I am amazed you fixed it so fast! > Will this make it into 2.6.7? Yes, and 2.4.27 hopefully as well. From shemminger@osdl.org Fri Jun 4 14:54:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 14:54:46 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54Lsdgi024237 for ; Fri, 4 Jun 2004 14:54:40 -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 i54LrXr21971; Fri, 4 Jun 2004 14:53:34 -0700 Date: Fri, 4 Jun 2004 14:53:33 -0700 From: Stephen Hemminger To: Jes Sorensen , Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] fix oops from acenic ethtool Message-Id: <20040604145333.34d1600f@dell_ss3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i386-redhat-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: 5616 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: 9150 Lines: 326 Fix the following OOPS that happens when doing ifup on FC-2 with 2.6.7 in acenic and a security hole due to missing capable(NET_ADMIN), by replacing private ethtool handling with ethtool_ops. (Yes, Jes because of DEV_ETHTOOL_OPS define it will still work on ancient kernels.) --------------------------------- # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/06/04 14:31:06-07:00 shemminger@osdl.org # Fix an OOPS and security hole by using ethtool_ops in acenic. # # drivers/net/acenic.h # 2004/06/04 14:30:56-07:00 shemminger@osdl.org +0 -1 # Fix an OOPS and security hole by using ethtool_ops in acenic. # # drivers/net/acenic.c # 2004/06/04 14:30:56-07:00 shemminger@osdl.org +127 -121 # Fix an OOPS and security hole by using ethtool_ops in acenic. # diff -Nru a/drivers/net/acenic.c b/drivers/net/acenic.c --- a/drivers/net/acenic.c 2004-06-04 14:31:46 -07:00 +++ b/drivers/net/acenic.c 2004-06-04 14:31:46 -07:00 @@ -443,6 +443,18 @@ "acenic.c: v0.92 08/05/2002 Jes Sorensen, linux-acenic@SunSITE.dk\n" " http://home.cern.ch/~jes/gige/acenic.html\n"; +#ifdef SET_ETHTOOL_OPS +static int ace_get_settings(struct net_device *, struct ethtool_cmd *); +static int ace_set_settings(struct net_device *, struct ethtool_cmd *); +static void ace_get_drvinfo(struct net_device *, struct ethtool_drvinfo *); + +static struct ethtool_ops ace_ethtool_ops = { + .get_settings = ace_get_settings, + .set_settings = ace_set_settings, + .get_drvinfo = ace_get_drvinfo, +}; +#endif + static int __devinit acenic_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) { @@ -480,7 +492,9 @@ dev->hard_start_xmit = &ace_start_xmit; dev->get_stats = &ace_get_stats; dev->set_multicast_list = &ace_set_multicast_list; - dev->do_ioctl = &ace_ioctl; +#ifdef SET_ETHTOOL_OPS + SET_ETHTOOL_OPS(dev, &ace_ethtool_ops); +#endif dev->set_mac_address = &ace_set_mac_addr; dev->change_mtu = &ace_change_mtu; @@ -2688,146 +2702,138 @@ return 0; } - -static int ace_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +#ifdef SET_ETHTOOL_OPS +static int ace_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) { struct ace_private *ap = dev->priv; struct ace_regs *regs = ap->regs; -#ifdef SIOCETHTOOL - struct ethtool_cmd ecmd; - u32 link, speed; + u32 link; - if (cmd != SIOCETHTOOL) - return -EOPNOTSUPP; - if (copy_from_user(&ecmd, ifr->ifr_data, sizeof(ecmd))) - return -EFAULT; - switch (ecmd.cmd) { - case ETHTOOL_GSET: - ecmd.supported = - (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | - SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | - SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full | - SUPPORTED_Autoneg | SUPPORTED_FIBRE); - - ecmd.port = PORT_FIBRE; - ecmd.transceiver = XCVR_INTERNAL; - ecmd.phy_address = 0; - - link = readl(®s->GigLnkState); - if (link & LNK_1000MB) - ecmd.speed = SPEED_1000; - else { - link = readl(®s->FastLnkState); - if (link & LNK_100MB) - ecmd.speed = SPEED_100; - else if (link & LNK_100MB) - ecmd.speed = SPEED_10; - else - ecmd.speed = 0; - } - if (link & LNK_FULL_DUPLEX) - ecmd.duplex = DUPLEX_FULL; + memset(ecmd, 0, sizeof(struct ethtool_cmd)); + ecmd->supported = + (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | + SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | + SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full | + SUPPORTED_Autoneg | SUPPORTED_FIBRE); + + ecmd->port = PORT_FIBRE; + ecmd->transceiver = XCVR_INTERNAL; + + link = readl(®s->GigLnkState); + if (link & LNK_1000MB) + ecmd->speed = SPEED_1000; + else { + link = readl(®s->FastLnkState); + if (link & LNK_100MB) + ecmd->speed = SPEED_100; + else if (link & LNK_100MB) + ecmd->speed = SPEED_10; else - ecmd.duplex = DUPLEX_HALF; + ecmd->speed = 0; + } + if (link & LNK_FULL_DUPLEX) + ecmd->duplex = DUPLEX_FULL; + else + ecmd->duplex = DUPLEX_HALF; - if (link & LNK_NEGOTIATE) - ecmd.autoneg = AUTONEG_ENABLE; - else - ecmd.autoneg = AUTONEG_DISABLE; + if (link & LNK_NEGOTIATE) + ecmd->autoneg = AUTONEG_ENABLE; + else + ecmd->autoneg = AUTONEG_DISABLE; #if 0 - /* - * Current struct ethtool_cmd is insufficient - */ - ecmd.trace = readl(®s->TuneTrace); + /* + * Current struct ethtool_cmd is insufficient + */ + ecmd->trace = readl(®s->TuneTrace); - ecmd.txcoal = readl(®s->TuneTxCoalTicks); - ecmd.rxcoal = readl(®s->TuneRxCoalTicks); + ecmd->txcoal = readl(®s->TuneTxCoalTicks); + ecmd->rxcoal = readl(®s->TuneRxCoalTicks); #endif - ecmd.maxtxpkt = readl(®s->TuneMaxTxDesc); - ecmd.maxrxpkt = readl(®s->TuneMaxRxDesc); + ecmd->maxtxpkt = readl(®s->TuneMaxTxDesc); + ecmd->maxrxpkt = readl(®s->TuneMaxRxDesc); - if(copy_to_user(ifr->ifr_data, &ecmd, sizeof(ecmd))) - return -EFAULT; - return 0; - - case ETHTOOL_SSET: - link = readl(®s->GigLnkState); - if (link & LNK_1000MB) - speed = SPEED_1000; - else { - link = readl(®s->FastLnkState); - if (link & LNK_100MB) - speed = SPEED_100; - else if (link & LNK_100MB) - speed = SPEED_10; - else - speed = SPEED_100; - } + return 0; +} - link = LNK_ENABLE | LNK_1000MB | LNK_100MB | LNK_10MB | - LNK_RX_FLOW_CTL_Y | LNK_NEG_FCTL; - if (!ACE_IS_TIGON_I(ap)) - link |= LNK_TX_FLOW_CTL_Y; - if (ecmd.autoneg == AUTONEG_ENABLE) - link |= LNK_NEGOTIATE; - if (ecmd.speed != speed) { - link &= ~(LNK_1000MB | LNK_100MB | LNK_10MB); - switch (speed) { - case SPEED_1000: - link |= LNK_1000MB; - break; - case SPEED_100: - link |= LNK_100MB; - break; - case SPEED_10: - link |= LNK_10MB; - break; - } +static int ace_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) +{ + struct ace_private *ap = dev->priv; + struct ace_regs *regs = ap->regs; + u32 link, speed; + + link = readl(®s->GigLnkState); + if (link & LNK_1000MB) + speed = SPEED_1000; + else { + link = readl(®s->FastLnkState); + if (link & LNK_100MB) + speed = SPEED_100; + else if (link & LNK_100MB) + speed = SPEED_10; + else + speed = SPEED_100; + } + + link = LNK_ENABLE | LNK_1000MB | LNK_100MB | LNK_10MB | + LNK_RX_FLOW_CTL_Y | LNK_NEG_FCTL; + if (!ACE_IS_TIGON_I(ap)) + link |= LNK_TX_FLOW_CTL_Y; + if (ecmd->autoneg == AUTONEG_ENABLE) + link |= LNK_NEGOTIATE; + if (ecmd->speed != speed) { + link &= ~(LNK_1000MB | LNK_100MB | LNK_10MB); + switch (speed) { + case SPEED_1000: + link |= LNK_1000MB; + break; + case SPEED_100: + link |= LNK_100MB; + break; + case SPEED_10: + link |= LNK_10MB; + break; } - if (ecmd.duplex == DUPLEX_FULL) - link |= LNK_FULL_DUPLEX; + } - if (link != ap->link) { - struct cmd cmd; - printk(KERN_INFO "%s: Renegotiating link state\n", - dev->name); + if (ecmd->duplex == DUPLEX_FULL) + link |= LNK_FULL_DUPLEX; - ap->link = link; - writel(link, ®s->TuneLink); - if (!ACE_IS_TIGON_I(ap)) - writel(link, ®s->TuneFastLink); - wmb(); + if (link != ap->link) { + struct cmd cmd; + printk(KERN_INFO "%s: Renegotiating link state\n", + dev->name); - cmd.evt = C_LNK_NEGOTIATION; - cmd.code = 0; - cmd.idx = 0; - ace_issue_cmd(regs, &cmd); - } - return 0; + ap->link = link; + writel(link, ®s->TuneLink); + if (!ACE_IS_TIGON_I(ap)) + writel(link, ®s->TuneFastLink); + wmb(); - case ETHTOOL_GDRVINFO: { - struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO}; - strncpy(info.driver, "acenic", sizeof(info.driver) - 1); - sprintf(info.fw_version, "%i.%i.%i", - tigonFwReleaseMajor, tigonFwReleaseMinor, - tigonFwReleaseFix); - strncpy(info.version, version, sizeof(info.version) - 1); - if (ap && ap->pdev) - strcpy(info.bus_info, pci_name(ap->pdev)); - if (copy_to_user(ifr->ifr_data, &info, sizeof(info))) - return -EFAULT; - return 0; - } - default: - break; + cmd.evt = C_LNK_NEGOTIATION; + cmd.code = 0; + cmd.idx = 0; + ace_issue_cmd(regs, &cmd); } - -#endif - - return -EOPNOTSUPP; + return 0; } +static void ace_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *info) +{ + struct ace_private *ap = dev->priv; + + strlcpy(info->driver, "acenic", sizeof(info->driver)); + snprintf(info->version, sizeof(info->version), "%i.%i.%i", + tigonFwReleaseMajor, tigonFwReleaseMinor, + tigonFwReleaseFix); + + if (ap->pdev) + strlcpy(info->bus_info, pci_name(ap->pdev), + sizeof(info->bus_info)); + +} +#endif /* * Set the hardware MAC address. diff -Nru a/drivers/net/acenic.h b/drivers/net/acenic.h --- a/drivers/net/acenic.h 2004-06-04 14:31:46 -07:00 +++ b/drivers/net/acenic.h 2004-06-04 14:31:46 -07:00 @@ -790,7 +790,6 @@ static void ace_dump_trace(struct ace_private *ap); static void ace_set_multicast_list(struct net_device *dev); static int ace_change_mtu(struct net_device *dev, int new_mtu); -static int ace_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); static int ace_set_mac_addr(struct net_device *dev, void *p); static void ace_set_rxtx_parms(struct net_device *dev, int jumbo); static int ace_allocate_descriptors(struct net_device *dev); From terpstra@dvs1.informatik.tu-darmstadt.de Fri Jun 4 14:58:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 14:58:16 -0700 (PDT) Received: from paris.dvs1.informatik.tu-darmstadt.de (paris.dvs1.informatik.tu-darmstadt.de [130.83.166.129]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54Lw0gi024593 for ; Fri, 4 Jun 2004 14:58:03 -0700 Received: by paris.dvs1.informatik.tu-darmstadt.de (Postfix, from userid 11060) id F27B58068D; Fri, 4 Jun 2004 23:29:14 +0200 (CEST) Date: Fri, 4 Jun 2004 23:29:16 +0200 From: "Wesley W. Terpstra" To: YOSHIFUJI Hideaki / =?utf-8?B?5ZCJ6Jek6Iux5piO?= Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, davem@redhat.com Subject: Re: Broken? 2.6.6 + IP_ADD_SOURCE_MEMBERSHIP + SO_REUSEADDR Message-ID: <20040604212916.GA6683@muffin> References: <20040604155423.GA5656@muffin> <20040605.015544.102223977.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20040605.015544.102223977.yoshfuji@linux-ipv6.org> User-Agent: Mutt/1.5.6i Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i54Lw0gi024593 X-archive-position: 5617 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: terpstra@gkec.tu-darmstadt.de Precedence: bulk X-list: netdev Content-Length: 1318 Lines: 36 On Sat, Jun 05, 2004 at 01:55:44AM +0900, YOSHIFUJI Hideaki / 吉藤英明 wrote: > In article <20040604155423.GA5656@muffin> (at Fri, 4 Jun 2004 17:54:23 +0200), "Wesley W. Terpstra" says: > > If I launch the same program twice with different senders, the first program > > ceases to receive multicast packets. (Neither from its own sender, nor the > > second program's sender) The second program receives packets from its > > designated sender only (as expected). > > > > If both programs specify the same sender, then both programs receive the > > message (as expected). > > Thanks for the report. > The following patch should fix the issue. Please try. > Thanks again. > > ===== net/ipv4/udp.c 1.60 vs edited ===== > --- 1.60/net/ipv4/udp.c 2004-05-31 03:57:26 +09:00 > +++ edited/net/ipv4/udp.c 2004-06-05 01:47:07 +09:00 > @@ -294,7 +294,7 @@ > ipv6_only_sock(s) || > (s->sk_bound_dev_if && s->sk_bound_dev_if != dif)) > continue; > - if (!ip_mc_sf_allow(sk, loc_addr, rmt_addr, dif)) > + if (!ip_mc_sf_allow(s, loc_addr, rmt_addr, dif)) > continue; > goto found; > } That works. I have confirmed that multiple senders for multiple processes is fixed. I am amazed you fixed it so fast! Will this make it into 2.6.7? -- Wesley W. Terpstra From shemminger@osdl.org Fri Jun 4 15:38:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 15:38:08 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54Mc2gi026245 for ; Fri, 4 Jun 2004 15:38:03 -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 i54Mbnr29586; Fri, 4 Jun 2004 15:37:49 -0700 Date: Fri, 4 Jun 2004 15:37:49 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] common code for generating tcp_info Message-Id: <20040604153749.5d8a13b9@dell_ss3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i386-redhat-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: 5618 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: 6129 Lines: 189 There are two places tcp_diag (netlink) and getsockopt, both with almost the same code to generate tcp_info from the current socket state. Patch agains 2.6.7-rc2 Signed-off-by: Stephen Hemminger diff -Nru a/net/ipv4/tcp.c b/net/ipv4/tcp.c --- a/net/ipv4/tcp.c 2004-06-04 15:35:55 -07:00 +++ b/net/ipv4/tcp.c 2004-06-04 15:35:55 -07:00 @@ -2498,56 +2498,11 @@ break; case TCP_INFO: { struct tcp_info info; - u32 now = tcp_time_stamp; if (get_user(len, optlen)) return -EFAULT; - info.tcpi_state = sk->sk_state; - info.tcpi_ca_state = tp->ca_state; - info.tcpi_retransmits = tp->retransmits; - info.tcpi_probes = tp->probes_out; - info.tcpi_backoff = tp->backoff; - info.tcpi_options = 0; - if (tp->tstamp_ok) - info.tcpi_options |= TCPI_OPT_TIMESTAMPS; - if (tp->sack_ok) - info.tcpi_options |= TCPI_OPT_SACK; - if (tp->wscale_ok) { - info.tcpi_options |= TCPI_OPT_WSCALE; - info.tcpi_snd_wscale = tp->snd_wscale; - info.tcpi_rcv_wscale = tp->rcv_wscale; - } else { - info.tcpi_snd_wscale = 0; - info.tcpi_rcv_wscale = 0; - } - if (tp->ecn_flags & TCP_ECN_OK) - info.tcpi_options |= TCPI_OPT_ECN; - info.tcpi_rto = (1000000 * tp->rto) / HZ; - info.tcpi_ato = (1000000 * tp->ack.ato) / HZ; - info.tcpi_snd_mss = tp->mss_cache_std; - info.tcpi_rcv_mss = tp->ack.rcv_mss; - - info.tcpi_unacked = tp->packets_out; - info.tcpi_sacked = tp->sacked_out; - info.tcpi_lost = tp->lost_out; - info.tcpi_retrans = tp->retrans_out; - info.tcpi_fackets = tp->fackets_out; - - info.tcpi_last_data_sent = ((now - tp->lsndtime) * 1000) / HZ; - info.tcpi_last_ack_sent = 0; - info.tcpi_last_data_recv = ((now - - tp->ack.lrcvtime) * 1000) / HZ; - info.tcpi_last_ack_recv = ((now - tp->rcv_tstamp) * 1000) / HZ; - - info.tcpi_pmtu = tp->pmtu_cookie; - info.tcpi_rcv_ssthresh = tp->rcv_ssthresh; - info.tcpi_rtt = ((1000000 * tp->srtt) / HZ) >> 3; - info.tcpi_rttvar = ((1000000 * tp->mdev) / HZ) >> 2; - info.tcpi_snd_ssthresh = tp->snd_ssthresh; - info.tcpi_snd_cwnd = tp->snd_cwnd; - info.tcpi_advmss = tp->advmss; - info.tcpi_reordering = tp->reordering; + tcp_get_info(sk, &info); len = min_t(unsigned int, len, sizeof(info)); if (put_user(len, optlen)) diff -Nru a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c --- a/net/ipv4/tcp_diag.c 2004-06-04 15:35:55 -07:00 +++ b/net/ipv4/tcp_diag.c 2004-06-04 15:35:55 -07:00 @@ -41,6 +41,58 @@ rta->rta_len = rtalen; \ RTA_DATA(rta); }) +/* Return information about state of tcp endpoint in API format. */ +void tcp_get_info(struct sock *sk, struct tcp_info *info) +{ + struct tcp_opt *tp = tcp_sk(sk); + u32 now = tcp_time_stamp; + + memset(info, 0, sizeof(*info)); + + info->tcpi_state = sk->sk_state; + info->tcpi_ca_state = tp->ca_state; + info->tcpi_retransmits = tp->retransmits; + info->tcpi_probes = tp->probes_out; + info->tcpi_backoff = tp->backoff; + + if (tp->tstamp_ok) + info->tcpi_options |= TCPI_OPT_TIMESTAMPS; + if (tp->sack_ok) + info->tcpi_options |= TCPI_OPT_SACK; + if (tp->wscale_ok) { + info->tcpi_options |= TCPI_OPT_WSCALE; + info->tcpi_snd_wscale = tp->snd_wscale; + info->tcpi_rcv_wscale = tp->rcv_wscale; + } + + if (tp->ecn_flags&TCP_ECN_OK) + info->tcpi_options |= TCPI_OPT_ECN; + + info->tcpi_rto = (1000000*tp->rto)/HZ; + info->tcpi_ato = (1000000*tp->ack.ato)/HZ; + info->tcpi_snd_mss = tp->mss_cache; + info->tcpi_rcv_mss = tp->ack.rcv_mss; + + info->tcpi_unacked = tp->packets_out; + info->tcpi_sacked = tp->sacked_out; + info->tcpi_lost = tp->lost_out; + info->tcpi_retrans = tp->retrans_out; + info->tcpi_fackets = tp->fackets_out; + + info->tcpi_last_data_sent = ((now - tp->lsndtime)*1000)/HZ; + info->tcpi_last_data_recv = ((now - tp->ack.lrcvtime)*1000)/HZ; + info->tcpi_last_ack_recv = ((now - tp->rcv_tstamp)*1000)/HZ; + + info->tcpi_pmtu = tp->pmtu_cookie; + info->tcpi_rcv_ssthresh = tp->rcv_ssthresh; + info->tcpi_rtt = ((1000000*tp->srtt)/HZ)>>3; + info->tcpi_rttvar = ((1000000*tp->mdev)/HZ)>>2; + info->tcpi_snd_ssthresh = tp->snd_ssthresh; + info->tcpi_snd_cwnd = tp->snd_cwnd; + info->tcpi_advmss = tp->advmss; + info->tcpi_reordering = tp->reordering; +} + static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk, int ext, u32 pid, u32 seq) { @@ -150,55 +202,8 @@ minfo->tcpdiag_tmem = atomic_read(&sk->sk_wmem_alloc); } - if (info) { - u32 now = tcp_time_stamp; - - info->tcpi_state = sk->sk_state; - info->tcpi_ca_state = tp->ca_state; - info->tcpi_retransmits = tp->retransmits; - info->tcpi_probes = tp->probes_out; - info->tcpi_backoff = tp->backoff; - info->tcpi_options = 0; - if (tp->tstamp_ok) - info->tcpi_options |= TCPI_OPT_TIMESTAMPS; - if (tp->sack_ok) - info->tcpi_options |= TCPI_OPT_SACK; - if (tp->wscale_ok) { - info->tcpi_options |= TCPI_OPT_WSCALE; - info->tcpi_snd_wscale = tp->snd_wscale; - info->tcpi_rcv_wscale = tp->rcv_wscale; - } else { - info->tcpi_snd_wscale = 0; - info->tcpi_rcv_wscale = 0; - } - if (tp->ecn_flags&TCP_ECN_OK) - info->tcpi_options |= TCPI_OPT_ECN; - - info->tcpi_rto = (1000000*tp->rto)/HZ; - info->tcpi_ato = (1000000*tp->ack.ato)/HZ; - info->tcpi_snd_mss = tp->mss_cache; - info->tcpi_rcv_mss = tp->ack.rcv_mss; - - info->tcpi_unacked = tp->packets_out; - info->tcpi_sacked = tp->sacked_out; - info->tcpi_lost = tp->lost_out; - info->tcpi_retrans = tp->retrans_out; - info->tcpi_fackets = tp->fackets_out; - - info->tcpi_last_data_sent = ((now - tp->lsndtime)*1000)/HZ; - info->tcpi_last_ack_sent = 0; - info->tcpi_last_data_recv = ((now - tp->ack.lrcvtime)*1000)/HZ; - info->tcpi_last_ack_recv = ((now - tp->rcv_tstamp)*1000)/HZ; - - info->tcpi_pmtu = tp->pmtu_cookie; - info->tcpi_rcv_ssthresh = tp->rcv_ssthresh; - info->tcpi_rtt = ((1000000*tp->srtt)/HZ)>>3; - info->tcpi_rttvar = ((1000000*tp->mdev)/HZ)>>2; - info->tcpi_snd_ssthresh = tp->snd_ssthresh; - info->tcpi_snd_cwnd = tp->snd_cwnd; - info->tcpi_advmss = tp->advmss; - info->tcpi_reordering = tp->reordering; - } + if (info) + tcp_get_info(sk, info); if (vinfo) { vinfo->tcpv_enabled = tp->vegas.doing_vegas_now; From jmorris@redhat.com Fri Jun 4 16:56:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 16:56:09 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i54Nu5gi031013 for ; Fri, 4 Jun 2004 16:56:06 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i54Ntwi5009536; Fri, 4 Jun 2004 19:55:58 -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 i54Ntw006229; Fri, 4 Jun 2004 19:55:58 -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 i54NtvZE012274; Fri, 4 Jun 2004 19:55:57 -0400 Date: Fri, 4 Jun 2004 19:55:57 -0400 (EDT) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: netfilter-devel@lists.netfilter.org cc: netdev@oss.sgi.com Subject: Developers please read: changes in Netfilter. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5619 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: 1088 Lines: 27 Netfilter developers should be aware of a changeset now merged into Linus' bk tree. A section of code in nf_hook_slow() which invalidates hardware checksums and recalculates them on output paths has been removed and pushed up to the Netfilter components which actually mangle packets (e.g. NAT). What this means is that any new code, or out of tree code (e.g. POM) needs to be reviewed to ensure that it handles hardware checksumming correctly itself, as the netfilter core code no longer does this. (Although note that NAT targets/helpers are covered automatically). Briefly, what needs to be done is: before mangling a packet in a way which might affect the TCP or UDP checksum, if the packet has hardware checksumming enabled, call skb_checksum_help(). For more details & code examples, refer to the changeset info: - James -- James Morris From davem@redhat.com Fri Jun 4 21:00:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 21:00:12 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55401gi006654 for ; Fri, 4 Jun 2004 21:00:02 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i553xui5019170; Fri, 4 Jun 2004 23:59:56 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i553xt015222; Fri, 4 Jun 2004 23:59:55 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i553xjo6017406; Fri, 4 Jun 2004 23:59:45 -0400 Date: Fri, 4 Jun 2004 20:57:49 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] common code for generating tcp_info Message-Id: <20040604205749.11725598.davem@redhat.com> In-Reply-To: <20040604153749.5d8a13b9@dell_ss3.pdx.osdl.net> References: <20040604153749.5d8a13b9@dell_ss3.pdx.osdl.net> X-Mailer: Sylpheed version 0.9.11 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5620 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 Fri, 4 Jun 2004 15:37:49 -0700 Stephen Hemminger wrote: > There are two places tcp_diag (netlink) and getsockopt, both with almost > the same code to generate tcp_info from the current socket state. Works for me, applied. Should maybe try to move that tcp_info off the stack at some point. From herbert@gondor.apana.org.au Fri Jun 4 22:29:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 04 Jun 2004 22:29:29 -0700 (PDT) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i555TBgi009059 for ; Fri, 4 Jun 2004 22:29:13 -0700 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1BWTie-0003ff-00; Sat, 05 Jun 2004 15:27:48 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1BWTiT-00078P-00; Sat, 05 Jun 2004 15:27:37 +1000 Date: Sat, 5 Jun 2004 15:27:37 +1000 To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: 4/x: [NETDRV] Merge register_netdev calls Message-ID: <20040605052737.GA27406@gondor.apana.org.au> References: <20040313025859.GA8186@gondor.apana.org.au> <405C294D.5040508@pobox.com> <20040520111937.GA21804@gondor.apana.org.au> <20040522074435.GA9628@gondor.apana.org.au> <20040529084109.GA13032@gondor.apana.org.au> <40BE3778.1020404@pobox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline In-Reply-To: <40BE3778.1020404@pobox.com> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Herbert Xu X-archive-position: 5621 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 25402 Lines: 1057 --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jun 02, 2004 at 04:24:24PM -0400, Jeff Garzik wrote: > > > >Here is the patch that adds register_ei_netdev which lets us get rid of > >some of the duplicated printk's in the 8390 drivers. > > Patch looks OK, but I would prefer to reject it, and merge it later when > an accompanying patch appears using this new function. Actually I've decided to scrap it in favour of a more generic ether_print_info() that can be used by all Ethernet drivers. So in its place I present the following patch that merges duplicate register_netdev calls by moving them to the probe function. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== drivers/net/3c503.c 1.20 vs edited ===== --- 1.20/drivers/net/3c503.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/3c503.c 2004-06-05 14:05:23 +10:00 @@ -162,12 +162,7 @@ err = do_el2_probe(dev); 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); @@ -343,6 +338,10 @@ dev->poll_controller = ei_poll; #endif + retval = register_netdev(dev); + if (retval) + goto out1; + if (dev->mem_start) printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n", dev->name, ei_status.name, (wordlength+1)<<3, @@ -702,11 +701,8 @@ dev->base_addr = io[this_dev]; dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */ if (do_el2_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_el2[found++] = dev; - continue; - } - cleanup_card(dev); + dev_el2[found++] = dev; + continue; } free_netdev(dev); printk(KERN_WARNING "3c503.c: No 3c503 card found (i/o = 0x%x).\n", io[this_dev]); ===== drivers/net/3c515.c 1.29 vs edited ===== --- 1.29/drivers/net/3c515.c 2004-03-30 20:17:59 +10:00 +++ edited/drivers/net/3c515.c 2004-06-05 15:16:01 +10:00 @@ -373,7 +373,7 @@ #endif /* __ISAPNP__ */ static struct net_device *corkscrew_scan(int unit); -static void corkscrew_setup(struct net_device *dev, int ioaddr, +static int corkscrew_setup(struct net_device *dev, int ioaddr, struct pnp_dev *idev, int card_number); static int corkscrew_open(struct net_device *dev); static void corkscrew_timer(unsigned long arg); @@ -537,10 +537,9 @@ printk(KERN_INFO "3c515 Resource configuration register %#4.4x, DCR %4.4x.\n", inl(ioaddr + 0x2002), inw(ioaddr + 0x2000)); /* irq = inw(ioaddr + 0x2002) & 15; */ /* Use the irq from isapnp */ - corkscrew_setup(dev, ioaddr, idev, cards_found++); SET_NETDEV_DEV(dev, &idev->dev); pnp_cards++; - err = register_netdev(dev); + err = corkscrew_setup(dev, ioaddr, idev, cards_found++); if (!err) return dev; cleanup_card(dev); @@ -556,8 +555,7 @@ printk(KERN_INFO "3c515 Resource configuration register %#4.4x, DCR %4.4x.\n", inl(ioaddr + 0x2002), inw(ioaddr + 0x2000)); - corkscrew_setup(dev, ioaddr, NULL, cards_found++); - err = register_netdev(dev); + err = corkscrew_setup(dev, ioaddr, NULL, cards_found++); if (!err) return dev; cleanup_card(dev); @@ -566,7 +564,7 @@ return NULL; } -static void corkscrew_setup(struct net_device *dev, int ioaddr, +static int corkscrew_setup(struct net_device *dev, int ioaddr, struct pnp_dev *idev, int card_number) { struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv; @@ -689,6 +687,8 @@ dev->get_stats = &corkscrew_get_stats; dev->set_multicast_list = &set_rx_mode; dev->ethtool_ops = &netdev_ethtool_ops; + + return register_netdev(dev); } ===== drivers/net/3c523.c 1.16 vs edited ===== --- 1.16/drivers/net/3c523.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/3c523.c 2004-06-05 14:12:44 +10:00 @@ -572,6 +572,10 @@ dev->flags&=~IFF_MULTICAST; /* Multicast doesn't work */ #endif + retval = register_netdev(dev); + if (retval) + goto err_out; + return 0; err_out: mca_set_adapter_procfn(slot, NULL, NULL); @@ -600,12 +604,7 @@ err = do_elmc_probe(dev); 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); @@ -1288,12 +1287,9 @@ dev->irq=irq[this_dev]; dev->base_addr=io[this_dev]; if (do_elmc_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_elmc[this_dev] = dev; - found++; - continue; - } - cleanup_card(dev); + dev_elmc[this_dev] = dev; + found++; + continue; } free_netdev(dev); if (io[this_dev]==0) ===== drivers/net/ac3200.c 1.19 vs edited ===== --- 1.19/drivers/net/ac3200.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/ac3200.c 2004-06-05 14:39:11 +10:00 @@ -147,12 +147,7 @@ err = do_ac3200_probe(dev); 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); @@ -284,7 +279,14 @@ dev->poll_controller = ei_poll; #endif NS8390_init(dev, 0); + + retval = register_netdev(dev); + if (retval) + goto out2; return 0; +out2: + if (ei_status.reg0) + iounmap((void *)dev->mem_start); out1: free_irq(dev->irq, dev); out: @@ -402,11 +404,8 @@ dev->base_addr = io[this_dev]; dev->mem_start = mem[this_dev]; /* Currently ignored by driver */ if (do_ac3200_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_ac32[found++] = dev; - continue; - } - cleanup_card(dev); + dev_ac32[found++] = dev; + continue; } free_netdev(dev); printk(KERN_WARNING "ac3200.c: No ac3200 card found (i/o = 0x%x).\n", io[this_dev]); ===== drivers/net/cs89x0.c 1.24 vs edited ===== --- 1.24/drivers/net/cs89x0.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/cs89x0.c 2004-06-05 14:20:36 +10:00 @@ -307,13 +307,7 @@ } if (err) goto out; - err = register_netdev(dev); - if (err) - goto out1; return dev; -out1: - outw(PP_ChipID, dev->base_addr + ADD_PORT); - release_region(dev->base_addr, NETCARD_IO_EXTENT); out: free_netdev(dev); printk(KERN_WARNING "cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP\n"); @@ -718,7 +712,13 @@ printk("\n"); if (net_debug) printk("cs89x0_probe1() successful\n"); + + retval = register_netdev(dev); + if (retval) + goto out3; return 0; +out3: + outw(PP_ChipID, dev->base_addr + ADD_PORT); out2: release_region(ioaddr & ~3, NETCARD_IO_EXTENT); out1: @@ -1806,13 +1806,6 @@ if (ret) goto out; - if (register_netdev(dev) != 0) { - printk(KERN_ERR "cs89x0.c: No card found at 0x%x\n", io); - ret = -ENXIO; - outw(PP_ChipID, dev->base_addr + ADD_PORT); - release_region(dev->base_addr, NETCARD_IO_EXTENT); - goto out; - } dev_cs89x0 = dev; return 0; out: ===== drivers/net/e2100.c 1.18 vs edited ===== --- 1.18/drivers/net/e2100.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/e2100.c 2004-06-05 14:23:56 +10:00 @@ -161,12 +161,7 @@ err = do_e2100_probe(dev); 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); @@ -278,6 +273,9 @@ #endif NS8390_init(dev, 0); + retval = register_netdev(dev); + if (retval) + goto out; return 0; out: release_region(ioaddr, E21_IO_EXTENT); @@ -445,11 +443,8 @@ dev->mem_start = mem[this_dev]; dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */ if (do_e2100_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_e21[found++] = dev; - continue; - } - cleanup_card(dev); + dev_e21[found++] = dev; + continue; } free_netdev(dev); printk(KERN_WARNING "e2100.c: No E2100 card found (i/o = 0x%x).\n", io[this_dev]); ===== drivers/net/eepro.c 1.25 vs edited ===== --- 1.25/drivers/net/eepro.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/eepro.c 2004-06-05 14:23:09 +10:00 @@ -596,12 +596,7 @@ err = do_eepro_probe(dev); if (err) goto out; - err = register_netdev(dev); - if (err) - goto out1; return dev; -out1: - release_region(dev->base_addr, EEPRO_IO_EXTENT); out: free_netdev(dev); return ERR_PTR(err); @@ -747,6 +742,7 @@ struct eepro_local *lp; enum iftype { AUI=0, BNC=1, TPE=2 }; int ioaddr = dev->base_addr; + int err; /* Grab the region so we can find another board if autoIRQ fails. */ if (!request_region(ioaddr, EEPRO_IO_EXTENT, DRV_NAME)) { @@ -856,10 +852,16 @@ /* reset 82595 */ eepro_reset(ioaddr); + + err = register_netdev(dev); + if (err) + goto err; return 0; exit: + err = -ENODEV; +err: release_region(dev->base_addr, EEPRO_IO_EXTENT); - return -ENODEV; + return err; } /* Open/initialize the board. This is called (in the current kernel) @@ -1756,11 +1758,8 @@ dev->irq = irq[i]; if (do_eepro_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_eepro[n_eepro++] = dev; - continue; - } - release_region(dev->base_addr, EEPRO_IO_EXTENT); + dev_eepro[n_eepro++] = dev; + continue; } free_netdev(dev); break; ===== drivers/net/eexpress.c 1.18 vs edited ===== --- 1.18/drivers/net/eexpress.c 2004-05-20 21:10:46 +10:00 +++ edited/drivers/net/eexpress.c 2004-06-05 14:27:54 +10:00 @@ -436,11 +436,8 @@ netdev_boot_setup_check(dev); err = do_express_probe(dev); - if (!err) { - err = register_netdev(dev); - if (!err) - return dev; - } + if (!err) + return dev; free_netdev(dev); return ERR_PTR(err); } @@ -1205,7 +1202,8 @@ dev->set_multicast_list = &eexp_set_multicast; dev->tx_timeout = eexp_timeout; dev->watchdog_timeo = 2*HZ; - return 0; + + return register_netdev(dev); } /* @@ -1716,7 +1714,7 @@ break; printk(KERN_NOTICE "eexpress.c: Module autoprobe not recommended, give io=xx.\n"); } - if (do_express_probe(dev) == 0 && register_netdev(dev) == 0) { + if (do_express_probe(dev) == 0) { dev_eexp[this_dev] = dev; found++; continue; ===== drivers/net/es3210.c 1.13 vs edited ===== --- 1.13/drivers/net/es3210.c 2004-05-20 21:10:46 +10:00 +++ edited/drivers/net/es3210.c 2004-06-05 14:27:31 +10:00 @@ -176,12 +176,7 @@ err = do_es_probe(dev); 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); @@ -304,6 +299,10 @@ dev->poll_controller = ei_poll; #endif NS8390_init(dev, 0); + + retval = register_netdev(dev); + if (retval) + goto out1; return 0; out1: free_irq(dev->irq, dev); @@ -439,11 +438,8 @@ dev->base_addr = io[this_dev]; dev->mem_start = mem[this_dev]; if (do_es_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_es3210[found++] = dev; - continue; - } - cleanup_card(dev); + dev_es3210[found++] = dev; + continue; } free_netdev(dev); printk(KERN_WARNING "es3210.c: No es3210 card found (i/o = 0x%x).\n", io[this_dev]); ===== drivers/net/eth16i.c 1.19 vs edited ===== --- 1.19/drivers/net/eth16i.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/eth16i.c 2004-06-05 14:28:57 +10:00 @@ -473,13 +473,7 @@ err = do_eth16i_probe(dev); 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, ETH16I_IO_EXTENT); out: free_netdev(dev); return ERR_PTR(err); @@ -569,7 +563,13 @@ dev->tx_timeout = eth16i_timeout; dev->watchdog_timeo = TX_TIMEOUT; spin_lock_init(&lp->lock); + + retval = register_netdev(dev); + if (retval) + goto out1; return 0; +out1: + free_irq(dev->irq, dev); out: release_region(ioaddr, ETH16I_IO_EXTENT); return retval; @@ -1462,12 +1462,8 @@ } if (do_eth16i_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_eth16i[found++] = dev; - continue; - } - free_irq(dev->irq, dev); - release_region(dev->base_addr, ETH16I_IO_EXTENT); + dev_eth16i[found++] = dev; + continue; } printk(KERN_WARNING "eth16i.c No Eth16i card found (i/o = 0x%x).\n", io[this_dev]); ===== drivers/net/hp-plus.c 1.16 vs edited ===== --- 1.16/drivers/net/hp-plus.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/hp-plus.c 2004-06-05 14:29:37 +10:00 @@ -159,12 +159,7 @@ err = do_hpp_probe(dev); 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); @@ -271,6 +266,9 @@ /* Leave the 8390 and HP chip reset. */ outw(inw(ioaddr + HPP_OPTION) & ~EnableIRQ, ioaddr + HPP_OPTION); + retval = register_netdev(dev); + if (retval) + goto out; return 0; out: release_region(ioaddr, HP_IO_EXTENT); @@ -463,11 +461,8 @@ dev->irq = irq[this_dev]; dev->base_addr = io[this_dev]; if (do_hpp_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_hpp[found++] = dev; - continue; - } - cleanup_card(dev); + dev_hpp[found++] = dev; + continue; } free_netdev(dev); printk(KERN_WARNING "hp-plus.c: No HP-Plus card found (i/o = 0x%x).\n", io[this_dev]); ===== drivers/net/hp.c 1.14 vs edited ===== --- 1.14/drivers/net/hp.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/hp.c 2004-06-05 14:41:28 +10:00 @@ -123,12 +123,7 @@ err = do_hp_probe(dev); 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); @@ -227,7 +222,12 @@ ei_status.block_output = &hp_block_output; hp_init_card(dev); + retval = register_netdev(dev); + if (retval) + goto out1; return 0; +out1: + free_irq(dev->irq, dev); out: release_region(ioaddr, HP_IO_EXTENT); return retval; @@ -432,11 +432,8 @@ dev->irq = irq[this_dev]; dev->base_addr = io[this_dev]; if (do_hp_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_hp[found++] = dev; - continue; - } - cleanup_card(dev); + dev_hp[found++] = dev; + continue; } free_netdev(dev); printk(KERN_WARNING "hp.c: No HP card found (i/o = 0x%x).\n", io[this_dev]); ===== drivers/net/hp100.c 1.28 vs edited ===== --- 1.28/drivers/net/hp100.c 2004-05-20 21:10:46 +10:00 +++ edited/drivers/net/hp100.c 2004-06-05 14:48:02 +10:00 @@ -411,12 +411,7 @@ if (err) goto out; - err = register_netdev(dev); - if (err) - goto out1; return dev; - out1: - release_region(dev->base_addr, HP100_REGION_SIZE); out: free_netdev(dev); return ERR_PTR(err); @@ -770,11 +765,22 @@ printk("Warning! Link down.\n"); } + err = register_netdev(dev); + if (err) + goto out3; + return 0; +out3: + if (local_mode == 1) + pci_free_consistent(lp->pci_dev, MAX_RINGSIZE + 0x0f, + lp->page_vaddr_algn, + virt_to_whatever(dev, lp->page_vaddr_algn)); + if (mem_ptr_virt) + iounmap(mem_ptr_virt); out2: release_region(ioaddr, HP100_REGION_SIZE); out1: - return -ENODEV; + return err; } /* This procedure puts the card into a stable init state */ @@ -2868,18 +2874,12 @@ if (err) goto out1; - err = register_netdev(dev); - if (err) - goto out2; - #ifdef HP100_DEBUG printk("hp100: %s: EISA adapter found at 0x%x\n", dev->name, dev->base_addr); #endif gendev->driver_data = dev; return 0; - out2: - release_region(dev->base_addr, HP100_REGION_SIZE); out1: free_netdev(dev); return err; @@ -2938,17 +2938,12 @@ err = hp100_probe1(dev, ioaddr, HP100_BUS_PCI, pdev); if (err) goto out1; - err = register_netdev(dev); - if (err) - goto out2; #ifdef HP100_DEBUG printk("hp100: %s: PCI adapter found at 0x%x\n", dev->name, ioaddr); #endif pci_set_drvdata(pdev, dev); return 0; - out2: - release_region(dev->base_addr, HP100_REGION_SIZE); out1: free_netdev(dev); return err; @@ -3016,15 +3011,9 @@ SET_MODULE_OWNER(dev); err = hp100_isa_probe(dev, hp100_port[i]); - if (!err) { - err = register_netdev(dev); - if (!err) - hp100_devlist[cards++] = dev; - else - release_region(dev->base_addr, HP100_REGION_SIZE); - } - - if (err) + if (!err) + hp100_devlist[cards++] = dev; + else free_netdev(dev); } ===== drivers/net/lance.c 1.22 vs edited ===== --- 1.22/drivers/net/lance.c 2004-05-20 21:10:47 +10:00 +++ edited/drivers/net/lance.c 2004-06-05 15:03:28 +10:00 @@ -355,11 +355,8 @@ dev->base_addr = io[this_dev]; dev->dma = dma[this_dev]; if (do_lance_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_lance[found++] = dev; - continue; - } - cleanup_card(dev); + dev_lance[found++] = dev; + continue; } free_netdev(dev); break; @@ -447,12 +444,7 @@ err = do_lance_probe(dev); 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); @@ -723,6 +715,9 @@ dev->tx_timeout = lance_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; + err = register_netdev(dev); + if (err) + goto out_dma; return 0; out_dma: if (dev->dma != 4) ===== drivers/net/ne-h8300.c 1.4 vs edited ===== --- 1.4/drivers/net/ne-h8300.c 2004-05-27 18:57:44 +10:00 +++ edited/drivers/net/ne-h8300.c 2004-06-05 15:05:17 +10:00 @@ -180,12 +180,7 @@ err = do_ne_probe(dev); 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); @@ -325,8 +320,13 @@ dev->poll_controller = ei_poll; #endif NS8390_init(dev, 0); - return 0; + ret = register_netdev(dev); + if (ret) + goto out_irq; + return 0; +out_irq: + free_irq(dev->irq, dev); err_out: release_region(ioaddr, NE_IO_EXTENT); return ret; @@ -633,11 +633,8 @@ err = init_reg_offset(dev, dev->base_addr); if (!err) { if (do_ne_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_ne[found++] = dev; - continue; - } - cleanup_card(dev); + dev_ne[found++] = dev; + continue; } } free_netdev(dev); ===== drivers/net/isa-skeleton.c 1.13 vs edited ===== --- 1.13/drivers/net/isa-skeleton.c 2004-05-20 21:10:47 +10:00 +++ edited/drivers/net/isa-skeleton.c 2004-06-05 14:36:42 +10:00 @@ -176,12 +176,7 @@ err = do_netcard_probe(dev); 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); @@ -316,7 +311,15 @@ dev->tx_timeout = &net_tx_timeout; dev->watchdog_timeo = MY_TX_TIMEOUT; + + err = register_netdev(dev); + if (err) + goto out2; return 0; +out2: +#ifdef jumpered_dma + free_dma(dev->dma); +#endif out1: #ifdef jumpered_interrupts free_irq(dev->irq, dev); @@ -691,11 +694,8 @@ dev->dma = dma; dev->mem_start = mem; if (do_netcard_probe(dev) == 0) { - if (register_netdev(dev) == 0) - this_device = dev; - return 0; - } - cleanup_card(dev); + this_device = dev; + return 0; } free_netdev(dev); return -ENXIO; ===== drivers/net/lne390.c 1.14 vs edited ===== --- 1.14/drivers/net/lne390.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/lne390.c 2004-06-05 15:03:09 +10:00 @@ -168,12 +168,7 @@ err = do_lne390_probe(dev); 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); @@ -307,7 +302,14 @@ dev->poll_controller = ei_poll; #endif NS8390_init(dev, 0); + + ret = register_netdev(dev); + if (ret) + goto unmap; return 0; +unmap: + if (ei_status.reg0) + iounmap((void *)dev->mem_start); cleanup: free_irq(dev->irq, dev); return ret; @@ -436,11 +438,8 @@ dev->base_addr = io[this_dev]; dev->mem_start = mem[this_dev]; if (do_lne390_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_lne[found++] = dev; - continue; - } - cleanup_card(dev); + dev_lne[found++] = dev; + continue; } free_netdev(dev); printk(KERN_WARNING "lne390.c: No LNE390 card found (i/o = 0x%x).\n", io[this_dev]); ===== drivers/net/ne.c 1.22 vs edited ===== --- 1.22/drivers/net/ne.c 2004-05-22 17:28:46 +10:00 +++ edited/drivers/net/ne.c 2004-06-05 15:06:46 +10:00 @@ -220,12 +220,7 @@ err = do_ne_probe(dev); 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); @@ -506,8 +501,14 @@ dev->poll_controller = ei_poll; #endif NS8390_init(dev, 0); + + ret = register_netdev(dev); + if (ret) + goto out_irq; return 0; +out_irq: + free_irq(dev->irq, dev); err_out: release_region(ioaddr, NE_IO_EXTENT); return ret; @@ -798,11 +799,8 @@ dev->mem_end = bad[this_dev]; dev->base_addr = io[this_dev]; if (do_ne_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_ne[found++] = dev; - continue; - } - cleanup_card(dev); + dev_ne[found++] = dev; + continue; } free_netdev(dev); if (found) ===== drivers/net/ne2.c 1.16 vs edited ===== --- 1.16/drivers/net/ne2.c 2004-05-22 17:28:46 +10:00 +++ edited/drivers/net/ne2.c 2004-06-05 15:08:21 +10:00 @@ -301,12 +301,7 @@ err = do_ne2_probe(dev); 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); @@ -517,7 +512,14 @@ dev->poll_controller = ei_poll; #endif NS8390_init(dev, 0); + + retval = register_netdev(dev); + if (retval) + goto out1; return 0; +out1: + mca_set_adapter_procfn( ei_status.priv, NULL, NULL); + free_irq(dev->irq, dev); out: release_region(base_addr, NE_IO_EXTENT); return retval; @@ -800,11 +802,8 @@ dev->mem_end = bad[this_dev]; dev->base_addr = io[this_dev]; if (do_ne2_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_ne[found++] = dev; - continue; - } - cleanup_card(dev); + dev_ne[found++] = dev; + continue; } free_netdev(dev); break; ===== drivers/net/ne2k_cbus.c 1.7 vs edited ===== --- 1.7/drivers/net/ne2k_cbus.c 2004-05-22 17:28:46 +10:00 +++ edited/drivers/net/ne2k_cbus.c 2004-06-05 15:09:51 +10:00 @@ -204,12 +204,7 @@ err = do_ne_probe(dev); 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); @@ -542,8 +537,14 @@ dev->poll_controller = ei_poll; #endif NS8390_init(dev, 0); + + ret = register_netdev(dev); + if (ret) + goto err_out_irq; return 0; +err_out_irq: + free_irq(dev->irq, dev); err_out_kfree: ne2k_cbus_destroy(dev); err_out: @@ -854,11 +855,8 @@ dev->base_addr = io[this_dev]; dev->mem_start = hwtype[this_dev]; if (do_ne_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_ne[found++] = dev; - continue; - } - cleanup_card(dev); + dev_ne[found++] = dev; + continue; } free_netdev(dev); if (found) ===== drivers/net/smc-ultra.c 1.22 vs edited ===== --- 1.22/drivers/net/smc-ultra.c 2004-05-22 17:28:46 +10:00 +++ edited/drivers/net/smc-ultra.c 2004-06-05 15:11:42 +10:00 @@ -195,12 +195,7 @@ err = do_ultra_probe(dev); 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); @@ -321,6 +316,9 @@ #endif NS8390_init(dev, 0); + retval = register_netdev(dev); + if (retval) + goto out; return 0; out: release_region(ioaddr, ULTRA_IO_EXTENT); @@ -579,11 +577,8 @@ dev->irq = irq[this_dev]; dev->base_addr = io[this_dev]; if (do_ultra_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_ultra[found++] = dev; - continue; - } - cleanup_card(dev); + dev_ultra[found++] = dev; + continue; } free_netdev(dev); printk(KERN_WARNING "smc-ultra.c: No SMC Ultra card found (i/o = 0x%x).\n", io[this_dev]); ===== drivers/net/wd.c 1.19 vs edited ===== --- 1.19/drivers/net/wd.c 2004-05-22 17:28:46 +10:00 +++ edited/drivers/net/wd.c 2004-06-05 15:14:05 +10:00 @@ -148,12 +148,7 @@ err = do_wd_probe(dev); 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); @@ -163,6 +158,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr) { int i; + int err; int checksum = 0; int ancient = 0; /* An old card without config registers. */ int word16 = 0; /* 0 = 8 bit, 1 = 16 bit */ @@ -349,7 +345,10 @@ outb(inb(ioaddr+4)|0x80, ioaddr+4); #endif - return 0; + err = register_netdev(dev); + if (err) + free_irq(dev->irq, dev); + return err; } static int @@ -519,11 +518,8 @@ dev->mem_start = mem[this_dev]; dev->mem_end = mem_end[this_dev]; if (do_wd_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_wd[found++] = dev; - continue; - } - cleanup_card(dev); + dev_wd[found++] = dev; + continue; } free_netdev(dev); printk(KERN_WARNING "wd.c: No wd80x3 card found (i/o = 0x%x).\n", io[this_dev]); --y0ulUmNC+osPPQO6-- From herbert@gondor.apana.org.au Sat Jun 5 00:56:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 00:56:58 -0700 (PDT) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i557uogi015168 for ; Sat, 5 Jun 2004 00:56:52 -0700 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1BWW1W-0004Fn-00; Sat, 05 Jun 2004 17:55:26 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1BWW1L-0007Tq-00; Sat, 05 Jun 2004 17:55:15 +1000 Date: Sat, 5 Jun 2004 17:55:15 +1000 To: Jeff Garzik , netdev@oss.sgi.com Subject: [NETDRV] Fix netdev leak on probe failure in 3c527 Message-ID: <20040605075515.GA28723@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i From: Herbert Xu X-archive-position: 5622 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 762 Lines: 33 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Jeff: This patch frees the netdev on failure in mc32_probe in 3c527. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== drivers/net/3c527.c 1.23 vs edited ===== --- 1.23/drivers/net/3c527.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/3c527.c 2004-06-05 17:51:23 +10:00 @@ -287,6 +287,7 @@ } } + free_netdev(dev); return ERR_PTR(-ENODEV); } --azLHFNyN32YCQGCU-- From rl@hellgate.ch Sat Jun 5 01:39:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 01:39:13 -0700 (PDT) Received: from mail3.bluewin.ch (mail3.bluewin.ch [195.186.1.75]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i558d5gi016126 for ; Sat, 5 Jun 2004 01:39:06 -0700 Received: from k3.hellgate.ch (83.77.24.119) by mail3.bluewin.ch (Bluewin AG 7.0.028) id 40A46963002627A2; Wed, 2 Jun 2004 11:58:50 +0000 Received: by k3.hellgate.ch (Postfix, from userid 1000) id 887F18CA75E; Wed, 2 Jun 2004 13:58:50 +0200 (CEST) Date: Wed, 2 Jun 2004 13:58:50 +0200 From: Roger Luethi To: Jeff Garzik , Andrew Morton Cc: netdev@oss.sgi.com Subject: [6/9][PATCH 2.6] Return codes for rhine_init_one Message-ID: <20040602115850.GA17556@k3.hellgate.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602115703.GA16079@k3.hellgate.ch> X-Operating-System: Linux 2.6.7-rc1 on i686 X-GPG-Fingerprint: 92 F4 DC 20 57 46 7B 95 24 4E 9E E7 5A 54 DC 1B X-GPG: 1024/80E744BD wwwkeys.ch.pgp.net User-Agent: Mutt/1.5.6i X-archive-position: 5623 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rl@hellgate.ch Precedence: bulk X-list: netdev Content-Length: 2660 Lines: 104 Use return codes in rhine_init_one instead of -ENODEV for all errors. Signed-off-by: Roger Luethi --- orig/drivers/net/via-rhine.c +++ mod/drivers/net/via-rhine.c @@ -616,7 +616,7 @@ { struct net_device *dev; struct rhine_private *rp; - int i, option; + int i, option, rc; int chip_id = (int) ent->driver_data; static int card_idx = -1; long ioaddr; @@ -638,11 +638,13 @@ option = card_idx < MAX_UNITS ? options[card_idx] : 0; io_size = rhine_chip_info[chip_id].io_size; - if (pci_enable_device(pdev)) + rc = pci_enable_device(pdev); + if (rc) goto err_out; /* this should always be supported */ - if (pci_set_dma_mask(pdev, 0xffffffff)) { + rc = pci_set_dma_mask(pdev, 0xffffffff); + if (rc) { printk(KERN_ERR "32-bit PCI DMA addresses not supported by " "the card!?\n"); goto err_out; @@ -651,6 +653,7 @@ /* sanity check */ if ((pci_resource_len(pdev, 0) < io_size) || (pci_resource_len(pdev, 1) < io_size)) { + rc = -EIO; printk(KERN_ERR "Insufficient PCI resources, aborting\n"); goto err_out; } @@ -662,6 +665,7 @@ dev = alloc_etherdev(sizeof(*rp)); if (dev == NULL) { + rc = -ENOMEM; printk(KERN_ERR "init_ethernet failed for card #%d\n", card_idx); goto err_out; @@ -669,7 +673,8 @@ SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - if (pci_request_regions(pdev, shortname)) + rc = pci_request_regions(pdev, shortname); + if (rc) goto err_out_free_netdev; #ifdef USE_MMIO @@ -678,6 +683,7 @@ ioaddr = (long) ioremap(memaddr, io_size); if (!ioaddr) { + rc = -EIO; printk(KERN_ERR "ioremap failed for device %s, region 0x%X " "@ 0x%lX\n", pci_name(pdev), io_size, memaddr); goto err_out_free_res; @@ -690,6 +696,7 @@ unsigned char a = inb(ioaddr0+reg); unsigned char b = readb(ioaddr+reg); if (a != b) { + rc = -EIO; printk(KERN_ERR "MMIO do not match PIO [%02x] " "(%02x != %02x)\n", reg, a, b); goto err_out_unmap; @@ -736,6 +743,7 @@ dev->dev_addr[i] = readb(ioaddr + StationAddr + i); if (!is_valid_ether_addr(dev->dev_addr)) { + rc = -EIO; printk(KERN_ERR "Invalid MAC address for card #%d\n", card_idx); goto err_out_unmap; } @@ -787,8 +795,8 @@ dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM; /* dev->name not defined before register_netdev()! */ - i = register_netdev(dev); - if (i) + rc = register_netdev(dev); + if (rc) goto err_out_unmap; /* The lower four bits are the media type. */ @@ -871,7 +879,7 @@ err_out_free_netdev: free_netdev(dev); err_out: - return -ENODEV; + return rc; } static int alloc_ring(struct net_device* dev) From herbert@gondor.apana.org.au Sat Jun 5 01:40:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 01:40:35 -0700 (PDT) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i558eLgi016265 for ; Sat, 5 Jun 2004 01:40:23 -0700 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1BWWhM-0004ZK-00; Sat, 05 Jun 2004 18:38:40 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1BWWhG-0007aN-00; Sat, 05 Jun 2004 18:38:34 +1000 Date: Sat, 5 Jun 2004 18:38:34 +1000 To: Jeff Garzik , netdev@oss.sgi.com Subject: [NETDRV] Fixed MCA resource bugs in at1700 Message-ID: <20040605083834.GA29142@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i From: Herbert Xu X-archive-position: 5624 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1543 Lines: 67 --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Jeff: This patch fixes an incorrect MCA check as well as a leak on probe failure in at1700. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== drivers/net/at1700.c 1.22 vs edited ===== --- 1.22/drivers/net/at1700.c 2004-05-22 17:28:45 +10:00 +++ edited/drivers/net/at1700.c 2004-06-05 18:34:29 +10:00 @@ -244,7 +244,7 @@ { #ifdef CONFIG_MCA struct net_local *lp = netdev_priv(dev); - if (lp->mca_slot) + if (lp->mca_slot >= 0) mca_mark_as_unused(lp->mca_slot); #endif free_irq(dev->irq, NULL); @@ -446,11 +446,11 @@ break; } if (i == 8) { - goto err_out; + goto err_mca; } } else { if (fmv18x_probe_list[inb(ioaddr + IOCONFIG) & 0x07] != ioaddr) - goto err_out; + goto err_mca; irq = fmv_irqmap[(inb(ioaddr + IOCONFIG)>>6) & 0x03]; } } @@ -548,11 +548,16 @@ if (ret) { printk (" AT1700 at %#3x is unusable due to a conflict on" "IRQ %d.\n", ioaddr, irq); - goto err_out; + goto err_mca; } return 0; +err_mca: +#ifdef CONFIG_MCA + if (slot >= 0) + mca_mark_as_unused(slot); +#endif err_out: #ifndef CONFIG_X86_PC9800 release_region(ioaddr, AT1700_IO_EXTENT); --a8Wt8u1KmwUX3Y2C-- From margitsw@t-online.de Sat Jun 5 03:51:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 03:51:18 -0700 (PDT) Received: from mailout08.sul.t-online.com (mailout08.sul.t-online.com [194.25.134.20]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55Ap9gi020691 for ; Sat, 5 Jun 2004 03:51:10 -0700 Received: from fwd04.aul.t-online.de by mailout08.sul.t-online.com with smtp id 1BWYlA-0002kp-00; Sat, 05 Jun 2004 12:50:44 +0200 Received: from roglap.local (GEB2BsZZ8esVZlZnMJFL3Dm-VwozaHuI8gZfunk5cyAV5FNrKuiXEK@[217.224.28.133]) by fwd04.sul.t-online.com with esmtp id 1BWYks-0F6aZs0; Sat, 5 Jun 2004 12:50:26 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 6/17 linux-2.6.7-rc2] prism54: Kernel compatibility (resend) Date: Sat, 5 Jun 2004 14:48:08 +0200 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Cc: netdev@oss.sgi.com Content-Type: Multipart/Mixed; boundary="Boundary-00=_IEcwA9i+0zpj2K4" Message-Id: <200406051448.08292.margitsw@t-online.de> X-Seen: false X-ID: GEB2BsZZ8esVZlZnMJFL3Dm-VwozaHuI8gZfunk5cyAV5FNrKuiXEK X-archive-position: 5625 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 18948 Lines: 608 --Boundary-00=_IEcwA9i+0zpj2K4 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 2004-03-20 Margit Schubert-While * isl_38xx.[ch], isl_ioctl.c, islpci_dev.[ch], islpci_eth.c islpci_hotplug.c, islpci_mgt.[ch], oid_mgt.c, prismcompat.h: Adopt new prism54 kernel compatibility. Remove remaining kernel version ifdefs. --Boundary-00=_IEcwA9i+0zpj2K4 Content-Type: text/x-diff; charset="us-ascii"; name="06-kernel-compatibility.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="06-kernel-compatibility.patch" diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/isl_38xx.c linux-2.6.6-01/drivers/net/wireless/prism54/isl_38xx.c --- linux-2.6.6ct/drivers/net/wireless/prism54/isl_38xx.c 2004-06-05 13:39:20.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/isl_38xx.c 2004-06-05 13:45:32.000000000 +0200 @@ -25,17 +25,11 @@ #include #include -#include "isl_38xx.h" -#include - #include #include -#include -#if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE) -#error No Firmware Loading configured in the kernel ! -#endif - +#include "prismcompat.h" +#include "isl_38xx.h" #include "islpci_dev.h" #include "islpci_mgt.h" @@ -236,130 +230,6 @@ } int -isl38xx_upload_firmware(char *fw_id, _REQ_FW_DEV_T dev, void *device_base, - dma_addr_t host_address) -{ - u32 reg, rc; - -#if VERBOSE > SHOW_ERROR_MESSAGES - DEBUG(SHOW_ERROR_MESSAGES, "isl38xx_upload_firmware(0x%lx, 0x%lx)\n", - (long) device_base, (long) host_address); -#endif - - /* clear the RAMBoot and the Reset bit */ - reg = readl(device_base + ISL38XX_CTRL_STAT_REG); - reg &= ~ISL38XX_CTRL_STAT_RESET; - reg &= ~ISL38XX_CTRL_STAT_RAMBOOT; - writel(reg, device_base + ISL38XX_CTRL_STAT_REG); - wmb(); - udelay(ISL38XX_WRITEIO_DELAY); - - /* set the Reset bit without reading the register ! */ - reg |= ISL38XX_CTRL_STAT_RESET; - writel(reg, device_base + ISL38XX_CTRL_STAT_REG); - wmb(); - udelay(ISL38XX_WRITEIO_DELAY); - - /* clear the Reset bit */ - reg &= ~ISL38XX_CTRL_STAT_RESET; - writel(reg, device_base + ISL38XX_CTRL_STAT_REG); - wmb(); - - /* wait a while for the device to reboot */ - mdelay(50); - - { - const struct firmware *fw_entry = 0; - long fw_len; - const u32 *fw_ptr; - - rc = request_firmware(&fw_entry, fw_id, dev); - if (rc) { - printk(KERN_ERR - "%s: request_firmware() failed for '%s'\n", - "prism54", fw_id); - return rc; - } - /* prepare the Direct Memory Base register */ - reg = ISL38XX_DEV_FIRMWARE_ADDRES; - - fw_ptr = (u32 *) fw_entry->data; - fw_len = fw_entry->size; - - if (fw_len % 4) { - printk(KERN_ERR - "%s: firmware '%s' size is not multiple of 32bit, aborting!\n", - "prism54", fw_id); - release_firmware(fw_entry); - return EILSEQ; /* Illegal byte sequence */; - } - - while (fw_len > 0) { - long _fw_len = - (fw_len > - ISL38XX_MEMORY_WINDOW_SIZE) ? - ISL38XX_MEMORY_WINDOW_SIZE : fw_len; - u32 *dev_fw_ptr = device_base + ISL38XX_DIRECT_MEM_WIN; - - /* set the cards base address for writting the data */ - isl38xx_w32_flush(device_base, reg, - ISL38XX_DIR_MEM_BASE_REG); - wmb(); /* be paranoid */ - - /* increment the write address for next iteration */ - reg += _fw_len; - fw_len -= _fw_len; - - /* write the data to the Direct Memory Window 32bit-wise */ - /* memcpy_toio() doesn't guarantee 32bit writes :-| */ - while (_fw_len > 0) { - /* use non-swapping writel() */ - __raw_writel(*fw_ptr, dev_fw_ptr); - fw_ptr++, dev_fw_ptr++; - _fw_len -= 4; - } - - /* flush PCI posting */ - (void) readl(device_base + ISL38XX_PCI_POSTING_FLUSH); - wmb(); /* be paranoid again */ - - BUG_ON(_fw_len != 0); - } - - BUG_ON(fw_len != 0); - - release_firmware(fw_entry); - } - - /* now reset the device - * clear the Reset & ClkRun bit, set the RAMBoot bit */ - reg = readl(device_base + ISL38XX_CTRL_STAT_REG); - reg &= ~ISL38XX_CTRL_STAT_CLKRUN; - reg &= ~ISL38XX_CTRL_STAT_RESET; - reg |= ISL38XX_CTRL_STAT_RAMBOOT; - isl38xx_w32_flush(device_base, reg, ISL38XX_CTRL_STAT_REG); - wmb(); - udelay(ISL38XX_WRITEIO_DELAY); - - /* set the reset bit latches the host override and RAMBoot bits - * into the device for operation when the reset bit is reset */ - reg |= ISL38XX_CTRL_STAT_RESET; - writel(reg, device_base + ISL38XX_CTRL_STAT_REG); - /* don't do flush PCI posting here! */ - wmb(); - udelay(ISL38XX_WRITEIO_DELAY); - - /* clear the reset bit should start the whole circus */ - reg &= ~ISL38XX_CTRL_STAT_RESET; - writel(reg, device_base + ISL38XX_CTRL_STAT_REG); - /* don't do flush PCI posting here! */ - wmb(); - udelay(ISL38XX_WRITEIO_DELAY); - - return 0; -} - -int isl38xx_in_queue(isl38xx_control_block *cb, int queue) { const s32 delta = (le32_to_cpu(cb->driver_curr_frag[queue]) - diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/isl_38xx.h linux-2.6.6-01/drivers/net/wireless/prism54/isl_38xx.h --- linux-2.6.6ct/drivers/net/wireless/prism54/isl_38xx.h 2004-06-05 13:39:20.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/isl_38xx.h 2004-06-05 13:45:32.000000000 +0200 @@ -22,14 +22,6 @@ #include #include - -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,75)) -#include -# define _REQ_FW_DEV_T struct device * -#else -# define _REQ_FW_DEV_T char * -#endif - #include #define ISL38XX_CB_RX_QSIZE 8 @@ -174,6 +166,4 @@ void isl38xx_trigger_device(int, void *); void isl38xx_interface_reset(void *, dma_addr_t); -int isl38xx_upload_firmware(char *, _REQ_FW_DEV_T, void *, dma_addr_t); - #endif /* _ISL_38XX_H */ diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c --- linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c 2004-06-05 13:39:34.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c 2004-06-05 13:44:14.000000000 +0200 @@ -25,10 +25,10 @@ #include #include #include -#include #include +#include "prismcompat.h" #include "isl_ioctl.h" #include "islpci_mgt.h" #include "isl_oid.h" /* additional types and defs for isl38xx fw */ diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.c 2004-06-05 13:39:34.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.c 2004-06-05 13:45:32.000000000 +0200 @@ -30,6 +30,7 @@ #include +#include "prismcompat.h" #include "isl_38xx.h" #include "isl_ioctl.h" #include "islpci_dev.h" @@ -37,12 +38,6 @@ #include "islpci_eth.h" #include "oid_mgt.h" -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0) -#define prism54_synchronize_irq(irq) synchronize_irq() -#else -#define prism54_synchronize_irq(irq) synchronize_irq(irq) -#endif - #define ISL3877_IMAGE_FILE "isl3877" #define ISL3890_IMAGE_FILE "isl3890" @@ -55,6 +50,125 @@ * ndev->set_mac_address. Jean II */ const unsigned char dummy_mac[6] = { 0x00, 0x30, 0xB4, 0x00, 0x00, 0x00 }; +static int +isl_upload_firmware(islpci_private *priv) +{ + u32 reg, rc; + void *device_base = priv->device_base; + + /* clear the RAMBoot and the Reset bit */ + reg = readl(device_base + ISL38XX_CTRL_STAT_REG); + reg &= ~ISL38XX_CTRL_STAT_RESET; + reg &= ~ISL38XX_CTRL_STAT_RAMBOOT; + writel(reg, device_base + ISL38XX_CTRL_STAT_REG); + wmb(); + udelay(ISL38XX_WRITEIO_DELAY); + + /* set the Reset bit without reading the register ! */ + reg |= ISL38XX_CTRL_STAT_RESET; + writel(reg, device_base + ISL38XX_CTRL_STAT_REG); + wmb(); + udelay(ISL38XX_WRITEIO_DELAY); + + /* clear the Reset bit */ + reg &= ~ISL38XX_CTRL_STAT_RESET; + writel(reg, device_base + ISL38XX_CTRL_STAT_REG); + wmb(); + + /* wait a while for the device to reboot */ + mdelay(50); + + { + const struct firmware *fw_entry = 0; + long fw_len; + const u32 *fw_ptr; + + rc = request_firmware(&fw_entry, priv->firmware, PRISM_FW_PDEV); + if (rc) { + printk(KERN_ERR + "%s: request_firmware() failed for '%s'\n", + "prism54", priv->firmware); + return rc; + } + /* prepare the Direct Memory Base register */ + reg = ISL38XX_DEV_FIRMWARE_ADDRES; + + fw_ptr = (u32 *) fw_entry->data; + fw_len = fw_entry->size; + + if (fw_len % 4) { + printk(KERN_ERR + "%s: firmware '%s' size is not multiple of 32bit, aborting!\n", + "prism54", priv->firmware); + release_firmware(fw_entry); + return EILSEQ; /* Illegal byte sequence */; + } + + while (fw_len > 0) { + long _fw_len = + (fw_len > + ISL38XX_MEMORY_WINDOW_SIZE) ? + ISL38XX_MEMORY_WINDOW_SIZE : fw_len; + u32 *dev_fw_ptr = device_base + ISL38XX_DIRECT_MEM_WIN; + + /* set the cards base address for writting the data */ + isl38xx_w32_flush(device_base, reg, + ISL38XX_DIR_MEM_BASE_REG); + wmb(); /* be paranoid */ + + /* increment the write address for next iteration */ + reg += _fw_len; + fw_len -= _fw_len; + + /* write the data to the Direct Memory Window 32bit-wise */ + /* memcpy_toio() doesn't guarantee 32bit writes :-| */ + while (_fw_len > 0) { + /* use non-swapping writel() */ + __raw_writel(*fw_ptr, dev_fw_ptr); + fw_ptr++, dev_fw_ptr++; + _fw_len -= 4; + } + + /* flush PCI posting */ + (void) readl(device_base + ISL38XX_PCI_POSTING_FLUSH); + wmb(); /* be paranoid again */ + + BUG_ON(_fw_len != 0); + } + + BUG_ON(fw_len != 0); + + release_firmware(fw_entry); + } + + /* now reset the device + * clear the Reset & ClkRun bit, set the RAMBoot bit */ + reg = readl(device_base + ISL38XX_CTRL_STAT_REG); + reg &= ~ISL38XX_CTRL_STAT_CLKRUN; + reg &= ~ISL38XX_CTRL_STAT_RESET; + reg |= ISL38XX_CTRL_STAT_RAMBOOT; + isl38xx_w32_flush(device_base, reg, ISL38XX_CTRL_STAT_REG); + wmb(); + udelay(ISL38XX_WRITEIO_DELAY); + + /* set the reset bit latches the host override and RAMBoot bits + * into the device for operation when the reset bit is reset */ + reg |= ISL38XX_CTRL_STAT_RESET; + writel(reg, device_base + ISL38XX_CTRL_STAT_REG); + /* don't do flush PCI posting here! */ + wmb(); + udelay(ISL38XX_WRITEIO_DELAY); + + /* clear the reset bit should start the whole circus */ + reg &= ~ISL38XX_CTRL_STAT_RESET; + writel(reg, device_base + ISL38XX_CTRL_STAT_REG); + /* don't do flush PCI posting here! */ + wmb(); + udelay(ISL38XX_WRITEIO_DELAY); + + return 0; +} + /****************************************************************************** Device Interrupt Handler ******************************************************************************/ @@ -324,14 +438,7 @@ printk(KERN_DEBUG "%s: uploading firmware...\n", priv->ndev->name); - rc = isl38xx_upload_firmware(priv->firmware, -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,75)) - &priv->pdev->dev, -#else - pci_name(priv->pdev), -#endif - priv->device_base, - priv->device_host_address); + rc = isl_upload_firmware(priv); if (rc) { /* error uploading the firmware */ printk(KERN_ERR "%s: could not upload firmware ('%s')\n", @@ -357,15 +464,8 @@ int result = -ETIME; int count; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - /* This is 2.6 specific, nicer, shorter, but not in 2.4 yet */ DEFINE_WAIT(wait); prepare_to_wait(&priv->reset_done, &wait, TASK_UNINTERRUPTIBLE); -#else - DECLARE_WAITQUEUE(wait, current); - set_current_state(TASK_UNINTERRUPTIBLE); - add_wait_queue(&priv->reset_done, &wait); -#endif /* now the last step is to reset the interface */ isl38xx_interface_reset(priv->device_base, priv->device_host_address); @@ -390,13 +490,7 @@ } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - /* 2.6 specific too */ finish_wait(&priv->reset_done, &wait); -#else - remove_wait_queue(&priv->reset_done, &wait); - set_current_state(TASK_RUNNING); -#endif if(result) return result; diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.h linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.h --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.h 2004-06-05 13:39:34.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.h 2004-06-05 13:44:14.000000000 +0200 @@ -29,20 +29,6 @@ #include #include -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) -# include -#else -# include -# define work_struct tq_struct -# define INIT_WORK INIT_TQUEUE -# define schedule_work schedule_task -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23) -#define free_netdev(x) kfree(x) -#define pci_name(x) x->slot_name -#endif - #include "isl_38xx.h" #include "isl_oid.h" #include "islpci_mgt.h" @@ -210,12 +196,6 @@ #define ISLPCI_TX_TIMEOUT (2*HZ) -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,75)) -# define irqreturn_t void -# define IRQ_HANDLED -# define IRQ_NONE -#endif - irqreturn_t islpci_interrupt(int, void *, struct pt_regs *); int prism54_post_setup(islpci_private *, int); diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c 2004-06-05 13:39:34.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c 2004-06-05 13:44:14.000000000 +0200 @@ -26,6 +26,7 @@ #include #include +#include "prismcompat.h" #include "isl_38xx.h" #include "islpci_eth.h" #include "islpci_mgt.h" diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_hotplug.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_hotplug.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_hotplug.c 2004-06-05 13:39:20.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_hotplug.c 2004-06-05 13:44:14.000000000 +0200 @@ -24,6 +24,7 @@ #include #include /* For __init, __exit */ +#include "prismcompat.h" #include "islpci_dev.h" #include "islpci_mgt.h" /* for pc_debug */ #include "isl_oid.h" diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.c 2004-06-05 13:39:20.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.c 2004-06-05 13:44:14.000000000 +0200 @@ -22,12 +22,12 @@ #include #include #include -#include #include #include #include +#include "prismcompat.h" #include "isl_38xx.h" #include "islpci_mgt.h" #include "isl_oid.h" /* additional types and defs for isl38xx fw */ @@ -456,21 +456,12 @@ const long wait_cycle_jiffies = (ISL38XX_WAIT_CYCLE * 10 * HZ) / 1000; long timeout_left = ISL38XX_MAX_WAIT_CYCLES * wait_cycle_jiffies; int err; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) DEFINE_WAIT(wait); -#else - DECLARE_WAITQUEUE(wait, current); -#endif if (down_interruptible(&priv->mgmt_sem)) return -ERESTARTSYS; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) prepare_to_wait(&priv->mgmt_wqueue, &wait, TASK_UNINTERRUPTIBLE); -#else - set_current_state(TASK_UNINTERRUPTIBLE); - add_wait_queue(&priv->mgmt_wqueue, &wait); -#endif err = islpci_mgt_transmit(ndev, operation, oid, senddata, sendlen); if(err) goto out; @@ -499,12 +490,7 @@ /* TODO: we should reset the device here */ out: -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) finish_wait(&priv->mgmt_wqueue, &wait); -#else - remove_wait_queue(&priv->mgmt_wqueue, &wait); - set_current_state(TASK_RUNNING); -#endif up(&priv->mgmt_sem); return err; } diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.h linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.h --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.h 2004-06-05 13:39:20.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.h 2004-06-05 13:44:14.000000000 +0200 @@ -24,15 +24,6 @@ #include #include -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) -# include -#else -# include -# define work_struct tq_struct -# define INIT_WORK INIT_TQUEUE -# define schedule_work schedule_task -#endif - /* * Function definitions */ diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.c linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.c --- linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.c 2004-06-05 13:39:34.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.c 2004-06-05 13:44:14.000000000 +0200 @@ -16,6 +16,7 @@ * */ +#include "prismcompat.h" #include "islpci_dev.h" #include "islpci_mgt.h" #include "isl_oid.h" diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/prismcompat.h linux-2.6.6-01/drivers/net/wireless/prism54/prismcompat.h --- linux-2.6.6ct/drivers/net/wireless/prism54/prismcompat.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.6-01/drivers/net/wireless/prism54/prismcompat.h 2004-06-05 13:45:32.000000000 +0200 @@ -0,0 +1,46 @@ +/* + * (C) 2004 Margit Schubert-While + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +/* + * Compatibility header file to aid support of different kernel versions + */ + +#ifdef PRISM54_COMPAT24 +#include "prismcompat24.h" +#else /* PRISM54_COMPAT24 */ + +#ifndef _PRISM_COMPAT_H +#define _PRISM_COMPAT_H + +#include +#include +#include +#include +#include +#include + +#if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE) +#error Firmware Loading is not configured in the kernel ! +#endif + +#define prism54_synchronize_irq(irq) synchronize_irq(irq) + +#define PRISM_FW_PDEV &priv->pdev->dev + +#endif /* _PRISM_COMPAT_H */ +#endif /* PRISM54_COMPAT24 */ --Boundary-00=_IEcwA9i+0zpj2K4-- From margitsw@t-online.de Sat Jun 5 03:51:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 03:51:57 -0700 (PDT) Received: from mailout06.sul.t-online.com (mailout06.sul.t-online.com [194.25.134.19]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55Apsgi020829 for ; Sat, 5 Jun 2004 03:51:55 -0700 Received: from fwd08.aul.t-online.de by mailout06.sul.t-online.com with smtp id 1BWYlg-0003d7-06; Sat, 05 Jun 2004 12:51:16 +0200 Received: from roglap.local (rXDLRcZVQeHIAw9Sf1PnNOPg6bobWHwtwBBoLg7n9goOfOqF+nQ-sO@[217.224.28.133]) by fwd08.sul.t-online.com with esmtp id 1BWYlX-0rq0ga0; Sat, 5 Jun 2004 12:51:07 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 7/17 linux-2.6.7-rc2] prism54: Fix endian patch (resend) Date: Sat, 5 Jun 2004 14:48:49 +0200 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Cc: netdev@oss.sgi.com Content-Type: Multipart/Mixed; boundary="Boundary-00=_xEcwAn8+ZGAgS1T" Message-Id: <200406051448.49243.margitsw@t-online.de> X-Seen: false X-ID: rXDLRcZVQeHIAw9Sf1PnNOPg6bobWHwtwBBoLg7n9goOfOqF+nQ-sO X-archive-position: 5626 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 2796 Lines: 73 --Boundary-00=_xEcwAn8+ZGAgS1T Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline * Split out patch islpci_eth.c : * Fix endian problem (bug 74/75 related) --Boundary-00=_xEcwAn8+ZGAgS1T Content-Type: text/x-diff; charset="us-ascii"; name="07-fix-endian.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="07-fix-endian.patch" diff -NaurEb linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c 2004-05-28 14:40:26.996454744 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c 2004-05-28 14:25:30.065808928 +0200 @@ -262,9 +262,9 @@ if (priv->ndev->type == ARPHRD_IEEE80211_PRISM) { struct avs_80211_1_header *avs; /* extract the relevant data from the header */ - u32 clock = hdr->clock; + u32 clock = le32_to_cpu(hdr->clock); u8 rate = hdr->rate; - u16 freq = be16_to_cpu(hdr->freq); + u16 freq = le16_to_cpu(hdr->freq); u8 rssi = hdr->rssi; skb_pull(*skb, sizeof (struct rfmon_header)); @@ -288,20 +288,20 @@ sizeof (struct avs_80211_1_header)); - avs->version = htonl(P80211CAPTURE_VERSION); - avs->length = htonl(sizeof (struct avs_80211_1_header)); - avs->mactime = __cpu_to_be64(clock); - avs->hosttime = __cpu_to_be64(jiffies); - avs->phytype = htonl(6); /*OFDM: 6 for (g), 8 for (a) */ - avs->channel = htonl(channel_of_freq(freq)); - avs->datarate = htonl(rate * 5); - avs->antenna = htonl(0); /*unknown */ - avs->priority = htonl(0); /*unknown */ - avs->ssi_type = htonl(2); /*2: dBm, 3: raw RSSI */ - avs->ssi_signal = htonl(rssi); - avs->ssi_noise = htonl(priv->local_iwstatistics.qual.noise); /*better than 'undefined', I assume */ - avs->preamble = htonl(0); /*unknown */ - avs->encoding = htonl(0); /*unknown */ + avs->version = cpu_to_be32(P80211CAPTURE_VERSION); + avs->length = cpu_to_be32(sizeof (struct avs_80211_1_header)); + avs->mactime = cpu_to_be64(le64_to_cpu(clock)); + avs->hosttime = cpu_to_be64(jiffies); + avs->phytype = cpu_to_be32(6); /*OFDM: 6 for (g), 8 for (a) */ + avs->channel = cpu_to_be32(channel_of_freq(freq)); + avs->datarate = cpu_to_be32(rate * 5); + avs->antenna = cpu_to_be32(0); /*unknown */ + avs->priority = cpu_to_be32(0); /*unknown */ + avs->ssi_type = cpu_to_be32(3); /*2: dBm, 3: raw RSSI */ + avs->ssi_signal = cpu_to_be32(rssi & 0x7f); + avs->ssi_noise = cpu_to_be32(priv->local_iwstatistics.qual.noise); /*better than 'undefined', I assume */ + avs->preamble = cpu_to_be32(0); /*unknown */ + avs->encoding = cpu_to_be32(0); /*unknown */ } else skb_pull(*skb, sizeof (struct rfmon_header)); --Boundary-00=_xEcwAn8+ZGAgS1T-- From margitsw@t-online.de Sat Jun 5 03:52:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 03:52:52 -0700 (PDT) Received: from mailout07.sul.t-online.com (mailout07.sul.t-online.com [194.25.134.83]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55Aqigi021173 for ; Sat, 5 Jun 2004 03:52:45 -0700 Received: from fwd05.aul.t-online.de by mailout07.sul.t-online.com with smtp id 1BWYmi-0001y6-05; Sat, 05 Jun 2004 12:52:20 +0200 Received: from roglap.local (G-LQeiZDQeeJpMWhQ+9AbO3aNyKCANWfOcS-C37MxmFoIX+-HtVDU3@[217.224.28.133]) by fwd05.sul.t-online.com with esmtp id 1BWYmb-1qOtW40; Sat, 5 Jun 2004 12:52:13 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 11/17 linux-2.6.7-rc2] prism54: Don't allow mib reads while unconfigured (resend) Date: Sat, 5 Jun 2004 14:49:55 +0200 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Cc: netdev@oss.sgi.com Content-Type: Multipart/Mixed; boundary="Boundary-00=_zFcwAfFmTGrEPSo" Message-Id: <200406051449.55893.margitsw@t-online.de> X-Seen: false X-ID: G-LQeiZDQeeJpMWhQ+9AbO3aNyKCANWfOcS-C37MxmFoIX+-HtVDU3 X-archive-position: 5627 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 10353 Lines: 312 --Boundary-00=_zFcwAfFmTGrEPSo Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 004-04-17 Aurelien Alleaume * oid_mgt.c, isl_ioctl.c : Cleanup. Prevented real oid reading before the card is configured with mib values (might be related to bug #53). --Boundary-00=_zFcwAfFmTGrEPSo Content-Type: text/x-diff; charset="us-ascii"; name="11-prevent-oid-read-before-config.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="11-prevent-oid-read-before-config.patch" diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c --- linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c 2004-06-05 14:02:14.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c 2004-06-05 14:03:15.000000000 +0200 @@ -173,14 +173,6 @@ prism54_mib_mode_helper(priv, init_mode); } -void -prism54_mib_init_work(islpci_private *priv) -{ - down_write(&priv->mib_sem); - mgt_commit(priv); - up_write(&priv->mib_sem); -} - /* this will be executed outside of atomic context thanks to * schedule_work(), thus we can as well use sleeping semaphore * locking */ @@ -195,13 +187,6 @@ if (down_interruptible(&priv->stats_sem)) return; -/* missing stats are : - * iwstatistics.qual.updated - * iwstatistics.discard.nwid - * iwstatistics.discard.fragment - * iwstatistics.discard.misc - * iwstatistics.miss.beacon */ - /* Noise floor. * I'm not sure if the unit is dBm. * Note : If we are not connected, this value seems to be irrelevant. */ @@ -425,7 +410,6 @@ /* by default the card sets this to 20. */ sens = vwrq->disabled ? 20 : vwrq->value; - /* set the ed threshold. */ return mgt_set_request(priv, DOT11_OID_EDTHRESHOLD, 0, &sens); } @@ -712,7 +696,7 @@ /* Ask the device for a list of known bss. We can report at most * IW_MAX_AP=64 to the range struct. But the device won't repport anything - * if you change the value of MAXBSS=24. Anyway 24 AP It is probably enough. + * if you change the value of IWMAX_BSS=24. */ rvalue |= mgt_get_request(priv, DOT11_OID_BSSLIST, 0, NULL, &r); bsslist = r.ptr; @@ -969,8 +953,6 @@ * small frame <=> smaller than the rts threshold * This is not really the behavior expected by the wireless tool but it seems * to be a common behavior in other drivers. - * - * It seems that playing with this tends to hang the card -> DISABLED */ static int @@ -1002,14 +984,13 @@ lifetime = vwrq->value / 1024; /* now set what is requested */ - - if (slimit != 0) + if (slimit) rvalue = mgt_set_request(priv, DOT11_OID_SHORTRETRIES, 0, &slimit); - if (llimit != 0) + if (llimit) rvalue |= mgt_set_request(priv, DOT11_OID_LONGRETRIES, 0, &llimit); - if (lifetime != 0) + if (lifetime) rvalue |= mgt_set_request(priv, DOT11_OID_MAXTXLIFETIME, 0, &lifetime); @@ -1261,11 +1242,6 @@ prism54_set_u32(struct net_device *ndev, struct iw_request_info *info, __u32 * uwrq, char *extra) { - /* - u32 *i = (int *) extra; - int param = *i; - int u = *(i + 1); - */ u32 oid = uwrq[0], u = uwrq[1]; return mgt_set_request((islpci_private *) ndev->priv, oid, 0, &u); @@ -1836,9 +1812,7 @@ 0); break; - /* Note : the following should never happen since we don't run the card in - * extended mode. - * Note : "mlme" is actually a "struct obj_mlmeex *" here, but this + /* Note : "mlme" is actually a "struct obj_mlmeex *" here, but this * is backward compatible layout-wise with "struct obj_mlme". */ diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.h linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.h --- linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.h 2004-06-05 13:39:20.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.h 2004-06-05 14:03:15.000000000 +0200 @@ -30,7 +30,6 @@ #define SUPPORTED_WIRELESS_EXT 16 void prism54_mib_init(islpci_private *); -void prism54_mib_init_work(islpci_private *); struct iw_statistics *prism54_get_wireless_stats(struct net_device *); void prism54_update_stats(islpci_private *); diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.c 2004-06-05 13:58:59.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.c 2004-06-05 14:03:15.000000000 +0200 @@ -504,7 +504,9 @@ * the IRQ line until we know for sure the reset went through */ isl38xx_enable_common_interrupts(priv->device_base); - prism54_mib_init_work(priv); + down_write(&priv->mib_sem); + mgt_commit(priv); + up_write(&priv->mib_sem); islpci_set_state(priv, PRV_STATE_READY); diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.c 2004-06-05 14:02:14.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.c 2004-06-05 14:03:15.000000000 +0200 @@ -312,8 +312,9 @@ * size of a receive buffer. Thus, if this check * triggers, we likely have kernel heap corruption. */ if (frag_len > MGMT_FRAME_SIZE) { - printk(KERN_WARNING "%s: Bogus packet size of %d (%#x).\ -n", ndev->name, frag_len, frag_len); + printk(KERN_WARNING + "%s: Bogus packet size of %d (%#x).\n", + ndev->name, frag_len, frag_len); frag_len = MGMT_FRAME_SIZE; } @@ -488,7 +489,8 @@ } if (timeleft == 0) { printk(KERN_DEBUG - "%s: timeout waiting for mgmt response %lu, trigging device\n", + "%s: timeout waiting for mgmt response %lu, " + "triggering device\n", ndev->name, timeout_left); islpci_trigger(priv); } diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.c linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.c --- linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.c 2004-06-05 14:02:14.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.c 2004-06-05 14:03:15.000000000 +0200 @@ -446,7 +446,7 @@ if (cache) down_write(&priv->mib_sem); - if (islpci_get_state(priv) >= PRV_STATE_INIT) { + if (islpci_get_state(priv) >= PRV_STATE_READY) { ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_SET, oid, _data, dlen, &response); if (!ret) { @@ -500,7 +500,7 @@ if (cache) down_read(&priv->mib_sem); - if (islpci_get_state(priv) >= PRV_STATE_INIT) { + if (islpci_get_state(priv) >= PRV_STATE_READY) { ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET, oid, data, dlen, &response); if (ret || !response || @@ -539,7 +539,7 @@ if (reslen > isl_oid[n].size) printk(KERN_DEBUG "mgt_get_request(0x%x): received data length was bigger " - "than expected (%d > %d). Memory is probably corrupted... ", + "than expected (%d > %d). Memory is probably corrupted...", oid, reslen, isl_oid[n].size); return ret; @@ -622,12 +622,32 @@ OID_INL_OUTPUTPOWER, }; +/* update the MAC addr. */ +static int +mgt_update_addr(islpci_private *priv) +{ + struct islpci_mgmtframe *res; + int ret; + + ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET, + isl_oid[GEN_OID_MACADDRESS].oid, NULL, + isl_oid[GEN_OID_MACADDRESS].size, &res); + + if ((ret == 0) && res && (res->header->operation != PIMFOR_OP_ERROR)) + memcpy(priv->ndev->dev_addr, res->data, 6); + else + ret = -EIO; + if (res) + islpci_mgt_release(res); + + return ret; +} + void mgt_commit(islpci_private *priv) { int rvalue; u32 u; - union oid_res_t r; if (islpci_get_state(priv) < PRV_STATE_INIT) return; @@ -643,6 +663,7 @@ u = OID_INL_MODE; rvalue |= mgt_commit_list(priv, &u, 1); + rvalue |= mgt_update_addr(priv); if (rvalue) { /* some request have failed. The device might be in an @@ -650,14 +671,6 @@ printk(KERN_DEBUG "%s: mgt_commit has failed. Restart the " "device \n", priv->ndev->name); } - - /* update the MAC addr. As it's not cached, no lock will be acquired by - * the mgt_get_request - */ - mgt_get_request(priv, GEN_OID_MACADDRESS, 0, NULL, &r); - memcpy(priv->ndev->dev_addr, r.ptr, 6); - kfree(r.ptr); - } /* This will tell you if you are allowed to answer a mlme(ex) request .*/ @@ -710,8 +723,11 @@ case OID_TYPE_BSS:{ struct obj_bss *bss = r->ptr; return snprintf(str, PRIV_STR_SIZE, - "age=%u\nchannel=%u\n\ - capinfo=0x%X\nrates=0x%X\nbasic_rates=0x%X\n", bss->age, bss->channel, bss->capinfo, bss->rates, bss->basic_rates); + "age=%u\nchannel=%u\n" + "capinfo=0x%X\nrates=0x%X\n" + "basic_rates=0x%X\n", bss->age, + bss->channel, bss->capinfo, + bss->rates, bss->basic_rates); } break; case OID_TYPE_BSSLIST:{ @@ -720,7 +736,9 @@ k = snprintf(str, PRIV_STR_SIZE, "nr=%u\n", list->nr); for (i = 0; i < list->nr; i++) k += snprintf(str + k, PRIV_STR_SIZE - k, - "bss[%u] : \nage=%u\nchannel=%u\ncapinfo=0x%X\nrates=0x%X\nbasic_rates=0x%X\n", + "bss[%u] : \nage=%u\nchannel=%u\n" + "capinfo=0x%X\nrates=0x%X\n" + "basic_rates=0x%X\n", i, list->bsslist[i].age, list->bsslist[i].channel, list->bsslist[i].capinfo, @@ -742,16 +760,17 @@ break; case OID_TYPE_MLME:{ struct obj_mlme *mlme = r->ptr; - return snprintf(str, PRIV_STR_SIZE, "id=0x%X\nstate=0x%X\n\ - code=0x%X\n", mlme->id, mlme->state, - mlme->code); + return snprintf(str, PRIV_STR_SIZE, + "id=0x%X\nstate=0x%X\ncode=0x%X\n", + mlme->id, mlme->state, mlme->code); } break; case OID_TYPE_MLMEEX:{ struct obj_mlmeex *mlme = r->ptr; - return snprintf(str, PRIV_STR_SIZE, "id=0x%X\nstate=0x%X\n\ - code=0x%X\nsize=0x%X\n", mlme->id, mlme->state, - mlme->code, mlme->size); + return snprintf(str, PRIV_STR_SIZE, + "id=0x%X\nstate=0x%X\n" + "code=0x%X\nsize=0x%X\n", mlme->id, + mlme->state, mlme->code, mlme->size); } break; case OID_TYPE_SSID:{ --Boundary-00=_zFcwAfFmTGrEPSo-- From margitsw@t-online.de Sat Jun 5 03:52:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 03:53:02 -0700 (PDT) Received: from mailout02.sul.t-online.com (mailout02.sul.t-online.com [194.25.134.17]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55Aqugi021304 for ; Sat, 5 Jun 2004 03:52:57 -0700 Received: from fwd10.aul.t-online.de by mailout02.sul.t-online.com with smtp id 1BWYnE-0002oZ-05; Sat, 05 Jun 2004 12:52:52 +0200 Received: from roglap.local (TbWRPcZGYeDHnrIMZ3QH5eB0Z50tnbV2SDXpYx5oWIuR3+GGD15ec5@[217.224.28.133]) by fwd10.sul.t-online.com with esmtp id 1BWYnA-0898qG0; Sat, 5 Jun 2004 12:52:48 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 13/17 linux-2.6.7-rc2] prism54: Align skb patch (resend) Date: Sat, 5 Jun 2004 14:50:30 +0200 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Cc: netdev@oss.sgi.com Content-Type: Multipart/Mixed; boundary="Boundary-00=_WGcwAoFrpsImxIG" Message-Id: <200406051450.30316.margitsw@t-online.de> X-Seen: false X-ID: TbWRPcZGYeDHnrIMZ3QH5eB0Z50tnbV2SDXpYx5oWIuR3+GGD15ec5 X-archive-position: 5628 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 1613 Lines: 45 --Boundary-00=_WGcwAoFrpsImxIG Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline * islpci_eth.c, islpci_dev.c : Align skb->data unconditonally after allocation. This would appear to improve RX rate --Boundary-00=_WGcwAoFrpsImxIG Content-Type: text/x-diff; charset="us-ascii"; name="13-align-skb.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="13-align-skb.patch" diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.c 2004-06-05 14:06:30.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.c 2004-06-05 14:09:41.000000000 +0200 @@ -676,6 +676,7 @@ skb = NULL; goto out_free; } + skb_reserve(skb, (4 - (long) skb->data) & 0x03); /* add the new allocated sk_buff to the buffer array */ priv->data_low_rx[counter] = skb; diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c 2004-06-05 14:09:07.000000000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c 2004-06-05 14:09:41.000000000 +0200 @@ -440,6 +440,7 @@ DEBUG(SHOW_ERROR_MESSAGES, "Error allocating skb \n"); break; } + skb_reserve(skb, (4 - (long) skb->data) & 0x03); /* store the new skb structure pointer */ index = index % ISL38XX_CB_RX_QSIZE; priv->data_low_rx[index] = skb; --Boundary-00=_WGcwAoFrpsImxIG-- From margitsw@t-online.de Sat Jun 5 03:53:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 03:53:43 -0700 (PDT) Received: from mailout03.sul.t-online.com (mailout03.sul.t-online.com [194.25.134.81]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55Ardgi021916 for ; Sat, 5 Jun 2004 03:53:40 -0700 Received: from fwd11.aul.t-online.de by mailout03.sul.t-online.com with smtp id 1BWYm1-0005ET-08; Sat, 05 Jun 2004 12:51:37 +0200 Received: from roglap.local (GW5i5cZE8eQ5SP3E3l8lEyws784hMXva7YOE3e+50o5Ii+mQtmO+YO@[217.224.28.133]) by fwd11.sul.t-online.com with esmtp id 1BWYls-1DYK8W0; Sat, 5 Jun 2004 12:51:28 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 8/17 linux-2.6.7-rc2] prism54: Fix bugs 74/75 (resend) Date: Sat, 5 Jun 2004 14:49:10 +0200 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Cc: netdev@oss.sgi.com Content-Type: Multipart/Mixed; boundary="Boundary-00=_GFcwAqf0vwOMgYR" Message-Id: <200406051449.10281.margitsw@t-online.de> X-Seen: false X-ID: GW5i5cZE8eQ5SP3E3l8lEyws784hMXva7YOE3e+50o5Ii+mQtmO+YO X-archive-position: 5629 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 1639 Lines: 54 --Boundary-00=_GFcwAqf0vwOMgYR Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 2004-03-22 Aurelien Alleaume * oid_mgt.c, isl_ioctl.c : Minor bugfixes : #74 and #75. --Boundary-00=_GFcwAqf0vwOMgYR Content-Type: text/x-diff; charset="us-ascii"; name="08-fix-bug-74-75.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="08-fix-bug-74-75.patch" diff -NaurEb linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c --- linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c 2004-05-28 14:40:26.990455656 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c 2004-05-28 14:43:00.926053888 +0200 @@ -1893,6 +1893,7 @@ struct net_device *ndev = frame->ndev; enum oid_num_t n = mgt_oidtonum(frame->header->oid); + if (n != OID_NUM_LAST) prism54_process_trap_helper(netdev_priv(ndev), n, frame->data); islpci_mgt_release(frame); } diff -NaurEb linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.c linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.c --- linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.c 2004-05-28 14:40:27.001453984 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.c 2004-05-28 14:43:00.929053432 +0200 @@ -688,13 +688,13 @@ { int i; - for (i = 0; i < OID_NUM_LAST - 1; i++) + for (i = 0; i < OID_NUM_LAST; i++) if (isl_oid[i].oid == oid) return i; printk(KERN_DEBUG "looking for an unknown oid 0x%x", oid); - return 0; + return OID_NUM_LAST; } int --Boundary-00=_GFcwAqf0vwOMgYR-- From margitsw@t-online.de Sat Jun 5 03:53:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 03:54:02 -0700 (PDT) Received: from mailout01.sul.t-online.com (mailout01.sul.t-online.com [194.25.134.80]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55Arvgi022067 for ; Sat, 5 Jun 2004 03:53:57 -0700 Received: from fwd04.aul.t-online.de by mailout01.sul.t-online.com with smtp id 1BWYno-0005Dk-00; Sat, 05 Jun 2004 12:53:28 +0200 Received: from roglap.local (XRnN-sZf8e6myqMlrYE1g-ZdM4pXAv6IyxXUp0aHEQ853KjQy6gew1@[217.224.28.133]) by fwd04.sul.t-online.com with esmtp id 1BWYnl-0vz7Pk0; Sat, 5 Jun 2004 12:53:25 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 15/17 linux-2.6.7-rc2] prism54: Fix channel stats, bump version to 1.2 (resend) Date: Sat, 5 Jun 2004 14:51:07 +0200 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Cc: netdev@oss.sgi.com Content-Type: Multipart/Mixed; boundary="Boundary-00=_7GcwAXNDN/WMQKP" Message-Id: <200406051451.07953.margitsw@t-online.de> X-Seen: false X-ID: XRnN-sZf8e6myqMlrYE1g-ZdM4pXAv6IyxXUp0aHEQ853KjQy6gew1 X-archive-position: 5630 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 2909 Lines: 84 --Boundary-00=_7GcwAXNDN/WMQKP Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 2004-05-20 Aurelien Alleaume * islpci_eth.c : use dev_kfree_skb_irq instead of dev_kfree_skb where needed. * isl_ioctl.c : report channel instead of frequency in scan. * islpci_hotplug.c : bump version to 1.2 --Boundary-00=_7GcwAXNDN/WMQKP Content-Type: text/x-diff; charset="us-ascii"; name="15-fix-channel.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="15-fix-channel.patch" diff -NaurEbB linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c --- linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c 2004-05-28 15:44:40.849580016 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c 2004-05-28 15:49:40.516023792 +0200 @@ -632,8 +629,8 @@ current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, NULL); /* Add frequency. (short) bss->channel is the frequency in MHz */ - iwe.u.freq.m = bss->channel; - iwe.u.freq.e = 6; + iwe.u.freq.m = channel_of_freq(bss->channel); + iwe.u.freq.e = 0; iwe.cmd = SIOCGIWFREQ; current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_FREQ_LEN); diff -NaurEbB linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c 2004-05-28 15:48:34.157111880 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c 2004-05-28 15:49:40.517023640 +0200 @@ -275,7 +275,7 @@ avs_80211_1_header), 0, GFP_ATOMIC); if (newskb) { - kfree_skb(*skb); + dev_kfree_skb_irq(*skb); *skb = newskb; } else return -1; @@ -419,7 +419,7 @@ skb->data[4], skb->data[5]); #endif if (unlikely(discard)) { - dev_kfree_skb(skb); + dev_kfree_skb_irq(skb); skb = NULL; } else netif_rx(skb); @@ -462,7 +462,7 @@ "Error mapping DMA address\n"); /* free the skbuf structure before aborting */ - dev_kfree_skb((struct sk_buff *) skb); + dev_kfree_skb_irq((struct sk_buff *) skb); skb = NULL; break; } diff -NaurEbB linux-2.6.6ct/drivers/net/wireless/prism54/islpci_hotplug.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_hotplug.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_hotplug.c 2004-05-28 14:40:26.997454592 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_hotplug.c 2004-05-28 15:49:40.519023336 +0200 @@ -30,7 +30,7 @@ #include "isl_oid.h" #define DRV_NAME "prism54" -#define DRV_VERSION "1.1" +#define DRV_VERSION "1.2" MODULE_AUTHOR("[Intersil] R.Bastings and W.Termorshuizen, The prism54.org Development Team "); MODULE_DESCRIPTION("The Prism54 802.11 Wireless LAN adapter"); --Boundary-00=_7GcwAXNDN/WMQKP-- From margitsw@t-online.de Sat Jun 5 03:54:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 03:54:04 -0700 (PDT) Received: from mailout11.sul.t-online.com (mailout11.sul.t-online.com [194.25.134.85]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55As0gi022101 for ; Sat, 5 Jun 2004 03:54:01 -0700 Received: from fwd02.aul.t-online.de by mailout11.sul.t-online.com with smtp id 1BWYn3-00031L-01; Sat, 05 Jun 2004 12:52:41 +0200 Received: from roglap.local (SrY4+YZf8e2cV4TAAKoGeQBFloXx1WUOkTZ3ijqJvXuC8JvEf+Ozrr@[217.224.28.133]) by fwd02.sul.t-online.com with esmtp id 1BWYmo-1ld0tM0; Sat, 5 Jun 2004 12:52:26 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 12/17 linux-2.6.7-rc2] prism54: Add likely/unlikely, KO wds completely (resend) Date: Sat, 5 Jun 2004 14:50:08 +0200 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Cc: netdev@oss.sgi.com Content-Type: Multipart/Mixed; boundary="Boundary-00=_AGcwArowYloYPgO" Message-Id: <200406051450.08650.margitsw@t-online.de> X-Seen: false X-ID: SrY4+YZf8e2cV4TAAKoGeQBFloXx1WUOkTZ3ijqJvXuC8JvEf+Ozrr X-archive-position: 5631 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 4148 Lines: 106 --Boundary-00=_AGcwArowYloYPgO Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline * islpci_mgt.h : Change init_wds definition * islpci_eth.c : Do some likely/unlikely --Boundary-00=_AGcwArowYloYPgO Content-Type: text/x-diff; charset="us-ascii"; name="12-add-likely.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="12-add-likely.patch" diff -NaurEbB linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c 2004-05-28 14:41:32.820447976 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c 2004-05-28 15:33:42.187711840 +0200 @@ -105,7 +105,7 @@ /* check whether the destination queue has enough fragments for the frame */ curr_frag = le32_to_cpu(cb->driver_curr_frag[ISL38XX_CB_TX_DATA_LQ]); - if (curr_frag - priv->free_data_tx >= ISL38XX_CB_TX_QSIZE) { + if (unlikely(curr_frag - priv->free_data_tx >= ISL38XX_CB_TX_QSIZE)) { printk(KERN_ERR "%s: transmit device queue full when awake\n", ndev->name); netif_stop_queue(ndev); @@ -121,7 +121,7 @@ /* Check alignment and WDS frame formatting. The start of the packet should * be aligned on a 4-byte boundary. If WDS is enabled add another 6 bytes * and add WDS address information */ - if (((long) skb->data & 0x03) | init_wds) { + if (unlikely(((long) skb->data & 0x03) | init_wds)) { /* get the number of bytes to add and re-allign */ offset = (4 - (long) skb->data) & 0x03; offset += init_wds ? 6 : 0; @@ -192,7 +192,7 @@ pci_map_address = pci_map_single(priv->pdev, (void *) skb->data, skb->len, PCI_DMA_TODEVICE); - if (pci_map_address == 0) { + if (unlikely(pci_map_address == 0)) { printk(KERN_WARNING "%s: cannot map buffer to PCI\n", ndev->name); @@ -382,10 +382,10 @@ skb->dev = ndev; /* take care of monitor mode and spy monitoring. */ - if (priv->iw_mode == IW_MODE_MONITOR) + if (unlikely(priv->iw_mode == IW_MODE_MONITOR)) discard = islpci_monitor_rx(priv, &skb); else { - if (skb->data[2 * ETH_ALEN] == 0) { + if (unlikely(skb->data[2 * ETH_ALEN] == 0)) { /* The packet has a rx_annex. Read it for spy monitoring, Then * remove it, while keeping the 2 leading MAC addr. */ @@ -418,7 +418,7 @@ skb->data[0], skb->data[1], skb->data[2], skb->data[3], skb->data[4], skb->data[5]); #endif - if (discard) { + if (unlikely(discard)) { dev_kfree_skb(skb); skb = NULL; } else @@ -434,7 +434,8 @@ index - priv->free_data_rx < ISL38XX_CB_RX_QSIZE) { /* allocate an sk_buff for received data frames storage * include any required allignment operations */ - if (skb = dev_alloc_skb(MAX_FRAGMENT_SIZE_RX + 2), skb == NULL) { + skb = dev_alloc_skb(MAX_FRAGMENT_SIZE_RX + 2); + if (unlikely(skb == NULL)) { /* error allocating an sk_buff structure elements */ DEBUG(SHOW_ERROR_MESSAGES, "Error allocating skb \n"); break; @@ -454,7 +455,7 @@ pci_map_single(priv->pdev, (void *) skb->data, MAX_FRAGMENT_SIZE_RX + 2, PCI_DMA_FROMDEVICE); - if (priv->pci_map_rx_address[index] == (dma_addr_t) NULL) { + if (unlikely(priv->pci_map_rx_address[index] == (dma_addr_t) NULL)) { /* error mapping the buffer to device accessable memory address */ DEBUG(SHOW_ERROR_MESSAGES, "Error mapping DMA address\n"); diff -NaurEbB linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.h linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.h --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.h 2004-05-28 14:40:27.000454136 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.h 2004-05-28 15:33:42.188711688 +0200 @@ -34,7 +34,7 @@ #define TRACE(devname) K_DEBUG(SHOW_TRACING, VERBOSE, "%s: -> " __FUNCTION__ "()\n", devname) extern int pc_debug; -static const int init_wds = 0; /* help compiler optimize away dead code */ +const int init_wds = 0; /* help compiler optimize away dead code */ /* General driver definitions */ --Boundary-00=_AGcwArowYloYPgO-- From margitsw@t-online.de Sat Jun 5 03:54:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 03:54:19 -0700 (PDT) Received: from mailout02.sul.t-online.com (mailout02.sul.t-online.com [194.25.134.17]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55As7gi022233 for ; Sat, 5 Jun 2004 03:54:08 -0700 Received: from fwd03.aul.t-online.de by mailout02.sul.t-online.com with smtp id 1BWYoO-00084d-03; Sat, 05 Jun 2004 12:54:04 +0200 Received: from roglap.local (ThyW5cZBYe4xnhtK+3vFhKP33xgYXDnNkYa6s8v6l6QBeixv-7FGrN@[217.224.28.133]) by fwd03.sul.t-online.com with esmtp id 1BWYoB-1Q9H280; Sat, 5 Jun 2004 12:53:51 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 17/17 linux-2.6.7-rc2] prism54: White space and indentation (resend) Date: Sat, 5 Jun 2004 14:51:34 +0200 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Cc: netdev@oss.sgi.com Content-Type: Multipart/Mixed; boundary="Boundary-00=_WHcwAw8pWE41qOR" Message-Id: <200406051451.34065.margitsw@t-online.de> X-Seen: false X-ID: ThyW5cZBYe4xnhtK+3vFhKP33xgYXDnNkYa6s8v6l6QBeixv-7FGrN X-archive-position: 5632 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 18402 Lines: 624 --Boundary-00=_WHcwAw8pWE41qOR Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 2004-05-29 Margit Schubert-While * White space and indentation patch --Boundary-00=_WHcwAw8pWE41qOR Content-Type: text/x-diff; charset="us-ascii"; name="17-white-space-indent.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="17-white-space-indent.patch" diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c --- linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c 2004-05-28 15:50:41.989678376 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c 2004-05-28 15:49:40.516023792 +0200 @@ -166,7 +166,7 @@ * for it save old values */ if (init_mode > IW_MODE_MONITOR || init_mode < IW_MODE_AUTO) { printk(KERN_DEBUG "%s(): You passed a non-valid init_mode. " - "Using default mode\n", __FUNCTION__); + "Using default mode\n", __FUNCTION__); init_mode = CARD_DEFAULT_IW_MODE; } /* This sets all of the mode-dependent values */ @@ -518,9 +518,7 @@ i++; data++; } - range->num_bitrates = i; - kfree(r.ptr); return rvalue; @@ -559,7 +557,6 @@ int rvalue; rvalue = mgt_get_request(priv, DOT11_OID_BSSID, 0, NULL, &r); - memcpy(awrq->sa_data, r.ptr, 6); awrq->sa_family = ARPHRD_ETHER; kfree(r.ptr); @@ -669,7 +666,6 @@ kfree(buf); } } - return current_ev; } @@ -731,7 +727,7 @@ memcpy(essid.octets, extra, dwrq->length); } else essid.length = 0; - + if (priv->iw_mode != IW_MODE_MONITOR) return mgt_set_request(priv, DOT11_OID_SSID, 0, &essid); @@ -817,21 +813,21 @@ char *data; int ret, i; union oid_res_t r; - + if (vwrq->value == -1) { /* auto mode. No limit. */ profile = 1; return mgt_set_request(priv, DOT11_OID_PROFILES, 0, &profile); } - + if ((ret = mgt_get_request(priv, DOT11_OID_SUPPORTEDRATES, 0, NULL, &r))) return ret; - + rate = (u32) (vwrq->value / 500000); data = r.ptr; i = 0; - + while (data[i]) { if (rate && (data[i] == rate)) { break; @@ -842,14 +838,14 @@ data[i] |= 0x80; i++; } - + if (!data[i]) { return -EINVAL; } - + data[i] |= 0x80; data[i + 1] = 0; - + /* Now, check if we want a fixed or auto value */ if (vwrq->fixed) { data[0] = data[i]; @@ -864,14 +860,14 @@ i++; } printk("0\n"); -*/ +*/ profile = -1; ret = mgt_set_request(priv, DOT11_OID_PROFILES, 0, &profile); ret |= mgt_set_request(priv, DOT11_OID_EXTENDEDRATES, 0, data); ret |= mgt_set_request(priv, DOT11_OID_RATES, 0, data); - + kfree(r.ptr); - + return ret; } @@ -897,7 +893,7 @@ data = r.ptr; vwrq->fixed = (data[0] != 0) && (data[1] == 0); kfree(r.ptr); - + return 0; } @@ -994,7 +990,6 @@ rvalue |= mgt_set_request(priv, DOT11_OID_MAXTXLIFETIME, 0, &lifetime); - return rvalue; } @@ -1090,8 +1085,7 @@ } } } - - /* now read the flags */ + /* now read the flags */ if (dwrq->flags & IW_ENCODE_DISABLED) { /* Encoding disabled, * authen = DOT11_AUTH_OS; @@ -1240,7 +1234,7 @@ static int prism54_set_u32(struct net_device *ndev, struct iw_request_info *info, - __u32 * uwrq, char *extra) + __u32 * uwrq, char *extra) { u32 oid = uwrq[0], u = uwrq[1]; @@ -1858,7 +1852,7 @@ enum oid_num_t n = mgt_oidtonum(frame->header->oid); if (n != OID_NUM_LAST) - prism54_process_trap_helper(netdev_priv(ndev), n, frame->data); + prism54_process_trap_helper(netdev_priv(ndev), n, frame->data); islpci_mgt_release(frame); } @@ -1935,7 +1929,7 @@ __u32 * uwrq, char *extra) { islpci_private *priv = netdev_priv(ndev); - + priv->priv_oid = *uwrq; printk("%s: oid 0x%08X\n", ndev->name, *uwrq); @@ -1944,15 +1938,15 @@ int prism54_debug_get_oid(struct net_device *ndev, struct iw_request_info *info, - struct iw_point *data, char *extra) + struct iw_point *data, char *extra) { islpci_private *priv = netdev_priv(ndev); struct islpci_mgmtframe *response = NULL; int ret = -EIO, response_op = PIMFOR_OP_ERROR; - + printk("%s: get_oid 0x%08X\n", ndev->name, priv->priv_oid); data->length = 0; - + if (islpci_get_state(priv) >= PRV_STATE_INIT) { ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET, @@ -1976,21 +1970,21 @@ printk("%s: len: %i\n", ndev->name, data->length); } } - + return ret; } int prism54_debug_set_oid(struct net_device *ndev, struct iw_request_info *info, - struct iw_point *data, char *extra) + struct iw_point *data, char *extra) { islpci_private *priv = netdev_priv(ndev); struct islpci_mgmtframe *response = NULL; int ret = 0, response_op = PIMFOR_OP_ERROR; - + printk("%s: set_oid 0x%08X\tlen: %d\n", ndev->name, priv->priv_oid, data->length); - + if (islpci_get_state(priv) >= PRV_STATE_INIT) { ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_SET, @@ -2005,10 +1999,10 @@ } if (ret || response_op == PIMFOR_OP_ERROR) { printk("%s: EIO\n", ndev->name); - ret = -EIO; + ret = -EIO; } } - + return (ret ? ret : -EINPROGRESS); } @@ -2107,7 +2101,7 @@ #define PRISM54_DBG_GET_OID SIOCIWFIRSTPRIV+15 #define PRISM54_DBG_SET_OID SIOCIWFIRSTPRIV+16 -#define PRISM54_GET_OID SIOCIWFIRSTPRIV+17 +#define PRISM54_GET_OID SIOCIWFIRSTPRIV+17 #define PRISM54_SET_OID_U32 SIOCIWFIRSTPRIV+18 #define PRISM54_SET_OID_STR SIOCIWFIRSTPRIV+20 #define PRISM54_SET_OID_ADDR SIOCIWFIRSTPRIV+22 @@ -2179,7 +2173,7 @@ IWPRIV_U32(DOT11_OID_AUTHENABLE, "authenable"), IWPRIV_U32(DOT11_OID_PRIVACYINVOKED, "privinvok"), IWPRIV_U32(DOT11_OID_EXUNENCRYPTED, "exunencrypt"), - + IWPRIV_U32(DOT11_OID_REKEYTHRESHOLD, "rekeythresh"), IWPRIV_U32(DOT11_OID_MAXTXLIFETIME, "maxtxlife"), diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.h linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.h --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.h 2004-05-28 14:40:26.994455048 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.h 2004-05-28 14:25:30.063809232 +0200 @@ -173,7 +173,7 @@ islpci_state_t state; int state_off; /* enumeration of off-state, if 0 then * we're not in any off-state */ - + /* WPA stuff */ int wpa; /* WPA mode enabled */ struct list_head bss_wpa_list; diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_eth.c 2004-05-28 15:50:41.991678072 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_eth.c 2004-05-28 15:49:40.517023640 +0200 @@ -208,7 +208,7 @@ priv->data_low_tx[index] = skb; /* set the proper fragment start address and size information */ fragment->size = cpu_to_le16(frame_size); - fragment->flags = cpu_to_le16(0); /* set to 1 if more fragments */ + fragment->flags = cpu_to_le16(0); /* set to 1 if more fragments */ fragment->address = cpu_to_le32(pci_map_address); curr_frag++; @@ -218,7 +218,7 @@ cb->driver_curr_frag[ISL38XX_CB_TX_DATA_LQ] = cpu_to_le32(curr_frag); if (curr_frag - priv->free_data_tx + ISL38XX_MIN_QTHRESHOLD - > ISL38XX_CB_TX_QSIZE) { + > ISL38XX_CB_TX_QSIZE) { /* stop sends from upper layers */ netif_stop_queue(ndev); @@ -239,7 +239,7 @@ return 0; - drop_free: + drop_free: /* free the skbuf structure before aborting */ dev_kfree_skb(skb); skb = NULL; @@ -287,7 +287,7 @@ (struct avs_80211_1_header *) skb_push(*skb, sizeof (struct avs_80211_1_header)); - + avs->version = cpu_to_be32(P80211CAPTURE_VERSION); avs->length = cpu_to_be32(sizeof (struct avs_80211_1_header)); avs->mactime = cpu_to_be64(le64_to_cpu(clock)); @@ -487,10 +487,10 @@ void islpci_do_reset_and_wake(void *data) { - islpci_private *priv = (islpci_private *) data; - islpci_reset(priv, 1); - netif_wake_queue(priv->ndev); - priv->reset_task_pending = 0; + islpci_private *priv = (islpci_private *) data; + islpci_reset(priv, 1); + netif_wake_queue(priv->ndev); + priv->reset_task_pending = 0; } void diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.c 2004-05-28 15:14:49.426917656 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.c 2004-05-28 15:12:49.370169056 +0200 @@ -85,7 +85,7 @@ { pimfor_header_t *h = data; - while ((void *) h < data + len) { + while ((void *) h < data + len) { if (h->flags & PIMFOR_FLAG_LITTLE_ENDIAN) { le32_to_cpus(&h->oid); le32_to_cpus(&h->length); @@ -107,8 +107,8 @@ islpci_mgmt_rx_fill(struct net_device *ndev) { islpci_private *priv = netdev_priv(ndev); - isl38xx_control_block *cb = /* volatile not needed */ - (isl38xx_control_block *) priv->control_block; + isl38xx_control_block *cb = /* volatile not needed */ + (isl38xx_control_block *) priv->control_block; u32 curr = le32_to_cpu(cb->driver_curr_frag[ISL38XX_CB_RX_MGMTQ]); #if VERBOSE > SHOW_ERROR_MESSAGES @@ -140,15 +140,15 @@ } } - /* be safe: always reset control block information */ + /* be safe: always reset control block information */ frag->size = cpu_to_le16(MGMT_FRAME_SIZE); frag->flags = 0; frag->address = cpu_to_le32(buf->pci_addr); curr++; - /* The fragment address in the control block must have - * been written before announcing the frame buffer to - * device */ + /* The fragment address in the control block must have + * been written before announcing the frame buffer to + * device */ wmb(); cb->driver_curr_frag[ISL38XX_CB_RX_MGMTQ] = cpu_to_le32(curr); } @@ -168,7 +168,7 @@ { islpci_private *priv = netdev_priv(ndev); isl38xx_control_block *cb = - (isl38xx_control_block *) priv->control_block; + (isl38xx_control_block *) priv->control_block; void *p; int err = -EINVAL; unsigned long flags; @@ -242,7 +242,7 @@ priv->mgmt_tx[index] = buf; frag = &cb->tx_data_mgmt[index]; frag->size = cpu_to_le16(frag_len); - frag->flags = 0; /* for any other than the last fragment, set to 1 */ + frag->flags = 0; /* for any other than the last fragment, set to 1 */ frag->address = cpu_to_le32(buf.pci_addr); /* The fragment address in the control block must have @@ -256,11 +256,11 @@ islpci_trigger(priv); return 0; - error_unlock: + error_unlock: spin_unlock_irqrestore(&priv->slock, flags); - error_free: + error_free: kfree(buf.mem); - error: + error: return err; } @@ -274,16 +274,16 @@ { islpci_private *priv = netdev_priv(ndev); isl38xx_control_block *cb = - (isl38xx_control_block *) priv->control_block; + (isl38xx_control_block *) priv->control_block; u32 curr_frag; #if VERBOSE > SHOW_ERROR_MESSAGES DEBUG(SHOW_FUNCTION_CALLS, "islpci_mgt_receive \n"); #endif - /* Only once per interrupt, determine fragment range to - * process. This avoids an endless loop (i.e. lockup) if - * frames come in faster than we can process them. */ + /* Only once per interrupt, determine fragment range to + * process. This avoids an endless loop (i.e. lockup) if + * frames come in faster than we can process them. */ curr_frag = le32_to_cpu(cb->device_curr_frag[ISL38XX_CB_RX_MGMTQ]); barrier(); @@ -294,29 +294,29 @@ u16 frag_len; int size; struct islpci_mgmtframe *frame; - - /* I have no idea (and no documentation) if flags != 0 - * is possible. Drop the frame, reuse the buffer. */ + + /* I have no idea (and no documentation) if flags != 0 + * is possible. Drop the frame, reuse the buffer. */ if (le16_to_cpu(cb->rx_data_mgmt[index].flags) != 0) { - printk(KERN_WARNING "%s: unknown flags 0x%04x\n", - ndev->name, - le16_to_cpu(cb->rx_data_mgmt[index].flags)); - continue; - } + printk(KERN_WARNING "%s: unknown flags 0x%04x\n", + ndev->name, + le16_to_cpu(cb->rx_data_mgmt[index].flags)); + continue; + } /* The device only returns the size of the header(s) here. */ frag_len = le16_to_cpu(cb->rx_data_mgmt[index].size); /* - * We appear to have no way to tell the device the - * size of a receive buffer. Thus, if this check - * triggers, we likely have kernel heap corruption. */ - if (frag_len > MGMT_FRAME_SIZE) { + * We appear to have no way to tell the device the + * size of a receive buffer. Thus, if this check + * triggers, we likely have kernel heap corruption. */ + if (frag_len > MGMT_FRAME_SIZE) { printk(KERN_WARNING "%s: Bogus packet size of %d (%#x).\n", ndev->name, frag_len, frag_len); - frag_len = MGMT_FRAME_SIZE; - } + frag_len = MGMT_FRAME_SIZE; + } /* Ensure the results of device DMA are visible to the CPU. */ pci_dma_sync_single(priv->pdev, buf->pci_addr, @@ -338,7 +338,7 @@ #if VERBOSE > SHOW_ERROR_MESSAGES DEBUG(SHOW_PIMFOR_FRAMES, "PIMFOR: op %i, oid 0x%08x, device %i, flags 0x%x length 0x%x \n", - header->operation, header->oid, header->device_id, + header->operation, header->oid, header->device_id, header->flags, header->length); /* display the buffer contents for debugging */ @@ -363,7 +363,7 @@ printk(KERN_WARNING "%s: Out of memory, cannot handle oid 0x%08x\n", ndev->name, header->oid); - continue; + continue; } frame->ndev = ndev; memcpy(&frame->buf, header, size); @@ -383,7 +383,7 @@ header->oid, header->device_id, header->flags, header->length); #endif - + /* Create work to handle trap out of interrupt * context. */ INIT_WORK(&frame->ws, prism54_process_trap, frame); @@ -416,19 +416,19 @@ islpci_mgt_cleanup_transmit(struct net_device *ndev) { islpci_private *priv = netdev_priv(ndev); - isl38xx_control_block *cb = /* volatile not needed */ - (isl38xx_control_block *) priv->control_block; + isl38xx_control_block *cb = /* volatile not needed */ + (isl38xx_control_block *) priv->control_block; u32 curr_frag; #if VERBOSE > SHOW_ERROR_MESSAGES - DEBUG(SHOW_FUNCTION_CALLS, "islpci_mgt_cleanup_transmit\n"); + DEBUG(SHOW_FUNCTION_CALLS, "islpci_mgt_cleanup_transmit\n"); #endif /* Only once per cleanup, determine fragment range to * process. This avoids an endless loop (i.e. lockup) if * the device became confused, incrementing device_curr_frag * rapidly. */ - curr_frag = le32_to_cpu(cb->device_curr_frag[ISL38XX_CB_TX_MGMTQ]); + curr_frag = le32_to_cpu(cb->device_curr_frag[ISL38XX_CB_TX_MGMTQ]); barrier(); for (; priv->index_mgmt_tx < curr_frag; priv->index_mgmt_tx++) { @@ -475,9 +475,9 @@ frame = xchg(&priv->mgmt_received, NULL); if (frame) { if (frame->header->oid == oid) { - *recvframe = frame; - err = 0; - goto out; + *recvframe = frame; + err = 0; + goto out; } else { printk(KERN_DEBUG "%s: expecting oid 0x%x, received 0x%x.\n", @@ -485,13 +485,13 @@ frame->header->oid); kfree(frame); frame = NULL; - } + } } if (timeleft == 0) { printk(KERN_DEBUG "%s: timeout waiting for mgmt response %lu, " "triggering device\n", - ndev->name, timeout_left); + ndev->name, timeout_left); islpci_trigger(priv); } timeout_left += timeleft - wait_cycle_jiffies; diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.c linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.c --- linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.c 2004-05-28 15:14:49.431916896 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.c 2004-05-28 15:12:49.372168752 +0200 @@ -454,7 +454,7 @@ islpci_mgt_release(response); } if (ret || response_op == PIMFOR_OP_ERROR) - ret = -EIO; + ret = -EIO; } else if (!cache) ret = -EIO; @@ -479,7 +479,7 @@ int ret = -EIO; int reslen = 0; struct islpci_mgmtframe *response = NULL; - + int dlen; void *cache, *_res = NULL; u32 oid; @@ -504,7 +504,7 @@ ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET, oid, data, dlen, &response); if (ret || !response || - response->header->operation == PIMFOR_OP_ERROR) { + response->header->operation == PIMFOR_OP_ERROR) { if (response) islpci_mgt_release(response); ret = -EIO; @@ -541,7 +541,7 @@ "mgt_get_request(0x%x): received data length was bigger " "than expected (%d > %d). Memory is probably corrupted...", oid, reslen, isl_oid[n].size); - + return ret; } @@ -561,11 +561,11 @@ while (j <= t->range) { response = NULL; ret |= islpci_mgt_transaction(priv->ndev, PIMFOR_OP_SET, - oid, data, t->size, + oid, data, t->size, &response); if (response) { ret |= (response->header->operation == - PIMFOR_OP_ERROR); + PIMFOR_OP_ERROR); islpci_mgt_release(response); } j++; @@ -669,7 +669,7 @@ /* some request have failed. The device might be in an incoherent state. We should reset it ! */ printk(KERN_DEBUG "%s: mgt_commit has failed. Restart the " - "device \n", priv->ndev->name); + "device \n", priv->ndev->name); } } diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.h linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.h --- linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.h 2004-05-28 14:07:22.645122000 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.h 2004-05-28 14:06:37.941917920 +0200 @@ -38,7 +38,7 @@ int mgt_set_request(islpci_private *, enum oid_num_t, int, void *); int mgt_get_request(islpci_private *, enum oid_num_t, int, void *, - union oid_res_t *); + union oid_res_t *); int mgt_commit_list(islpci_private *, enum oid_num_t *, int); --Boundary-00=_WHcwAw8pWE41qOR-- From hadi@znyx.com Sat Jun 5 04:22:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 04:22:52 -0700 (PDT) Received: from lotus.znyx.com (znx208-2-156-007.znyx.com [208.2.156.7]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55BMdgi027008 for ; Sat, 5 Jun 2004 04:22:39 -0700 Received: from [127.0.0.1] ([208.2.156.2]) by lotus.znyx.com (Lotus Domino Release 5.0.11) with ESMTP id 2004060504214840:11409 ; Sat, 5 Jun 2004 04:21:48 -0700 Subject: small netfilter cleanup From: Jamal Hadi Salim Reply-To: hadi@znyx.com To: Harald Welte Cc: netdev@oss.sgi.com, "David S. Miller" Organization: ZNYX Networks Message-Id: <1086434538.1590.16.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 05 Jun 2004 07:22:19 -0400 X-MIMETrack: Itemize by SMTP Server on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 06/05/2004 04:21:49 AM, Serialize by Router on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 06/05/2004 04:22:07 AM, Serialize complete at 06/05/2004 04:22:07 AM Content-Type: multipart/mixed; boundary="=-q0+k3WAQkq6HY9b92iVN" X-archive-position: 5633 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@znyx.com Precedence: bulk X-list: netdev Content-Length: 21299 Lines: 670 --=-q0+k3WAQkq6HY9b92iVN Content-Transfer-Encoding: 7bit Content-Type: text/plain I have been sitting on these patches for sometime now. Harald, we did discuss this back when. Attached patches for 2.4.26 and 2.6.6; both should patch cleanly against pre 2.4.27 and 2.6.7 cheers, jamal --=-q0+k3WAQkq6HY9b92iVN Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=nf24p Content-Type: text/plain; name=nf24p; charset=ISO-8859-1 --- /usr/src/2426/include/linux/netfilter.h 2003-08-25 07:44:44.000000000 -0400 +++ /usr/src/2426-mod/include/linux/netfilter.h 2004-06-03 22:51:00.000000000 -0400 @@ -146,6 +146,12 @@ struct nf_info *info, unsigned int verdict); +extern inline struct ipt_target * +ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex); +extern inline struct ip6t_target * +ip6t_find_target_lock(const char *name, int *error, struct semaphore *mutex); +extern inline struct arpt_target * +arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex); extern void (*ip_ct_attach)(struct sk_buff *, struct nf_ct_info *); #ifdef CONFIG_NETFILTER_DEBUG --- /usr/src/2426/include/linux/netfilter_ipv4/ip_tables.h 2002-02-25 14:38:13.000000000 -0500 +++ /usr/src/2426-mod/include/linux/netfilter_ipv4/ip_tables.h 2004-06-03 22:52:39.000000000 -0400 @@ -283,6 +283,8 @@ struct ipt_entry entrytable[0]; }; +extern struct semaphore ipt_mutex; + /* Standard return verdict, or do jump. */ #define IPT_STANDARD_TARGET "" /* Error verdict. */ @@ -334,6 +336,7 @@ /* * Main firewall chains definitions and global var's definitions. */ +static DECLARE_MUTEX(ipt_mutex); #ifdef __KERNEL__ #include @@ -403,6 +406,11 @@ struct module *me; }; +extern struct ipt_target * +ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex); +extern struct arpt_target * +arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex); + extern int ipt_register_target(struct ipt_target *target); extern void ipt_unregister_target(struct ipt_target *target); --- /usr/src/2426/net/ipv4/netfilter/ip_tables.c 2004-02-18 08:36:32.000000000 -0500 +++ /usr/src/2426-mod/net/ipv4/netfilter/ip_tables.c 2004-06-03 21:56:59.000000000 -0400 @@ -53,9 +53,6 @@ #endif #define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) -/* Mutex protects lists (only traversed in user context). */ -static DECLARE_MUTEX(ipt_mutex); - /* Must have mutex */ #define ASSERT_READ_LOCK(x) IP_NF_ASSERT(down_trylock(&ipt_mutex) != 0) #define ASSERT_WRITE_LOCK(x) IP_NF_ASSERT(down_trylock(&ipt_mutex) != 0) @@ -418,7 +415,7 @@ { void *ret; -#if 0 +#if 0 duprintf("find_inlist: searching for `%s' in %s.\n", name, head == &ipt_target ? "ipt_target" : head == &ipt_match ? "ipt_match" @@ -464,7 +461,7 @@ #endif static inline struct ipt_table * -find_table_lock(const char *name, int *error, struct semaphore *mutex) +ipt_find_table_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&ipt_tables, name, "iptable_", error, mutex); } @@ -475,8 +472,8 @@ return find_inlist_lock(&ipt_match, name, "ipt_", error, mutex); } -static inline struct ipt_target * -find_target_lock(const char *name, int *error, struct semaphore *mutex) +struct ipt_target * +ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&ipt_target, name, "ipt_", error, mutex); } @@ -693,7 +690,7 @@ goto cleanup_matches; t = ipt_get_target(e); - target = find_target_lock(t->u.user.name, &ret, &ipt_mutex); + target = ipt_find_target_lock(t->u.user.name, &ret, &ipt_mutex); if (!target) { duprintf("check_entry: `%s' not found\n", t->u.user.name); goto cleanup_matches; @@ -1030,7 +1027,7 @@ int ret; struct ipt_table *t; - t = find_table_lock(entries->name, &ret, &ipt_mutex); + t = ipt_find_table_lock(entries->name, &ret, &ipt_mutex); if (t) { duprintf("t->private->number = %u\n", t->private->number); @@ -1097,7 +1094,7 @@ duprintf("ip_tables: Translated table\n"); - t = find_table_lock(tmp.name, &ret, &ipt_mutex); + t = ipt_find_table_lock(tmp.name, &ret, &ipt_mutex); if (!t) goto free_newinfo_counters_untrans; @@ -1191,7 +1188,7 @@ goto free; } - t = find_table_lock(tmp.name, &ret, &ipt_mutex); + t = ipt_find_table_lock(tmp.name, &ret, &ipt_mutex); if (!t) goto free; @@ -1266,7 +1263,7 @@ break; } name[IPT_TABLE_MAXNAMELEN-1] = '\0'; - t = find_table_lock(name, &ret, &ipt_mutex); + t = ipt_find_table_lock(name, &ret, &ipt_mutex); if (t) { struct ipt_getinfo info; @@ -1838,6 +1835,7 @@ EXPORT_SYMBOL(ipt_do_table); EXPORT_SYMBOL(ipt_register_target); EXPORT_SYMBOL(ipt_unregister_target); +EXPORT_SYMBOL(ipt_find_target_lock); module_init(init); module_exit(fini); --- /usr/src/2426/include/linux/netfilter_arp.h 2002-08-02 20:39:45.000000000 -0400 +++ /usr/src/2426-mod/include/linux/netfilter_arp.h 2004-06-03 22:52:11.000000000 -0400 @@ -16,4 +16,5 @@ #define NF_ARP_OUT 1 #define NF_ARP_NUMHOOKS 2 +static DECLARE_MUTEX(arpt_mutex); #endif /* __LINUX_ARP_NETFILTER_H */ --- /usr/src/2426/net/ipv4/netfilter/arp_tables.c 2003-08-25 07:44:44.000000000 -0400 +++ /usr/src/2426-mod/net/ipv4/netfilter/arp_tables.c 2004-06-03 21:56:59.000000000 -0400 @@ -52,7 +52,6 @@ #endif #define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) -static DECLARE_MUTEX(arpt_mutex); #define ASSERT_READ_LOCK(x) ARP_NF_ASSERT(down_trylock(&arpt_mutex) != 0) #define ASSERT_WRITE_LOCK(x) ARP_NF_ASSERT(down_trylock(&arpt_mutex) != 0) @@ -380,12 +379,12 @@ } #endif -static inline struct arpt_table *find_table_lock(const char *name, int *error, struct semaphore *mutex) +static inline struct arpt_table *arpt_find_table_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&arpt_tables, name, "arptable_", error, mutex); } -static inline struct arpt_target *find_target_lock(const char *name, int *error, struct semaphore *mutex) +struct arpt_target *arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&arpt_target, name, "arpt_", error, mutex); } @@ -535,7 +534,7 @@ } t = arpt_get_target(e); - target = find_target_lock(t->u.user.name, &ret, &arpt_mutex); + target = arpt_find_target_lock(t->u.user.name, &ret, &arpt_mutex); if (!target) { duprintf("check_entry: `%s' not found\n", t->u.user.name); goto out; @@ -834,7 +833,7 @@ int ret; struct arpt_table *t; - t = find_table_lock(entries->name, &ret, &arpt_mutex); + t = arpt_find_table_lock(entries->name, &ret, &arpt_mutex); if (t) { duprintf("t->private->number = %u\n", t->private->number); @@ -900,7 +899,7 @@ duprintf("arp_tables: Translated table\n"); - t = find_table_lock(tmp.name, &ret, &arpt_mutex); + t = arpt_find_table_lock(tmp.name, &ret, &arpt_mutex); if (!t) goto free_newinfo_counters_untrans; @@ -985,7 +984,7 @@ goto free; } - t = find_table_lock(tmp.name, &ret, &arpt_mutex); + t = arpt_find_table_lock(tmp.name, &ret, &arpt_mutex); if (!t) goto free; @@ -1058,7 +1057,7 @@ break; } name[ARPT_TABLE_MAXNAMELEN-1] = '\0'; - t = find_table_lock(name, &ret, &arpt_mutex); + t = arpt_find_table_lock(name, &ret, &arpt_mutex); if (t) { struct arpt_getinfo info; @@ -1306,6 +1305,7 @@ EXPORT_SYMBOL(arpt_register_table); EXPORT_SYMBOL(arpt_unregister_table); EXPORT_SYMBOL(arpt_do_table); +EXPORT_SYMBOL(arpt_find_target_lock); EXPORT_SYMBOL(arpt_register_target); EXPORT_SYMBOL(arpt_unregister_target); --- /usr/src/2426/include/linux/netfilter_ipv6/ip6_tables.h 2003-06-13 10:51:38.000000000 -0400 +++ /usr/src/2426-mod/include/linux/netfilter_ipv6/ip6_tables.h 2004-06-03 22:54:59.000000000 -0400 @@ -106,6 +106,8 @@ u_int64_t pcnt, bcnt; /* Packet and byte counters */ }; +static DECLARE_MUTEX(ip6t_mutex); + /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ #define IP6T_F_PROTO 0x01 /* Set if rule cares about upper protocols */ --- /usr/src/2426/net/ipv6/netfilter/ip6_tables.c 2004-04-14 09:05:41.000000000 -0400 +++ /usr/src/2426-mod/net/ipv6/netfilter/ip6_tables.c 2004-06-03 21:56:59.000000000 -0400 @@ -57,8 +57,6 @@ #endif #define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) -/* Mutex protects lists (only traversed in user context). */ -static DECLARE_MUTEX(ip6t_mutex); /* Must have mutex */ #define ASSERT_READ_LOCK(x) IP_NF_ASSERT(down_trylock(&ip6t_mutex) != 0) @@ -535,7 +533,7 @@ #endif static inline struct ip6t_table * -find_table_lock(const char *name, int *error, struct semaphore *mutex) +ip6t_find_table_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&ip6t_tables, name, "ip6table_", error, mutex); } @@ -546,8 +544,8 @@ return find_inlist_lock(&ip6t_match, name, "ip6t_", error, mutex); } -static inline struct ip6t_target * -find_target_lock(const char *name, int *error, struct semaphore *mutex) +struct ip6t_target * +ip6t_find_target_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&ip6t_target, name, "ip6t_", error, mutex); } @@ -764,7 +762,7 @@ goto cleanup_matches; t = ip6t_get_target(e); - target = find_target_lock(t->u.user.name, &ret, &ip6t_mutex); + target = ip6t_find_target_lock(t->u.user.name, &ret, &ip6t_mutex); if (!target) { duprintf("check_entry: `%s' not found\n", t->u.user.name); goto cleanup_matches; @@ -1101,7 +1099,7 @@ int ret; struct ip6t_table *t; - t = find_table_lock(entries->name, &ret, &ip6t_mutex); + t = ip6t_find_table_lock(entries->name, &ret, &ip6t_mutex); if (t) { duprintf("t->private->number = %u\n", t->private->number); @@ -1164,7 +1162,7 @@ duprintf("ip_tables: Translated table\n"); - t = find_table_lock(tmp.name, &ret, &ip6t_mutex); + t = ip6t_find_table_lock(tmp.name, &ret, &ip6t_mutex); if (!t) goto free_newinfo_counters_untrans; @@ -1258,7 +1256,7 @@ goto free; } - t = find_table_lock(tmp.name, &ret, &ip6t_mutex); + t = ip6t_find_table_lock(tmp.name, &ret, &ip6t_mutex); if (!t) goto free; @@ -1333,7 +1331,7 @@ break; } name[IP6T_TABLE_MAXNAMELEN-1] = '\0'; - t = find_table_lock(name, &ret, &ip6t_mutex); + t = ip6t_find_table_lock(name, &ret, &ip6t_mutex); if (t) { struct ip6t_getinfo info; @@ -1940,6 +1938,7 @@ EXPORT_SYMBOL(ip6t_register_table); EXPORT_SYMBOL(ip6t_unregister_table); EXPORT_SYMBOL(ip6t_do_table); +EXPORT_SYMBOL(ip6t_find_target_lock); EXPORT_SYMBOL(ip6t_register_match); EXPORT_SYMBOL(ip6t_unregister_match); EXPORT_SYMBOL(ip6t_register_target); --=-q0+k3WAQkq6HY9b92iVN Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=nf26p Content-Type: text/plain; name=nf26p; charset=ISO-8859-1 --- /usr/src/266/include/linux/netfilter.h 2004-05-09 22:32:37.000000000 -0400 +++ /usr/src/266-mod/include/linux/netfilter.h 2004-06-04 10:21:20.000000000 -0400 @@ -171,6 +171,12 @@ struct nf_info *info, unsigned int verdict); +extern inline struct ipt_target * +ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex); +extern inline struct ip6t_target * +ip6t_find_target_lock(const char *name, int *error, struct semaphore *mutex); +extern inline struct arpt_target * +arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex); extern void (*ip_ct_attach)(struct sk_buff *, struct nf_ct_info *); #ifdef CONFIG_NETFILTER_DEBUG --- /usr/src/266/include/linux/netfilter_ipv4/ip_tables.h 2004-05-09 22:32:37.000000000 -0400 +++ /usr/src/266-mod/include/linux/netfilter_ipv4/ip_tables.h 2004-06-04 10:21:20.000000000 -0400 @@ -283,6 +283,8 @@ struct ipt_entry entrytable[0]; }; +extern struct semaphore ipt_mutex; + /* Standard return verdict, or do jump. */ #define IPT_STANDARD_TARGET "" /* Error verdict. */ @@ -334,6 +336,7 @@ /* * Main firewall chains definitions and global var's definitions. */ +static DECLARE_MUTEX(ipt_mutex); #ifdef __KERNEL__ #include @@ -406,6 +409,11 @@ struct module *me; }; +extern struct ipt_target * +ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex); +extern struct arpt_target * +arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex); + extern int ipt_register_target(struct ipt_target *target); extern void ipt_unregister_target(struct ipt_target *target); --- /usr/src/266/net/ipv4/netfilter/ip_tables.c 2004-05-09 22:32:26.000000000 -0400 +++ /usr/src/266-mod/net/ipv4/netfilter/ip_tables.c 2004-06-04 10:21:20.000000000 -0400 @@ -61,9 +61,6 @@ #endif #define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) -/* Mutex protects lists (only traversed in user context). */ -static DECLARE_MUTEX(ipt_mutex); - /* Must have mutex */ #define ASSERT_READ_LOCK(x) IP_NF_ASSERT(down_trylock(&ipt_mutex) != 0) #define ASSERT_WRITE_LOCK(x) IP_NF_ASSERT(down_trylock(&ipt_mutex) != 0) @@ -418,7 +415,7 @@ { void *ret; -#if 0 +#if 0 duprintf("find_inlist: searching for `%s' in %s.\n", name, head == &ipt_target ? "ipt_target" : head == &ipt_match ? "ipt_match" @@ -461,7 +458,7 @@ #endif static inline struct ipt_table * -find_table_lock(const char *name, int *error, struct semaphore *mutex) +ipt_find_table_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&ipt_tables, name, "iptable_", error, mutex); } @@ -472,8 +469,8 @@ return find_inlist_lock(&ipt_match, name, "ipt_", error, mutex); } -static inline struct ipt_target * -find_target_lock(const char *name, int *error, struct semaphore *mutex) +struct ipt_target * +ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&ipt_target, name, "ipt_", error, mutex); } @@ -688,7 +685,7 @@ goto cleanup_matches; t = ipt_get_target(e); - target = find_target_lock(t->u.user.name, &ret, &ipt_mutex); + target = ipt_find_target_lock(t->u.user.name, &ret, &ipt_mutex); if (!target) { duprintf("check_entry: `%s' not found\n", t->u.user.name); goto cleanup_matches; @@ -1025,7 +1022,7 @@ int ret; struct ipt_table *t; - t = find_table_lock(entries->name, &ret, &ipt_mutex); + t = ipt_find_table_lock(entries->name, &ret, &ipt_mutex); if (t) { duprintf("t->private->number = %u\n", t->private->number); @@ -1092,7 +1089,7 @@ duprintf("ip_tables: Translated table\n"); - t = find_table_lock(tmp.name, &ret, &ipt_mutex); + t = ipt_find_table_lock(tmp.name, &ret, &ipt_mutex); if (!t) goto free_newinfo_counters_untrans; @@ -1195,7 +1192,7 @@ goto free; } - t = find_table_lock(tmp.name, &ret, &ipt_mutex); + t = ipt_find_table_lock(tmp.name, &ret, &ipt_mutex); if (!t) goto free; @@ -1270,7 +1267,7 @@ break; } name[IPT_TABLE_MAXNAMELEN-1] = '\0'; - t = find_table_lock(name, &ret, &ipt_mutex); + t = ipt_find_table_lock(name, &ret, &ipt_mutex); if (t) { struct ipt_getinfo info; @@ -1855,6 +1852,7 @@ EXPORT_SYMBOL(ipt_do_table); EXPORT_SYMBOL(ipt_register_target); EXPORT_SYMBOL(ipt_unregister_target); +EXPORT_SYMBOL(ipt_find_target_lock); module_init(init); module_exit(fini); --- /usr/src/266/include/linux/netfilter_arp.h 2004-05-09 22:32:00.000000000 -0400 +++ /usr/src/266-mod/include/linux/netfilter_arp.h 2004-06-04 10:21:20.000000000 -0400 @@ -17,4 +17,5 @@ #define NF_ARP_FORWARD 2 #define NF_ARP_NUMHOOKS 3 +static DECLARE_MUTEX(arpt_mutex); #endif /* __LINUX_ARP_NETFILTER_H */ --- /usr/src/266/net/ipv4/netfilter/arp_tables.c 2004-05-09 22:33:12.000000000 -0400 +++ /usr/src/266-mod/net/ipv4/netfilter/arp_tables.c 2004-06-04 10:21:20.000000000 -0400 @@ -56,7 +56,6 @@ #endif #define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) -static DECLARE_MUTEX(arpt_mutex); #define ASSERT_READ_LOCK(x) ARP_NF_ASSERT(down_trylock(&arpt_mutex) != 0) #define ASSERT_WRITE_LOCK(x) ARP_NF_ASSERT(down_trylock(&arpt_mutex) != 0) @@ -388,12 +387,12 @@ } #endif -static inline struct arpt_table *find_table_lock(const char *name, int *error, struct semaphore *mutex) +static inline struct arpt_table *arpt_find_table_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&arpt_tables, name, "arptable_", error, mutex); } -static inline struct arpt_target *find_target_lock(const char *name, int *error, struct semaphore *mutex) +struct arpt_target *arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&arpt_target, name, "arpt_", error, mutex); } @@ -543,7 +542,7 @@ } t = arpt_get_target(e); - target = find_target_lock(t->u.user.name, &ret, &arpt_mutex); + target = arpt_find_target_lock(t->u.user.name, &ret, &arpt_mutex); if (!target) { duprintf("check_entry: `%s' not found\n", t->u.user.name); goto out; @@ -843,7 +842,7 @@ int ret; struct arpt_table *t; - t = find_table_lock(entries->name, &ret, &arpt_mutex); + t = arpt_find_table_lock(entries->name, &ret, &arpt_mutex); if (t) { duprintf("t->private->number = %u\n", t->private->number); @@ -909,7 +908,7 @@ duprintf("arp_tables: Translated table\n"); - t = find_table_lock(tmp.name, &ret, &arpt_mutex); + t = arpt_find_table_lock(tmp.name, &ret, &arpt_mutex); if (!t) goto free_newinfo_counters_untrans; @@ -1002,7 +1001,7 @@ goto free; } - t = find_table_lock(tmp.name, &ret, &arpt_mutex); + t = arpt_find_table_lock(tmp.name, &ret, &arpt_mutex); if (!t) goto free; @@ -1075,7 +1074,7 @@ break; } name[ARPT_TABLE_MAXNAMELEN-1] = '\0'; - t = find_table_lock(name, &ret, &arpt_mutex); + t = arpt_find_table_lock(name, &ret, &arpt_mutex); if (t) { struct arpt_getinfo info; @@ -1323,6 +1322,7 @@ EXPORT_SYMBOL(arpt_register_table); EXPORT_SYMBOL(arpt_unregister_table); EXPORT_SYMBOL(arpt_do_table); +EXPORT_SYMBOL(arpt_find_target_lock); EXPORT_SYMBOL(arpt_register_target); EXPORT_SYMBOL(arpt_unregister_target); --- /usr/src/266/include/linux/netfilter_ipv6/ip6_tables.h 2004-05-09 22:33:20.000000000 -0400 +++ /usr/src/266-mod/include/linux/netfilter_ipv6/ip6_tables.h 2004-06-04 10:21:20.000000000 -0400 @@ -106,6 +106,8 @@ u_int64_t pcnt, bcnt; /* Packet and byte counters */ }; +static DECLARE_MUTEX(ip6t_mutex); + /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ #define IP6T_F_PROTO 0x01 /* Set if rule cares about upper protocols */ --- /usr/src/266/net/ipv6/netfilter/ip6_tables.c 2004-05-09 22:33:19.000000000 -0400 +++ /usr/src/266-mod/net/ipv6/netfilter/ip6_tables.c 2004-06-04 10:21:20.000000000 -0400 @@ -66,8 +66,6 @@ #endif #define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) -/* Mutex protects lists (only traversed in user context). */ -static DECLARE_MUTEX(ip6t_mutex); /* Must have mutex */ #define ASSERT_READ_LOCK(x) IP_NF_ASSERT(down_trylock(&ip6t_mutex) != 0) @@ -544,7 +542,7 @@ #endif static inline struct ip6t_table * -find_table_lock(const char *name, int *error, struct semaphore *mutex) +ip6t_find_table_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&ip6t_tables, name, "ip6table_", error, mutex); } @@ -555,8 +553,8 @@ return find_inlist_lock(&ip6t_match, name, "ip6t_", error, mutex); } -static inline struct ip6t_target * -find_target_lock(const char *name, int *error, struct semaphore *mutex) +struct ip6t_target * +ip6t_find_target_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&ip6t_target, name, "ip6t_", error, mutex); } @@ -771,7 +769,7 @@ goto cleanup_matches; t = ip6t_get_target(e); - target = find_target_lock(t->u.user.name, &ret, &ip6t_mutex); + target = ip6t_find_target_lock(t->u.user.name, &ret, &ip6t_mutex); if (!target) { duprintf("check_entry: `%s' not found\n", t->u.user.name); goto cleanup_matches; @@ -1111,7 +1109,7 @@ int ret; struct ip6t_table *t; - t = find_table_lock(entries->name, &ret, &ip6t_mutex); + t = ip6t_find_table_lock(entries->name, &ret, &ip6t_mutex); if (t) { duprintf("t->private->number = %u\n", t->private->number); @@ -1174,7 +1172,7 @@ duprintf("ip_tables: Translated table\n"); - t = find_table_lock(tmp.name, &ret, &ip6t_mutex); + t = ip6t_find_table_lock(tmp.name, &ret, &ip6t_mutex); if (!t) goto free_newinfo_counters_untrans; @@ -1276,7 +1274,7 @@ goto free; } - t = find_table_lock(tmp.name, &ret, &ip6t_mutex); + t = ip6t_find_table_lock(tmp.name, &ret, &ip6t_mutex); if (!t) goto free; @@ -1351,7 +1349,7 @@ break; } name[IP6T_TABLE_MAXNAMELEN-1] = '\0'; - t = find_table_lock(name, &ret, &ip6t_mutex); + t = ip6t_find_table_lock(name, &ret, &ip6t_mutex); if (t) { struct ip6t_getinfo info; @@ -1964,6 +1962,7 @@ EXPORT_SYMBOL(ip6t_register_table); EXPORT_SYMBOL(ip6t_unregister_table); EXPORT_SYMBOL(ip6t_do_table); +EXPORT_SYMBOL(ip6t_find_target_lock); EXPORT_SYMBOL(ip6t_register_match); EXPORT_SYMBOL(ip6t_unregister_match); EXPORT_SYMBOL(ip6t_register_target); --=-q0+k3WAQkq6HY9b92iVN-- From margitsw@t-online.de Sat Jun 5 05:04:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 05:05:02 -0700 (PDT) Received: from mailout03.sul.t-online.com (mailout03.sul.t-online.com [194.25.134.81]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55C4sgi028006 for ; Sat, 5 Jun 2004 05:04:55 -0700 Received: from fwd11.aul.t-online.de by mailout03.sul.t-online.com with smtp id 1BWYmY-0005ET-02; Sat, 05 Jun 2004 12:52:10 +0200 Received: from roglap.local (bVj0BEZTre2P6XYzQkzjPnaIzWDlQYu4fZV35gqnfi7mH1uKDnv5ZX@[217.224.28.133]) by fwd11.sul.t-online.com with esmtp id 1BWYmL-1KPzqS0; Sat, 5 Jun 2004 12:51:57 +0200 From: margitsw@t-online.de (Margit Schubert-While) To: jgarzik@pobox.com Subject: [PATCH 10/17 linux-2.6.7-rc2] prism54: Fix bug 77, strengthened oid txn (resend) Date: Sat, 5 Jun 2004 14:49:39 +0200 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Cc: netdev@oss.sgi.com Content-Type: Multipart/Mixed; boundary="Boundary-00=_jFcwAw/FU/M0bFU" Message-Id: <200406051449.39098.margitsw@t-online.de> X-Seen: false X-ID: bVj0BEZTre2P6XYzQkzjPnaIzWDlQYu4fZV35gqnfi7mH1uKDnv5ZX X-archive-position: 5634 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: margitsw@t-online.de Precedence: bulk X-list: netdev Content-Length: 13017 Lines: 395 --Boundary-00=_jFcwAw/FU/M0bFU Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 2004-04-09 Aurelien Alleaume * oid_mgt.c, isl_ioctl.c : Cleanups. Bug #77. Minor stuffs. * islpci_mgt.c (islpci_mgt_transaction) : enforce serialization in oid transaction. lindent.sh. * islpci_mgt.c (islpci_mgt_transaction) : Strengthened oid transaction. --Boundary-00=_jFcwAw/FU/M0bFU Content-Type: text/x-diff; charset="us-ascii"; name="10-fix-bug-77-enforce-serialization.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="10-fix-bug-77-enforce-serialization.patch" diff -NaurEb linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c --- linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c 2004-05-28 14:44:24.886289992 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c 2004-05-28 15:08:00.681056472 +0200 @@ -204,7 +204,7 @@ /* Noise floor. * I'm not sure if the unit is dBm. - * Note : If we are not connected, this value seems to be irrevelant. */ + * Note : If we are not connected, this value seems to be irrelevant. */ mgt_get_request(priv, DOT11_OID_NOISEFLOOR, 0, NULL, &r); priv->local_iwstatistics.qual.noise = r.u; @@ -216,8 +216,7 @@ data = r.ptr; /* copy this MAC to the bss */ - for (j = 0; j < 6; j++) - bss.address[j] = data[j]; + memcpy(bss.address, data, 6); kfree(data); /* now ask for the corresponding bss */ @@ -505,7 +504,7 @@ return 0; /* Request the device for the supported frequencies - * not really revelant since some devices will report the 5 GHz band + * not really relevant since some devices will report the 5 GHz band * frequencies even if they don't support them. */ rvalue = @@ -515,21 +514,12 @@ range->num_channels = freq->nr; range->num_frequency = freq->nr; - /* Frequencies are not listed in the right order. The reordering is probably - * firmware dependant and thus should work for everyone. - */ m = min(IW_MAX_FREQUENCIES, (int) freq->nr); - for (i = 0; i < m - 12; i++) { - range->freq[i].m = freq->mhz[12 + i]; - range->freq[i].e = 6; - range->freq[i].i = i + 1; - } - for (i = m - 12; i < m; i++) { - range->freq[i].m = freq->mhz[i - m + 12]; + for (i = 0; i < m; i++) { + range->freq[i].m = freq->mhz[i]; range->freq[i].e = 6; - range->freq[i].i = i + 23; + range->freq[i].i = channel_of_freq(freq->mhz[i]); } - kfree(freq); rvalue |= mgt_get_request(priv, DOT11_OID_SUPPORTEDRATES, 0, NULL, &r); @@ -1967,60 +1957,6 @@ } int -prism54_set_maxframeburst(struct net_device *ndev, struct iw_request_info *info, - __u32 * uwrq, char *extra) -{ - islpci_private *priv = netdev_priv(ndev); - u32 max_burst; - - max_burst = (*uwrq) ? *uwrq : CARD_DEFAULT_MAXFRAMEBURST; - mgt_set_request(priv, DOT11_OID_MAXFRAMEBURST, 0, &max_burst); - - return -EINPROGRESS; /* Call commit handler */ -} - -int -prism54_get_maxframeburst(struct net_device *ndev, struct iw_request_info *info, - __u32 * uwrq, char *extra) -{ - islpci_private *priv = netdev_priv(ndev); - union oid_res_t r; - int rvalue; - - rvalue = mgt_get_request(priv, DOT11_OID_MAXFRAMEBURST, 0, NULL, &r); - *uwrq = r.u; - - return rvalue; -} - -int -prism54_set_profile(struct net_device *ndev, struct iw_request_info *info, - __u32 * uwrq, char *extra) -{ - islpci_private *priv = netdev_priv(ndev); - u32 profile; - - profile = (*uwrq) ? *uwrq : CARD_DEFAULT_PROFILE; - mgt_set_request(priv, DOT11_OID_PROFILES, 0, &profile); - - return -EINPROGRESS; /* Call commit handler */ -} - -int -prism54_get_profile(struct net_device *ndev, struct iw_request_info *info, - __u32 * uwrq, char *extra) -{ - islpci_private *priv = netdev_priv(ndev); - union oid_res_t r; - int rvalue; - - rvalue = mgt_get_request(priv, DOT11_OID_PROFILES, 0, NULL, &r); - *uwrq = r.u; - - return rvalue; -} - -int prism54_debug_oid(struct net_device *ndev, struct iw_request_info *info, __u32 * uwrq, char *extra) { @@ -2099,7 +2035,7 @@ } } - return ret; + return (ret ? ret : -EINPROGRESS); } static int @@ -2205,16 +2141,16 @@ #define PRISM54_GET_PRISMHDR SIOCIWFIRSTPRIV+23 #define PRISM54_SET_PRISMHDR SIOCIWFIRSTPRIV+24 -#define IWPRIV_SET_U32(n,x) { n, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_"x } -#define IWPRIV_SET_SSID(n,x) { n, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 1, 0, "set_"x } -#define IWPRIV_SET_ADDR(n,x) { n, IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "set_"x } -#define IWPRIV_GET(n,x) { n, 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | PRIV_STR_SIZE, "get_"x } +#define IWPRIV_SET_U32(n,x) { n, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "s_"x } +#define IWPRIV_SET_SSID(n,x) { n, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 1, 0, "s_"x } +#define IWPRIV_SET_ADDR(n,x) { n, IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "s_"x } +#define IWPRIV_GET(n,x) { n, 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | PRIV_STR_SIZE, "g_"x } #define IWPRIV_U32(n,x) IWPRIV_SET_U32(n,x), IWPRIV_GET(n,x) #define IWPRIV_SSID(n,x) IWPRIV_SET_SSID(n,x), IWPRIV_GET(n,x) #define IWPRIV_ADDR(n,x) IWPRIV_SET_ADDR(n,x), IWPRIV_GET(n,x) -/* Note : limited to 128 private ioctls */ +/* Note : limited to 128 private ioctls (wireless tools 26) */ static const struct iw_priv_args prism54_private_args[] = { /*{ cmd, set_args, get_args, name } */ @@ -2352,5 +2288,6 @@ int prism54_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) { + return -EOPNOTSUPP; } diff -NaurEb linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.c --- linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.c 2004-05-28 14:40:26.998454440 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.c 2004-05-28 15:08:00.686055712 +0200 @@ -63,7 +63,6 @@ Queue handling for management frames ******************************************************************************/ - /* * Helper function to create a PIMFOR management frame header. */ @@ -87,7 +86,7 @@ pimfor_header_t *h = data; while ((void *) h < data + len) { - if(h->flags & PIMFOR_FLAG_LITTLE_ENDIAN) { + if (h->flags & PIMFOR_FLAG_LITTLE_ENDIAN) { le32_to_cpus(&h->oid); le32_to_cpus(&h->length); } else { @@ -124,7 +123,8 @@ if (buf->mem == NULL) { buf->mem = kmalloc(MGMT_FRAME_SIZE, GFP_ATOMIC); if (!buf->mem) { - printk(KERN_WARNING "Error allocating management frame.\n"); + printk(KERN_WARNING + "Error allocating management frame.\n"); return -ENOMEM; } buf->size = MGMT_FRAME_SIZE; @@ -133,8 +133,9 @@ buf->pci_addr = pci_map_single(priv->pdev, buf->mem, MGMT_FRAME_SIZE, PCI_DMA_FROMDEVICE); - if(!buf->pci_addr) { - printk(KERN_WARNING "Failed to make memory DMA'able\n."); + if (!buf->pci_addr) { + printk(KERN_WARNING + "Failed to make memory DMA'able\n."); return -ENOMEM; } } @@ -149,8 +150,7 @@ * been written before announcing the frame buffer to * device */ wmb(); - cb->driver_curr_frag[ISL38XX_CB_RX_MGMTQ] = - cpu_to_le32(curr); + cb->driver_curr_frag[ISL38XX_CB_RX_MGMTQ] = cpu_to_le32(curr); } return 0; } @@ -249,7 +249,7 @@ * been written before announcing the frame buffer to * device */ wmb(); - cb->driver_curr_frag[ISL38XX_CB_TX_MGMTQ] = cpu_to_le32(curr_frag+1); + cb->driver_curr_frag[ISL38XX_CB_TX_MGMTQ] = cpu_to_le32(curr_frag + 1); spin_unlock_irqrestore(&priv->slock, flags); /* trigger the device */ @@ -281,14 +281,13 @@ DEBUG(SHOW_FUNCTION_CALLS, "islpci_mgt_receive \n"); #endif - /* Only once per interrupt, determine fragment range to * process. This avoids an endless loop (i.e. lockup) if * frames come in faster than we can process them. */ curr_frag = le32_to_cpu(cb->device_curr_frag[ISL38XX_CB_RX_MGMTQ]); barrier(); - for ( ; priv->index_mgmt_rx < curr_frag; priv->index_mgmt_rx++) { + for (; priv->index_mgmt_rx < curr_frag; priv->index_mgmt_rx++) { pimfor_header_t *header; u32 index = priv->index_mgmt_rx % ISL38XX_CB_MGMT_QSIZE; struct islpci_membuf *buf = &priv->mgmt_rx[index]; @@ -298,7 +297,7 @@ /* I have no idea (and no documentation) if flags != 0 * is possible. Drop the frame, reuse the buffer. */ - if(le16_to_cpu(cb->rx_data_mgmt[index].flags) != 0) { + if (le16_to_cpu(cb->rx_data_mgmt[index].flags) != 0) { printk(KERN_WARNING "%s: unknown flags 0x%04x\n", ndev->name, le16_to_cpu(cb->rx_data_mgmt[index].flags)); @@ -314,8 +313,7 @@ * triggers, we likely have kernel heap corruption. */ if (frag_len > MGMT_FRAME_SIZE) { printk(KERN_WARNING "%s: Bogus packet size of %d (%#x).\ -n", - ndev->name, frag_len, frag_len); +n", ndev->name, frag_len, frag_len); frag_len = MGMT_FRAME_SIZE; } @@ -344,23 +342,25 @@ /* display the buffer contents for debugging */ display_buffer((char *) header, PIMFOR_HEADER_SIZE); - display_buffer((char *) header + PIMFOR_HEADER_SIZE, header->length); + display_buffer((char *) header + PIMFOR_HEADER_SIZE, + header->length); #endif /* nobody sends these */ if (header->flags & PIMFOR_FLAG_APPLIC_ORIGIN) { - printk(KERN_DEBUG "%s: errant PIMFOR application frame\n", + printk(KERN_DEBUG + "%s: errant PIMFOR application frame\n", ndev->name); continue; } /* Determine frame size, skipping OID_INL_TUNNEL headers. */ size = PIMFOR_HEADER_SIZE + header->length; - frame = kmalloc(sizeof(struct islpci_mgmtframe) + size, + frame = kmalloc(sizeof (struct islpci_mgmtframe) + size, GFP_ATOMIC); if (!frame) { - printk(KERN_WARNING "%s: Out of memory, cannot handle oid 0x%08x\n", - + printk(KERN_WARNING + "%s: Out of memory, cannot handle oid 0x%08x\n", ndev->name, header->oid); continue; } @@ -392,14 +392,13 @@ /* Signal the one waiting process that a response * has been received. */ if ((frame = xchg(&priv->mgmt_received, frame)) != NULL) { - printk(KERN_WARNING "%s: mgmt response not collected\n", + printk(KERN_WARNING + "%s: mgmt response not collected\n", ndev->name); kfree(frame); } - #if VERBOSE > SHOW_ERROR_MESSAGES - DEBUG(SHOW_TRACING, - "Wake up Mgmt Queue\n"); + DEBUG(SHOW_TRACING, "Wake up Mgmt Queue\n"); #endif wake_up(&priv->mgmt_wqueue); } @@ -431,7 +430,7 @@ curr_frag = le32_to_cpu(cb->device_curr_frag[ISL38XX_CB_TX_MGMTQ]); barrier(); - for ( ; priv->index_mgmt_tx < curr_frag; priv->index_mgmt_tx++) { + for (; priv->index_mgmt_tx < curr_frag; priv->index_mgmt_tx++) { int index = priv->index_mgmt_tx % ISL38XX_CB_MGMT_QSIZE; struct islpci_membuf *buf = &priv->mgmt_tx[index]; pci_unmap_single(priv->pdev, buf->pci_addr, buf->size, @@ -463,7 +462,7 @@ prepare_to_wait(&priv->mgmt_wqueue, &wait, TASK_UNINTERRUPTIBLE); err = islpci_mgt_transmit(ndev, operation, oid, senddata, sendlen); - if(err) + if (err) goto out; err = -ETIMEDOUT; @@ -474,12 +473,22 @@ timeleft = schedule_timeout(wait_cycle_jiffies); frame = xchg(&priv->mgmt_received, NULL); if (frame) { + if (frame->header->oid == oid) { *recvframe = frame; err = 0; goto out; + } else { + printk(KERN_DEBUG + "%s: expecting oid 0x%x, received 0x%x.\n", + ndev->name, (unsigned int) oid, + frame->header->oid); + kfree(frame); + frame = NULL; } - if(timeleft == 0) { - printk(KERN_DEBUG "%s: timeout waiting for mgmt response %lu, trigging device\n", + } + if (timeleft == 0) { + printk(KERN_DEBUG + "%s: timeout waiting for mgmt response %lu, trigging device\n", ndev->name, timeout_left); islpci_trigger(priv); } diff -NaurEb linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.c linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.c --- linux-2.6.6ct/drivers/net/wireless/prism54/oid_mgt.c 2004-05-28 14:44:24.888289688 +0200 +++ linux-2.6.6-01/drivers/net/wireless/prism54/oid_mgt.c 2004-05-28 15:08:00.688055408 +0200 @@ -40,17 +40,13 @@ if ((f >= 2412) && (f <= 2484)) { while ((c < 14) && (f != frequency_list_bg[c])) c++; - if (c >= 14) - return 0; + return (c >= 14) ? 0 : ++c; } else if ((f >= (int) 5170) && (f <= (int) 5320)) { while ((c < 12) && (f != frequency_list_a[c])) c++; - if (c >= 12) - return 0; + return (c >= 12) ? 0 : (c + 37); } else return 0; - - return ++c; } #define OID_STRUCT(name,oid,s,t) [name] = {oid, 0, sizeof(s), t} --Boundary-00=_jFcwAw/FU/M0bFU-- From mikpe@user.it.uu.se Sat Jun 5 05:15:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 05:15:17 -0700 (PDT) Received: from aun.it.uu.se (root@aun.it.uu.se [130.238.12.36]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55CF9gi028531 for ; Sat, 5 Jun 2004 05:15:10 -0700 Received: from harpo.it.uu.se (daemon@harpo.it.uu.se [130.238.12.34]) by aun.it.uu.se (8.12.11/8.12.10) with ESMTP id i55CF4RE019159; Sat, 5 Jun 2004 14:15:04 +0200 (MEST) Received: (from mikpe@localhost) by harpo.it.uu.se (8.12.10+Sun/8.12.10) id i55CF4hH004189; Sat, 5 Jun 2004 14:15:04 +0200 (MEST) Date: Sat, 5 Jun 2004 14:15:04 +0200 (MEST) Message-Id: <200406051215.i55CF4hH004189@harpo.it.uu.se> From: Mikael Pettersson To: jgarzik@pobox.com Subject: Re: PROBLEM: network driver causes kernel panic Cc: dctucker@hotmail.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com X-archive-position: 5635 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: 1381 Lines: 44 On Fri, 04 Jun 2004 16:47:13 -0400, Jeff Garzik wrote: >Mikael Pettersson wrote: >> This confirms that eth1 is a 21041 driven by the de2104x driver. >> >> I've seen something very similar to Casey's problem, on a PowerMac >> with a built-in 21041. Booting it with no network cable connected >> causes a timer to hit a BUG() in de2104x about a second after >> the device is ifup:d. >> >> The 2.4 kernel's tulip driver works just fine. >> >> I reported this last year, but nothing happened. > > >Well, I'm very interested in debugging it. There were a flurry of >de2104x patches in the past year, I thought that took care of the issues. > >Please email details to netdev@oss.sgi.com and jgarzik@pobox.com... Booting 2.6.7-rc1 with the de2104x driver built-in and eth0 disconnected from the LAN leads to the following oops about a second after INIT tried to ifup eth0: eth0: timeout expired stopping DMA kernel BUG in de_set_media at drivers/net/tulip/de2104x.c:919! Call trace: de21041_media_timer run_timer_softirq __do_softirq do_softirq timer_interrupt ret_from_except ppc6xx_idle cpu_idle rest_init start_kernel The PowerPC kernel decides to panic() after a brief delay at this point, so I can't capture the oops text except by typing it down manually. Besides, I doubt the ppc register dump would be useful; we know which BUG() was hit. /Mikael From hadi@cyberus.ca Sat Jun 5 07:38:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 07:38:39 -0700 (PDT) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55EcZgi031387 for ; Sat, 5 Jun 2004 07:38:35 -0700 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.20) id 1BWcJc-0008A2-Fi for netdev@oss.sgi.com; Sat, 05 Jun 2004 10:38:32 -0400 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1BWcJZ-0006Jq-3X; Sat, 05 Jun 2004 10:38:29 -0400 Subject: RE: TxDescriptors -> 1024 default. Please not for every NIC! From: jamal Reply-To: hadi@cyberus.ca To: Cheng Jin Cc: Marc Herbert , "netdev@oss.sgi.com" In-Reply-To: References: Content-Type: text/plain Organization: jamalopolis Message-Id: <1086446277.1592.205.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 05 Jun 2004 10:37:57 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 5636 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 2387 Lines: 55 On Wed, 2004-06-02 at 15:49, Cheng Jin wrote: > Marc, > > In general, I very much agree with what you have stated about not having > a large txqueuelen. Txqueuelen should be something that alleviates > the mismatch between CPU speed and NIC transmission speed, Thats the theory. More interesting of course are bus speeds, arbitration schemes, RAM latencies and throughput and other dynamic bottlenecks like system loads. > temporarily. > As long as the txqueuelne is greater than zero, say 10 just to be safe, > NIC will be running at full speed (unless there were inefficiencies in > scheduling) so there is no incentive in setting it to be an excessively > large value like 1000. In theory as well, the only time you even need to queue is when theres congestion.. In reality, totaly different ballgame. In other words its not a simple system that you can throw Littles theorems at. Marc, good email, at least you didnt hand wave and declare the wind was blowing towards the south today. My opinion: I agree that the 1000 qlen is excessive for 10/100 - infact i think the value should dynamically adjust itself even for gige capable NICs (example if a gige NIC negotiates a 10Mbps speed with link partner, then you should adjust the qlen)[1]. That wont be trivial to do - but more importantly motivation lacks because i dont think the situation we have right now is devastating. To clarify: A single TCP flow will fill in any pipe you give it under proper conditions (proper congestion control algorithms, buffer etc)[2]. Most apps using TCP dont care very much about latency; the only exception would be some scientific clustering technologies using TCP for control messaging. And for those type of apps, you should be able to tune the qlen to your liking using tc or ip utilities (I claim they shouldnt be using tcp to begin with, but thats another discussion). If you dont want to take that extra step to tune then you dont care, and IMO you shouldnt complain. Having said all that: i still think theres value in maybe issuing a warning or making the default qlen selection a compile time config. cheers, jamal [1] I think it would make a nice project for someone with time. I can consult for anyone interested. [2] Looking at the recent patches on BIC, it does seem pretty agressive and should have no problem filling a 10Gige pipe with proper processing power. From pp@ee.oulu.fi Sat Jun 5 13:06:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 13:06:54 -0700 (PDT) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55K6jgi013461 for ; Sat, 5 Jun 2004 13:06:46 -0700 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.12.10/8.12.10) with ESMTP id i55K6iwx010179; Sat, 5 Jun 2004 23:06:44 +0300 (EEST) Received: (from pp@localhost) by tk28.oulu.fi (8.12.11/8.12.11/Submit) id i55K6i2l002757; Sat, 5 Jun 2004 23:06:44 +0300 (EEST) Date: Sat, 5 Jun 2004 23:06:44 +0300 From: Pekka Pietikainen To: netdev@oss.sgi.com Cc: linux-kernel@vger.kernel.org Subject: Dealing with buggy hardware (was: b44 and 4g4g) Message-ID: <20040605200643.GA2210@ee.oulu.fi> References: <20040531202104.GA8301@ee.oulu.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20040531202104.GA8301@ee.oulu.fi> User-Agent: Mutt/1.4.2i X-archive-position: 5637 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev Content-Length: 4072 Lines: 139 On Mon, May 31, 2004 at 11:21:04PM +0300, Pekka Pietikainen wrote: > After diagnosing > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=118165 > for a while > > it seems that bcm4401 is quite broken when DMA:ing from/to > addresses that are > 1GB. This only is a problem with > 1GB of physical > memory and when using a 4:4 split. And here's a workaround-everything-in-the-driver version that makes everything work. Cc:d to linux-kernel to get wider coverage. There _really_ has to be a better way of dealing with hardware problems like this (with a 512 entry TX ring this uses almost 800k of GFP_DMA, probably should be made smaller in any case...): (And again, please prepare your barf-bags!) --- ../b44.c 2004-06-05 22:54:50.210817784 +0300 +++ b44.c 2004-06-05 22:54:56.721827960 +0300 @@ -67,6 +67,7 @@ #define NEXT_TX(N) (((N) + 1) & (B44_TX_RING_SIZE - 1)) #define RX_PKT_BUF_SZ (1536 + bp->rx_offset + 64) +#define TX_PKT_BUF_SZ (B44_MAX_MTU + ETH_HLEN + 8) /* minimum number of free TX descriptors required to wake up TX process */ #define B44_TX_WAKEUP_THRESH (B44_TX_RING_SIZE / 4) @@ -82,6 +83,12 @@ static int b44_debug = -1; /* -1 == use B44_DEF_MSG_ENABLE as value */ +/* Hardware bug work-around, the chip seems to be unable to do PCI DMA + to anything above 1GB :-( */ + +#define B44_DMA_MASK 0x3fffffff +static int b44_use_bounce_buffers = 0; + 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 }, @@ -634,7 +641,13 @@ src_map = &bp->rx_buffers[src_idx]; dest_idx = dest_idx_unmasked & (B44_RX_RING_SIZE - 1); map = &bp->rx_buffers[dest_idx]; - skb = dev_alloc_skb(RX_PKT_BUF_SZ); + + if(!b44_use_bounce_buffers) { + skb = dev_alloc_skb(RX_PKT_BUF_SZ); + } else { + /* Sigh... */ + skb = __dev_alloc_skb(RX_PKT_BUF_SZ,GFP_DMA); + } if (skb == NULL) return -ENOMEM; @@ -918,6 +931,10 @@ } entry = bp->tx_prod; + if(virt_to_bus(skb->data) + skb->len > B44_PCI_DMA_MAX) { + memcpy(bp->tx_bufs+entry*TX_PKT_BUF_SZ,skb->data,skb->len); + skb->data=bp->tx_bufs+entry*TX_PKT_BUF_SZ; + } mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE); bp->tx_buffers[entry].skb = skb; @@ -1066,6 +1083,11 @@ bp->tx_ring, bp->tx_ring_dma); bp->tx_ring = NULL; } + if (bp->tx_bufs) { + pci_free_consistent(bp->pdev, B44_TX_RING_SIZE * TX_PKT_BUF_SZ, + bp->tx_bufs, bp->tx_bufs_dma); + bp->tx_bufs = NULL; + } } /* @@ -1088,6 +1110,13 @@ goto out_err; memset(bp->tx_buffers, 0, size); + if(b44_use_bounce_buffers) { + size = B44_TX_RING_SIZE * TX_PKT_BUF_SZ; + bp->tx_bufs = pci_alloc_consistent(bp->pdev, size, &bp->tx_bufs_dma); + if (!bp->tx_bufs) + goto out_err; + memset(bp->tx_bufs, 0, size); + } size = DMA_TABLE_BYTES; bp->rx_ring = pci_alloc_consistent(bp->pdev, size, &bp->rx_ring_dma); if (!bp->rx_ring) @@ -1724,12 +1753,25 @@ pci_set_master(pdev); - err = pci_set_dma_mask(pdev, (u64) 0xffffffff); +#ifdef CONFIG_X86_4G + /* XXX only set if > 1GB of physmem */ + b44_use_bounce_buffers=1; +#endif + err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK); if (err) { printk(KERN_ERR PFX "No usable DMA configuration, " "aborting.\n"); goto err_out_free_res; } + + if(b44_use_bounce_buffers) { + err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK); + if (err) { + printk(KERN_ERR PFX "No usable DMA configuration, " + "aborting.\n"); + goto err_out_free_res; + } + } b44reg_base = pci_resource_start(pdev, 0); b44reg_len = pci_resource_len(pdev, 0); --- ../b44.h 2004-06-04 20:03:16.000000000 +0300 +++ b44.h 2004-06-05 21:45:19.000000000 +0300 @@ -503,6 +503,7 @@ struct ring_info *rx_buffers; struct ring_info *tx_buffers; + unsigned char *tx_bufs; u32 dma_offset; u32 flags; @@ -534,7 +535,7 @@ struct pci_dev *pdev; struct net_device *dev; - dma_addr_t rx_ring_dma, tx_ring_dma; + dma_addr_t rx_ring_dma, tx_ring_dma,tx_bufs_dma; u32 rx_pending; u32 tx_pending; From davem@redhat.com Sat Jun 5 13:21:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 13:21:50 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55KLkgi013964 for ; Sat, 5 Jun 2004 13:21:46 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i55KLhi5023602; Sat, 5 Jun 2004 16:21:43 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i55KLh018579; Sat, 5 Jun 2004 16:21:43 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i55KLXsi018996; Sat, 5 Jun 2004 16:21:33 -0400 Date: Sat, 5 Jun 2004 13:19:23 -0700 From: "David S. Miller" To: Pekka Pietikainen Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: Dealing with buggy hardware (was: b44 and 4g4g) Message-Id: <20040605131923.232f8950.davem@redhat.com> In-Reply-To: <20040605200643.GA2210@ee.oulu.fi> References: <20040531202104.GA8301@ee.oulu.fi> <20040605200643.GA2210@ee.oulu.fi> X-Mailer: Sylpheed version 0.9.11 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5638 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: 248 Lines: 9 On Sat, 5 Jun 2004 23:06:44 +0300 Pekka Pietikainen wrote: > + if(virt_to_bus(skb->data) + skb->len > B44_PCI_DMA_MAX) { You can't use this non-portable interface, you have to: 1) pci_map the data 2) test the dma_addr_t returned From davem@redhat.com Sat Jun 5 14:04:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 14:04:29 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55L4Ggi015386 for ; Sat, 5 Jun 2004 14:04:16 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i55L4Fi5030368; Sat, 5 Jun 2004 17:04:15 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i55L4F027350; Sat, 5 Jun 2004 17:04:15 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i55L44Ip028932; Sat, 5 Jun 2004 17:04:04 -0400 Date: Sat, 5 Jun 2004 14:01:53 -0700 From: "David S. Miller" To: Olaf Hering Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] compat bug in sys_recvmsg, MSG_CMSG_COMPAT check missing Message-Id: <20040605140153.6c5945a0.davem@redhat.com> In-Reply-To: <20040605204334.GA1134@suse.de> References: <20040605204334.GA1134@suse.de> X-Mailer: Sylpheed version 0.9.11 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5639 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: 729 Lines: 17 On Sat, 5 Jun 2004 22:43:34 +0200 Olaf Hering wrote: > packet_recvmsg() gets the flags from the compat_sys_socketcall(), but it > does not check for the active MSG_CMSG_COMPAT bit. As a result, it > returns -EINVAL and makes the user rather unhappy Not just packet_recvmsg() (frankly, I'm stumped how tcpdump is working on my sparc64 boxes due to this bug!), every other sendmsg/recvmsg implementation has a test like this verifying the msg_flags for bogons. Let's ask a better question, why do we need to pass this thing down into the implementations anyways? I can't see a reason, can anyone else? If there is no reason, the right fix is simply to mask it out at the top level, for both sendmsg and recvmsg. From davem@redhat.com Sat Jun 5 14:08:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 14:08:20 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55L86gi015783 for ; Sat, 5 Jun 2004 14:08:06 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i55L85i5031047; Sat, 5 Jun 2004 17:08:05 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i55L85028236; Sat, 5 Jun 2004 17:08:05 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id i55L7smm030208; Sat, 5 Jun 2004 17:07:55 -0400 Date: Sat, 5 Jun 2004 14:05:44 -0700 From: "David S. Miller" To: "David S. Miller" Cc: olh@suse.de, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] compat bug in sys_recvmsg, MSG_CMSG_COMPAT check missing Message-Id: <20040605140544.0de4034d.davem@redhat.com> In-Reply-To: <20040605140153.6c5945a0.davem@redhat.com> References: <20040605204334.GA1134@suse.de> <20040605140153.6c5945a0.davem@redhat.com> X-Mailer: Sylpheed version 0.9.11 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5640 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: 487 Lines: 16 [ Replying to myself :-) ] On Sat, 5 Jun 2004 14:01:53 -0700 "David S. Miller" wrote: > Let's ask a better question, why do we need to pass this thing down > into the implementations anyways? It's for net/core/scm.c handling, sigh. This means also that Olaf's patch is broken, when CONFIG_COMPAT is not set, MSG_CMSG_COMPAT is zero, thus ~MSG_CMSG_COMPAT is the unexpected value all 1's thus breaking the tests for unexpected flags completely. Any better ideas? From olh@suse.de Sat Jun 5 14:24:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 05 Jun 2004 14:24:39 -0700 (PDT) Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i55LOMgi016463 for ; Sat, 5 Jun 2004 14:24:23 -0700 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 7566269EF61; Sat, 5 Jun 2004 22:43:35 +0200 (CEST) Date: Sat, 5 Jun 2004 22:43:34 +0200 From: Olaf Hering To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] compat bug in sys_recvmsg, MSG_CMSG_COMPAT check missing Message-ID: <20040605204334.GA1134@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i55LOMgi016463 X-archive-position: 5641 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 Content-Length: 774 Lines: 23 packet_recvmsg() gets the flags from the compat_sys_socketc